Version in base suite: 7.3.1+1-1~deb12u1 Base version: jtreg7_7.3.1+1-1~deb12u1 Target version: jtreg7_7.5.2+1+ds2-3~deb12u1 Base file: /srv/ftp-master.debian.org/ftp/pool/main/j/jtreg7/jtreg7_7.3.1+1-1~deb12u1.dsc Target file: /srv/ftp-master.debian.org/policy/pool/main/j/jtreg7/jtreg7_7.5.2+1+ds2-3~deb12u1.dsc /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/src/images/module-deps-graph.png |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/src/images/project-icon-160x160.png |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/src/images/project-icon-48x48.png |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/src/images/project-logo-vector.png |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/src/images/project-logo.gif |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/src/images/project-logo.png |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/src/images/rss.gif |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/jansi1/jansi-website/src/images/after-jansi-windows.png |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/jansi1/jansi-website/src/images/before-windows.png |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/jansi1/jansi-website/src/images/project-icon.png |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/jansi1/jansi-website/src/images/project-logo-full.png |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/jansi1/jansi-website/src/images/project-logo.png |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/jansi1/jansi-website/src/images/rss.gif |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/jansi1/src/site/resources/images/project-logo.png |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/junit4/doc/cookstour/Image1.gif |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/junit4/doc/cookstour/Image2.gif |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/junit4/doc/cookstour/Image3.gif |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/junit4/doc/cookstour/Image4.gif |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/junit4/doc/cookstour/Image5.gif |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/junit4/doc/cookstour/Image6.gif |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/junit4/doc/cookstour/Image7.gif |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/junit4/doc/testinfected/IMG00001.GIF |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/junit4/doc/testinfected/IMG00002.GIF |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/junit4/doc/testinfected/IMG00003.GIF |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/junit4/doc/testinfected/logo.gif |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/junit4/src/main/resources/junit/runner/logo.gif |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/junit4/src/main/resources/junit/runner/smalllogo.gif |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/junit4/src/test/resources/junit/tests/runner/testRunAssumptionFailedResultCanBeReserialised_v4_12 |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/junit4/src/test/resources/junit/tests/runner/testRunAssumptionFailedResultCanBeReserialised_v4_13 |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/junit4/src/test/resources/junit/tests/runner/testRunFailureResultCanBeReserialised_v4_12 |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/junit4/src/test/resources/junit/tests/runner/testRunSuccessResultCanBeReserialised_v4_12 |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/junit4/src/test/resources/junit/tests/runner/testRunSuccessResultCanBeReserialised_v4_13 |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/junit4/src/test/resources/org/junit/assumptionViolatedExceptionWithValueAndMatcherCanBeReserialized_v4_13 |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/junit4/src/test/resources/org/junit/assumptionViolatedExceptionWithoutValueAndMatcherCanBeReserialized_v4_13 |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/junit4/src/test/resources/org/junit/internal/arrayComparisonFailure_411 |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/junit4/src/test/resources/org/junit/internal/arrayComparisonFailure_412 |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/junit5/.idea/icon.png |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/test/resources/vintage-testjar.jar |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/resources/jupiter-testjar.jar |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/folder with spaces/jar test with spaces.jar |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/gh-1436-invalid-nested-class-file.jar |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/jartest-shadowed.jar |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/jartest.jar |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/serialized-test-identifier |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/libhamcrest-java/docs/images/logo.jpg |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/opentest4j/src/test/resources/AssertionFailedError_serializedVersion_1_0_0.out |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/picocli/src/main/java/picocli/doc-files/class-diagram-definition.png |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/picocli/src/main/java/picocli/doc-files/class-diagram-exceptions.png |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/picocli/src/main/java/picocli/doc-files/class-diagram-help-api.png |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/picocli/src/main/java/picocli/doc-files/class-diagram-parsing.png |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/plugins/idea/gradle/wrapper/gradle-wrapper.jar |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/plugins/idea/src/main/resources/com/oracle/plugin/jtreg/icons/JavaCup16.png |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/plugins/idea/src/main/resources/com/oracle/plugin/jtreg/icons/JavaCup32.png |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/resources/org/testng/bullet_point.png |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/resources/org/testng/collapseall.gif |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/resources/org/testng/failed.png |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/resources/org/testng/navigator-bullet.png |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/resources/org/testng/passed.png |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/resources/org/testng/skipped.png |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/serviceloader.jar |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/with-different-name-testng-xml.jar |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/withouttestngxml.jar |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/withtestngxml.jar |binary /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/univocity-parsers/images/uniVocity-parsers.png |binary jtreg7-7.5.2+1+ds2/.github/workflows/gradle-wrapper-validation.yml | 14 jtreg7-7.5.2+1+ds2/.github/workflows/test.yml | 46 jtreg7-7.5.2+1+ds2/.jcheck/conf | 2 jtreg7-7.5.2+1+ds2/CHANGELOG.md | 74 jtreg7-7.5.2+1+ds2/CONTRIBUTING.md | 4 jtreg7-7.5.2+1+ds2/README.md | 4 jtreg7-7.5.2+1+ds2/apiguardian/.github/workflows/main.yml | 57 jtreg7-7.5.2+1+ds2/apiguardian/.gitignore | 22 jtreg7-7.5.2+1+ds2/apiguardian/LICENSE | 201 jtreg7-7.5.2+1+ds2/apiguardian/README.md | 29 jtreg7-7.5.2+1+ds2/apiguardian/build.gradle.kts | 218 jtreg7-7.5.2+1+ds2/apiguardian/gradle.properties | 5 jtreg7-7.5.2+1+ds2/apiguardian/gradlew | 185 jtreg7-7.5.2+1+ds2/apiguardian/gradlew.bat | 89 jtreg7-7.5.2+1+ds2/apiguardian/settings.gradle.kts | 5 jtreg7-7.5.2+1+ds2/apiguardian/src/main/java/org/apiguardian/api/API.java | 126 jtreg7-7.5.2+1+ds2/apiguardian/src/module/java/org.apiguardian.api/module-info.java | 3 jtreg7-7.5.2+1+ds2/debian/apiguardian/poms | 1 jtreg7-7.5.2+1+ds2/debian/apiguardian/rules | 16 jtreg7-7.5.2+1+ds2/debian/changelog | 154 jtreg7-7.5.2+1+ds2/debian/compat | 1 jtreg7-7.5.2+1+ds2/debian/component-scripts/build-components.sh | 25 jtreg7-7.5.2+1+ds2/debian/component-scripts/clean-components.sh | 24 jtreg7-7.5.2+1+ds2/debian/component-scripts/setup-component.sh | 14 jtreg7-7.5.2+1+ds2/debian/control | 42 jtreg7-7.5.2+1+ds2/debian/copyright | 946 jtreg7-7.5.2+1+ds2/debian/gbp-export.sh | 3 jtreg7-7.5.2+1+ds2/debian/gbp-import.sh | 3 jtreg7-7.5.2+1+ds2/debian/hawt-jni/maven.ignoreRules | 13 jtreg7-7.5.2+1+ds2/debian/hawt-jni/maven.properties | 6 jtreg7-7.5.2+1+ds2/debian/hawt-jni/maven.rules | 6 jtreg7-7.5.2+1+ds2/debian/hawt-jni/poms | 33 jtreg7-7.5.2+1+ds2/debian/hawt-jni/rules | 4 jtreg7-7.5.2+1+ds2/debian/jansi1/maven.ignoreRules | 32 jtreg7-7.5.2+1+ds2/debian/jansi1/maven.rules | 4 jtreg7-7.5.2+1+ds2/debian/jansi1/poms | 4 jtreg7-7.5.2+1+ds2/debian/jansi1/rules | 14 jtreg7-7.5.2+1+ds2/debian/jline3/maven.ignoreRules | 7 jtreg7-7.5.2+1+ds2/debian/jline3/maven.rules | 2 jtreg7-7.5.2+1+ds2/debian/jline3/poms | 10 jtreg7-7.5.2+1+ds2/debian/jline3/rules | 13 jtreg7-7.5.2+1+ds2/debian/jtreg7.install | 2 jtreg7-7.5.2+1+ds2/debian/jtreg7.links | 20 jtreg7-7.5.2+1+ds2/debian/jtreg7.lintian-overrides | 6 jtreg7-7.5.2+1+ds2/debian/junit4/maven.ignoreRules | 9 jtreg7-7.5.2+1+ds2/debian/junit4/maven.rules | 2 jtreg7-7.5.2+1+ds2/debian/junit4/poms | 1 jtreg7-7.5.2+1+ds2/debian/junit4/rules | 8 jtreg7-7.5.2+1+ds2/debian/junit5/junit-jupiter-api/build/generated/sources/jte/main/org/junit/jupiter/api/condition/JRE.java | 299 jtreg7-7.5.2+1+ds2/debian/junit5/maven.ignoreRules | 5 jtreg7-7.5.2+1+ds2/debian/junit5/maven.rules | 2 jtreg7-7.5.2+1+ds2/debian/junit5/poms | 21 jtreg7-7.5.2+1+ds2/debian/junit5/rules | 9 jtreg7-7.5.2+1+ds2/debian/libhamcrest-java/maven.rules | 3 jtreg7-7.5.2+1+ds2/debian/libhamcrest-java/poms | 2 jtreg7-7.5.2+1+ds2/debian/libhamcrest-java/rules | 7 jtreg7-7.5.2+1+ds2/debian/maven.properties | 6 jtreg7-7.5.2+1+ds2/debian/opentest4j-reporting/maven.rules | 3 jtreg7-7.5.2+1+ds2/debian/opentest4j-reporting/poms | 2 jtreg7-7.5.2+1+ds2/debian/opentest4j-reporting/rules | 10 jtreg7-7.5.2+1+ds2/debian/opentest4j/maven.rules | 1 jtreg7-7.5.2+1+ds2/debian/opentest4j/poms | 1 jtreg7-7.5.2+1+ds2/debian/opentest4j/rules | 4 jtreg7-7.5.2+1+ds2/debian/patches/apiguardian-01-build_gradle.patch | 399 jtreg7-7.5.2+1+ds2/debian/patches/codetools-7904101-proposed.patch | 411 jtreg7-7.5.2+1+ds2/debian/patches/codetools-7904104-proposed.patch | 35 jtreg7-7.5.2+1+ds2/debian/patches/codetools-7904105-proposed.patch | 42 jtreg7-7.5.2+1+ds2/debian/patches/codetools-7904106-proposed.patch | 75 jtreg7-7.5.2+1+ds2/debian/patches/codetools-7904107-proposed.patch | 38 jtreg7-7.5.2+1+ds2/debian/patches/codetools-7904152.patch | 73 jtreg7-7.5.2+1+ds2/debian/patches/codetools-7904157-proposed.patch | 18 jtreg7-7.5.2+1+ds2/debian/patches/do-not-export-headless-display.patch | 6 jtreg7-7.5.2+1+ds2/debian/patches/flush-alarm.patch | 15 jtreg7-7.5.2+1+ds2/debian/patches/hawt-jni-02-commons-lang-dependency.patch | 17 jtreg7-7.5.2+1+ds2/debian/patches/java21-codetools-7903646.patch | 24 jtreg7-7.5.2+1+ds2/debian/patches/jline3-01-ignore-warnings.patch | 49 jtreg7-7.5.2+1+ds2/debian/patches/jline3-02-ignore-remote-modules.patch | 59 jtreg7-7.5.2+1+ds2/debian/patches/jline3-03-java21-compatibility.patch | 136 jtreg7-7.5.2+1+ds2/debian/patches/jtdiff-version.patch | 17 jtreg7-7.5.2+1+ds2/debian/patches/junit4-Version.patch | 16 jtreg7-7.5.2+1+ds2/debian/patches/junit4-exclude-dependency-sources.patch | 30 jtreg7-7.5.2+1+ds2/debian/patches/junit4-hamcrest-compatibility.patch | 24 jtreg7-7.5.2+1+ds2/debian/patches/junit4-java17-compatibility.patch | 50 jtreg7-7.5.2+1+ds2/debian/patches/junit5-15-deprecated.patch | 16 jtreg7-7.5.2+1+ds2/debian/patches/junit5-16-maven-build.patch | 1117 jtreg7-7.5.2+1+ds2/debian/patches/junit5-17-backward-compatibility.patch | 49 jtreg7-7.5.2+1+ds2/debian/patches/libhamcrest-java-04-gradle-build.patch | 70 jtreg7-7.5.2+1+ds2/debian/patches/libhamcrest-java-05-backward-compatibility.patch | 23 jtreg7-7.5.2+1+ds2/debian/patches/libhamcrest-java-06-type-inference-fix.patch | 116 jtreg7-7.5.2+1+ds2/debian/patches/opentest4j-01-ignore-versioning-plugin.patch | 21 jtreg7-7.5.2+1+ds2/debian/patches/opentest4j-02-ignore-github-pages-plugin.patch | 58 jtreg7-7.5.2+1+ds2/debian/patches/opentest4j-03-ignore-spotless-plugin.patch | 50 jtreg7-7.5.2+1+ds2/debian/patches/opentest4j-04-reproducible-builds-timestamp.patch | 23 jtreg7-7.5.2+1+ds2/debian/patches/opentest4j-05-build-on-java-17.patch | 26 jtreg7-7.5.2+1+ds2/debian/patches/opentest4j-reporting-01-gradle-compatibility.patch | 55 jtreg7-7.5.2+1+ds2/debian/patches/picocli-0001-Adjust-build-to-work-without-asciidoctor.patch | 391 jtreg7-7.5.2+1+ds2/debian/patches/preview-test.patch | 31 jtreg7-7.5.2+1+ds2/debian/patches/reproducible-build.patch | 23 jtreg7-7.5.2+1+ds2/debian/patches/series | 33 jtreg7-7.5.2+1+ds2/debian/patches/testng-build-with-gradle.patch | 128 jtreg7-7.5.2+1+ds2/debian/picocli/maven.ignoreRules | 1 jtreg7-7.5.2+1+ds2/debian/picocli/maven.rules | 3 jtreg7-7.5.2+1+ds2/debian/picocli/poms | 3 jtreg7-7.5.2+1+ds2/debian/picocli/rules | 19 jtreg7-7.5.2+1+ds2/debian/rules | 30 jtreg7-7.5.2+1+ds2/debian/source/lintian-overrides | 16 jtreg7-7.5.2+1+ds2/debian/testng/maven.ignoreRules | 7 jtreg7-7.5.2+1+ds2/debian/testng/maven.rules | 7 jtreg7-7.5.2+1+ds2/debian/testng/poms | 1 jtreg7-7.5.2+1+ds2/debian/testng/rules | 16 jtreg7-7.5.2+1+ds2/debian/tests/self-test | 15 jtreg7-7.5.2+1+ds2/debian/univocity-parsers/maven.ignoreRules | 9 jtreg7-7.5.2+1+ds2/debian/univocity-parsers/maven.rules | 2 jtreg7-7.5.2+1+ds2/debian/univocity-parsers/poms | 1 jtreg7-7.5.2+1+ds2/debian/univocity-parsers/rules | 8 jtreg7-7.5.2+1+ds2/debian/watch | 44 jtreg7-7.5.2+1+ds2/doc/building.md | 29 jtreg7-7.5.2+1+ds2/hawt-jni/.gitignore | 11 jtreg7-7.5.2+1+ds2/hawt-jni/.travis.yml | 11 jtreg7-7.5.2+1+ds2/hawt-jni/changelog.md | 189 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-example/pom.xml | 148 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-example/src/main/java/test/Example.java | 351 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-example/src/main/java/test/ObjectiveCExample.java | 73 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-example/src/main/native-package/src/foo.cpp | 53 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-example/src/main/native-package/src/foo.h | 63 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-example/src/main/native-package/src/hawtjni-example.h | 64 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-example/src/test/java/test/ExampleTest.java | 88 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/pom.xml | 111 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/CleanupClass.java | 139 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/CleanupConstants.java | 105 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/CleanupNatives.java | 104 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/ConstantsGenerator.java | 76 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/DOMWriter.java | 1 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/HawtJNI.java | 495 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/JNIGenerator.java | 239 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/LockGenerator.java | 160 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/MacGenerator.java | 1828 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/MozillaGenerator.java | 631 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/NativesGenerator.java | 1227 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/ProgressMonitor.java | 22 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/SizeofGenerator.java | 76 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/StatsGenerator.java | 225 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/StructsGenerator.java | 631 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/JNIClass.java | 37 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/JNIField.java | 37 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/JNIFieldAccessor.java | 19 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/JNIMethod.java | 56 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/JNIParameter.java | 31 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/JNIType.java | 32 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/ReflectClass.java | 151 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/ReflectField.java | 157 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/ReflectFieldAccessor.java | 48 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/ReflectMethod.java | 242 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/ReflectParameter.java | 92 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/ReflectType.java | 247 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/util/FileSupport.java | 97 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/util/OptionBuilder.java | 95 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/util/TextSupport.java | 27 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/resources/hawtjni-callback.c | 793 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/resources/hawtjni.c | 175 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/resources/hawtjni.h | 194 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/resources/windows/stdint.h | 247 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-maven-plugin/pom.xml | 168 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-maven-plugin/src/main/java/org/fusesource/hawtjni/maven/BuildMojo.java | 457 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-maven-plugin/src/main/java/org/fusesource/hawtjni/maven/CLI.java | 100 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-maven-plugin/src/main/java/org/fusesource/hawtjni/maven/GenerateMojo.java | 412 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-maven-plugin/src/main/java/org/fusesource/hawtjni/maven/PackageJarMojo.java | 232 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-maven-plugin/src/main/java/org/fusesource/hawtjni/maven/PackageSourceMojo.java | 109 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/Makefile.am | 26 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/autogen.sh | 44 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/configure.ac | 67 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/m4/custom.m4 | 27 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/m4/jni.m4 | 163 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/m4/osx-universal.m4 | 115 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/readme.md | 57 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/vs2008.vcproj | 167 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/vs2010.custom.props | 16 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/vs2010.vcxproj | 188 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-runtime/pom.xml | 59 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/ArgFlag.java | 81 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/Callback.java | 263 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/ClassFlag.java | 46 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/FieldFlag.java | 58 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/JNIEnv.java | 18 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/JniArg.java | 30 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/JniClass.java | 32 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/JniField.java | 35 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/JniMethod.java | 36 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/Library.java | 550 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/MethodFlag.java | 116 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/NativeStats.java | 220 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/PointerMath.java | 27 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/T32.java | 22 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/ext/ScalatePackage.scala | 30 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/ext/Website.scala | 71 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/ext/scalate/Boot.scala | 66 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/pom.xml | 259 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/src/WEB-INF/scalate/layouts/default.jade | 87 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/src/WEB-INF/web.xml | 45 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/src/_navigation.ssp.md | 6 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/src/blog/index.page | 40 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/src/blog/index.rss.feed | 5 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/src/blog/releases/release-1.0.page | 39 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/src/blog/releases/release-1.1.page | 47 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/src/blog/releases/release-1.2.page | 42 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/src/blog/releases/release-1.3.page | 48 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/src/blog/releases/release-1.4.page | 43 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/src/blog/releases/release-1.5.page | 41 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/src/blog/releases/release-1.6.page | 42 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/src/blog/releases/release-1.7.page | 42 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/src/blog/releases/release-1.8.page | 41 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/src/blog/releases/release-1.9.page | 42 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/src/community/_creating_patches.ssp.md | 23 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/src/community/building.page | 88 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/src/community/contributing.page | 74 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/src/community/developers.page | 39 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/src/community/faq.page | 60 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/src/community/index.page | 86 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/src/community/release-guide.page | 54 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/src/community/site.page | 85 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/src/community/source.page | 92 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/src/community/support.page | 40 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/src/documentation/developer-guide.md | 865 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/src/documentation/index.page | 28 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/src/download.page.off | 123 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/src/index.page | 64 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/src/privacy-policy.page | 49 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/src/styles/impact/blog.template | 27 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/src/styles/impact/css/pygmentize.css | 128 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/src/styles/impact/css/site.css | 248 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/src/versions/index.page | 38 jtreg7-7.5.2+1+ds2/hawt-jni/license.txt | 466 jtreg7-7.5.2+1+ds2/hawt-jni/notice.md | 10 jtreg7-7.5.2+1+ds2/hawt-jni/pom.xml | 241 jtreg7-7.5.2+1+ds2/hawt-jni/print_surefire_reports.sh | 11 jtreg7-7.5.2+1+ds2/hawt-jni/readme.md | 77 jtreg7-7.5.2+1+ds2/jansi1/.gitignore | 9 jtreg7-7.5.2+1+ds2/jansi1/KEYS | 30 jtreg7-7.5.2+1+ds2/jansi1/changelog.md | 273 jtreg7-7.5.2+1+ds2/jansi1/example/pom.xml | 33 jtreg7-7.5.2+1+ds2/jansi1/example/src/main/java/org/fusesource/jansi/Main.java | 12 jtreg7-7.5.2+1+ds2/jansi1/jansi-website/ext/ScalatePackage.scala | 28 jtreg7-7.5.2+1+ds2/jansi1/jansi-website/ext/Website.scala | 70 jtreg7-7.5.2+1+ds2/jansi1/jansi-website/ext/scalate/Boot.scala | 64 jtreg7-7.5.2+1+ds2/jansi1/jansi-website/pom.xml | 265 jtreg7-7.5.2+1+ds2/jansi1/jansi-website/src/WEB-INF/scalate/layouts/default.jade | 87 jtreg7-7.5.2+1+ds2/jansi1/jansi-website/src/WEB-INF/web.xml | 45 jtreg7-7.5.2+1+ds2/jansi1/jansi-website/src/_navigation.ssp.md | 6 jtreg7-7.5.2+1+ds2/jansi1/jansi-website/src/blog/index.page | 38 jtreg7-7.5.2+1+ds2/jansi1/jansi-website/src/blog/index.rss.feed | 5 jtreg7-7.5.2+1+ds2/jansi1/jansi-website/src/blog/releases/release-1.0.page | 33 jtreg7-7.5.2+1+ds2/jansi1/jansi-website/src/blog/releases/release-1.1.page | 34 jtreg7-7.5.2+1+ds2/jansi1/jansi-website/src/blog/releases/release-1.2.page | 33 jtreg7-7.5.2+1+ds2/jansi1/jansi-website/src/blog/releases/release-1.3.page | 33 jtreg7-7.5.2+1+ds2/jansi1/jansi-website/src/blog/releases/release-1.4.page | 33 jtreg7-7.5.2+1+ds2/jansi1/jansi-website/src/blog/releases/release-1.5.page | 33 jtreg7-7.5.2+1+ds2/jansi1/jansi-website/src/blog/releases/release-1.6.page | 33 jtreg7-7.5.2+1+ds2/jansi1/jansi-website/src/blog/releases/release-1.7.page | 33 jtreg7-7.5.2+1+ds2/jansi1/jansi-website/src/blog/releases/release-1.8.page | 40 jtreg7-7.5.2+1+ds2/jansi1/jansi-website/src/blog/releases/release-1.9.page | 38 jtreg7-7.5.2+1+ds2/jansi1/jansi-website/src/community/_creating_patches.ssp.md | 23 jtreg7-7.5.2+1+ds2/jansi1/jansi-website/src/community/building.page | 86 jtreg7-7.5.2+1+ds2/jansi1/jansi-website/src/community/contributing.page | 69 jtreg7-7.5.2+1+ds2/jansi1/jansi-website/src/community/developers.page | 38 jtreg7-7.5.2+1+ds2/jansi1/jansi-website/src/community/faq.page | 58 jtreg7-7.5.2+1+ds2/jansi1/jansi-website/src/community/index.page | 80 jtreg7-7.5.2+1+ds2/jansi1/jansi-website/src/community/release-guide.page | 52 jtreg7-7.5.2+1+ds2/jansi1/jansi-website/src/community/site.page | 68 jtreg7-7.5.2+1+ds2/jansi1/jansi-website/src/community/source.page | 91 jtreg7-7.5.2+1+ds2/jansi1/jansi-website/src/community/support.page | 38 jtreg7-7.5.2+1+ds2/jansi1/jansi-website/src/download.page | 70 jtreg7-7.5.2+1+ds2/jansi1/jansi-website/src/index.page | 61 jtreg7-7.5.2+1+ds2/jansi1/jansi-website/src/privacy-policy.page | 47 jtreg7-7.5.2+1+ds2/jansi1/jansi-website/src/styles/impact/blog.template | 25 jtreg7-7.5.2+1+ds2/jansi1/jansi-website/src/styles/impact/css/pygmentize.css | 126 jtreg7-7.5.2+1+ds2/jansi1/jansi-website/src/styles/impact/css/site.css | 244 jtreg7-7.5.2+1+ds2/jansi1/jansi-website/src/versions/index.page | 36 jtreg7-7.5.2+1+ds2/jansi1/jansi/pom.xml | 197 jtreg7-7.5.2+1+ds2/jansi1/jansi/src/main/java/org/fusesource/jansi/Ansi.java | 790 jtreg7-7.5.2+1+ds2/jansi1/jansi/src/main/java/org/fusesource/jansi/AnsiConsole.java | 323 jtreg7-7.5.2+1+ds2/jansi1/jansi/src/main/java/org/fusesource/jansi/AnsiMain.java | 237 jtreg7-7.5.2+1+ds2/jansi1/jansi/src/main/java/org/fusesource/jansi/AnsiOutputStream.java | 801 jtreg7-7.5.2+1+ds2/jansi1/jansi/src/main/java/org/fusesource/jansi/AnsiPrintStream.java | 800 jtreg7-7.5.2+1+ds2/jansi1/jansi/src/main/java/org/fusesource/jansi/AnsiRenderWriter.java | 75 jtreg7-7.5.2+1+ds2/jansi1/jansi/src/main/java/org/fusesource/jansi/AnsiRenderer.java | 259 jtreg7-7.5.2+1+ds2/jansi1/jansi/src/main/java/org/fusesource/jansi/AnsiString.java | 92 jtreg7-7.5.2+1+ds2/jansi1/jansi/src/main/java/org/fusesource/jansi/FilterPrintStream.java | 245 jtreg7-7.5.2+1+ds2/jansi1/jansi/src/main/java/org/fusesource/jansi/HtmlAnsiOutputStream.java | 136 jtreg7-7.5.2+1+ds2/jansi1/jansi/src/main/java/org/fusesource/jansi/WindowsAnsiOutputStream.java | 382 jtreg7-7.5.2+1+ds2/jansi1/jansi/src/main/java/org/fusesource/jansi/WindowsAnsiPrintStream.java | 384 jtreg7-7.5.2+1+ds2/jansi1/jansi/src/main/java/org/fusesource/jansi/WindowsSupport.java | 42 jtreg7-7.5.2+1+ds2/jansi1/jansi/src/main/resources/org/fusesource/jansi/jansi.properties | 1 jtreg7-7.5.2+1+ds2/jansi1/jansi/src/main/resources/org/fusesource/jansi/jansi.txt | 8 jtreg7-7.5.2+1+ds2/jansi1/jansi/src/test/java/org/fusesource/jansi/AnsiConsoleExample.java | 48 jtreg7-7.5.2+1+ds2/jansi1/jansi/src/test/java/org/fusesource/jansi/AnsiConsoleExample2.java | 53 jtreg7-7.5.2+1+ds2/jansi1/jansi/src/test/java/org/fusesource/jansi/AnsiRenderWriterTest.java | 56 jtreg7-7.5.2+1+ds2/jansi1/jansi/src/test/java/org/fusesource/jansi/AnsiRendererTest.java | 112 jtreg7-7.5.2+1+ds2/jansi1/jansi/src/test/java/org/fusesource/jansi/AnsiStringTest.java | 48 jtreg7-7.5.2+1+ds2/jansi1/jansi/src/test/java/org/fusesource/jansi/AnsiTest.java | 55 jtreg7-7.5.2+1+ds2/jansi1/jansi/src/test/java/org/fusesource/jansi/FilterPrintStreamTest.java | 30 jtreg7-7.5.2+1+ds2/jansi1/jansi/src/test/java/org/fusesource/jansi/HtmlAnsiOutputStreamTest.java | 92 jtreg7-7.5.2+1+ds2/jansi1/jansi/src/test/java/org/fusesource/jansi/WindowsSupportTest.java | 33 jtreg7-7.5.2+1+ds2/jansi1/jansi/src/test/resources/jansi.ans | 8 jtreg7-7.5.2+1+ds2/jansi1/license.txt | 202 jtreg7-7.5.2+1+ds2/jansi1/pom.xml | 305 jtreg7-7.5.2+1+ds2/jansi1/readme.md | 97 jtreg7-7.5.2+1+ds2/jansi1/src/site/site.xml | 37 jtreg7-7.5.2+1+ds2/jline3/.gitignore | 7 jtreg7-7.5.2+1+ds2/jline3/.travis.yml | 22 jtreg7-7.5.2+1+ds2/jline3/.travis/settings.xml | 16 jtreg7-7.5.2+1+ds2/jline3/LICENSE.txt | 35 jtreg7-7.5.2+1+ds2/jline3/README.md | 68 jtreg7-7.5.2+1+ds2/jline3/build | 116 jtreg7-7.5.2+1+ds2/jline3/build.config | 11 jtreg7-7.5.2+1+ds2/jline3/builtins/pom.xml | 89 jtreg7-7.5.2+1+ds2/jline3/builtins/src/main/java/org/jline/builtins/Commands.java | 797 jtreg7-7.5.2+1+ds2/jline3/builtins/src/main/java/org/jline/builtins/Completers.java | 504 jtreg7-7.5.2+1+ds2/jline3/builtins/src/main/java/org/jline/builtins/Less.java | 754 jtreg7-7.5.2+1+ds2/jline3/builtins/src/main/java/org/jline/builtins/Nano.java | 2117 + jtreg7-7.5.2+1+ds2/jline3/builtins/src/main/java/org/jline/builtins/NfaMatcher.java | 276 jtreg7-7.5.2+1+ds2/jline3/builtins/src/main/java/org/jline/builtins/Options.java | 505 jtreg7-7.5.2+1+ds2/jline3/builtins/src/main/java/org/jline/builtins/ScreenTerminal.java | 1975 + jtreg7-7.5.2+1+ds2/jline3/builtins/src/main/java/org/jline/builtins/Source.java | 108 jtreg7-7.5.2+1+ds2/jline3/builtins/src/main/java/org/jline/builtins/TTop.java | 615 jtreg7-7.5.2+1+ds2/jline3/builtins/src/main/java/org/jline/builtins/Tmux.java | 1795 jtreg7-7.5.2+1+ds2/jline3/builtins/src/main/resources/org/jline/builtins/nano-browser-help.txt | 16 jtreg7-7.5.2+1+ds2/jline3/builtins/src/main/resources/org/jline/builtins/nano-main-help.txt | 81 jtreg7-7.5.2+1+ds2/jline3/builtins/src/main/resources/org/jline/builtins/nano-read-help.txt | 11 jtreg7-7.5.2+1+ds2/jline3/builtins/src/main/resources/org/jline/builtins/nano-search-help.txt | 22 jtreg7-7.5.2+1+ds2/jline3/builtins/src/main/resources/org/jline/builtins/nano-write-help.txt | 17 jtreg7-7.5.2+1+ds2/jline3/builtins/src/test/java/org/jline/builtins/NanoTest.java | 34 jtreg7-7.5.2+1+ds2/jline3/builtins/src/test/java/org/jline/builtins/NfaMatcherTest.java | 97 jtreg7-7.5.2+1+ds2/jline3/builtins/src/test/java/org/jline/builtins/OptionsTest.java | 70 jtreg7-7.5.2+1+ds2/jline3/builtins/src/test/java/org/jline/builtins/TmuxTest.java | 31 jtreg7-7.5.2+1+ds2/jline3/builtins/src/test/java/org/jline/example/Example.java | 369 jtreg7-7.5.2+1+ds2/jline3/builtins/src/test/java/org/jline/example/PasswordReader.java | 42 jtreg7-7.5.2+1+ds2/jline3/demo/etc/gosh_profile | 134 jtreg7-7.5.2+1+ds2/jline3/demo/etc/logging-verbose.properties | 24 jtreg7-7.5.2+1+ds2/jline3/demo/etc/logging.properties | 23 jtreg7-7.5.2+1+ds2/jline3/demo/jline-gogo.bat | 84 jtreg7-7.5.2+1+ds2/jline3/demo/jline-gogo.sh | 102 jtreg7-7.5.2+1+ds2/jline3/demo/pom.xml | 85 jtreg7-7.5.2+1+ds2/jline3/demo/src/main/java/org/jline/demo/FunctionConverter.java | 98 jtreg7-7.5.2+1+ds2/jline3/demo/src/main/java/org/jline/demo/Gogo.java | 95 jtreg7-7.5.2+1+ds2/jline3/header.txt | 6 jtreg7-7.5.2+1+ds2/jline3/jline/pom.xml | 273 jtreg7-7.5.2+1+ds2/jline3/mvnw | 235 jtreg7-7.5.2+1+ds2/jline3/mvnw.cmd | 145 jtreg7-7.5.2+1+ds2/jline3/pom.xml | 443 jtreg7-7.5.2+1+ds2/jline3/reader/pom.xml | 38 jtreg7-7.5.2+1+ds2/jline3/reader/src/main/java/org/jline/keymap/BindingReader.java | 169 jtreg7-7.5.2+1+ds2/jline3/reader/src/main/java/org/jline/keymap/KeyMap.java | 470 jtreg7-7.5.2+1+ds2/jline3/reader/src/main/java/org/jline/reader/Binding.java | 22 jtreg7-7.5.2+1+ds2/jline3/reader/src/main/java/org/jline/reader/Buffer.java | 87 jtreg7-7.5.2+1+ds2/jline3/reader/src/main/java/org/jline/reader/Candidate.java | 126 jtreg7-7.5.2+1+ds2/jline3/reader/src/main/java/org/jline/reader/Completer.java | 37 jtreg7-7.5.2+1+ds2/jline3/reader/src/main/java/org/jline/reader/EOFError.java | 39 jtreg7-7.5.2+1+ds2/jline3/reader/src/main/java/org/jline/reader/EndOfFileException.java | 37 jtreg7-7.5.2+1+ds2/jline3/reader/src/main/java/org/jline/reader/Expander.java | 17 jtreg7-7.5.2+1+ds2/jline3/reader/src/main/java/org/jline/reader/Highlighter.java | 16 jtreg7-7.5.2+1+ds2/jline3/reader/src/main/java/org/jline/reader/History.java | 135 jtreg7-7.5.2+1+ds2/jline3/reader/src/main/java/org/jline/reader/LineReader.java | 523 jtreg7-7.5.2+1+ds2/jline3/reader/src/main/java/org/jline/reader/LineReaderBuilder.java | 125 jtreg7-7.5.2+1+ds2/jline3/reader/src/main/java/org/jline/reader/Macro.java | 41 jtreg7-7.5.2+1+ds2/jline3/reader/src/main/java/org/jline/reader/ParsedLine.java | 48 jtreg7-7.5.2+1+ds2/jline3/reader/src/main/java/org/jline/reader/Parser.java | 38 jtreg7-7.5.2+1+ds2/jline3/reader/src/main/java/org/jline/reader/Reference.java | 44 jtreg7-7.5.2+1+ds2/jline3/reader/src/main/java/org/jline/reader/SyntaxError.java | 41 jtreg7-7.5.2+1+ds2/jline3/reader/src/main/java/org/jline/reader/UserInterruptException.java | 36 jtreg7-7.5.2+1+ds2/jline3/reader/src/main/java/org/jline/reader/Widget.java | 19 jtreg7-7.5.2+1+ds2/jline3/reader/src/main/java/org/jline/reader/impl/BufferImpl.java | 366 jtreg7-7.5.2+1+ds2/jline3/reader/src/main/java/org/jline/reader/impl/DefaultExpander.java | 207 jtreg7-7.5.2+1+ds2/jline3/reader/src/main/java/org/jline/reader/impl/DefaultHighlighter.java | 84 jtreg7-7.5.2+1+ds2/jline3/reader/src/main/java/org/jline/reader/impl/DefaultParser.java | 257 jtreg7-7.5.2+1+ds2/jline3/reader/src/main/java/org/jline/reader/impl/KillRing.java | 164 jtreg7-7.5.2+1+ds2/jline3/reader/src/main/java/org/jline/reader/impl/LineReaderImpl.java | 5328 ++ jtreg7-7.5.2+1+ds2/jline3/reader/src/main/java/org/jline/reader/impl/ReaderUtils.java | 70 jtreg7-7.5.2+1+ds2/jline3/reader/src/main/java/org/jline/reader/impl/UndoTree.java | 75 jtreg7-7.5.2+1+ds2/jline3/reader/src/main/java/org/jline/reader/impl/completer/AggregateCompleter.java | 86 jtreg7-7.5.2+1+ds2/jline3/reader/src/main/java/org/jline/reader/impl/completer/ArgumentCompleter.java | 165 jtreg7-7.5.2+1+ds2/jline3/reader/src/main/java/org/jline/reader/impl/completer/EnumCompleter.java | 30 jtreg7-7.5.2+1+ds2/jline3/reader/src/main/java/org/jline/reader/impl/completer/FileNameCompleter.java | 128 jtreg7-7.5.2+1+ds2/jline3/reader/src/main/java/org/jline/reader/impl/completer/NullCompleter.java | 32 jtreg7-7.5.2+1+ds2/jline3/reader/src/main/java/org/jline/reader/impl/completer/StringsCompleter.java | 52 jtreg7-7.5.2+1+ds2/jline3/reader/src/main/java/org/jline/reader/impl/completer/package-info.java | 14 jtreg7-7.5.2+1+ds2/jline3/reader/src/main/java/org/jline/reader/impl/history/DefaultHistory.java | 461 jtreg7-7.5.2+1+ds2/jline3/reader/src/main/java/org/jline/reader/impl/history/package-info.java | 14 jtreg7-7.5.2+1+ds2/jline3/reader/src/main/java/org/jline/reader/package-info.java | 14 jtreg7-7.5.2+1+ds2/jline3/reader/src/test/java/org/jline/keymap/BindingReaderTest.java | 76 jtreg7-7.5.2+1+ds2/jline3/reader/src/test/java/org/jline/keymap/KeyMapTest.java | 163 jtreg7-7.5.2+1+ds2/jline3/reader/src/test/java/org/jline/reader/completer/ArgumentCompleterTest.java | 68 jtreg7-7.5.2+1+ds2/jline3/reader/src/test/java/org/jline/reader/completer/DefaultParserTest.java | 84 jtreg7-7.5.2+1+ds2/jline3/reader/src/test/java/org/jline/reader/completer/NullCompleterTest.java | 31 jtreg7-7.5.2+1+ds2/jline3/reader/src/test/java/org/jline/reader/completer/StringsCompleterTest.java | 33 jtreg7-7.5.2+1+ds2/jline3/reader/src/test/java/org/jline/reader/impl/BufferTest.java | 48 jtreg7-7.5.2+1+ds2/jline3/reader/src/test/java/org/jline/reader/impl/CompletionTest.java | 127 jtreg7-7.5.2+1+ds2/jline3/reader/src/test/java/org/jline/reader/impl/DigitArgumentTest.java | 399 jtreg7-7.5.2+1+ds2/jline3/reader/src/test/java/org/jline/reader/impl/EditLineTest.java | 229 jtreg7-7.5.2+1+ds2/jline3/reader/src/test/java/org/jline/reader/impl/HistorySearchTest.java | 130 jtreg7-7.5.2+1+ds2/jline3/reader/src/test/java/org/jline/reader/impl/KillRingTest.java | 177 jtreg7-7.5.2+1+ds2/jline3/reader/src/test/java/org/jline/reader/impl/LineReaderTest.java | 62 jtreg7-7.5.2+1+ds2/jline3/reader/src/test/java/org/jline/reader/impl/MultiByteCharTest.java | 53 jtreg7-7.5.2+1+ds2/jline3/reader/src/test/java/org/jline/reader/impl/ReaderTestSupport.java | 338 jtreg7-7.5.2+1+ds2/jline3/reader/src/test/java/org/jline/reader/impl/TerminalReaderTest.java | 404 jtreg7-7.5.2+1+ds2/jline3/reader/src/test/java/org/jline/reader/impl/ViMoveModeTest.java | 1262 jtreg7-7.5.2+1+ds2/jline3/reader/src/test/java/org/jline/reader/impl/WidgetTest.java | 66 jtreg7-7.5.2+1+ds2/jline3/reader/src/test/java/org/jline/reader/impl/history/HistoryPersistenceTest.java | 105 jtreg7-7.5.2+1+ds2/jline3/reader/src/test/java/org/jline/reader/impl/history/HistoryReaderTest.java | 155 jtreg7-7.5.2+1+ds2/jline3/reader/src/test/java/org/jline/reader/impl/history/HistoryTest.java | 114 jtreg7-7.5.2+1+ds2/jline3/reader/src/test/java/org/jline/terminal/impl/ExternalTerminalTest.java | 132 jtreg7-7.5.2+1+ds2/jline3/remote-ssh/pom.xml | 44 jtreg7-7.5.2+1+ds2/jline3/remote-ssh/src/main/java/org/jline/builtins/ssh/ShellCommand.java | 90 jtreg7-7.5.2+1+ds2/jline3/remote-ssh/src/main/java/org/jline/builtins/ssh/ShellFactoryImpl.java | 242 jtreg7-7.5.2+1+ds2/jline3/remote-ssh/src/main/java/org/jline/builtins/ssh/Ssh.java | 431 jtreg7-7.5.2+1+ds2/jline3/remote-telnet/pom.xml | 44 jtreg7-7.5.2+1+ds2/jline3/remote-telnet/src/main/java/org/jline/builtins/telnet/Connection.java | 247 jtreg7-7.5.2+1+ds2/jline3/remote-telnet/src/main/java/org/jline/builtins/telnet/ConnectionData.java | 439 jtreg7-7.5.2+1+ds2/jline3/remote-telnet/src/main/java/org/jline/builtins/telnet/ConnectionEvent.java | 127 jtreg7-7.5.2+1+ds2/jline3/remote-telnet/src/main/java/org/jline/builtins/telnet/ConnectionFilter.java | 72 jtreg7-7.5.2+1+ds2/jline3/remote-telnet/src/main/java/org/jline/builtins/telnet/ConnectionListener.java | 101 jtreg7-7.5.2+1+ds2/jline3/remote-telnet/src/main/java/org/jline/builtins/telnet/ConnectionManager.java | 383 jtreg7-7.5.2+1+ds2/jline3/remote-telnet/src/main/java/org/jline/builtins/telnet/PortListener.java | 212 jtreg7-7.5.2+1+ds2/jline3/remote-telnet/src/main/java/org/jline/builtins/telnet/Telnet.java | 175 jtreg7-7.5.2+1+ds2/jline3/remote-telnet/src/main/java/org/jline/builtins/telnet/TelnetIO.java | 1536 jtreg7-7.5.2+1+ds2/jline3/terminal-jansi/pom.xml | 62 jtreg7-7.5.2+1+ds2/jline3/terminal-jansi/src/main/java/org/jline/terminal/impl/jansi/JansiNativePty.java | 158 jtreg7-7.5.2+1+ds2/jline3/terminal-jansi/src/main/java/org/jline/terminal/impl/jansi/JansiSupportImpl.java | 106 jtreg7-7.5.2+1+ds2/jline3/terminal-jansi/src/main/java/org/jline/terminal/impl/jansi/freebsd/FreeBsdNativePty.java | 325 jtreg7-7.5.2+1+ds2/jline3/terminal-jansi/src/main/java/org/jline/terminal/impl/jansi/linux/LinuxNativePty.java | 364 jtreg7-7.5.2+1+ds2/jline3/terminal-jansi/src/main/java/org/jline/terminal/impl/jansi/osx/OsXNativePty.java | 336 jtreg7-7.5.2+1+ds2/jline3/terminal-jansi/src/main/java/org/jline/terminal/impl/jansi/solaris/SolarisNativePty.java | 347 jtreg7-7.5.2+1+ds2/jline3/terminal-jansi/src/main/java/org/jline/terminal/impl/jansi/win/JansiWinSysTerminal.java | 134 jtreg7-7.5.2+1+ds2/jline3/terminal-jansi/src/main/resources/META-INF/services/org.jline.terminal.spi.JansiSupport | 1 jtreg7-7.5.2+1+ds2/jline3/terminal-jna/pom.xml | 58 jtreg7-7.5.2+1+ds2/jline3/terminal-jna/src/main/java/org/jline/terminal/impl/jna/JnaNativePty.java | 133 jtreg7-7.5.2+1+ds2/jline3/terminal-jna/src/main/java/org/jline/terminal/impl/jna/JnaSupportImpl.java | 27 jtreg7-7.5.2+1+ds2/jline3/terminal-jna/src/main/java/org/jline/terminal/impl/jna/freebsd/CLibrary.java | 328 jtreg7-7.5.2+1+ds2/jline3/terminal-jna/src/main/java/org/jline/terminal/impl/jna/freebsd/FreeBsdNativePty.java | 95 jtreg7-7.5.2+1+ds2/jline3/terminal-jna/src/main/java/org/jline/terminal/impl/jna/linux/CLibrary.java | 385 jtreg7-7.5.2+1+ds2/jline3/terminal-jna/src/main/java/org/jline/terminal/impl/jna/linux/LinuxNativePty.java | 101 jtreg7-7.5.2+1+ds2/jline3/terminal-jna/src/main/java/org/jline/terminal/impl/jna/osx/CLibrary.java | 382 jtreg7-7.5.2+1+ds2/jline3/terminal-jna/src/main/java/org/jline/terminal/impl/jna/osx/OsXNativePty.java | 88 jtreg7-7.5.2+1+ds2/jline3/terminal-jna/src/main/java/org/jline/terminal/impl/jna/solaris/CLibrary.java | 388 jtreg7-7.5.2+1+ds2/jline3/terminal-jna/src/main/java/org/jline/terminal/impl/jna/solaris/SolarisNativePty.java | 87 jtreg7-7.5.2+1+ds2/jline3/terminal-jna/src/main/java/org/jline/terminal/impl/jna/win/AnsiOutputStream.java | 763 jtreg7-7.5.2+1+ds2/jline3/terminal-jna/src/main/java/org/jline/terminal/impl/jna/win/JnaWinSysTerminal.java | 176 jtreg7-7.5.2+1+ds2/jline3/terminal-jna/src/main/java/org/jline/terminal/impl/jna/win/Kernel32.java | 568 jtreg7-7.5.2+1+ds2/jline3/terminal-jna/src/main/java/org/jline/terminal/impl/jna/win/WindowsAnsiOutputStream.java | 324 jtreg7-7.5.2+1+ds2/jline3/terminal-jna/src/main/resources/META-INF/services/org.jline.terminal.spi.JnaSupport | 1 jtreg7-7.5.2+1+ds2/jline3/terminal-jna/src/test/java/org/jline/terminal/impl/jna/JnaNativePtyTest.java | 23 jtreg7-7.5.2+1+ds2/jline3/terminal/pom.xml | 39 jtreg7-7.5.2+1+ds2/jline3/terminal/src/main/java/org/jline/terminal/Attributes.java | 348 jtreg7-7.5.2+1+ds2/jline3/terminal/src/main/java/org/jline/terminal/Cursor.java | 53 jtreg7-7.5.2+1+ds2/jline3/terminal/src/main/java/org/jline/terminal/MouseEvent.java | 82 jtreg7-7.5.2+1+ds2/jline3/terminal/src/main/java/org/jline/terminal/Size.java | 73 jtreg7-7.5.2+1+ds2/jline3/terminal/src/main/java/org/jline/terminal/Terminal.java | 196 jtreg7-7.5.2+1+ds2/jline3/terminal/src/main/java/org/jline/terminal/TerminalBuilder.java | 345 jtreg7-7.5.2+1+ds2/jline3/terminal/src/main/java/org/jline/terminal/impl/AbstractPosixTerminal.java | 83 jtreg7-7.5.2+1+ds2/jline3/terminal/src/main/java/org/jline/terminal/impl/AbstractTerminal.java | 199 jtreg7-7.5.2+1+ds2/jline3/terminal/src/main/java/org/jline/terminal/impl/AbstractWindowsTerminal.java | 346 jtreg7-7.5.2+1+ds2/jline3/terminal/src/main/java/org/jline/terminal/impl/CursorSupport.java | 109 jtreg7-7.5.2+1+ds2/jline3/terminal/src/main/java/org/jline/terminal/impl/DumbTerminal.java | 145 jtreg7-7.5.2+1+ds2/jline3/terminal/src/main/java/org/jline/terminal/impl/ExecPty.java | 302 jtreg7-7.5.2+1+ds2/jline3/terminal/src/main/java/org/jline/terminal/impl/ExternalTerminal.java | 85 jtreg7-7.5.2+1+ds2/jline3/terminal/src/main/java/org/jline/terminal/impl/LineDisciplineTerminal.java | 285 jtreg7-7.5.2+1+ds2/jline3/terminal/src/main/java/org/jline/terminal/impl/MouseSupport.java | 114 jtreg7-7.5.2+1+ds2/jline3/terminal/src/main/java/org/jline/terminal/impl/NativeSignalHandler.java | 26 jtreg7-7.5.2+1+ds2/jline3/terminal/src/main/java/org/jline/terminal/impl/PosixPtyTerminal.java | 119 jtreg7-7.5.2+1+ds2/jline3/terminal/src/main/java/org/jline/terminal/impl/PosixSysTerminal.java | 98 jtreg7-7.5.2+1+ds2/jline3/terminal/src/main/java/org/jline/terminal/impl/package-info.java | 14 jtreg7-7.5.2+1+ds2/jline3/terminal/src/main/java/org/jline/terminal/spi/JansiSupport.java | 17 jtreg7-7.5.2+1+ds2/jline3/terminal/src/main/java/org/jline/terminal/spi/JnaSupport.java | 17 jtreg7-7.5.2+1+ds2/jline3/terminal/src/main/java/org/jline/terminal/spi/Pty.java | 37 jtreg7-7.5.2+1+ds2/jline3/terminal/src/main/java/org/jline/utils/AttributedCharSequence.java | 365 jtreg7-7.5.2+1+ds2/jline3/terminal/src/main/java/org/jline/utils/AttributedString.java | 220 jtreg7-7.5.2+1+ds2/jline3/terminal/src/main/java/org/jline/utils/AttributedStringBuilder.java | 358 jtreg7-7.5.2+1+ds2/jline3/terminal/src/main/java/org/jline/utils/AttributedStyle.java | 235 jtreg7-7.5.2+1+ds2/jline3/terminal/src/main/java/org/jline/utils/ClosedException.java | 31 jtreg7-7.5.2+1+ds2/jline3/terminal/src/main/java/org/jline/utils/Curses.java | 371 jtreg7-7.5.2+1+ds2/jline3/terminal/src/main/java/org/jline/utils/DiffHelper.java | 134 jtreg7-7.5.2+1+ds2/jline3/terminal/src/main/java/org/jline/utils/Display.java | 505 jtreg7-7.5.2+1+ds2/jline3/terminal/src/main/java/org/jline/utils/ExecHelper.java | 86 jtreg7-7.5.2+1+ds2/jline3/terminal/src/main/java/org/jline/utils/InfoCmp.java | 622 jtreg7-7.5.2+1+ds2/jline3/terminal/src/main/java/org/jline/utils/InputStreamReader.java | 346 jtreg7-7.5.2+1+ds2/jline3/terminal/src/main/java/org/jline/utils/Levenshtein.java | 119 jtreg7-7.5.2+1+ds2/jline3/terminal/src/main/java/org/jline/utils/Log.java | 126 jtreg7-7.5.2+1+ds2/jline3/terminal/src/main/java/org/jline/utils/NonBlockingReader.java | 303 jtreg7-7.5.2+1+ds2/jline3/terminal/src/main/java/org/jline/utils/OSUtils.java | 75 jtreg7-7.5.2+1+ds2/jline3/terminal/src/main/java/org/jline/utils/ShutdownHooks.java | 117 jtreg7-7.5.2+1+ds2/jline3/terminal/src/main/java/org/jline/utils/Signals.java | 115 jtreg7-7.5.2+1+ds2/jline3/terminal/src/main/java/org/jline/utils/WCWidth.java | 161 jtreg7-7.5.2+1+ds2/jline3/terminal/src/main/java/org/jline/utils/package-info.java | 14 jtreg7-7.5.2+1+ds2/jline3/terminal/src/main/resources/org/jline/utils/ansi.caps | 23 jtreg7-7.5.2+1+ds2/jline3/terminal/src/main/resources/org/jline/utils/capabilities.txt | 473 jtreg7-7.5.2+1+ds2/jline3/terminal/src/main/resources/org/jline/utils/dumb.caps | 5 jtreg7-7.5.2+1+ds2/jline3/terminal/src/main/resources/org/jline/utils/screen-256color.caps | 27 jtreg7-7.5.2+1+ds2/jline3/terminal/src/main/resources/org/jline/utils/screen.caps | 26 jtreg7-7.5.2+1+ds2/jline3/terminal/src/main/resources/org/jline/utils/windows.caps | 27 jtreg7-7.5.2+1+ds2/jline3/terminal/src/main/resources/org/jline/utils/xterm-256color.caps | 51 jtreg7-7.5.2+1+ds2/jline3/terminal/src/main/resources/org/jline/utils/xterm.caps | 51 jtreg7-7.5.2+1+ds2/jline3/terminal/src/test/java/org/jline/terminal/impl/ExecPtyTest.java | 216 jtreg7-7.5.2+1+ds2/jline3/terminal/src/test/java/org/jline/terminal/impl/PosixSysTerminalTest.java | 74 jtreg7-7.5.2+1+ds2/jline3/terminal/src/test/java/org/jline/utils/AttributedStringTest.java | 138 jtreg7-7.5.2+1+ds2/jline3/terminal/src/test/java/org/jline/utils/CursesTest.java | 34 jtreg7-7.5.2+1+ds2/jline3/terminal/src/test/java/org/jline/utils/InfoCmpTest.java | 53 jtreg7-7.5.2+1+ds2/junit4/.gitattributes | 21 jtreg7-7.5.2+1+ds2/junit4/.github/workflows/main.yml | 48 jtreg7-7.5.2+1+ds2/junit4/.github/workflows/settings.xml | 22 jtreg7-7.5.2+1+ds2/junit4/.gitignore | 13 jtreg7-7.5.2+1+ds2/junit4/BUILDING | 14 jtreg7-7.5.2+1+ds2/junit4/CODING_STYLE.txt | 9 jtreg7-7.5.2+1+ds2/junit4/CONTRIBUTING.md | 45 jtreg7-7.5.2+1+ds2/junit4/KEYS | 70 jtreg7-7.5.2+1+ds2/junit4/LEGACY_CODING_STYLE.txt | 132 jtreg7-7.5.2+1+ds2/junit4/LICENSE-junit.txt | 214 jtreg7-7.5.2+1+ds2/junit4/NOTICE.txt | 5 jtreg7-7.5.2+1+ds2/junit4/README.md | 9 jtreg7-7.5.2+1+ds2/junit4/acknowledgements.txt | 163 jtreg7-7.5.2+1+ds2/junit4/doc/ReleaseNotes4.10.html | 93 jtreg7-7.5.2+1+ds2/junit4/doc/ReleaseNotes4.10.md | 86 jtreg7-7.5.2+1+ds2/junit4/doc/ReleaseNotes4.10.txt | 1 jtreg7-7.5.2+1+ds2/junit4/doc/ReleaseNotes4.11.html | 121 jtreg7-7.5.2+1+ds2/junit4/doc/ReleaseNotes4.11.md | 116 jtreg7-7.5.2+1+ds2/junit4/doc/ReleaseNotes4.11.txt | 1 jtreg7-7.5.2+1+ds2/junit4/doc/ReleaseNotes4.12.md | 734 jtreg7-7.5.2+1+ds2/junit4/doc/ReleaseNotes4.13.1.md | 13 jtreg7-7.5.2+1+ds2/junit4/doc/ReleaseNotes4.13.2.md | 38 jtreg7-7.5.2+1+ds2/junit4/doc/ReleaseNotes4.13.md | 327 jtreg7-7.5.2+1+ds2/junit4/doc/ReleaseNotes4.4.html | 271 jtreg7-7.5.2+1+ds2/junit4/doc/ReleaseNotes4.4.md | 319 jtreg7-7.5.2+1+ds2/junit4/doc/ReleaseNotes4.4.txt | 1 jtreg7-7.5.2+1+ds2/junit4/doc/ReleaseNotes4.5.html | 320 jtreg7-7.5.2+1+ds2/junit4/doc/ReleaseNotes4.5.md | 96 jtreg7-7.5.2+1+ds2/junit4/doc/ReleaseNotes4.5.txt | 1 jtreg7-7.5.2+1+ds2/junit4/doc/ReleaseNotes4.6.html | 106 jtreg7-7.5.2+1+ds2/junit4/doc/ReleaseNotes4.6.md | 106 jtreg7-7.5.2+1+ds2/junit4/doc/ReleaseNotes4.6.txt | 1 jtreg7-7.5.2+1+ds2/junit4/doc/ReleaseNotes4.7.html | 229 jtreg7-7.5.2+1+ds2/junit4/doc/ReleaseNotes4.7.md | 210 jtreg7-7.5.2+1+ds2/junit4/doc/ReleaseNotes4.7.txt | 1 jtreg7-7.5.2+1+ds2/junit4/doc/ReleaseNotes4.8.1.html | 9 jtreg7-7.5.2+1+ds2/junit4/doc/ReleaseNotes4.8.1.md | 7 jtreg7-7.5.2+1+ds2/junit4/doc/ReleaseNotes4.8.1.txt | 1 jtreg7-7.5.2+1+ds2/junit4/doc/ReleaseNotes4.8.2.html | 10 jtreg7-7.5.2+1+ds2/junit4/doc/ReleaseNotes4.8.2.md | 8 jtreg7-7.5.2+1+ds2/junit4/doc/ReleaseNotes4.8.2.txt | 1 jtreg7-7.5.2+1+ds2/junit4/doc/ReleaseNotes4.8.html | 59 jtreg7-7.5.2+1+ds2/junit4/doc/ReleaseNotes4.8.md | 57 jtreg7-7.5.2+1+ds2/junit4/doc/ReleaseNotes4.8.txt | 1 jtreg7-7.5.2+1+ds2/junit4/doc/ReleaseNotes4.9.1.md | 14 jtreg7-7.5.2+1+ds2/junit4/doc/ReleaseNotes4.9.1.txt | 1 jtreg7-7.5.2+1+ds2/junit4/doc/ReleaseNotes4.9.html | 96 jtreg7-7.5.2+1+ds2/junit4/doc/ReleaseNotes4.9.md | 91 jtreg7-7.5.2+1+ds2/junit4/doc/ReleaseNotes4.9.txt | 1 jtreg7-7.5.2+1+ds2/junit4/doc/building-junit.txt | 98 jtreg7-7.5.2+1+ds2/junit4/doc/cookstour/cookstour.htm | 668 jtreg7-7.5.2+1+ds2/junit4/doc/markdown.sh | 1 jtreg7-7.5.2+1+ds2/junit4/doc/testinfected/testing.htm | 617 jtreg7-7.5.2+1+ds2/junit4/epl-v10.html | 261 jtreg7-7.5.2+1+ds2/junit4/pom.xml | 633 jtreg7-7.5.2+1+ds2/junit4/src/main/java/junit/extensions/ActiveTestSuite.java | 70 jtreg7-7.5.2+1+ds2/junit4/src/main/java/junit/extensions/RepeatedTest.java | 39 jtreg7-7.5.2+1+ds2/junit4/src/main/java/junit/extensions/TestDecorator.java | 43 jtreg7-7.5.2+1+ds2/junit4/src/main/java/junit/extensions/TestSetup.java | 42 jtreg7-7.5.2+1+ds2/junit4/src/main/java/junit/extensions/package-info.java | 4 jtreg7-7.5.2+1+ds2/junit4/src/main/java/junit/framework/Assert.java | 339 jtreg7-7.5.2+1+ds2/junit4/src/main/java/junit/framework/AssertionFailedError.java | 29 jtreg7-7.5.2+1+ds2/junit4/src/main/java/junit/framework/ComparisonCompactor.java | 78 jtreg7-7.5.2+1+ds2/junit4/src/main/java/junit/framework/ComparisonFailure.java | 56 jtreg7-7.5.2+1+ds2/junit4/src/main/java/junit/framework/JUnit4TestAdapter.java | 107 jtreg7-7.5.2+1+ds2/junit4/src/main/java/junit/framework/JUnit4TestAdapterCache.java | 77 jtreg7-7.5.2+1+ds2/junit4/src/main/java/junit/framework/JUnit4TestCaseFacade.java | 30 jtreg7-7.5.2+1+ds2/junit4/src/main/java/junit/framework/Protectable.java | 14 jtreg7-7.5.2+1+ds2/junit4/src/main/java/junit/framework/Test.java | 18 jtreg7-7.5.2+1+ds2/junit4/src/main/java/junit/framework/TestCase.java | 509 jtreg7-7.5.2+1+ds2/junit4/src/main/java/junit/framework/TestFailure.java | 69 jtreg7-7.5.2+1+ds2/junit4/src/main/java/junit/framework/TestListener.java | 26 jtreg7-7.5.2+1+ds2/junit4/src/main/java/junit/framework/TestResult.java | 185 jtreg7-7.5.2+1+ds2/junit4/src/main/java/junit/framework/TestSuite.java | 308 jtreg7-7.5.2+1+ds2/junit4/src/main/java/junit/framework/package-info.java | 4 jtreg7-7.5.2+1+ds2/junit4/src/main/java/junit/runner/BaseTestRunner.java | 326 jtreg7-7.5.2+1+ds2/junit4/src/main/java/junit/runner/TestRunListener.java | 25 jtreg7-7.5.2+1+ds2/junit4/src/main/java/junit/runner/Version.java | 18 jtreg7-7.5.2+1+ds2/junit4/src/main/java/junit/runner/Version.java.template | 18 jtreg7-7.5.2+1+ds2/junit4/src/main/java/junit/runner/package-info.java | 4 jtreg7-7.5.2+1+ds2/junit4/src/main/java/junit/textui/ResultPrinter.java | 137 jtreg7-7.5.2+1+ds2/junit4/src/main/java/junit/textui/TestRunner.java | 206 jtreg7-7.5.2+1+ds2/junit4/src/main/java/junit/textui/package-info.java | 4 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/After.java | 41 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/AfterClass.java | 42 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/Assert.java | 1034 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/Assume.java | 169 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/AssumptionViolatedException.java | 46 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/Before.java | 39 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/BeforeClass.java | 37 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/ClassRule.java | 118 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/ComparisonFailure.java | 171 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/FixMethodOrder.java | 41 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/Ignore.java | 40 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/Rule.java | 101 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/Test.java | 117 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/TestCouldNotBeSkippedException.java | 19 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/experimental/ParallelComputer.java | 67 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/experimental/categories/Categories.java | 375 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/experimental/categories/Category.java | 48 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/experimental/categories/CategoryFilterFactory.java | 51 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/experimental/categories/CategoryValidator.java | 62 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/experimental/categories/ExcludeCategories.java | 52 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/experimental/categories/IncludeCategories.java | 52 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/experimental/max/CouldNotReadCoreException.java | 15 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/experimental/max/MaxCore.java | 181 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/experimental/max/MaxHistory.java | 178 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/experimental/results/FailureList.java | 28 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/experimental/results/PrintableResult.java | 72 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/experimental/results/ResultMatchers.java | 99 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/experimental/runners/Enclosed.java | 45 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/experimental/theories/DataPoint.java | 56 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/experimental/theories/DataPoints.java | 64 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/experimental/theories/FromDataPoints.java | 54 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/experimental/theories/ParameterSignature.java | 134 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/experimental/theories/ParameterSupplier.java | 43 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/experimental/theories/ParametersSuppliedBy.java | 48 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/experimental/theories/PotentialAssignment.java | 52 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/experimental/theories/Theories.java | 310 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/experimental/theories/Theory.java | 18 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/experimental/theories/internal/AllMembersSupplier.java | 204 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/experimental/theories/internal/Assignments.java | 153 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/experimental/theories/internal/BooleanSupplier.java | 18 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/experimental/theories/internal/EnumSupplier.java | 30 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/experimental/theories/internal/ParameterizedAssertionError.java | 50 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/experimental/theories/internal/SpecificDataPointsSupplier.java | 90 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/experimental/theories/suppliers/TestedOn.java | 31 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/experimental/theories/suppliers/TestedOnSupplier.java | 25 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/function/ThrowingRunnable.java | 14 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/ArrayComparisonFailure.java | 74 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/AssumptionViolatedException.java | 139 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/Checks.java | 37 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/Classes.java | 44 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/ComparisonCriteria.java | 132 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/ExactComparisonCriteria.java | 10 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/InexactComparisonCriteria.java | 24 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/JUnitSystem.java | 14 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/MethodSorter.java | 72 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/RealSystem.java | 19 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/SerializableMatcherDescription.java | 47 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/SerializableValueDescription.java | 38 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/TextListener.java | 101 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/Throwables.java | 273 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/builders/AllDefaultPossibilitiesBuilder.java | 67 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/builders/AnnotatedBuilder.java | 116 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/builders/IgnoredBuilder.java | 15 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/builders/IgnoredClassRunner.java | 23 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/builders/JUnit3Builder.java | 19 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/builders/JUnit4Builder.java | 12 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/builders/NullBuilder.java | 11 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/builders/SuiteMethodBuilder.java | 24 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/management/FakeRuntimeMXBean.java | 21 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/management/FakeThreadMXBean.java | 27 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/management/ManagementFactory.java | 77 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/management/ReflectiveRuntimeMXBean.java | 61 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/management/ReflectiveThreadMXBean.java | 92 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/management/RuntimeMXBean.java | 14 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/management/ThreadMXBean.java | 17 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/matchers/StacktracePrintingMatcher.java | 53 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/matchers/ThrowableCauseMatcher.java | 50 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/matchers/ThrowableMessageMatcher.java | 37 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/matchers/TypeSafeMatcher.java | 63 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/requests/ClassRequest.java | 54 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/requests/FilterRequest.java | 45 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/requests/MemoizingRequest.java | 30 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/requests/OrderingRequest.java | 29 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/requests/SortingRequest.java | 25 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/requests/package-info.java | 6 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/runners/ClassRoadie.java | 81 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/runners/ErrorReportingRunner.java | 92 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/runners/FailedBefore.java | 13 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/runners/InitializationError.java | 37 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/runners/JUnit38ClassRunner.java | 196 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/runners/JUnit4ClassRunner.java | 147 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/runners/MethodRoadie.java | 163 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/runners/MethodValidator.java | 97 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/runners/SuiteMethod.java | 41 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/runners/TestClass.java | 109 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/runners/TestMethod.java | 71 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/runners/model/EachTestNotifier.java | 71 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/runners/model/MultipleFailureException.java | 12 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/runners/model/ReflectiveCallable.java | 19 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/runners/package-info.java | 6 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/runners/rules/RuleMemberValidator.java | 279 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/runners/rules/ValidationError.java | 14 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/runners/statements/ExpectException.java | 38 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/runners/statements/Fail.java | 16 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/runners/statements/FailOnTimeout.java | 312 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/runners/statements/InvokeMethod.java | 19 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/runners/statements/RunAfters.java | 48 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/internal/runners/statements/RunBefores.java | 35 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/matchers/JUnitMatchers.java | 113 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/matchers/package-info.java | 9 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/package-info.java | 8 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/rules/DisableOnDebug.java | 125 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/rules/ErrorCollector.java | 120 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/rules/ExpectedException.java | 285 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/rules/ExpectedExceptionMatcherBuilder.java | 46 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/rules/ExternalResource.java | 84 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/rules/MethodRule.java | 32 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/rules/RuleChain.java | 113 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/rules/RunRules.java | 30 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/rules/Stopwatch.java | 183 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/rules/TemporaryFolder.java | 351 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/rules/TestName.java | 41 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/rules/TestRule.java | 56 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/rules/TestWatcher.java | 170 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/rules/TestWatchman.java | 91 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/rules/Timeout.java | 233 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/rules/Verifier.java | 47 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runner/Computer.java | 52 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runner/Describable.java | 14 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runner/Description.java | 327 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runner/FilterFactories.java | 82 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runner/FilterFactory.java | 25 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runner/FilterFactoryParams.java | 23 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runner/JUnitCommandLineParseResult.java | 147 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runner/JUnitCore.java | 167 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runner/OrderWith.java | 28 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runner/OrderWithValidator.java | 38 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runner/Request.java | 202 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runner/Result.java | 217 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runner/RunWith.java | 36 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runner/Runner.java | 43 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runner/manipulation/Alphanumeric.java | 27 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runner/manipulation/Filter.java | 122 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runner/manipulation/Filterable.java | 19 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runner/manipulation/InvalidOrderingException.java | 21 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runner/manipulation/NoTestsRemainException.java | 10 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runner/manipulation/Orderable.java | 21 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runner/manipulation/Orderer.java | 62 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runner/manipulation/Ordering.java | 172 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runner/manipulation/Sortable.java | 20 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runner/manipulation/Sorter.java | 90 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runner/manipulation/package-info.java | 7 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runner/notification/Failure.java | 90 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runner/notification/RunListener.java | 168 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runner/notification/RunNotifier.java | 249 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runner/notification/StoppedByUserException.java | 12 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runner/notification/SynchronizedRunListener.java | 134 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runner/notification/package-info.java | 6 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runner/package-info.java | 6 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runners/AllTests.java | 27 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runners/BlockJUnit4ClassRunner.java | 473 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runners/JUnit4.java | 25 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runners/MethodSorters.java | 41 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runners/Parameterized.java | 504 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runners/ParentRunner.java | 582 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runners/RuleContainer.java | 113 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runners/Suite.java | 130 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runners/model/Annotatable.java | 20 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runners/model/FrameworkField.java | 99 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runners/model/FrameworkMember.java | 59 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runners/model/FrameworkMethod.java | 216 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runners/model/InitializationError.java | 47 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runners/model/InvalidTestClassError.java | 39 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runners/model/MemberValueConsumer.java | 18 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runners/model/MultipleFailureException.java | 104 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runners/model/NoGenericTypeParametersValidator.java | 58 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runners/model/RunnerBuilder.java | 132 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runners/model/RunnerScheduler.java | 23 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runners/model/Statement.java | 15 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runners/model/TestClass.java | 348 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runners/model/TestTimedOutException.java | 44 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runners/package-info.java | 8 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runners/parameterized/BlockJUnit4ClassRunnerWithParameters.java | 219 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runners/parameterized/BlockJUnit4ClassRunnerWithParametersFactory.java | 18 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runners/parameterized/ParametersRunnerFactory.java | 21 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/runners/parameterized/TestWithParameters.java | 77 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/validator/AnnotationValidator.java | 60 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/validator/AnnotationValidatorFactory.java | 39 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/validator/AnnotationsValidator.java | 120 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/validator/PublicClassValidator.java | 33 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/validator/TestClassValidator.java | 21 jtreg7-7.5.2+1+ds2/junit4/src/main/java/org/junit/validator/ValidateWith.java | 22 jtreg7-7.5.2+1+ds2/junit4/src/main/javadoc/stylesheet.css | 1 jtreg7-7.5.2+1+ds2/junit4/src/test/java/junit/samples/AllTests.java | 22 jtreg7-7.5.2+1+ds2/junit4/src/test/java/junit/samples/ListTest.java | 67 jtreg7-7.5.2+1+ds2/junit4/src/test/java/junit/samples/SimpleTest.java | 72 jtreg7-7.5.2+1+ds2/junit4/src/test/java/junit/samples/money/IMoney.java | 51 jtreg7-7.5.2+1+ds2/junit4/src/test/java/junit/samples/money/Money.java | 92 jtreg7-7.5.2+1+ds2/junit4/src/test/java/junit/samples/money/MoneyBag.java | 155 jtreg7-7.5.2+1+ds2/junit4/src/test/java/junit/samples/money/MoneyTest.java | 166 jtreg7-7.5.2+1+ds2/junit4/src/test/java/junit/samples/money/package-info.java | 4 jtreg7-7.5.2+1+ds2/junit4/src/test/java/junit/samples/package-info.java | 4 jtreg7-7.5.2+1+ds2/junit4/src/test/java/junit/tests/AllTests.java | 22 jtreg7-7.5.2+1+ds2/junit4/src/test/java/junit/tests/SampleJUnit3Tests.java | 51 jtreg7-7.5.2+1+ds2/junit4/src/test/java/junit/tests/WasRun.java | 16 jtreg7-7.5.2+1+ds2/junit4/src/test/java/junit/tests/extensions/ActiveTestTest.java | 64 jtreg7-7.5.2+1+ds2/junit4/src/test/java/junit/tests/extensions/AllTests.java | 22 jtreg7-7.5.2+1+ds2/junit4/src/test/java/junit/tests/extensions/ExtensionTest.java | 104 jtreg7-7.5.2+1+ds2/junit4/src/test/java/junit/tests/extensions/RepeatedTestTest.java | 62 jtreg7-7.5.2+1+ds2/junit4/src/test/java/junit/tests/extensions/package-info.java | 4 jtreg7-7.5.2+1+ds2/junit4/src/test/java/junit/tests/framework/AllTests.java | 31 jtreg7-7.5.2+1+ds2/junit4/src/test/java/junit/tests/framework/AssertTest.java | 171 jtreg7-7.5.2+1+ds2/junit4/src/test/java/junit/tests/framework/AssertionFailedErrorTest.java | 23 jtreg7-7.5.2+1+ds2/junit4/src/test/java/junit/tests/framework/ComparisonCompactorTest.java | 102 jtreg7-7.5.2+1+ds2/junit4/src/test/java/junit/tests/framework/ComparisonFailureTest.java | 47 jtreg7-7.5.2+1+ds2/junit4/src/test/java/junit/tests/framework/DoublePrecisionAssertTest.java | 59 jtreg7-7.5.2+1+ds2/junit4/src/test/java/junit/tests/framework/Failure.java | 13 jtreg7-7.5.2+1+ds2/junit4/src/test/java/junit/tests/framework/FloatAssertTest.java | 63 jtreg7-7.5.2+1+ds2/junit4/src/test/java/junit/tests/framework/InheritedTestCase.java | 9 jtreg7-7.5.2+1+ds2/junit4/src/test/java/junit/tests/framework/NoArgTestCaseTest.java | 8 jtreg7-7.5.2+1+ds2/junit4/src/test/java/junit/tests/framework/NoTestCaseClass.java | 9 jtreg7-7.5.2+1+ds2/junit4/src/test/java/junit/tests/framework/NoTestCases.java | 11 jtreg7-7.5.2+1+ds2/junit4/src/test/java/junit/tests/framework/NotPublicTestCase.java | 14 jtreg7-7.5.2+1+ds2/junit4/src/test/java/junit/tests/framework/NotVoidTestCase.java | 15 jtreg7-7.5.2+1+ds2/junit4/src/test/java/junit/tests/framework/OneTestCase.java | 17 jtreg7-7.5.2+1+ds2/junit4/src/test/java/junit/tests/framework/OverrideTestCase.java | 10 jtreg7-7.5.2+1+ds2/junit4/src/test/java/junit/tests/framework/Success.java | 16 jtreg7-7.5.2+1+ds2/junit4/src/test/java/junit/tests/framework/SuiteTest.java | 118 jtreg7-7.5.2+1+ds2/junit4/src/test/java/junit/tests/framework/TestCaseTest.java | 205 jtreg7-7.5.2+1+ds2/junit4/src/test/java/junit/tests/framework/TestImplementorTest.java | 54 jtreg7-7.5.2+1+ds2/junit4/src/test/java/junit/tests/framework/TestListenerTest.java | 80 jtreg7-7.5.2+1+ds2/junit4/src/test/java/junit/tests/framework/ThreeTestCases.java | 17 jtreg7-7.5.2+1+ds2/junit4/src/test/java/junit/tests/framework/package-info.java | 4 jtreg7-7.5.2+1+ds2/junit4/src/test/java/junit/tests/package-info.java | 4 jtreg7-7.5.2+1+ds2/junit4/src/test/java/junit/tests/runner/AllTests.java | 30 jtreg7-7.5.2+1+ds2/junit4/src/test/java/junit/tests/runner/BaseTestRunnerTest.java | 52 jtreg7-7.5.2+1+ds2/junit4/src/test/java/junit/tests/runner/ResultTest.java | 189 jtreg7-7.5.2+1+ds2/junit4/src/test/java/junit/tests/runner/StackFilterTest.java | 46 jtreg7-7.5.2+1+ds2/junit4/src/test/java/junit/tests/runner/TextFeedbackTest.java | 126 jtreg7-7.5.2+1+ds2/junit4/src/test/java/junit/tests/runner/TextRunnerSingleMethodTest.java | 39 jtreg7-7.5.2+1+ds2/junit4/src/test/java/junit/tests/runner/TextRunnerTest.java | 62 jtreg7-7.5.2+1+ds2/junit4/src/test/java/junit/tests/runner/package-info.java | 4 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/AssumptionViolatedExceptionTest.java | 207 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/experimental/categories/AllCategoriesTests.java | 17 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/experimental/categories/CategoriesAndParameterizedTest.java | 127 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/experimental/categories/CategoryFilterFactoryTest.java | 66 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/experimental/categories/CategoryTest.java | 574 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/experimental/categories/CategoryValidatorTest.java | 86 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/experimental/categories/JavadocTest.java | 76 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/experimental/categories/MultiCategoryTest.java | 169 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/internal/AllInternalTests.java | 27 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/internal/ArrayComparisonFailureTest.java | 68 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/internal/ChecksTest.java | 60 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/internal/MethodSorterTest.java | 182 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/internal/StackTracesTest.java | 332 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/internal/builders/AnnotatedBuilderTest.java | 105 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/internal/matchers/StacktracePrintingMatcherTest.java | 38 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/internal/matchers/ThrowableCauseMatcherTest.java | 18 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/internal/runners/ErrorReportingRunnerTest.java | 88 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/internal/runners/statements/ExpectExceptionTest.java | 88 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/internal/runners/statements/FailOnTimeoutTest.java | 271 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/rules/AllRulesTests.java | 31 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/rules/BlockJUnit4ClassRunnerOverrideTest.java | 175 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/rules/ClassRulesTest.java | 366 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/rules/DisableOnDebugTest.java | 164 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/rules/ErrorCollectorTest.java | 327 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/rules/EventCollector.java | 191 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/rules/ExpectedExceptionTest.java | 386 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/rules/ExternalResourceRuleTest.java | 168 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/rules/LoggingMethodRule.java | 18 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/rules/LoggingStatement.java | 24 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/rules/LoggingTestRule.java | 18 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/rules/LoggingTestWatcher.java | 42 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/rules/MethodRulesTest.java | 420 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/rules/NameRulesTest.java | 50 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/rules/RuleChainTest.java | 94 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/rules/RuleMemberValidatorTest.java | 356 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/rules/StopwatchTest.java | 212 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/rules/TempFolderRuleTest.java | 281 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/rules/TemporaryFolderRuleAssuredDeletionTest.java | 45 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/rules/TemporaryFolderUsageTest.java | 302 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/rules/TestRuleTest.java | 610 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/rules/TestWatcherTest.java | 397 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/rules/TestWatchmanTest.java | 90 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/rules/TimeoutRuleTest.java | 162 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/rules/VerifierRuleTest.java | 36 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/runner/AllRunnerTests.java | 18 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/runner/FilterFactoriesTest.java | 137 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/runner/FilterOptionIntegrationTest.java | 190 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/runner/JUnitCommandLineParseResultTest.java | 146 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/runner/JUnitCoreTest.java | 20 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/runner/OrderWithValidatorTest.java | 50 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/runner/RequestTest.java | 50 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/runner/RunnerSpy.java | 37 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/runner/notification/AllNotificationTests.java | 14 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/runner/notification/ConcurrentRunNotifierTest.java | 180 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/runner/notification/RunNotifierTest.java | 131 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/runner/notification/SynchronizedRunListenerTest.java | 156 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/runners/AllRunnersTests.java | 16 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/runners/CustomBlockJUnit4ClassRunnerTest.java | 90 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/runners/RuleContainerTest.java | 68 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/runners/model/AllModelTests.java | 15 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/runners/model/FrameworkFieldTest.java | 58 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/runners/model/FrameworkMethodTest.java | 60 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/runners/model/InvalidTestClassErrorTest.java | 23 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/runners/model/RunnerBuilderStub.java | 11 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/runners/model/TestClassTest.java | 263 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/runners/parameterized/AllParameterizedTests.java | 14 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/runners/parameterized/BlockJUnit4ClassRunnerWithParametersTest.java | 80 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/runners/parameterized/ParameterizedNamesTest.java | 51 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/runners/parameterized/TestWithParametersTest.java | 137 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/samples/AllSamplesTests.java | 14 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/samples/ListTest.java | 91 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/samples/SimpleTest.java | 47 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/samples/money/MoneyTest.java | 205 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/samples/money/package-info.java | 7 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/samples/package-info.java | 6 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/AllTests.java | 49 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/ObjectContractTest.java | 46 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/SampleJUnit4Tests.java | 136 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/TestSystem.java | 35 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/assertion/AllAssertionTests.java | 14 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/assertion/AssertionTest.java | 1005 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/assertion/ComparisonFailureTest.java | 78 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/assertion/MultipleFailureExceptionTest.java | 118 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/deprecated/AllDeprecatedTests.java | 13 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/deprecated/JUnit4ClassRunnerTest.java | 64 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/description/AllDescriptionTests.java | 15 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/description/AnnotatedDescriptionTest.java | 96 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/description/SuiteDescriptionTest.java | 38 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/description/TestDescriptionMethodNameTest.java | 50 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/description/TestDescriptionTest.java | 24 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/experimental/AllExperimentalTests.java | 25 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/experimental/AssumptionTest.java | 312 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/experimental/MatcherTest.java | 44 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/experimental/max/AllMaxTests.java | 14 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/experimental/max/DescriptionTest.java | 123 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/experimental/max/JUnit38SortingTest.java | 62 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/experimental/max/MaxStarterTest.java | 292 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/experimental/parallel/AllParallelTests.java | 13 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/experimental/parallel/ParallelClassTest.java | 79 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/experimental/parallel/ParallelMethodTest.java | 61 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/experimental/results/AllResultsTests.java | 13 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/experimental/results/PrintableResultTest.java | 50 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/experimental/results/ResultMatchersTest.java | 46 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/experimental/theories/AllTheoriesTests.java | 19 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/experimental/theories/AssumingInTheoriesTest.java | 42 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/experimental/theories/ParameterSignatureTest.java | 92 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/experimental/theories/PotentialAssignmentTest.java | 57 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/experimental/theories/TestedOnSupplierTest.java | 32 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/experimental/theories/TheoryTestUtils.java | 33 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/experimental/theories/extendingwithstubs/Correspondent.java | 7 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/experimental/theories/extendingwithstubs/Guesser.java | 126 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/experimental/theories/extendingwithstubs/GuesserQueue.java | 58 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/experimental/theories/extendingwithstubs/MethodCall.java | 55 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/experimental/theories/extendingwithstubs/ReguessableValue.java | 16 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/experimental/theories/extendingwithstubs/StringableObject.java | 29 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/experimental/theories/extendingwithstubs/Stub.java | 8 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/experimental/theories/extendingwithstubs/StubbedTheories.java | 65 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/experimental/theories/extendingwithstubs/StubbedTheoriesTest.java | 16 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/experimental/theories/internal/AllMembersSupplierTest.java | 209 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/experimental/theories/internal/AllTheoriesInternalTests.java | 14 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/experimental/theories/internal/ParameterizedAssertionErrorTest.java | 95 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/experimental/theories/internal/SpecificDataPointsSupplierTest.java | 156 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/experimental/theories/runner/AllTheoriesRunnerTests.java | 24 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/experimental/theories/runner/FailingDataPointMethods.java | 136 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/experimental/theories/runner/SuccessfulWithDataPointFields.java | 211 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/experimental/theories/runner/TheoriesPerformanceTest.java | 38 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/experimental/theories/runner/TypeMatchingBetweenMultiDataPointsMethod.java | 57 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/experimental/theories/runner/UnsuccessfulWithDataPointFields.java | 243 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/experimental/theories/runner/WhenNoParametersMatch.java | 51 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/experimental/theories/runner/WithAutoGeneratedDataPoints.java | 71 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/experimental/theories/runner/WithDataPointMethod.java | 114 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/experimental/theories/runner/WithExtendedParameterSources.java | 180 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/experimental/theories/runner/WithNamedDataPoints.java | 73 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/experimental/theories/runner/WithOnlyTestAnnotations.java | 82 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/experimental/theories/runner/WithParameterSupplier.java | 165 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/experimental/theories/runner/WithUnresolvedGenericTypeVariablesOnTheoryParms.java | 180 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/junit3compatibility/AllJUnit3CompatibilityTests.java | 21 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/junit3compatibility/AllTestsTest.java | 87 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/junit3compatibility/ClassRequestTest.java | 20 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/junit3compatibility/ForwardCompatibilityPrintingTest.java | 91 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/junit3compatibility/ForwardCompatibilityTest.java | 254 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/junit3compatibility/InitializationErrorForwardCompatibilityTest.java | 102 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/junit3compatibility/JUnit38ClassRunnerTest.java | 155 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/junit3compatibility/JUnit4TestAdapterTest.java | 82 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/junit3compatibility/OldTestClassAdaptingListenerTest.java | 28 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/junit3compatibility/OldTests.java | 12 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/junit3compatibility/SuiteMethodTest.java | 134 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/listening/AllListeningTests.java | 16 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/listening/ListenerTest.java | 38 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/listening/RunnerTest.java | 75 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/listening/TestListenerTest.java | 65 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/listening/TextListenerTest.java | 73 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/listening/UserStopTest.java | 33 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/manipulation/AllManipulationTests.java | 17 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/manipulation/AlphanumericOrdering.java | 15 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/manipulation/ComparatorBasedOrdering.java | 28 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/manipulation/Comparators.java | 19 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/manipulation/FilterTest.java | 50 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/manipulation/FilterableTest.java | 62 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/manipulation/OrderWithTest.java | 268 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/manipulation/OrderableTest.java | 301 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/manipulation/ReverseAlphanumericOrdering.java | 20 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/manipulation/ReverseAlphanumericSorter.java | 16 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/manipulation/SingleMethodTest.java | 190 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/manipulation/SortableTest.java | 302 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/package-info.java | 8 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/running/AllRunningTests.java | 17 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/running/classes/AllClassesTests.java | 24 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/running/classes/BlockJUnit4ClassRunnerTest.java | 68 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/running/classes/ClassLevelMethodsWithIgnoredTestsTest.java | 165 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/running/classes/EnclosedTest.java | 55 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/running/classes/IgnoreClassTest.java | 31 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/running/classes/ParameterizedTestTest.java | 809 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/running/classes/ParentRunnerFilteringTest.java | 171 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/running/classes/ParentRunnerTest.java | 310 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/running/classes/RunWithTest.java | 88 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/running/classes/SuiteTest.java | 218 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/running/classes/ThreadsTest.java | 83 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/running/classes/UseSuiteAsASuperclassTest.java | 45 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/running/classes/parent/ParentRunnerClassLoaderTest.java | 94 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/running/classes/parent/TestWithClassRule.java | 42 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/running/core/AllCoreTests.java | 14 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/running/core/CommandLineTest.java | 78 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/running/core/JUnitCoreReturnsCorrectExitCodeTest.java | 47 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/running/core/MainRunner.java | 67 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/running/core/SystemExitTest.java | 31 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/running/methods/AllMethodsTests.java | 17 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/running/methods/AnnotationTest.java | 842 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/running/methods/ExpectedTest.java | 83 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/running/methods/InheritedTestTest.java | 39 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/running/methods/ParameterizedTestMethodTest.java | 188 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/running/methods/TestMethodTest.java | 255 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/running/methods/TimeoutTest.java | 334 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/validation/AllValidationTests.java | 14 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/validation/BadlyFormedClassesTest.java | 71 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/validation/FailedConstructionTest.java | 28 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/validation/ValidationTest.java | 42 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/validation/anotherpackage/Sub.java | 5 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/tests/validation/anotherpackage/Super.java | 9 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/validator/AllValidatorTests.java | 14 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/validator/AnnotationValidatorFactoryTest.java | 47 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/validator/AnnotationsValidatorTest.java | 98 jtreg7-7.5.2+1+ds2/junit4/src/test/java/org/junit/validator/PublicClassValidatorTest.java | 41 jtreg7-7.5.2+1+ds2/junit4/to-do.txt | 27 jtreg7-7.5.2+1+ds2/junit5/.editorconfig | 6 jtreg7-7.5.2+1+ds2/junit5/.gitattributes | 7 jtreg7-7.5.2+1+ds2/junit5/.github/FUNDING.yml | 8 jtreg7-7.5.2+1+ds2/junit5/.github/ISSUE_TEMPLATE/bug_report.md | 20 jtreg7-7.5.2+1+ds2/junit5/.github/ISSUE_TEMPLATE/feature_request.md | 11 jtreg7-7.5.2+1+ds2/junit5/.github/ISSUE_TEMPLATE/question.md | 11 jtreg7-7.5.2+1+ds2/junit5/.github/PULL_REQUEST_TEMPLATE.md | 18 jtreg7-7.5.2+1+ds2/junit5/.github/actions/main-build/action.yml | 18 jtreg7-7.5.2+1+ds2/junit5/.github/actions/run-gradle/action.yml | 32 jtreg7-7.5.2+1+ds2/junit5/.github/actions/setup-test-jdk/action.yml | 17 jtreg7-7.5.2+1+ds2/junit5/.github/codecov.yml | 12 jtreg7-7.5.2+1+ds2/junit5/.github/workflows/close-inactive-issues.yml | 31 jtreg7-7.5.2+1+ds2/junit5/.github/workflows/codeql-analysis.yml | 48 jtreg7-7.5.2+1+ds2/junit5/.github/workflows/combine-prs.yml | 16 jtreg7-7.5.2+1+ds2/junit5/.github/workflows/cross-version.yml | 104 jtreg7-7.5.2+1+ds2/junit5/.github/workflows/gradle-dependency-submission.yml | 27 jtreg7-7.5.2+1+ds2/junit5/.github/workflows/issue-labels.yml | 20 jtreg7-7.5.2+1+ds2/junit5/.github/workflows/main.yml | 135 jtreg7-7.5.2+1+ds2/junit5/.github/workflows/reproducible-build.yml | 34 jtreg7-7.5.2+1+ds2/junit5/.gitignore | 34 jtreg7-7.5.2+1+ds2/junit5/.idea/codeStyles/Project.xml | 95 jtreg7-7.5.2+1+ds2/junit5/.idea/codeStyles/codeStyleConfig.xml | 5 jtreg7-7.5.2+1+ds2/junit5/.idea/vcs.xml | 26 jtreg7-7.5.2+1+ds2/junit5/CODE_OF_CONDUCT.md | 76 jtreg7-7.5.2+1+ds2/junit5/CONTRIBUTING.md | 172 jtreg7-7.5.2+1+ds2/junit5/KEYS | 70 jtreg7-7.5.2+1+ds2/junit5/LICENSE-notice.md | 8 jtreg7-7.5.2+1+ds2/junit5/LICENSE.md | 98 jtreg7-7.5.2+1+ds2/junit5/README.md | 112 jtreg7-7.5.2+1+ds2/junit5/SECURITY.md | 12 jtreg7-7.5.2+1+ds2/junit5/build.gradle.kts | 72 jtreg7-7.5.2+1+ds2/junit5/gradle.properties | 30 jtreg7-7.5.2+1+ds2/junit5/gradle/base/code-generator-model/build.gradle.kts | 9 jtreg7-7.5.2+1+ds2/junit5/gradle/base/code-generator-model/src/main/kotlin/junitbuild/generator/model/JRE.kt | 3 jtreg7-7.5.2+1+ds2/junit5/gradle/base/code-generator-model/src/main/resources/jre.yaml | 32 jtreg7-7.5.2+1+ds2/junit5/gradle/base/settings.gradle.kts | 3 jtreg7-7.5.2+1+ds2/junit5/gradle/config/checkstyle/checkstyleMain.xml | 46 jtreg7-7.5.2+1+ds2/junit5/gradle/config/checkstyle/checkstyleTest.xml | 32 jtreg7-7.5.2+1+ds2/junit5/gradle/config/checkstyle/suppressions.xml | 9 jtreg7-7.5.2+1+ds2/junit5/gradle/config/eclipse/junit-eclipse-formatter-settings.xml | 404 jtreg7-7.5.2+1+ds2/junit5/gradle/config/eclipse/junit-eclipse.importorder | 12 jtreg7-7.5.2+1+ds2/junit5/gradle/config/spotless/eclipse-public-license-2.0.java | 9 jtreg7-7.5.2+1+ds2/junit5/gradle/gradle-daemon-jvm.properties | 2 jtreg7-7.5.2+1+ds2/junit5/gradle/libs.versions.toml | 94 jtreg7-7.5.2+1+ds2/junit5/gradle/plugins/build-parameters/build.gradle.kts | 92 jtreg7-7.5.2+1+ds2/junit5/gradle/plugins/build.gradle.kts | 3 jtreg7-7.5.2+1+ds2/junit5/gradle/plugins/code-generator/build.gradle.kts | 15 jtreg7-7.5.2+1+ds2/junit5/gradle/plugins/code-generator/src/main/kotlin/junitbuild.code-generator.gradle.kts | 35 jtreg7-7.5.2+1+ds2/junit5/gradle/plugins/code-generator/src/main/kotlin/junitbuild/generator/GenerateJreRelatedSourceCode.kt | 77 jtreg7-7.5.2+1+ds2/junit5/gradle/plugins/common/build.gradle.kts | 24 jtreg7-7.5.2+1+ds2/junit5/gradle/plugins/common/src/main/kotlin/JavaLibraryExtension.kt | 7 jtreg7-7.5.2+1+ds2/junit5/gradle/plugins/common/src/main/kotlin/License.kt | 4 jtreg7-7.5.2+1+ds2/junit5/gradle/plugins/common/src/main/kotlin/ProjectExtensions.kt | 19 jtreg7-7.5.2+1+ds2/junit5/gradle/plugins/common/src/main/kotlin/TaskExtensions.kt | 5 jtreg7-7.5.2+1+ds2/junit5/gradle/plugins/common/src/main/kotlin/junitbuild.base-conventions.gradle.kts | 6 jtreg7-7.5.2+1+ds2/junit5/gradle/plugins/common/src/main/kotlin/junitbuild.build-metadata.gradle.kts | 34 jtreg7-7.5.2+1+ds2/junit5/gradle/plugins/common/src/main/kotlin/junitbuild.dependency-update-check.gradle.kts | 19 jtreg7-7.5.2+1+ds2/junit5/gradle/plugins/common/src/main/kotlin/junitbuild.jacoco-aggregation-conventions.gradle.kts | 39 jtreg7-7.5.2+1+ds2/junit5/gradle/plugins/common/src/main/kotlin/junitbuild.jacoco-conventions.gradle.kts | 12 jtreg7-7.5.2+1+ds2/junit5/gradle/plugins/common/src/main/kotlin/junitbuild.jacoco-java-conventions.gradle.kts | 28 jtreg7-7.5.2+1+ds2/junit5/gradle/plugins/common/src/main/kotlin/junitbuild.java-library-conventions.gradle.kts | 332 jtreg7-7.5.2+1+ds2/junit5/gradle/plugins/common/src/main/kotlin/junitbuild.java-multi-release-sources.gradle.kts | 45 jtreg7-7.5.2+1+ds2/junit5/gradle/plugins/common/src/main/kotlin/junitbuild.java-multi-release-test-sources.gradle.kts | 42 jtreg7-7.5.2+1+ds2/junit5/gradle/plugins/common/src/main/kotlin/junitbuild.java-toolchain-conventions.gradle.kts | 54 jtreg7-7.5.2+1+ds2/junit5/gradle/plugins/common/src/main/kotlin/junitbuild.jmh-conventions.gradle.kts | 23 jtreg7-7.5.2+1+ds2/junit5/gradle/plugins/common/src/main/kotlin/junitbuild.junit4-compatibility.gradle.kts | 33 jtreg7-7.5.2+1+ds2/junit5/gradle/plugins/common/src/main/kotlin/junitbuild.kotlin-library-conventions.gradle.kts | 33 jtreg7-7.5.2+1+ds2/junit5/gradle/plugins/common/src/main/kotlin/junitbuild.osgi-conventions.gradle.kts | 118 jtreg7-7.5.2+1+ds2/junit5/gradle/plugins/common/src/main/kotlin/junitbuild.publishing-conventions.gradle.kts | 115 jtreg7-7.5.2+1+ds2/junit5/gradle/plugins/common/src/main/kotlin/junitbuild.settings-conventions.settings.gradle.kts | 5 jtreg7-7.5.2+1+ds2/junit5/gradle/plugins/common/src/main/kotlin/junitbuild.shadow-conventions.gradle.kts | 77 jtreg7-7.5.2+1+ds2/junit5/gradle/plugins/common/src/main/kotlin/junitbuild.spotless-conventions.gradle.kts | 58 jtreg7-7.5.2+1+ds2/junit5/gradle/plugins/common/src/main/kotlin/junitbuild.temp-maven-repo.gradle.kts | 31 jtreg7-7.5.2+1+ds2/junit5/gradle/plugins/common/src/main/kotlin/junitbuild.testing-conventions.gradle.kts | 92 jtreg7-7.5.2+1+ds2/junit5/gradle/plugins/common/src/main/kotlin/junitbuild/exec/CaptureJavaExecOutput.kt | 50 jtreg7-7.5.2+1+ds2/junit5/gradle/plugins/common/src/main/kotlin/junitbuild/exec/ClasspathSystemPropertyProvider.kt | 9 jtreg7-7.5.2+1+ds2/junit5/gradle/plugins/common/src/main/kotlin/junitbuild/exec/GenerateStandaloneConsoleLauncherShadowedArtifactsFile.kt | 40 jtreg7-7.5.2+1+ds2/junit5/gradle/plugins/common/src/main/kotlin/junitbuild/exec/RunConsoleLauncher.kt | 114 jtreg7-7.5.2+1+ds2/junit5/gradle/plugins/common/src/main/kotlin/junitbuild/extensions/Extensions.kt | 7 jtreg7-7.5.2+1+ds2/junit5/gradle/plugins/common/src/main/kotlin/junitbuild/java/ModuleCompileOptions.kt | 7 jtreg7-7.5.2+1+ds2/junit5/gradle/plugins/common/src/main/kotlin/junitbuild/java/ModulePathArgumentProvider.kt | 40 jtreg7-7.5.2+1+ds2/junit5/gradle/plugins/common/src/main/kotlin/junitbuild/java/PatchModuleArgumentProvider.kt | 50 jtreg7-7.5.2+1+ds2/junit5/gradle/plugins/common/src/main/kotlin/junitbuild/java/UpdateJarAction.kt | 46 jtreg7-7.5.2+1+ds2/junit5/gradle/plugins/common/src/main/kotlin/junitbuild/java/WriteArtifactsFile.kt | 36 jtreg7-7.5.2+1+ds2/junit5/gradle/plugins/common/src/main/kotlin/junitbuild/javadoc/ModuleSpecificJavadocFileOption.kt | 26 jtreg7-7.5.2+1+ds2/junit5/gradle/plugins/settings.gradle.kts | 17 jtreg7-7.5.2+1+ds2/junit5/gradle/scripts/checkBuildReproducibility.sh | 29 jtreg7-7.5.2+1+ds2/junit5/junit-bom/README.md | 8 jtreg7-7.5.2+1+ds2/junit5/junit-bom/junit-bom.gradle.kts | 42 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/junit-jupiter-api.gradle.kts | 34 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AfterAll.java | 98 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AfterEach.java | 92 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertAll.java | 86 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertArrayEquals.java | 449 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertDoesNotThrow.java | 91 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertEquals.java | 199 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertFalse.java | 66 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertInstanceOf.java | 54 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertIterableEquals.java | 212 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertLinesMatch.java | 239 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertNotEquals.java | 280 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertNotNull.java | 51 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertNotSame.java | 52 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertNull.java | 53 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertSame.java | 53 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertThrows.java | 76 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertThrowsExactly.java | 77 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertTimeout.java | 86 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertTimeoutPreemptively.java | 156 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertTrue.java | 66 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertionFailureBuilder.java | 205 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertionUtils.java | 117 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Assertions.java | 3667 + jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Assumptions.java | 319 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AutoClose.java | 94 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/BeforeAll.java | 98 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/BeforeEach.java | 92 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/ClassDescriptor.java | 87 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/ClassOrderer.java | 242 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/ClassOrdererContext.java | 56 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Disabled.java | 72 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/DisplayName.java | 51 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/DisplayNameGeneration.java | 57 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/DisplayNameGenerator.java | 383 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/DynamicContainer.java | 109 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/DynamicNode.java | 71 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/DynamicTest.java | 305 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/IndicativeSentencesGeneration.java | 71 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/MethodDescriptor.java | 90 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/MethodOrderer.java | 307 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/MethodOrdererContext.java | 63 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Named.java | 94 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/NamedExecutable.java | 48 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Nested.java | 54 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Order.java | 72 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/RandomOrdererUtils.java | 53 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/RepeatedTest.java | 197 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/RepetitionInfo.java | 74 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Tag.java | 75 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Tags.java | 47 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Test.java | 84 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/TestClassOrder.java | 85 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/TestFactory.java | 86 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/TestInfo.java | 110 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/TestInstance.java | 131 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/TestMethodOrder.java | 95 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/TestReporter.java | 80 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/TestTemplate.java | 91 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Timeout.java | 388 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/AbstractOsBasedExecutionCondition.java | 70 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/AbstractRepeatableAnnotationCondition.java | 72 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/BooleanExecutionCondition.java | 54 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledForJreRange.java | 120 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledForJreRangeCondition.java | 45 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledIf.java | 105 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledIfCondition.java | 31 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledIfEnvironmentVariable.java | 116 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledIfEnvironmentVariableCondition.java | 75 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledIfEnvironmentVariables.java | 51 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledIfSystemProperties.java | 51 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledIfSystemProperty.java | 116 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledIfSystemPropertyCondition.java | 64 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledInNativeImage.java | 83 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledOnJre.java | 104 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledOnJreCondition.java | 40 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledOnOs.java | 120 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledOnOsCondition.java | 61 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledForJreRange.java | 120 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledForJreRangeCondition.java | 45 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledIf.java | 105 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledIfCondition.java | 32 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledIfEnvironmentVariable.java | 115 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledIfEnvironmentVariableCondition.java | 74 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledIfEnvironmentVariables.java | 51 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledIfSystemProperties.java | 51 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledIfSystemProperty.java | 115 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledIfSystemPropertyCondition.java | 63 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledInNativeImage.java | 83 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledOnJre.java | 103 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledOnJreCondition.java | 43 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledOnOs.java | 120 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledOnOsCondition.java | 61 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/MethodBasedCondition.java | 114 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/OS.java | 156 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/package-info.java | 5 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/AfterAllCallback.java | 70 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/AfterEachCallback.java | 73 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/AfterTestExecutionCallback.java | 75 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/AnnotatedElementContext.java | 116 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/BeforeAllCallback.java | 70 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/BeforeEachCallback.java | 73 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/BeforeTestExecutionCallback.java | 75 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ConditionEvaluationResult.java | 102 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/DynamicTestInvocationContext.java | 36 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ExecutableInvoker.java | 72 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ExecutionCondition.java | 73 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ExtendWith.java | 105 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/Extension.java | 41 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ExtensionConfigurationException.java | 37 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ExtensionContext.java | 712 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ExtensionContextException.java | 41 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/Extensions.java | 48 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/InvocationInterceptor.java | 248 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/LifecycleMethodExecutionExceptionHandler.java | 123 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ParameterContext.java | 133 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ParameterResolutionException.java | 38 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ParameterResolver.java | 93 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ReflectiveInvocationContext.java | 74 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/RegisterExtension.java | 146 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestExecutionExceptionHandler.java | 65 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestInstanceFactory.java | 76 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestInstanceFactoryContext.java | 50 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestInstancePostProcessor.java | 59 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestInstancePreConstructCallback.java | 58 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestInstancePreDestroyCallback.java | 121 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestInstances.java | 69 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestInstantiationException.java | 37 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestTemplateInvocationContext.java | 69 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestTemplateInvocationContextProvider.java | 89 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestWatcher.java | 123 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/package-info.java | 5 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/support/TypeBasedParameterResolver.java | 81 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/support/package-info.java | 5 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/function/Executable.java | 49 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/function/ThrowingConsumer.java | 53 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/function/ThrowingSupplier.java | 54 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/function/package-info.java | 5 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/io/CleanupMode.java | 53 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/io/TempDir.java | 191 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/io/TempDirFactory.java | 100 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/io/package-info.java | 5 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/package-info.java | 5 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel/Execution.java | 119 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel/ExecutionMode.java | 41 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel/Isolated.java | 51 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel/ResourceAccessMode.java | 36 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel/ResourceLock.java | 80 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel/ResourceLocks.java | 48 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel/Resources.java | 84 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel/package-info.java | 5 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/main/kotlin/org/junit/jupiter/api/Assertions.kt | 360 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/module/org.junit.jupiter.api/module-info.java | 28 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/templates/resources/main/org/junit/jupiter/api/condition/JRE.java.jte | 134 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/templates/resources/testFixtures/org/junit/jupiter/api/condition/JavaVersionPredicates.java.jte | 22 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/test/README.md | 1 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/testFixtures/java/org/junit/jupiter/api/extension/DisabledOnOpenJ9.java | 24 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/testFixtures/java/org/junit/jupiter/api/extension/ExtensionContextParameterResolver.java | 26 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-api/src/testFixtures/java/org/junit/jupiter/api/fixtures/TrackLogRecords.java | 83 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/junit-jupiter-engine.gradle.kts | 34 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/Constants.java | 376 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/JupiterTestEngine.java | 102 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/CachingJupiterConfiguration.java | 128 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/DefaultJupiterConfiguration.java | 144 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/EnumConfigurationParameterConverter.java | 73 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/InstantiatingConfigurationParameterConverter.java | 74 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/JupiterConfiguration.java | 73 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/package-info.java | 5 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/AbstractExtensionContext.java | 166 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/ClassBasedTestDescriptor.java | 525 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/ClassExtensionContext.java | 108 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/ClassTestDescriptor.java | 82 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DefaultDynamicTestInvocationContext.java | 34 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DefaultTestInstanceFactoryContext.java | 53 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DisplayNameUtils.java | 144 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DynamicContainerTestDescriptor.java | 77 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DynamicDescendantFilter.java | 94 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DynamicExtensionContext.java | 74 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DynamicNodeTestDescriptor.java | 63 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DynamicTestTestDescriptor.java | 81 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/ExtensionUtils.java | 247 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/Filterable.java | 30 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/JupiterEngineDescriptor.java | 71 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/JupiterEngineExtensionContext.java | 78 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/JupiterTestDescriptor.java | 240 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/LifecycleMethodUtils.java | 105 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/MethodBasedTestDescriptor.java | 151 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/MethodExtensionContext.java | 89 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/MethodSourceSupport.java | 67 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/NestedClassTestDescriptor.java | 90 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/TestFactoryTestDescriptor.java | 210 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/TestInstanceLifecycleUtils.java | 46 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/TestMethodTestDescriptor.java | 323 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/TestTemplateExtensionContext.java | 81 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/TestTemplateInvocationTestDescriptor.java | 79 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/TestTemplateTestDescriptor.java | 154 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/package-info.java | 5 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/AbstractAnnotatedDescriptorWrapper.java | 65 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/AbstractOrderingVisitor.java | 189 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/ClassOrderingVisitor.java | 87 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/ClassSelectorResolver.java | 162 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/DefaultClassDescriptor.java | 39 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/DefaultClassOrdererContext.java | 45 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/DefaultMethodDescriptor.java | 41 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/DefaultMethodOrdererContext.java | 60 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/DiscoverySelectorResolver.java | 51 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/MethodFinder.java | 40 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/MethodOrderingVisitor.java | 84 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/MethodSelectorResolver.java | 251 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/package-info.java | 6 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/predicates/IsInnerClass.java | 42 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/predicates/IsNestedTestClass.java | 40 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/predicates/IsPotentialTestContainer.java | 49 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/predicates/IsTestClassWithTests.java | 57 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/predicates/IsTestFactoryMethod.java | 33 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/predicates/IsTestMethod.java | 30 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/predicates/IsTestTemplateMethod.java | 30 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/predicates/IsTestableMethod.java | 55 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/predicates/package-info.java | 5 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/AfterEachMethodAdapter.java | 33 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/BeforeEachMethodAdapter.java | 33 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/ConditionEvaluationException.java | 31 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/ConditionEvaluator.java | 84 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/ConstructorInvocation.java | 59 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/DefaultExecutableInvoker.java | 54 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/DefaultParameterContext.java | 80 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/DefaultTestInstances.java | 72 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/InterceptingExecutableInvoker.java | 116 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/InvocationInterceptorChain.java | 160 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/JupiterEngineExecutionContext.java | 190 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/MethodInvocation.java | 63 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/NamespaceAwareStore.java | 97 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/ParameterResolutionUtils.java | 194 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/TestInstancesProvider.java | 37 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/package-info.java | 5 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/AutoCloseExtension.java | 112 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/DefaultRepetitionInfo.java | 68 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/DisabledCondition.java | 53 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/ExtensionRegistrar.java | 105 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/ExtensionRegistry.java | 53 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/MutableExtensionRegistry.java | 301 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/RepeatedTestDisplayNameFormatter.java | 41 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/RepeatedTestExtension.java | 84 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/RepeatedTestInvocationContext.java | 47 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/RepetitionExtension.java | 72 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/SameThreadTimeoutInvocation.java | 84 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/SeparateThreadTimeoutInvocation.java | 45 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/TempDirectory.java | 515 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/TestInfoParameterResolver.java | 93 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/TestReporterParameterResolver.java | 35 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/TimeoutConfiguration.java | 146 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/TimeoutDuration.java | 98 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/TimeoutDurationParser.java | 66 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/TimeoutExceptionFactory.java | 39 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/TimeoutExtension.java | 232 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/TimeoutInvocationFactory.java | 114 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/package-info.java | 5 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/package-info.java | 5 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/support/JupiterThrowableCollectorFactory.java | 37 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/support/OpenTest4JAndJUnit4AwareThrowableCollector.java | 70 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/support/package-info.java | 5 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/main/resources/META-INF/services/org.junit.platform.engine.TestEngine | 1 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/module/org.junit.jupiter.engine/module-info.java | 35 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/test/README.md | 1 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-engine/src/testFixtures/java/org/junit/jupiter/engine/discovery/JupiterUniqueIdBuilder.java | 66 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-migrationsupport/README.md | 19 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-migrationsupport/junit-jupiter-migrationsupport.gradle.kts | 32 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/EnableJUnit4MigrationSupport.java | 57 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/conditions/IgnoreCondition.java | 62 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/conditions/package-info.java | 7 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/package-info.java | 5 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/EnableRuleMigrationSupport.java | 47 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/ExpectedExceptionSupport.java | 70 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/ExternalResourceSupport.java | 59 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/TestRuleSupport.java | 168 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/VerifierSupport.java | 53 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/adapter/AbstractTestRuleAdapter.java | 52 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/adapter/ExpectedExceptionAdapter.java | 41 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/adapter/ExternalResourceAdapter.java | 39 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/adapter/GenericBeforeAndAfterAdvice.java | 32 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/adapter/VerifierAdapter.java | 34 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/adapter/package-info.java | 5 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/member/AbstractTestRuleAnnotatedMember.java | 31 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/member/TestRuleAnnotatedField.java | 41 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/member/TestRuleAnnotatedMember.java | 26 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/member/TestRuleAnnotatedMethod.java | 31 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/member/package-info.java | 5 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/package-info.java | 5 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-migrationsupport/src/module/org.junit.jupiter.migrationsupport/module-info.java | 27 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-migrationsupport/src/test/README.md | 1 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/LICENSE-univocity-parsers.md | 168 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/junit-jupiter-params.gradle.kts | 51 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/jmh/java/org/junit/jupiter/params/ParameterizedTestNameFormatterBenchmarks.java | 62 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTest.java | 294 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTestExtension.java | 151 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTestInvocationContext.java | 62 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTestMethodContext.java | 276 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTestNameFormatter.java | 292 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTestParameterResolver.java | 126 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/aggregator/AggregateWith.java | 48 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/aggregator/ArgumentAccessException.java | 39 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/aggregator/ArgumentsAccessor.java | 195 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/aggregator/ArgumentsAggregationException.java | 39 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/aggregator/ArgumentsAggregator.java | 65 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/aggregator/DefaultArgumentsAccessor.java | 142 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/aggregator/package-info.java | 7 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/AnnotationBasedArgumentConverter.java | 68 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/ArgumentConversionException.java | 39 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/ArgumentConverter.java | 65 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/ConvertWith.java | 46 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/DefaultArgumentConverter.java | 93 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/JavaTimeArgumentConverter.java | 66 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/JavaTimeConversionPattern.java | 48 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/SimpleArgumentConverter.java | 53 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/TypedArgumentConverter.java | 80 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/package-info.java | 7 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/package-info.java | 5 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/AnnotationBasedArgumentsProvider.java | 67 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/Arguments.java | 173 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/ArgumentsProvider.java | 48 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/ArgumentsSource.java | 48 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/ArgumentsSources.java | 46 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/ArgumentsUtils.java | 53 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvArgumentsProvider.java | 157 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvFileArgumentsProvider.java | 210 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvFileSource.java | 230 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvFileSources.java | 46 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvParserFactory.java | 90 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvParsingException.java | 38 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvSource.java | 285 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvSources.java | 46 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/EmptyArgumentsProvider.java | 104 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/EmptySource.java | 59 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/EnumArgumentsProvider.java | 65 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/EnumSource.java | 186 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/EnumSources.java | 46 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/FieldArgumentsProvider.java | 159 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/FieldSource.java | 140 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/FieldSources.java | 46 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/MethodArgumentsProvider.java | 185 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/MethodSource.java | 140 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/MethodSources.java | 46 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/NullAndEmptySource.java | 44 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/NullArgumentsProvider.java | 39 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/NullEnum.java | 26 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/NullSource.java | 44 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/ValueArgumentsProvider.java | 63 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/ValueSource.java | 112 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/ValueSources.java | 46 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/package-info.java | 8 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/support/AnnotationConsumer.java | 34 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/support/AnnotationConsumerInitializer.java | 128 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/java/org/junit/jupiter/params/support/package-info.java | 9 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/main/kotlin/org/junit/jupiter/params/aggregator/ArgumentsAccessor.kt | 29 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/module/org.junit.jupiter.params/module-info.java | 30 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter-params/src/test/README.md | 1 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter/junit-jupiter.gradle.kts | 16 jtreg7-7.5.2+1+ds2/junit5/junit-jupiter/src/module/org.junit.jupiter/module-info.java | 20 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/junit-platform-commons.gradle.kts | 39 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/JUnitException.java | 36 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/PreconditionViolationException.java | 36 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/annotation/Testable.java | 81 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/annotation/package-info.java | 5 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/function/Try.java | 374 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/function/package-info.java | 5 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/logging/LogRecordListener.java | 149 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/logging/Logger.java | 118 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/logging/LoggerFactory.java | 187 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/logging/package-info.java | 11 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/package-info.java | 11 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/support/AnnotationSupport.java | 517 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/support/ClassSupport.java | 74 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/support/HierarchyTraversalMode.java | 38 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/support/ModifierSupport.java | 241 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/support/ReflectionSupport.java | 655 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/support/Resource.java | 61 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/support/SearchOption.java | 43 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/support/conversion/ConversionException.java | 37 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/support/conversion/ConversionSupport.java | 144 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/support/conversion/FallbackStringToObjectConverter.java | 173 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/support/conversion/StringToBooleanConverter.java | 30 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/support/conversion/StringToCharacterConverter.java | 28 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/support/conversion/StringToClassConverter.java | 36 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/support/conversion/StringToCommonJavaTypesConverter.java | 70 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/support/conversion/StringToEnumConverter.java | 26 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/support/conversion/StringToJavaTimeConverter.java | 65 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/support/conversion/StringToNumberConverter.java | 50 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/support/conversion/StringToObjectConverter.java | 52 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/support/conversion/package-info.java | 5 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/support/package-info.java | 11 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/util/AnnotationUtils.java | 506 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/util/BlacklistedExceptions.java | 60 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ClassFilter.java | 78 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ClassLoaderUtils.java | 107 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ClassNamePatternFilterUtils.java | 106 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ClassUtils.java | 95 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ClasspathFileVisitor.java | 65 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ClasspathFilters.java | 45 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ClasspathResource.java | 55 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ClasspathScanner.java | 349 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/util/CloseablePath.java | 138 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/util/CollectionUtils.java | 248 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ExceptionUtils.java | 177 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/util/FunctionUtils.java | 52 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/util/LruCache.java | 56 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ModuleUtils.java | 121 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/util/PackageNameUtils.java | 38 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/util/PackageUtils.java | 120 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/util/PreconditionViolationException.java | 39 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/util/Preconditions.java | 317 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ReflectionUtils.java | 2033 + jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/util/RuntimeUtils.java | 74 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/util/StringUtils.java | 364 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ToStringBuilder.java | 68 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/util/UnrecoverableExceptions.java | 56 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java/org/junit/platform/commons/util/package-info.java | 11 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java9/org/junit/platform/commons/util/ModuleUtils.java | 310 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/main/java9/org/junit/platform/commons/util/PackageNameUtils.java | 30 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/module/org.junit.platform.commons/module-info.java | 55 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/test/README.md | 1 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/testFixtures/java/org/junit/platform/commons/test/ConcurrencyTestingUtils.java | 69 jtreg7-7.5.2+1+ds2/junit5/junit-platform-commons/src/testFixtures/java/org/junit/platform/commons/test/TestClassLoader.java | 100 jtreg7-7.5.2+1+ds2/junit5/junit-platform-console-standalone/junit-platform-console-standalone.gradle.kts | 94 jtreg7-7.5.2+1+ds2/junit5/junit-platform-console/LICENSE-picocli.md | 194 jtreg7-7.5.2+1+ds2/junit5/junit-platform-console/junit-platform-console.gradle.kts | 77 jtreg7-7.5.2+1+ds2/junit5/junit-platform-console/src/main/java/org/junit/platform/console/ConsoleLauncher.java | 46 jtreg7-7.5.2+1+ds2/junit5/junit-platform-console/src/main/java/org/junit/platform/console/options/AnsiColorOptionMixin.java | 46 jtreg7-7.5.2+1+ds2/junit5/junit-platform-console/src/main/java/org/junit/platform/console/options/BannerOptionMixin.java | 27 jtreg7-7.5.2+1+ds2/junit5/junit-platform-console/src/main/java/org/junit/platform/console/options/BaseCommand.java | 109 jtreg7-7.5.2+1+ds2/junit5/junit-platform-console/src/main/java/org/junit/platform/console/options/ClasspathEntriesConverter.java | 27 jtreg7-7.5.2+1+ds2/junit5/junit-platform-console/src/main/java/org/junit/platform/console/options/CommandFacade.java | 56 jtreg7-7.5.2+1+ds2/junit5/junit-platform-console/src/main/java/org/junit/platform/console/options/CommandResult.java | 62 jtreg7-7.5.2+1+ds2/junit5/junit-platform-console/src/main/java/org/junit/platform/console/options/ConsoleUtils.java | 40 jtreg7-7.5.2+1+ds2/junit5/junit-platform-console/src/main/java/org/junit/platform/console/options/Details.java | 64 jtreg7-7.5.2+1+ds2/junit5/junit-platform-console/src/main/java/org/junit/platform/console/options/DiscoverTestsCommand.java | 46 jtreg7-7.5.2+1+ds2/junit5/junit-platform-console/src/main/java/org/junit/platform/console/options/ExecuteTestsCommand.java | 109 jtreg7-7.5.2+1+ds2/junit5/junit-platform-console/src/main/java/org/junit/platform/console/options/ListTestEnginesCommand.java | 51 jtreg7-7.5.2+1+ds2/junit5/junit-platform-console/src/main/java/org/junit/platform/console/options/MainCommand.java | 159 jtreg7-7.5.2+1+ds2/junit5/junit-platform-console/src/main/java/org/junit/platform/console/options/ManifestVersionProvider.java | 35 jtreg7-7.5.2+1+ds2/junit5/junit-platform-console/src/main/java/org/junit/platform/console/options/OutputStreamConfig.java | 34 jtreg7-7.5.2+1+ds2/junit5/junit-platform-console/src/main/java/org/junit/platform/console/options/SelectorConverter.java | 115 jtreg7-7.5.2+1+ds2/junit5/junit-platform-console/src/main/java/org/junit/platform/console/options/TestConsoleOutputOptions.java | 76 jtreg7-7.5.2+1+ds2/junit5/junit-platform-console/src/main/java/org/junit/platform/console/options/TestConsoleOutputOptionsMixin.java | 73 jtreg7-7.5.2+1+ds2/junit5/junit-platform-console/src/main/java/org/junit/platform/console/options/TestDiscoveryOptions.java | 286 jtreg7-7.5.2+1+ds2/junit5/junit-platform-console/src/main/java/org/junit/platform/console/options/TestDiscoveryOptionsMixin.java | 327 jtreg7-7.5.2+1+ds2/junit5/junit-platform-console/src/main/java/org/junit/platform/console/options/Theme.java | 140 jtreg7-7.5.2+1+ds2/junit5/junit-platform-console/src/main/java/org/junit/platform/console/options/package-info.java | 5 jtreg7-7.5.2+1+ds2/junit5/junit-platform-console/src/main/java/org/junit/platform/console/package-info.java | 5 jtreg7-7.5.2+1+ds2/junit5/junit-platform-console/src/main/java/org/junit/platform/console/tasks/ColorPalette.java | 128 jtreg7-7.5.2+1+ds2/junit5/junit-platform-console/src/main/java/org/junit/platform/console/tasks/ConsoleTestExecutor.java | 192 jtreg7-7.5.2+1+ds2/junit5/junit-platform-console/src/main/java/org/junit/platform/console/tasks/CustomContextClassLoaderExecutor.java | 61 jtreg7-7.5.2+1+ds2/junit5/junit-platform-console/src/main/java/org/junit/platform/console/tasks/DetailsPrintingListener.java | 27 jtreg7-7.5.2+1+ds2/junit5/junit-platform-console/src/main/java/org/junit/platform/console/tasks/DiscoveryRequestCreator.java | 148 jtreg7-7.5.2+1+ds2/junit5/junit-platform-console/src/main/java/org/junit/platform/console/tasks/FlatPrintingListener.java | 115 jtreg7-7.5.2+1+ds2/junit5/junit-platform-console/src/main/java/org/junit/platform/console/tasks/Style.java | 40 jtreg7-7.5.2+1+ds2/junit5/junit-platform-console/src/main/java/org/junit/platform/console/tasks/TestFeedPrintingListener.java | 130 jtreg7-7.5.2+1+ds2/junit5/junit-platform-console/src/main/java/org/junit/platform/console/tasks/TreeNode.java | 92 jtreg7-7.5.2+1+ds2/junit5/junit-platform-console/src/main/java/org/junit/platform/console/tasks/TreePrinter.java | 175 jtreg7-7.5.2+1+ds2/junit5/junit-platform-console/src/main/java/org/junit/platform/console/tasks/TreePrintingListener.java | 87 jtreg7-7.5.2+1+ds2/junit5/junit-platform-console/src/main/java/org/junit/platform/console/tasks/VerboseTreePrintingListener.java | 225 jtreg7-7.5.2+1+ds2/junit5/junit-platform-console/src/main/java/org/junit/platform/console/tasks/package-info.java | 5 jtreg7-7.5.2+1+ds2/junit5/junit-platform-console/src/main/java17/org/junit/platform/console/options/ConsoleUtils.java | 42 jtreg7-7.5.2+1+ds2/junit5/junit-platform-console/src/main/java9/org/junit/platform/console/ConsoleLauncherToolProvider.java | 37 jtreg7-7.5.2+1+ds2/junit5/junit-platform-console/src/main/resources/META-INF/services/java.util.spi.ToolProvider | 1 jtreg7-7.5.2+1+ds2/junit5/junit-platform-console/src/module/org.junit.platform.console/module-info.java | 25 jtreg7-7.5.2+1+ds2/junit5/junit-platform-console/src/test/README.md | 1 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/junit-platform-engine.gradle.kts | 19 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/CompositeFilter.java | 90 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/ConfigurationParameters.java | 152 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/DiscoveryFilter.java | 30 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/DiscoverySelector.java | 49 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/DiscoverySelectorIdentifier.java | 114 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/EngineDiscoveryListener.java | 56 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/EngineDiscoveryRequest.java | 87 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/EngineExecutionListener.java | 140 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/ExecutionRequest.java | 92 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/Filter.java | 115 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/FilterResult.java | 113 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/SelectorResolutionResult.java | 125 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/TestDescriptor.java | 332 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/TestEngine.java | 192 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/TestExecutionResult.java | 133 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/TestSource.java | 34 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/TestTag.java | 153 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/UniqueId.java | 362 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/UniqueIdFormat.java | 161 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/AbstractClassNameFilter.java | 50 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ClassNameFilter.java | 77 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ClassSelector.java | 166 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ClasspathResourceSelector.java | 146 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ClasspathRootSelector.java | 121 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/DirectorySelector.java | 140 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/DiscoverySelectorIdentifierParser.java | 71 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/DiscoverySelectorIdentifierParsers.java | 85 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/DiscoverySelectors.java | 999 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ExcludeClassNameFilter.java | 62 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ExcludePackageNameFilter.java | 79 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/FilePosition.java | 191 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/FileSelector.java | 162 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/IncludeClassNameFilter.java | 63 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/IncludePackageNameFilter.java | 79 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/IterationSelector.java | 189 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/MethodSelector.java | 344 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ModuleSelector.java | 106 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/NestedClassSelector.java | 184 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/NestedMethodSelector.java | 288 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/PackageNameFilter.java | 103 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/PackageSelector.java | 106 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/UniqueIdSelector.java | 107 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/UriSelector.java | 110 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/package-info.java | 7 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/package-info.java | 5 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/reporting/ReportEntry.java | 109 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/reporting/package-info.java | 6 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/config/PrefixedConfigurationParameters.java | 79 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/config/package-info.java | 6 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/AbstractTestDescriptor.java | 187 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/ClassSource.java | 223 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/ClasspathResourceSource.java | 174 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/CompositeTestSource.java | 93 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/DefaultUriSource.java | 61 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/DirectorySource.java | 99 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/EngineDescriptor.java | 53 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/FilePosition.java | 178 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/FileSource.java | 130 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/FileSystemSource.java | 38 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/MethodSource.java | 254 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/PackageSource.java | 93 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/ResourceUtils.java | 48 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/UriSource.java | 78 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/package-info.java | 7 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/discovery/ClassContainerSelectorResolver.java | 63 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/discovery/EngineDiscoveryRequestResolution.java | 263 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/discovery/EngineDiscoveryRequestResolver.java | 293 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/discovery/SelectorResolver.java | 677 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/discovery/package-info.java | 9 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/filter/ClasspathScanningSupport.java | 71 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/filter/package-info.java | 6 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/CompositeLock.java | 113 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/DefaultParallelExecutionConfiguration.java | 67 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/DefaultParallelExecutionConfigurationStrategy.java | 224 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/EngineExecutionContext.java | 26 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/ExclusiveResource.java | 145 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/ForkJoinPoolHierarchicalTestExecutorService.java | 339 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/HierarchicalTestEngine.java | 115 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/HierarchicalTestExecutor.java | 60 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/HierarchicalTestExecutorService.java | 104 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/LockManager.java | 103 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/Node.java | 362 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/NodeExecutionAdvisor.java | 55 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/NodeTestTask.java | 270 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/NodeTestTaskContext.java | 55 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/NodeTreeWalker.java | 122 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/NodeUtils.java | 33 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/NopLock.java | 55 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/OpenTest4JAwareThrowableCollector.java | 32 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/ParallelExecutionConfiguration.java | 76 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/ParallelExecutionConfigurationStrategy.java | 33 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/ResourceLock.java | 95 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/SameThreadHierarchicalTestExecutorService.java | 49 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/SingleLock.java | 87 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/SingleTestExecutor.java | 83 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/ThrowableCollector.java | 217 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/package-info.java | 8 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/store/NamespacedHierarchicalStore.java | 461 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/store/NamespacedHierarchicalStoreException.java | 36 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/java/org/junit/platform/engine/support/store/package-info.java | 5 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/main/resources/META-INF/services/org.junit.platform.engine.discovery.DiscoverySelectorIdentifierParser | 13 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/module/org.junit.platform.engine/module-info.java | 52 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/test/README.md | 1 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/testFixtures/java/org/junit/platform/engine/support/hierarchical/DemoEngineExecutionContext.java | 26 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/testFixtures/java/org/junit/platform/engine/support/hierarchical/DemoHierarchicalContainerDescriptor.java | 56 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/testFixtures/java/org/junit/platform/engine/support/hierarchical/DemoHierarchicalEngineDescriptor.java | 53 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/testFixtures/java/org/junit/platform/engine/support/hierarchical/DemoHierarchicalTestDescriptor.java | 67 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/testFixtures/java/org/junit/platform/engine/support/hierarchical/DemoHierarchicalTestEngine.java | 98 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/testFixtures/java/org/junit/platform/fakes/TestDescriptorStub.java | 30 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/testFixtures/java/org/junit/platform/fakes/TestEngineSpy.java | 55 jtreg7-7.5.2+1+ds2/junit5/junit-platform-engine/src/testFixtures/java/org/junit/platform/fakes/TestEngineStub.java | 48 jtreg7-7.5.2+1+ds2/junit5/junit-platform-jfr/junit-platform-jfr.gradle.kts | 37 jtreg7-7.5.2+1+ds2/junit5/junit-platform-jfr/src/main/java/org/junit/platform/jfr/FlightRecordingDiscoveryListener.java | 103 jtreg7-7.5.2+1+ds2/junit5/junit-platform-jfr/src/main/java/org/junit/platform/jfr/FlightRecordingExecutionListener.java | 162 jtreg7-7.5.2+1+ds2/junit5/junit-platform-jfr/src/main/java/org/junit/platform/jfr/UniqueId.java | 28 jtreg7-7.5.2+1+ds2/junit5/junit-platform-jfr/src/main/java/org/junit/platform/jfr/package-info.java | 5 jtreg7-7.5.2+1+ds2/junit5/junit-platform-jfr/src/main/resources/META-INF/services/org.junit.platform.launcher.LauncherDiscoveryListener | 1 jtreg7-7.5.2+1+ds2/junit5/junit-platform-jfr/src/main/resources/META-INF/services/org.junit.platform.launcher.TestExecutionListener | 1 jtreg7-7.5.2+1+ds2/junit5/junit-platform-jfr/src/module/org.junit.platform.jfr/module-info.java | 32 jtreg7-7.5.2+1+ds2/junit5/junit-platform-jfr/src/test/README.md | 1 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/junit-platform-launcher.gradle.kts | 29 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/EngineDiscoveryResult.java | 110 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/EngineFilter.java | 172 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/Launcher.java | 130 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherConstants.java | 198 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherDiscoveryListener.java | 91 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherDiscoveryRequest.java | 99 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherInterceptor.java | 85 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherSession.java | 50 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherSessionListener.java | 67 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/PostDiscoveryFilter.java | 36 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TagFilter.java | 185 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestExecutionListener.java | 187 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestIdentifier.java | 349 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestPlan.java | 347 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/CompositeEngineExecutionListener.java | 84 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/CompositeTestExecutionListener.java | 120 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultDiscoveryRequest.java | 97 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultLauncher.java | 106 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultLauncherConfig.java | 112 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultLauncherSession.java | 137 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DelegatingEngineExecutionListener.java | 54 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DelegatingLauncher.java | 55 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineDiscoveryErrorDescriptor.java | 51 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineDiscoveryOrchestrator.java | 234 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineDiscoveryResultValidator.java | 108 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineExecutionOrchestrator.java | 207 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineFilterer.java | 94 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineIdValidator.java | 89 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ExecutionListenerAdapter.java | 68 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/InterceptingLauncher.java | 51 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/InternalTestPlan.java | 121 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/IterationOrder.java | 35 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherConfig.java | 364 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherConfigurationParameters.java | 312 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherDiscoveryRequestBuilder.java | 350 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherDiscoveryResult.java | 78 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherFactory.java | 212 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherListenerRegistry.java | 19 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ListenerRegistry.java | 95 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/OutcomeDelayingEngineExecutionListener.java | 90 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ServiceLoaderRegistry.java | 39 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ServiceLoaderTestEngineRegistry.java | 44 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/SessionPerRequestLauncher.java | 83 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/StackTracePruningEngineExecutionListener.java | 70 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/StreamInterceptingTestExecutionListener.java | 99 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/StreamInterceptor.java | 118 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/TestEngineFormatter.java | 49 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/package-info.java | 8 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/LegacyReportingUtils.java | 86 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/LoggingListener.java | 130 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/MutableTestExecutionSummary.java | 308 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/OutputDir.java | 110 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/SummaryGeneratingListener.java | 138 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/TestExecutionSummary.java | 184 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/UniqueIdTrackingListener.java | 208 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/discovery/AbortOnFailureLauncherDiscoveryListener.java | 65 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/discovery/CompositeLauncherDiscoveryListener.java | 62 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/discovery/LauncherDiscoveryListeners.java | 121 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/discovery/LoggingLauncherDiscoveryListener.java | 107 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/discovery/package-info.java | 9 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/package-info.java | 7 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/session/CompositeLauncherSessionListener.java | 43 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/session/LauncherSessionListeners.java | 45 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/session/package-info.java | 9 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/package-info.java | 7 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/DequeStack.java | 48 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/Operator.java | 138 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/Operators.java | 41 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/ParseResult.java | 61 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/ParseResults.java | 42 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/ParseStatus.java | 84 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/Parser.java | 34 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/ShuntingYard.java | 164 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/Stack.java | 28 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/TagExpression.java | 50 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/TagExpressions.java | 107 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/Token.java | 51 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/TokenWith.java | 26 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/Tokenizer.java | 41 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/package-info.java | 5 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/main/resources/META-INF/services/org.junit.platform.launcher.TestExecutionListener | 1 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/module/org.junit.platform.launcher/module-info.java | 44 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/test/README.md | 1 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/testFixtures/java/org/junit/platform/launcher/core/ConfigurationParametersFactoryForTests.java | 28 jtreg7-7.5.2+1+ds2/junit5/junit-platform-launcher/src/testFixtures/java/org/junit/platform/launcher/core/LauncherFactoryForTestingPurposesOnly.java | 36 jtreg7-7.5.2+1+ds2/junit5/junit-platform-reporting/LICENSE-open-test-reporting.md | 194 jtreg7-7.5.2+1+ds2/junit5/junit-platform-reporting/junit-platform-reporting.gradle.kts | 34 jtreg7-7.5.2+1+ds2/junit5/junit-platform-reporting/src/main/java/org/junit/platform/reporting/legacy/LegacyReportingUtils.java | 56 jtreg7-7.5.2+1+ds2/junit5/junit-platform-reporting/src/main/java/org/junit/platform/reporting/legacy/package-info.java | 5 jtreg7-7.5.2+1+ds2/junit5/junit-platform-reporting/src/main/java/org/junit/platform/reporting/legacy/xml/LegacyXmlReportGeneratingListener.java | 133 jtreg7-7.5.2+1+ds2/junit5/junit-platform-reporting/src/main/java/org/junit/platform/reporting/legacy/xml/XmlReportData.java | 143 jtreg7-7.5.2+1+ds2/junit5/junit-platform-reporting/src/main/java/org/junit/platform/reporting/legacy/xml/XmlReportWriter.java | 569 jtreg7-7.5.2+1+ds2/junit5/junit-platform-reporting/src/main/java/org/junit/platform/reporting/legacy/xml/package-info.java | 7 jtreg7-7.5.2+1+ds2/junit5/junit-platform-reporting/src/main/java/org/junit/platform/reporting/open/xml/JUnitFactory.java | 35 jtreg7-7.5.2+1+ds2/junit5/junit-platform-reporting/src/main/java/org/junit/platform/reporting/open/xml/LegacyReportingName.java | 26 jtreg7-7.5.2+1+ds2/junit5/junit-platform-reporting/src/main/java/org/junit/platform/reporting/open/xml/OpenTestReportGeneratingListener.java | 265 jtreg7-7.5.2+1+ds2/junit5/junit-platform-reporting/src/main/java/org/junit/platform/reporting/open/xml/Type.java | 27 jtreg7-7.5.2+1+ds2/junit5/junit-platform-reporting/src/main/java/org/junit/platform/reporting/open/xml/UniqueId.java | 26 jtreg7-7.5.2+1+ds2/junit5/junit-platform-reporting/src/main/java/org/junit/platform/reporting/open/xml/package-info.java | 5 jtreg7-7.5.2+1+ds2/junit5/junit-platform-reporting/src/main/java/org/junit/platform/reporting/package-info.java | 5 jtreg7-7.5.2+1+ds2/junit5/junit-platform-reporting/src/main/resources/META-INF/services/org.junit.platform.launcher.TestExecutionListener | 1 jtreg7-7.5.2+1+ds2/junit5/junit-platform-reporting/src/main/resources/org/junit/platform/reporting/open/xml/catalog.xml | 4 jtreg7-7.5.2+1+ds2/junit5/junit-platform-reporting/src/main/resources/org/junit/platform/reporting/open/xml/junit.xsd | 30 jtreg7-7.5.2+1+ds2/junit5/junit-platform-reporting/src/module/org.junit.platform.reporting/module-info.java | 30 jtreg7-7.5.2+1+ds2/junit5/junit-platform-reporting/src/test/README.md | 1 jtreg7-7.5.2+1+ds2/junit5/junit-platform-runner/junit-platform-runner.gradle.kts | 37 jtreg7-7.5.2+1+ds2/junit5/junit-platform-runner/src/main/java/org/junit/platform/runner/JUnitPlatform.java | 205 jtreg7-7.5.2+1+ds2/junit5/junit-platform-runner/src/main/java/org/junit/platform/runner/JUnitPlatformRunnerListener.java | 96 jtreg7-7.5.2+1+ds2/junit5/junit-platform-runner/src/main/java/org/junit/platform/runner/JUnitPlatformTestTree.java | 167 jtreg7-7.5.2+1+ds2/junit5/junit-platform-runner/src/main/java/org/junit/platform/runner/package-info.java | 6 jtreg7-7.5.2+1+ds2/junit5/junit-platform-runner/src/module/org.junit.platform.runner/module-info.java | 25 jtreg7-7.5.2+1+ds2/junit5/junit-platform-runner/src/test/README.md | 1 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-api/junit-platform-suite-api.gradle.kts | 15 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/AfterSuite.java | 75 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/BeforeSuite.java | 75 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/ConfigurationParameter.java | 57 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/ConfigurationParameters.java | 47 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/ConfigurationParametersResource.java | 51 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/ConfigurationParametersResources.java | 48 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/DisableParentConfigurationParameters.java | 47 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/ExcludeClassNamePatterns.java | 50 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/ExcludeEngines.java | 46 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/ExcludePackages.java | 45 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/ExcludeTags.java | 77 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/IncludeClassNamePatterns.java | 58 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/IncludeEngines.java | 46 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/IncludePackages.java | 45 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/IncludeTags.java | 77 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/Select.java | 49 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectClasses.java | 63 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectClasspathResource.java | 60 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectClasspathResources.java | 48 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectDirectories.java | 45 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectFile.java | 59 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectFiles.java | 47 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectMethod.java | 152 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectMethods.java | 47 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectModules.java | 46 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectPackages.java | 45 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectUris.java | 45 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/Selects.java | 47 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/Suite.java | 88 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SuiteDisplayName.java | 57 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/UseTechnicalNames.java | 56 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/package-info.java | 13 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-api/src/module/org.junit.platform.suite.api/module-info.java | 21 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-api/src/test/README.md | 1 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-commons/junit-platform-suite-commons.gradle.kts | 18 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-commons/src/main/java/org/junit/platform/suite/commons/AdditionalDiscoverySelectors.java | 125 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-commons/src/main/java/org/junit/platform/suite/commons/SuiteLauncherDiscoveryRequestBuilder.java | 534 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-commons/src/main/java/org/junit/platform/suite/commons/package-info.java | 11 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-commons/src/module/org.junit.platform.suite.commons/module-info.java | 26 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-commons/src/test/README.md | 1 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-engine/junit-platform-suite-engine.gradle.kts | 18 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-engine/src/main/java/org/junit/platform/suite/engine/ClassSelectorResolver.java | 128 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-engine/src/main/java/org/junit/platform/suite/engine/DiscoverySelectorResolver.java | 46 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-engine/src/main/java/org/junit/platform/suite/engine/IsPotentialTestContainer.java | 42 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-engine/src/main/java/org/junit/platform/suite/engine/IsSuiteClass.java | 34 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-engine/src/main/java/org/junit/platform/suite/engine/LifecycleMethodUtils.java | 90 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-engine/src/main/java/org/junit/platform/suite/engine/NoTestsDiscoveredException.java | 23 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-engine/src/main/java/org/junit/platform/suite/engine/SuiteEngineDescriptor.java | 32 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-engine/src/main/java/org/junit/platform/suite/engine/SuiteLauncher.java | 67 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-engine/src/main/java/org/junit/platform/suite/engine/SuiteTestDescriptor.java | 196 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-engine/src/main/java/org/junit/platform/suite/engine/SuiteTestEngine.java | 78 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-engine/src/main/java/org/junit/platform/suite/engine/package-info.java | 5 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-engine/src/main/resources/META-INF/services/org.junit.platform.engine.TestEngine | 1 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-engine/src/module/org.junit.platform.suite.engine/module-info.java | 28 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite-engine/src/test/README.md | 1 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite/junit-platform-suite.gradle.kts | 14 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite/src/module/org.junit.platform.suite/module-info.java | 19 jtreg7-7.5.2+1+ds2/junit5/junit-platform-suite/src/test/README.md | 1 jtreg7-7.5.2+1+ds2/junit5/junit-platform-testkit/LICENSE.md | 98 jtreg7-7.5.2+1+ds2/junit5/junit-platform-testkit/junit-platform-testkit.gradle.kts | 17 jtreg7-7.5.2+1+ds2/junit5/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/Assertions.java | 88 jtreg7-7.5.2+1+ds2/junit5/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/EngineExecutionResults.java | 106 jtreg7-7.5.2+1+ds2/junit5/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/EngineTestKit.java | 446 jtreg7-7.5.2+1+ds2/junit5/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/Event.java | 260 jtreg7-7.5.2+1+ds2/junit5/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/EventConditions.java | 473 jtreg7-7.5.2+1+ds2/junit5/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/EventStatistics.java | 142 jtreg7-7.5.2+1+ds2/junit5/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/EventType.java | 65 jtreg7-7.5.2+1+ds2/junit5/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/Events.java | 473 jtreg7-7.5.2+1+ds2/junit5/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/Execution.java | 156 jtreg7-7.5.2+1+ds2/junit5/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/ExecutionRecorder.java | 94 jtreg7-7.5.2+1+ds2/junit5/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/Executions.java | 302 jtreg7-7.5.2+1+ds2/junit5/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/TerminationInfo.java | 147 jtreg7-7.5.2+1+ds2/junit5/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/TestExecutionResultConditions.java | 204 jtreg7-7.5.2+1+ds2/junit5/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/package-info.java | 6 jtreg7-7.5.2+1+ds2/junit5/junit-platform-testkit/src/main/java/org/junit/platform/testkit/package-info.java | 5 jtreg7-7.5.2+1+ds2/junit5/junit-platform-testkit/src/module/org.junit.platform.testkit/module-info.java | 29 jtreg7-7.5.2+1+ds2/junit5/junit-platform-testkit/src/test/README.md | 1 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/junit-vintage-engine.gradle.kts | 90 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/main/java/org/junit/vintage/engine/JUnit4VersionCheck.java | 77 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/main/java/org/junit/vintage/engine/VintageTestEngine.java | 85 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/DescriptionUtils.java | 37 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/OrFilter.java | 42 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/RunnerDecorator.java | 23 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/RunnerRequest.java | 31 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/RunnerTestDescriptor.java | 191 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/TestSourceProvider.java | 91 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/VintageEngineDescriptor.java | 36 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/VintageTestDescriptor.java | 141 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/package-info.java | 5 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/ClassSelectorResolver.java | 81 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/DefensiveAllDefaultPossibilitiesBuilder.java | 155 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/FilterableIgnoringRunnerDecorator.java | 36 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/IgnoringRunnerDecorator.java | 49 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/IsPotentialJUnit4TestClass.java | 44 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/IsPotentialJUnit4TestMethod.java | 30 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/MethodSelectorResolver.java | 121 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/RunnerTestDescriptorPostProcessor.java | 76 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/UniqueIdFilter.java | 87 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/VintageDiscoverer.java | 51 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/package-info.java | 5 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/main/java/org/junit/vintage/engine/execution/EventType.java | 18 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/main/java/org/junit/vintage/engine/execution/RunListenerAdapter.java | 266 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/main/java/org/junit/vintage/engine/execution/RunnerExecutor.java | 58 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/main/java/org/junit/vintage/engine/execution/TestRun.java | 276 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/main/java/org/junit/vintage/engine/execution/package-info.java | 5 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/main/java/org/junit/vintage/engine/package-info.java | 5 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/main/java/org/junit/vintage/engine/support/UniqueIdReader.java | 56 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/main/java/org/junit/vintage/engine/support/UniqueIdStringifier.java | 62 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/main/java/org/junit/vintage/engine/support/package-info.java | 6 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/main/resources/META-INF/services/org.junit.platform.engine.TestEngine | 1 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/module/org.junit.vintage.engine/module-info.java | 26 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/test/java/org/junit/vintage/engine/JUnit4ParameterizedTests.java | 81 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/test/java/org/junit/vintage/engine/JUnit4VersionCheckTests.java | 87 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageLauncherIntegrationTests.java | 286 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageTestEngineBasicTests.java | 42 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageTestEngineDiscoveryTests.java | 803 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageTestEngineExecutionTests.java | 947 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageTestEngineTestSuite.java | 38 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageUniqueIdBuilder.java | 69 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/test/java/org/junit/vintage/engine/descriptor/DescriptionUtilsTests.java | 62 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/test/java/org/junit/vintage/engine/descriptor/OrFilterTests.java | 78 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/test/java/org/junit/vintage/engine/descriptor/TestSourceProviderTests.java | 38 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/test/java/org/junit/vintage/engine/descriptor/VintageTestDescriptorTests.java | 51 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/test/java/org/junit/vintage/engine/discovery/IsPotentialJUnit4TestClassTests.java | 61 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/test/java/org/junit/vintage/engine/discovery/RunnerTestDescriptorPostProcessorTests.java | 80 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/test/java/org/junit/vintage/engine/discovery/VintageDiscovererTests.java | 144 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/test/java/org/junit/vintage/engine/execution/TestRunTests.java | 62 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/test/java/org/junit/vintage/engine/support/UniqueIdReaderTests.java | 57 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/test/java/org/junit/vintage/engine/support/UniqueIdStringifierTests.java | 101 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/test/resources/log4j2-test.xml | 16 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/groovy/org/junit/vintage/engine/samples/spock/SpockTestCaseWithUnrolledAndRegularFeatureMethods.groovy | 20 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/PlainOldJavaClassWithoutAnyTestsTestCase.java | 22 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit3/AbstractJUnit3TestCase.java | 26 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit3/IgnoredJUnit3TestCase.java | 28 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit3/JUnit3ParallelSuiteWithSubsuites.java | 39 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit3/JUnit3SuiteWithSingleTestCaseWithSingleTestWhichFails.java | 27 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit3/JUnit3SuiteWithSubsuites.java | 38 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit3/JUnit4SuiteWithIgnoredJUnit3TestCase.java | 20 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit3/PlainJUnit3TestCaseWithSingleTestWhichFails.java | 26 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/AbstractJUnit4TestCase.java | 21 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/AbstractJunit4TestCaseWithConstructorParameter.java | 24 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/Categories.java | 32 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/CompletelyDynamicTestCase.java | 22 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/ConcreteJUnit4TestCase.java | 14 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/ConfigurableRunner.java | 69 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/DynamicRunner.java | 36 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/EmptyIgnoredTestCase.java | 17 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/EnclosedJUnit4TestCase.java | 42 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/EnclosedWithParameterizedChildrenJUnit4TestCase.java | 59 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/ExceptionThrowingRunner.java | 29 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/IgnoredJUnit4TestCase.java | 36 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/IgnoredJUnit4TestCaseWithNotFilterableRunner.java | 20 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/IgnoredParameterizedTestCase.java | 42 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4ParameterizedTestCase.java | 56 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteOfSuiteWithFilterableChildRunner.java | 23 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteOfSuiteWithIgnoredJUnit4TestCase.java | 23 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteOfSuiteWithJUnit4TestCaseWithAssumptionFailureInBeforeClass.java | 23 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteOfSuiteWithJUnit4TestCaseWithErrorInBeforeClass.java | 23 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteWithExceptionThrowingRunner.java | 22 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteWithIgnoredJUnit4TestCase.java | 23 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteWithJUnit3SuiteWithSingleTestCase.java | 24 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteWithJUnit4TestCaseWithAssumptionFailureInBeforeClass.java | 23 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteWithJUnit4TestCaseWithErrorInBeforeClass.java | 23 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteWithJUnit4TestCaseWithFailingDescriptionThatIsNotReportedAsFinished.java | 21 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteWithJUnit4TestCaseWithRunnerWithCustomUniqueIdsAndDisplayNames.java | 23 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteWithPlainJUnit4TestCaseWithSingleTestWhichIsIgnored.java | 23 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteWithTwoTestCases.java | 23 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithAssumptionFailureInBeforeClass.java | 34 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithDistinguishableOverloadedMethod.java | 35 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithErrorCollectorStoringMultipleFailures.java | 35 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithErrorInAfterClass.java | 41 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithErrorInBeforeClass.java | 33 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithExceptionThrowingRunner.java | 22 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithFailingDescriptionThatIsNotReportedAsFinished.java | 24 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithIndistinguishableOverloadedMethod.java | 39 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithNotFilterableRunner.java | 30 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithRunnerWithCustomUniqueIdsAndDisplayNames.java | 39 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithRunnerWithDuplicateChangingChildDescriptions.java | 55 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/MalformedJUnit4TestCase.java | 28 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/NotFilterableRunner.java | 22 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/ParameterizedTestCase.java | 42 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/ParameterizedTimingTestCase.java | 68 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/ParameterizedWithAfterParamFailureTestCase.java | 49 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/ParameterizedWithBeforeParamFailureTestCase.java | 49 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/PlainJUnit4TestCaseWithFiveTestMethods.java | 64 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/PlainJUnit4TestCaseWithLifecycleMethods.java | 68 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/PlainJUnit4TestCaseWithSingleInheritedTestWhichFails.java | 17 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/PlainJUnit4TestCaseWithSingleTestWhichFails.java | 27 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/PlainJUnit4TestCaseWithSingleTestWhichIsIgnored.java | 28 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/PlainJUnit4TestCaseWithTwoTestMethods.java | 38 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/RunnerThatOnlyReportsFailures.java | 34 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/RunnerWithCustomUniqueIdsAndDisplayNames.java | 80 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/SingleFailingTheoryTestCase.java | 29 jtreg7-7.5.2+1+ds2/junit5/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/TestCaseRunWithJUnitPlatformRunner.java | 24 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/jupiter-tests.gradle.kts | 38 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/templates/resources/test/org/junit/jupiter/api/condition/DisabledOnJreConditionTests.java.jte | 99 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/templates/resources/test/org/junit/jupiter/api/condition/DisabledOnJreIntegrationTests.java.jte | 66 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/templates/resources/test/org/junit/jupiter/api/condition/EnabledOnJreConditionTests.java.jte | 99 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/templates/resources/test/org/junit/jupiter/api/condition/EnabledOnJreIntegrationTests.java.jte | 64 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/groovy/org/junit/jupiter/api/GroovyAssertEqualsTests.groovy | 192 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/groovy/org/junit/jupiter/api/GroovyAssertNotEqualsTests.groovy | 196 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/groovy/org/junit/jupiter/api/PrimitiveAndWrapperTypeHelpers.groovy | 70 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/DefaultPackageTestCase.java | 28 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/example/B_TestCase.java | 37 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/JupiterTestSuite.java | 39 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/AssertAllAssertionsTests.java | 225 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/AssertArrayEqualsAssertionsTests.java | 1999 + jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/AssertDoesNotThrowAssertionsTests.java | 321 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/AssertEqualsAssertionsTests.java | 771 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/AssertFalseAssertionsTests.java | 111 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/AssertInstanceOfAssertionsTests.java | 109 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/AssertIterableEqualsAssertionsTests.java | 478 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/AssertLinesMatchAssertionsTests.java | 337 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/AssertNotEqualsAssertionsTests.java | 768 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/AssertNotNullAssertionsTests.java | 65 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/AssertNotSameAssertionsTests.java | 87 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/AssertNullAssertionsTests.java | 152 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/AssertSameAssertionsTests.java | 116 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/AssertThrowsAssertionsTests.java | 279 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/AssertThrowsExactlyAssertionsTests.java | 319 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/AssertTimeoutAssertionsTests.java | 163 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/AssertTimeoutPreemptivelyAssertionsTests.java | 253 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/AssertTrueAssertionsTests.java | 111 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/AssertionTestUtils.java | 100 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/AssumptionsTests.java | 245 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/DisplayNameGenerationInheritanceTestCase.java | 36 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/DisplayNameGenerationTests.java | 441 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/DynamicTestTests.java | 249 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/EnigmaThrowable.java | 22 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/FailAssertionsTests.java | 153 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/IndicativeSentencesGenerationInheritanceTestCase.java | 36 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/IndicativeSentencesNestedTestCase.java | 33 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/IndicativeSentencesTopLevelTestCase.java | 33 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/IterableFactory.java | 28 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/RandomlyOrderedTests.java | 93 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/condition/AbstractExecutionConditionTests.java | 113 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/condition/DisabledForJreRangeConditionTests.java | 130 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/condition/DisabledForJreRangeIntegrationTests.java | 87 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/condition/DisabledIfConditionClassLoaderTests.java | 66 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/condition/DisabledIfConditionTests.java | 112 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/condition/DisabledIfEnvironmentVariableConditionTests.java | 144 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/condition/DisabledIfEnvironmentVariableIntegrationTests.java | 93 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/condition/DisabledIfIntegrationTests.java | 97 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/condition/DisabledIfSystemPropertyConditionTests.java | 131 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/condition/DisabledIfSystemPropertyIntegrationTests.java | 107 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/condition/DisabledOnOsConditionTests.java | 267 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/condition/DisabledOnOsIntegrationTests.java | 175 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/condition/EnabledForJreRangeConditionTests.java | 129 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/condition/EnabledForJreRangeIntegrationTests.java | 91 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/condition/EnabledIfConditionClassLoaderTests.java | 66 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/condition/EnabledIfConditionTests.java | 112 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/condition/EnabledIfEnvironmentVariableConditionTests.java | 164 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/condition/EnabledIfEnvironmentVariableIntegrationTests.java | 101 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/condition/EnabledIfIntegrationTests.java | 97 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/condition/EnabledIfSystemPropertyConditionTests.java | 138 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/condition/EnabledIfSystemPropertyIntegrationTests.java | 113 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/condition/EnabledOnOsConditionTests.java | 267 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/condition/EnabledOnOsIntegrationTests.java | 207 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/condition/JRETests.java | 72 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/condition/StaticConditionMethods.java | 23 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/extension/CloseableResourceIntegrationTests.java | 87 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/extension/ExecutableInvokerIntegrationTests.java | 110 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/extension/ExtensionComposabilityTests.java | 156 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/extension/KitchenSinkExtension.java | 245 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/extension/support/TypeBasedParameterResolverTests.java | 159 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/subpackage/SubclassedAssertionsTests.java | 37 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/api/subpackage/SubclassedAssumptionsTests.java | 45 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/AbstractJupiterTestEngineTests.java | 73 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/AtypicalJvmMethodNameTests.java | 48 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/BeforeAllAndAfterAllComposedAnnotationTests.java | 71 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/BeforeEachAndAfterEachComposedAnnotationTests.java | 71 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/DefaultExecutionModeTests.java | 186 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/DefaultMethodTests.java | 230 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/DisabledTests.java | 76 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/DynamicNodeGenerationTests.java | 533 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/ExceptionHandlingTests.java | 359 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/FailedAssumptionsTests.java | 69 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/InvalidLifecycleMethodConfigurationTests.java | 131 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/JupiterTestEngineBasicTests.java | 51 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/LifecycleMethodOverridingTests.java | 198 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/MultipleTestableAnnotationsTests.java | 54 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/NestedTestClassesTests.java | 369 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/NestedWithInheritanceTests.java | 65 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/NestedWithSeparateInheritanceTests.java | 95 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/NonVoidTestableMethodIntegrationTests.java | 42 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/OverloadedTestMethodTests.java | 79 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/RecordTests.java | 38 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/ReportingTests.java | 83 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/SealedClassTests.java | 42 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/StandardTestClassTests.java | 252 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/StaticNestedBeforeAllAndAfterAllMethodsTests.java | 95 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/TestClassInheritanceTests.java | 283 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/TestInstanceLifecycleConfigurationTests.java | 234 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/TestInstanceLifecycleKotlinTests.java | 80 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/TestInstanceLifecycleTests.java | 1067 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/TestTemplateInvocationTests.java | 792 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/bridge/AbstractNonGenericTests.java | 65 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/bridge/AbstractNumberTests.java | 32 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/bridge/BridgeMethodTests.java | 103 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/bridge/ChildWithBridgeMethods.java | 38 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/bridge/ChildWithoutBridgeMethods.java | 38 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/bridge/NumberResolver.java | 46 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/bridge/NumberTestGroup.java | 61 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/bridge/PackagePrivateParent.java | 43 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/config/CachingJupiterConfigurationTests.java | 152 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/config/DefaultJupiterConfigurationTests.java | 155 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/config/InstantiatingConfigurationParameterConverterTests.java | 153 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/descriptor/CustomDisplayNameGenerator.java | 33 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/descriptor/DisplayNameUtilsTests.java | 251 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/descriptor/ExtensionContextTests.java | 355 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/descriptor/ExtensionsUtilsTests.java | 88 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/descriptor/JupiterTestDescriptorTests.java | 406 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/descriptor/LifecycleMethodUtilsTests.java | 214 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/descriptor/NamespaceTests.java | 36 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/descriptor/TestFactoryTestDescriptorTests.java | 195 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/descriptor/TestInstanceLifecycleUtilsTests.java | 115 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/descriptor/TestTemplateInvocationTestDescriptorTests.java | 56 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/descriptor/TestTemplateTestDescriptorTests.java | 113 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/descriptor/subpackage/Class1WithTestCases.java | 24 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/descriptor/subpackage/Class2WithTestCases.java | 24 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/descriptor/subpackage/ClassWithStaticInnerTestCases.java | 35 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/descriptor/subpackage/ClassWithoutTestCases.java | 17 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/discovery/DiscoverySelectorResolverTests.java | 900 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/discovery/DiscoveryTests.java | 230 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/discovery/predicates/IsInnerClassTests.java | 54 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/discovery/predicates/IsNestedTestClassTests.java | 58 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/discovery/predicates/IsPotentialTestContainerTests.java | 71 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/discovery/predicates/IsTestClassWithTestsTests.java | 214 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/discovery/predicates/IsTestFactoryMethodTests.java | 86 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/discovery/predicates/IsTestMethodTests.java | 146 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/discovery/predicates/IsTestTemplateMethodTests.java | 57 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/execution/AbstractExecutableInvokerTests.java | 98 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/execution/DefaultExecutableInvokerTests.java | 36 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/execution/DefaultTestInstancesTests.java | 48 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/execution/DynamicTestIntegrationTests.java | 46 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/execution/ExtensionContextStoreConcurrencyTests.java | 53 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/execution/ExtensionContextStoreTests.java | 95 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/execution/InterceptingExecutableInvokerTests.java | 46 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/execution/JupiterEngineExecutionContextTests.java | 104 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/execution/ParameterResolutionUtilsTests.java | 465 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/execution/UniqueIdParsingForArrayParameterIntegrationTests.java | 67 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/execution/injection/sample/CustomAnnotation.java | 24 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/execution/injection/sample/CustomAnnotationParameterResolver.java | 35 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/execution/injection/sample/CustomType.java | 27 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/execution/injection/sample/CustomTypeParameterResolver.java | 32 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/execution/injection/sample/DoubleParameterResolver.java | 35 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/execution/injection/sample/LongParameterResolver.java | 63 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/execution/injection/sample/MapOfListsTypeBasedParameterResolver.java | 32 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/execution/injection/sample/MapOfStringsParameterResolver.java | 49 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/execution/injection/sample/NullIntegerParameterResolver.java | 36 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/execution/injection/sample/NumberParameterResolver.java | 49 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/execution/injection/sample/PrimitiveArrayParameterResolver.java | 34 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/execution/injection/sample/PrimitiveIntegerParameterResolver.java | 34 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/extension/AutoCloseTests.java | 734 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/extension/BeforeAndAfterAllTests.java | 393 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/extension/BeforeAndAfterEachTests.java | 524 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/extension/BeforeAndAfterTestExecutionCallbackTests.java | 465 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/extension/CloseablePathTests.java | 341 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/extension/EnigmaException.java | 20 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/extension/EventuallyInterruptibleInvocation.java | 32 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/extension/ExecutionConditionTests.java | 210 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/extension/ExtensionContextExecutionTests.java | 83 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/extension/ExtensionRegistrationViaParametersAndFieldsTests.java | 1021 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/extension/ExtensionRegistryTests.java | 213 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/extension/InvocationInterceptorTests.java | 355 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/extension/LifecycleMethodExecutionExceptionHandlerTests.java | 593 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/extension/OrderedClassTests.java | 269 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/extension/OrderedMethodTests.java | 740 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/extension/OrderedProgrammaticExtensionRegistrationTests.java | 378 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/extension/ParameterResolverTests.java | 501 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/extension/ProgrammaticExtensionRegistrationTests.java | 759 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/extension/RepeatedTestTests.java | 401 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/extension/SameThreadTimeoutInvocationTests.java | 54 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/extension/SeparateThreadTimeoutInvocationTests.java | 80 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/extension/ServiceLoaderExtension.java | 28 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/extension/TempDirectoryCleanupTests.java | 444 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/extension/TempDirectoryMetaAnnotationTests.java | 74 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/extension/TempDirectoryPerContextTests.java | 1452 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/extension/TempDirectoryPerDeclarationTests.java | 1516 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/extension/TempDirectoryPreconditionTests.java | 119 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/extension/TestExecutionExceptionHandlerTests.java | 217 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/extension/TestInfoParameterResolverTests.java | 86 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/extension/TestInstanceFactoryTests.java | 713 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/extension/TestInstancePostProcessorAndPreDestroyCallbackTests.java | 260 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/extension/TestInstancePostProcessorTests.java | 172 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/extension/TestInstancePreConstructCallbackTests.java | 432 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/extension/TestInstancePreDestroyCallbackTests.java | 215 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/extension/TestInstancePreDestroyCallbackUtilityMethodTests.java | 107 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/extension/TestReporterParameterResolverTests.java | 72 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/extension/TestWatcherTests.java | 468 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/extension/TimeoutConfigurationTests.java | 154 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/extension/TimeoutDurationParserTests.java | 77 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/extension/TimeoutDurationTests.java | 43 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/extension/TimeoutExceptionFactoryTests.java | 73 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/extension/TimeoutExtensionTests.java | 854 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/extension/TimeoutInvocationFactoryTests.java | 89 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/extension/sub/AlwaysDisabledCondition.java | 35 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/extension/sub/AnotherAlwaysDisabledCondition.java | 25 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/extension/sub/SystemPropertyCondition.java | 66 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/subpackage/SuperClassWithPackagePrivateLifecycleMethodInDifferentPackageTestCase.java | 35 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/engine/support/OpenTest4JAndJUnit4AwareThrowableCollectorTests.java | 134 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/migrationsupport/JupiterMigrationSupportTestSuite.java | 38 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/migrationsupport/conditions/IgnoreAnnotationIntegrationTests.java | 85 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/migrationsupport/conditions/IgnoreConditionTests.java | 150 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/migrationsupport/rules/AbstractTestRuleAdapterTests.java | 83 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/migrationsupport/rules/EnableRuleMigrationSupportWithBothRuleTypesTests.java | 87 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/migrationsupport/rules/ExpectedExceptionSupportTests.java | 125 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/migrationsupport/rules/ExternalResourceSupportForDifferentDeclaredReturnTypesRulesTests.java | 78 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/migrationsupport/rules/ExternalResourceSupportForMixedMethodAndFieldRulesTests.java | 94 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/migrationsupport/rules/ExternalResourceSupportForMultipleFieldRulesTests.java | 71 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/migrationsupport/rules/ExternalResourceSupportForMultipleMethodRulesTests.java | 75 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/migrationsupport/rules/ExternalResourceSupportForTemporaryFolderFieldTests.java | 42 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/migrationsupport/rules/ExternalResourceSupportWithInheritanceTests.java | 16 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/migrationsupport/rules/ExternalResourceWithoutAdapterTests.java | 40 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/migrationsupport/rules/FailAfterAllHelper.java | 23 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/migrationsupport/rules/LauncherBasedEnableRuleMigrationSupportTests.java | 114 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/migrationsupport/rules/VerifierSupportForMixedMethodAndFieldRulesTests.java | 62 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/migrationsupport/rules/WrongExtendWithForVerifierFieldTests.java | 46 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/migrationsupport/rules/WrongExtendWithForVerifierMethodTests.java | 50 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/params/ParameterizedTestExtensionTests.java | 369 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/params/ParameterizedTestIntegrationTests.java | 2286 + jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/params/ParameterizedTestMethodContextTests.java | 80 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/params/ParameterizedTestNameFormatterTests.java | 384 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/params/ParameterizedTestSuite.java | 38 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/params/aggregator/AggregatorIntegrationTests.java | 422 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/params/aggregator/DefaultArgumentsAccessorTests.java | 186 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/params/converter/DefaultArgumentConverterTests.java | 397 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/params/converter/JavaTimeArgumentConverterTests.java | 121 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/params/converter/TypedArgumentConverterTests.java | 176 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/params/provider/AnnotationBasedArgumentsProviderTests.java | 75 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/params/provider/ArgumentsTests.java | 59 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/params/provider/CsvArgumentsProviderTests.java | 393 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/params/provider/CsvFileArgumentsProviderTests.java | 562 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/params/provider/EnumArgumentsProviderTests.java | 139 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/params/provider/EnumSourceTests.java | 118 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/params/provider/FieldArgumentsProviderTests.java | 621 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/params/provider/MethodArgumentsProviderTests.java | 1056 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/params/provider/MockCsvAnnotationBuilder.java | 210 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/params/provider/ValueArgumentsProviderTests.java | 170 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/java/org/junit/jupiter/params/support/AnnotationConsumerInitializerTests.java | 166 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/kotlin/org/junit/jupiter/api/KotlinAssertTimeoutAssertionsTests.kt | 312 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/kotlin/org/junit/jupiter/api/KotlinAssertionsTests.kt | 259 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/kotlin/org/junit/jupiter/api/KotlinFailAssertionsTests.kt | 132 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/kotlin/org/junit/jupiter/engine/kotlin/ArbitraryNamingKotlinTestCase.kt | 26 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/kotlin/org/junit/jupiter/engine/kotlin/InstancePerClassKotlinTestCase.kt | 62 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/kotlin/org/junit/jupiter/engine/kotlin/InstancePerMethodKotlinTestCase.kt | 64 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/kotlin/org/junit/jupiter/params/ParameterizedTestNameFormatterIntegrationTests.kt | 77 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/kotlin/org/junit/jupiter/params/aggregator/ArgumentsAccessorKotlinTests.kt | 70 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/kotlin/org/junit/jupiter/params/aggregator/DisplayNameTests.kt | 40 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/resources/META-INF/services/org.junit.jupiter.api.extension.Extension | 1 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/resources/log4j2-test.xml | 18 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/resources/org/junit/jupiter/params/provider/broken.csv | 2 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/resources/org/junit/jupiter/params/provider/default-max-chars.csv | 1 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/resources/org/junit/jupiter/params/provider/exceeds-default-max-chars.csv | 1 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/resources/org/junit/jupiter/params/provider/leading-trailing-spaces.csv | 2 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/resources/org/junit/jupiter/params/provider/single-column.csv | 5 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/resources/org/junit/jupiter/params/two-column-with-headers.csv | 13 jtreg7-7.5.2+1+ds2/junit5/jupiter-tests/src/test/resources/org/junit/jupiter/params/two-column.csv | 4 jtreg7-7.5.2+1+ds2/junit5/platform-tests/platform-tests.gradle.kts | 111 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/jmh/java/org/junit/jupiter/jmh/AssertionBenchmarks.java | 59 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/DefaultPackageTestCase.java | 28 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/jupiter/api/condition/OSTests.java | 79 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/jupiter/extensions/Heavyweight.java | 93 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/jupiter/extensions/HeavyweightTests.java | 110 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/AbstractEqualsAndHashCodeTests.java | 42 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/JUnitPlatformTestSuite.java | 38 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/StackTracePruningTests.java | 250 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/TestEngineTests.java | 60 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/commons/annotation/TestableAnnotationTests.java | 48 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/commons/function/TryTests.java | 114 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/commons/support/AnnotationSupportTests.java | 325 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/commons/support/ClassSupportTests.java | 43 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/commons/support/ModifierSupportTests.java | 243 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/commons/support/PreconditionAssertions.java | 34 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/commons/support/ReflectionSupportTests.java | 485 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/commons/support/conversion/FallbackStringToObjectConverterTests.java | 240 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/commons/util/AnnotationUtilsTests.java | 1035 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/commons/util/ClassLoaderUtilsTests.java | 118 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/commons/util/ClassNamePatternFilterUtilsTests.java | 172 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/commons/util/ClassUtilsTests.java | 44 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/commons/util/ClasspathScannerTests.java | 625 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/commons/util/CloseablePathTests.java | 130 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/commons/util/CollectionUtilsTests.java | 359 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/commons/util/ExceptionUtilsTests.java | 133 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/commons/util/FunctionUtilsTests.java | 49 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/commons/util/LruCacheTests.java | 35 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/commons/util/ModuleUtilsTests.java | 37 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/commons/util/PackageUtilsTests.java | 98 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/commons/util/PreconditionsTests.java | 268 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/commons/util/ReflectionUtilsTests.java | 2253 + jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/commons/util/ReflectionUtilsWithGenericTypeHierarchiesTests.java | 182 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/commons/util/RuntimeUtilsTests.java | 33 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/commons/util/SerializationUtils.java | 34 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/commons/util/StringUtilsTests.java | 192 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/commons/util/ToStringBuilderTests.java | 168 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/commons/util/classes/AExecutionConditionClass.java | 26 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/commons/util/classes/ATestExecutionListenerClass.java | 20 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/commons/util/classes/AVanillaEmpty.java | 18 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/commons/util/classes/BExecutionConditionClass.java | 26 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/commons/util/classes/BTestExecutionListenerClass.java | 20 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/commons/util/classes/BVanillaEmpty.java | 18 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/commons/util/classes/CustomType.java | 21 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/commons/util/pkg1/ClassLevelDir.java | 24 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/commons/util/pkg1/InstanceLevelDir.java | 24 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/commons/util/pkg1/SuperclassWithStaticPackagePrivateBeforeMethod.java | 25 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/commons/util/pkg1/SuperclassWithStaticPackagePrivateTempDirField.java | 23 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/commons/util/pkg1/subpkg/SubclassWithNonStaticPackagePrivateBeforeMethod.java | 26 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/commons/util/pkg1/subpkg/SubclassWithNonStaticPackagePrivateTempDirField.java | 26 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/console/ConsoleDetailsTests.java | 251 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/console/ConsoleLauncherIntegrationTests.java | 82 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/console/ConsoleLauncherTests.java | 100 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/console/ConsoleLauncherWrapper.java | 65 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/console/ConsoleLauncherWrapperResult.java | 159 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/console/options/CommandLineOptionsParsingTests.java | 640 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/console/options/ConsoleUtilsTests.java | 28 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/console/options/ExecuteTestsCommandTests.java | 114 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/console/options/ThemeTests.java | 36 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/console/subpackage/ContainerForInnerTest.java | 30 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/console/subpackage/ContainerForInnerTests.java | 30 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/console/subpackage/ContainerForStaticNestedTest.java | 28 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/console/subpackage/ContainerForStaticNestedTests.java | 28 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/console/subpackage/SecondTest.java | 25 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/console/subpackage/Test.java | 23 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/console/subpackage/Test1.java | 25 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/console/subpackage/Tests.java | 25 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/console/subpackage/ThirdTests.java | 25 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/console/tasks/ColorPaletteTests.java | 207 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/console/tasks/ConsoleTestExecutorTests.java | 127 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/console/tasks/CustomContextClassLoaderExecutorTests.java | 76 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/console/tasks/DiscoveryRequestCreatorTests.java | 368 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/console/tasks/FlatPrintingListenerTests.java | 175 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/console/tasks/TestFeedPrintingListenerTests.java | 115 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/console/tasks/TreeNodeTests.java | 98 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/console/tasks/TreePrinterTests.java | 117 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/console/tasks/VerboseTreeListenerTests.java | 96 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/FilterCompositionTests.java | 74 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/TestDescriptorTests.java | 38 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/TestTagTests.java | 105 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/UniqueIdFormatTests.java | 141 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/UniqueIdTests.java | 299 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/discovery/ClassNameFilterTests.java | 151 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/discovery/ClassSelectorTests.java | 54 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/discovery/ClasspathResourceSelectorTests.java | 42 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/discovery/ClasspathRootSelectorTests.java | 35 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/discovery/DirectorySelectorTests.java | 33 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/discovery/DiscoverySelectorsTests.java | 1456 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/discovery/FilePositionTests.java | 118 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/discovery/FileSelectorTests.java | 42 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/discovery/IterationSelectorTests.java | 79 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/discovery/MethodSelectorTests.java | 93 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/discovery/ModuleSelectorTests.java | 33 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/discovery/NestedClassSelectorTests.java | 73 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/discovery/NestedMethodSelectorTests.java | 90 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/discovery/PackageNameFilterTests.java | 127 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/discovery/PackageSelectorTests.java | 33 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/discovery/UniqueIdSelectorTests.java | 35 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/discovery/UriSelectorTests.java | 35 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/support/config/PrefixedConfigurationParametersTests.java | 90 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/AbstractTestDescriptorTests.java | 188 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/AbstractTestSourceTests.java | 85 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/ClassSourceTests.java | 181 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/ClasspathResourceSourceTests.java | 120 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/CompositeTestSourceTests.java | 75 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/DefaultUriSourceTests.java | 59 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/DemoClassTestDescriptor.java | 71 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/DemoMethodTestDescriptor.java | 89 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/FilePositionTests.java | 122 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/FileSystemSourceTests.java | 95 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/MethodSourceTests.java | 293 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/PackageSourceTests.java | 72 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/CompositeLockTests.java | 101 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/DefaultParallelExecutionConfigurationStrategyTests.java | 219 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/ForkJoinDeadLockTests.java | 179 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/ForkJoinPoolHierarchicalTestExecutorServiceTests.java | 363 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/HierarchicalTestExecutorTests.java | 753 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/LockManagerTests.java | 142 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/MemoryLeakTests.java | 78 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/NodeTreeWalkerIntegrationTests.java | 259 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/ParallelExecutionIntegrationTests.java | 1018 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/ResourceLockSupport.java | 27 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/ResourceLockTests.java | 150 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/SameThreadExecutionIntegrationTests.java | 81 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/SingleLockTests.java | 50 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/SingleTestExecutorTests.java | 62 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/ThrowableCollectorTests.java | 70 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/engine/support/store/NamespacedHierarchicalStoreTests.java | 573 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/jfr/FlightRecordingDiscoveryListenerIntegrationTests.java | 53 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/jfr/FlightRecordingExecutionListenerIntegrationTests.java | 79 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/launcher/DiscoveryFilterStub.java | 32 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/launcher/FilterStub.java | 46 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/launcher/InterceptedTestEngine.java | 22 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/launcher/InterceptorInjectedLauncherSessionListener.java | 36 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/launcher/PostDiscoveryFilterStub.java | 32 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/launcher/TagFilterTests.java | 226 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/launcher/TagIntegrationTests.java | 121 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/launcher/TestIdentifierTests.java | 128 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/launcher/TestLauncherDiscoveryListener.java | 20 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/launcher/TestLauncherInterceptor1.java | 49 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/launcher/TestLauncherInterceptor2.java | 31 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/launcher/TestLauncherSessionListener.java | 30 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/launcher/TestPlanTests.java | 118 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/launcher/TestPostDiscoveryTagFilter.java | 23 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/launcher/core/CompositeEngineExecutionListenerTests.java | 176 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/launcher/core/CompositeTestExecutionListenerTests.java | 268 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/launcher/core/DefaultLauncherEngineFilterTests.java | 192 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/launcher/core/DefaultLauncherTests.java | 654 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/launcher/core/EngineDiscoveryResultValidatorTests.java | 90 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/launcher/core/ExecutionListenerAdapterTests.java | 75 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherConfigTests.java | 141 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherConfigurationParametersTests.java | 281 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherDiscoveryRequestBuilderTests.java | 424 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherFactoryTests.java | 382 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherSessionTests.java | 109 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/launcher/core/ListenerRegistryTests.java | 48 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/launcher/core/StreamInterceptingTestExecutionListenerIntegrationTests.java | 151 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/launcher/core/StreamInterceptorTests.java | 103 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/launcher/listeners/AnotherUnusedTestExecutionListener.java | 23 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/launcher/listeners/LoggingListenerTests.java | 127 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/launcher/listeners/NoopTestExecutionListener.java | 26 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/launcher/listeners/OutputDirTests.java | 87 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/launcher/listeners/SummaryGenerationTests.java | 277 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/launcher/listeners/UniqueIdTrackingListenerIntegrationTests.java | 369 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/launcher/listeners/UnusedTestExecutionListener.java | 23 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/launcher/listeners/discovery/AbortOnFailureLauncherDiscoveryListenerTests.java | 96 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/launcher/listeners/discovery/AbstractLauncherDiscoveryListenerTests.java | 47 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/launcher/listeners/discovery/CompositeLauncherDiscoveryListenerTests.java | 58 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/launcher/listeners/discovery/LoggingLauncherDiscoveryListenerTests.java | 128 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/launcher/listeners/session/CompositeLauncherSessionListenerTests.java | 42 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/launcher/tagexpression/ParserErrorTests.java | 107 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/launcher/tagexpression/ParserTests.java | 82 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/launcher/tagexpression/TagExpressionsTests.java | 109 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/launcher/tagexpression/TokenTests.java | 50 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/launcher/tagexpression/TokenizerTests.java | 96 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/reporting/legacy/LegacyReportingUtilsTests.java | 93 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/IncrementingClock.java | 52 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/LegacyXmlReportGeneratingListenerTests.java | 446 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/XmlReportAssertions.java | 62 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/XmlReportDataTests.java | 79 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/XmlReportWriterTests.java | 288 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/reporting/open/xml/OpenTestReportGeneratingListenerTests.java | 139 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/runner/JUnitPlatformRunnerTests.java | 901 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/suite/commons/SuiteLauncherDiscoveryRequestBuilderTests.java | 705 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/suite/engine/BeforeAndAfterSuiteTests.java | 229 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/suite/engine/SuiteEngineTests.java | 450 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/suite/engine/SuiteTestDescriptorTests.java | 120 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/suite/engine/testcases/ConfigurationSensitiveTestCase.java | 39 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/suite/engine/testcases/DynamicTestsTestCase.java | 34 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/suite/engine/testcases/EmptyDynamicTestsTestCase.java | 28 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/suite/engine/testcases/EmptyTestTestCase.java | 18 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/suite/engine/testcases/JUnit4TestsTestCase.java | 20 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/suite/engine/testcases/MultipleTestsTestCase.java | 27 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/suite/engine/testcases/SingleTestTestCase.java | 23 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/suite/engine/testcases/StatefulTestCase.java | 46 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/suite/engine/testcases/TaggedTestTestCase.java | 22 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/suite/engine/testsuites/AbstractSuite.java | 23 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/suite/engine/testsuites/ConfigurationSuite.java | 24 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/suite/engine/testsuites/CyclicSuite.java | 25 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/suite/engine/testsuites/DynamicSuite.java | 23 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/suite/engine/testsuites/EmptyCyclicSuite.java | 24 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/suite/engine/testsuites/EmptyDynamicTestSuite.java | 23 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/suite/engine/testsuites/EmptyDynamicTestWithFailIfNoTestFalseSuite.java | 23 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/suite/engine/testsuites/EmptyTestCaseSuite.java | 23 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/suite/engine/testsuites/EmptyTestCaseWithFailIfNoTestFalseSuite.java | 23 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/suite/engine/testsuites/LifecycleMethodsSuites.java | 245 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/suite/engine/testsuites/MultiEngineSuite.java | 22 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/suite/engine/testsuites/MultipleSuite.java | 23 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/suite/engine/testsuites/NestedSuite.java | 33 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/suite/engine/testsuites/SelectByIdentifierSuite.java | 24 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/suite/engine/testsuites/SelectClassesSuite.java | 23 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/suite/engine/testsuites/SelectMethodsSuite.java | 23 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/suite/engine/testsuites/SuiteDisplayNameSuite.java | 25 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/suite/engine/testsuites/SuiteSuite.java | 24 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/suite/engine/testsuites/ThreePartCyclicSuite.java | 43 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/testkit/engine/EngineTestKitTests.java | 82 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/testkit/engine/EventsTests.java | 287 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/testkit/engine/ExecutionsIntegrationTests.java | 120 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/testkit/engine/NestedContainerEventConditionTests.java | 148 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/java/org/junit/platform/testkit/engine/TestExecutionResultConditionsTests.java | 123 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/config-test-override.properties | 2 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/config-test.properties | 4 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/basic/Basic-changeDisplayName-flat-ascii.out.txt | 22 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/basic/Basic-changeDisplayName-flat-unicode.out.txt | 22 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/basic/Basic-changeDisplayName-none-ascii.out.txt | 1 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/basic/Basic-changeDisplayName-none-unicode.out.txt | 1 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/basic/Basic-changeDisplayName-summary-ascii.out.txt | 14 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/basic/Basic-changeDisplayName-summary-unicode.out.txt | 14 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/basic/Basic-changeDisplayName-testfeed-ascii.out.txt | 16 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/basic/Basic-changeDisplayName-testfeed-unicode.out.txt | 16 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/basic/Basic-changeDisplayName-tree-ascii.out.txt | 18 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/basic/Basic-changeDisplayName-tree-unicode.out.txt | 18 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/basic/Basic-changeDisplayName-verbose-ascii.out.txt | 28 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/basic/Basic-changeDisplayName-verbose-unicode.out.txt | 28 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/basic/Basic-empty-flat-ascii.out.txt | 22 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/basic/Basic-empty-flat-unicode.out.txt | 22 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/basic/Basic-empty-none-ascii.out.txt | 1 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/basic/Basic-empty-none-unicode.out.txt | 1 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/basic/Basic-empty-summary-ascii.out.txt | 14 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/basic/Basic-empty-summary-unicode.out.txt | 14 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/basic/Basic-empty-testfeed-ascii.out.txt | 16 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/basic/Basic-empty-testfeed-unicode.out.txt | 16 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/basic/Basic-empty-tree-ascii.out.txt | 18 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/basic/Basic-empty-tree-unicode.out.txt | 18 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/basic/Basic-empty-verbose-ascii.out.txt | 28 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/basic/Basic-empty-verbose-unicode.out.txt | 28 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/fail/Fail-failWithMultiLineMessage-flat-ascii.out.txt | 27 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/fail/Fail-failWithMultiLineMessage-flat-unicode.out.txt | 27 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/fail/Fail-failWithMultiLineMessage-none-ascii.out.txt | 23 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/fail/Fail-failWithMultiLineMessage-none-unicode.out.txt | 23 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/fail/Fail-failWithMultiLineMessage-summary-ascii.out.txt | 23 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/fail/Fail-failWithMultiLineMessage-summary-unicode.out.txt | 23 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/fail/Fail-failWithMultiLineMessage-testfeed-ascii.out.txt | 21 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/fail/Fail-failWithMultiLineMessage-testfeed-unicode.out.txt | 21 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/fail/Fail-failWithMultiLineMessage-tree-ascii.out.txt | 30 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/fail/Fail-failWithMultiLineMessage-tree-unicode.out.txt | 30 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/fail/Fail-failWithMultiLineMessage-verbose-ascii.out.txt | 33 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/fail/Fail-failWithMultiLineMessage-verbose-unicode.out.txt | 33 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/fail/Fail-failWithSingleLineMessage-flat-ascii.out.txt | 24 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/fail/Fail-failWithSingleLineMessage-flat-unicode.out.txt | 24 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/fail/Fail-failWithSingleLineMessage-none-ascii.out.txt | 20 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/fail/Fail-failWithSingleLineMessage-none-unicode.out.txt | 20 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/fail/Fail-failWithSingleLineMessage-summary-ascii.out.txt | 20 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/fail/Fail-failWithSingleLineMessage-summary-unicode.out.txt | 20 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/fail/Fail-failWithSingleLineMessage-testfeed-ascii.out.txt | 18 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/fail/Fail-failWithSingleLineMessage-testfeed-unicode.out.txt | 18 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/fail/Fail-failWithSingleLineMessage-tree-ascii.out.txt | 24 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/fail/Fail-failWithSingleLineMessage-tree-unicode.out.txt | 24 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/fail/Fail-failWithSingleLineMessage-verbose-ascii.out.txt | 30 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/fail/Fail-failWithSingleLineMessage-verbose-unicode.out.txt | 30 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportMultiEntriesWithMultiMappings-flat-ascii.out.txt | 28 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportMultiEntriesWithMultiMappings-flat-unicode.out.txt | 28 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportMultiEntriesWithMultiMappings-none-ascii.out.txt | 1 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportMultiEntriesWithMultiMappings-none-unicode.out.txt | 1 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportMultiEntriesWithMultiMappings-summary-ascii.out.txt | 14 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportMultiEntriesWithMultiMappings-summary-unicode.out.txt | 14 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportMultiEntriesWithMultiMappings-testfeed-ascii.out.txt | 16 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportMultiEntriesWithMultiMappings-testfeed-unicode.out.txt | 16 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportMultiEntriesWithMultiMappings-tree-ascii.out.txt | 26 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportMultiEntriesWithMultiMappings-tree-unicode.out.txt | 26 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportMultiEntriesWithMultiMappings-verbose-ascii.out.txt | 31 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportMultiEntriesWithMultiMappings-verbose-unicode.out.txt | 31 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportMultiEntriesWithSingleMapping-flat-ascii.out.txt | 26 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportMultiEntriesWithSingleMapping-flat-unicode.out.txt | 26 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportMultiEntriesWithSingleMapping-none-ascii.out.txt | 1 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportMultiEntriesWithSingleMapping-none-unicode.out.txt | 1 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportMultiEntriesWithSingleMapping-summary-ascii.out.txt | 14 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportMultiEntriesWithSingleMapping-summary-unicode.out.txt | 14 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportMultiEntriesWithSingleMapping-testfeed-ascii.out.txt | 16 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportMultiEntriesWithSingleMapping-testfeed-unicode.out.txt | 16 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportMultiEntriesWithSingleMapping-tree-ascii.out.txt | 20 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportMultiEntriesWithSingleMapping-tree-unicode.out.txt | 20 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportMultiEntriesWithSingleMapping-verbose-ascii.out.txt | 30 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportMultiEntriesWithSingleMapping-verbose-unicode.out.txt | 30 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportMultipleMessages-flat-ascii.out.txt | 26 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportMultipleMessages-flat-unicode.out.txt | 26 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportMultipleMessages-none-ascii.out.txt | 1 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportMultipleMessages-none-unicode.out.txt | 1 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportMultipleMessages-summary-ascii.out.txt | 14 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportMultipleMessages-summary-unicode.out.txt | 14 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportMultipleMessages-testfeed-ascii.out.txt | 16 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportMultipleMessages-testfeed-unicode.out.txt | 16 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportMultipleMessages-tree-ascii.out.txt | 20 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportMultipleMessages-tree-unicode.out.txt | 20 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportMultipleMessages-verbose-ascii.out.txt | 30 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportMultipleMessages-verbose-unicode.out.txt | 30 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportSingleEntryWithSingleMapping-flat-ascii.out.txt | 24 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportSingleEntryWithSingleMapping-flat-unicode.out.txt | 24 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportSingleEntryWithSingleMapping-none-ascii.out.txt | 1 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportSingleEntryWithSingleMapping-none-unicode.out.txt | 1 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportSingleEntryWithSingleMapping-summary-ascii.out.txt | 14 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportSingleEntryWithSingleMapping-summary-unicode.out.txt | 14 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportSingleEntryWithSingleMapping-testfeed-ascii.out.txt | 16 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportSingleEntryWithSingleMapping-testfeed-unicode.out.txt | 16 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportSingleEntryWithSingleMapping-tree-ascii.out.txt | 19 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportSingleEntryWithSingleMapping-tree-unicode.out.txt | 19 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportSingleEntryWithSingleMapping-verbose-ascii.out.txt | 29 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportSingleEntryWithSingleMapping-verbose-unicode.out.txt | 29 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportSingleMessage-flat-ascii.out.txt | 24 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportSingleMessage-flat-unicode.out.txt | 24 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportSingleMessage-none-ascii.out.txt | 1 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportSingleMessage-none-unicode.out.txt | 1 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportSingleMessage-summary-ascii.out.txt | 14 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportSingleMessage-summary-unicode.out.txt | 14 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportSingleMessage-testfeed-ascii.out.txt | 16 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportSingleMessage-testfeed-unicode.out.txt | 16 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportSingleMessage-tree-ascii.out.txt | 19 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportSingleMessage-tree-unicode.out.txt | 19 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportSingleMessage-verbose-ascii.out.txt | 29 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/report/Report-reportSingleMessage-verbose-unicode.out.txt | 29 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/skip/Skip-skipWithMultiLineMessage-flat-ascii.out.txt | 25 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/skip/Skip-skipWithMultiLineMessage-flat-unicode.out.txt | 25 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/skip/Skip-skipWithMultiLineMessage-none-ascii.out.txt | 1 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/skip/Skip-skipWithMultiLineMessage-none-unicode.out.txt | 1 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/skip/Skip-skipWithMultiLineMessage-summary-ascii.out.txt | 14 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/skip/Skip-skipWithMultiLineMessage-summary-unicode.out.txt | 14 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/skip/Skip-skipWithMultiLineMessage-testfeed-ascii.out.txt | 19 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/skip/Skip-skipWithMultiLineMessage-testfeed-unicode.out.txt | 19 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/skip/Skip-skipWithMultiLineMessage-tree-ascii.out.txt | 21 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/skip/Skip-skipWithMultiLineMessage-tree-unicode.out.txt | 21 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/skip/Skip-skipWithMultiLineMessage-verbose-ascii.out.txt | 31 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/skip/Skip-skipWithMultiLineMessage-verbose-unicode.out.txt | 31 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/skip/Skip-skipWithSingleLineReason-flat-ascii.out.txt | 22 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/skip/Skip-skipWithSingleLineReason-flat-unicode.out.txt | 22 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/skip/Skip-skipWithSingleLineReason-none-ascii.out.txt | 1 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/skip/Skip-skipWithSingleLineReason-none-unicode.out.txt | 1 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/skip/Skip-skipWithSingleLineReason-summary-ascii.out.txt | 14 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/skip/Skip-skipWithSingleLineReason-summary-unicode.out.txt | 14 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/skip/Skip-skipWithSingleLineReason-testfeed-ascii.out.txt | 16 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/skip/Skip-skipWithSingleLineReason-testfeed-unicode.out.txt | 16 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/skip/Skip-skipWithSingleLineReason-tree-ascii.out.txt | 18 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/skip/Skip-skipWithSingleLineReason-tree-unicode.out.txt | 18 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/skip/Skip-skipWithSingleLineReason-verbose-ascii.out.txt | 28 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/console/details/skip/Skip-skipWithSingleLineReason-verbose-unicode.out.txt | 28 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/default-package.resource | 1 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/do_not_delete_me.txt | 3 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/intercepted-testservices/META-INF/services/org.junit.platform.engine.TestEngine | 1 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/intercepted-testservices/META-INF/services/org.junit.platform.launcher.LauncherSessionListener | 1 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/jenkins-junit.xsd | 118 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/listeners/uidtracking/gradle/groovy/build.gradle | 1 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/listeners/uidtracking/gradle/groovy/sub-project/sub-project.gradle | 1 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/listeners/uidtracking/gradle/kotlin/build.gradle.kts | 1 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/listeners/uidtracking/gradle/kotlin/sub-project/sub-project.gradle.kts | 1 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/listeners/uidtracking/maven/pom.xml | 1 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/log4j2-test.xml | 23 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/modules-2500/foo.bar/FooBar.java | 3 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/modules-2500/foo.bar/module-info.java | 3 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/modules-2500/foo/Foo.java | 3 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/modules-2500/foo/module-info.java | 3 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/org/junit/platform/commons/example.resource | 1 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/org/junit/platform/commons/other-example.resource | 1 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/test-junit-platform.properties | 1 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/testservices/META-INF/services/org.junit.platform.launcher.LauncherDiscoveryListener | 1 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/testservices/META-INF/services/org.junit.platform.launcher.LauncherInterceptor | 2 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/testservices/META-INF/services/org.junit.platform.launcher.LauncherSessionListener | 1 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/testservices/META-INF/services/org.junit.platform.launcher.PostDiscoveryFilter | 1 jtreg7-7.5.2+1+ds2/junit5/platform-tests/src/test/resources/testservices/META-INF/services/org.junit.platform.launcher.TestExecutionListener | 3 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts | 231 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/ant-starter/build.xml | 71 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/ant-starter/src/main/java/com/example/project/Calculator.java | 19 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/ant-starter/src/test/java/com/example/project/CalculatorTests.java | 41 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/graalvm-starter/build.gradle.kts | 37 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/graalvm-starter/settings.gradle.kts | 11 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/graalvm-starter/src/main/java/com/example/project/Calculator.java | 19 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/graalvm-starter/src/test/java/com/example/project/CalculatorTests.java | 41 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/graalvm-starter/src/test/java/com/example/project/ClassLevelAnnotationTests.java | 25 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/gradle-kotlin-extensions/build.gradle.kts | 33 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/gradle-kotlin-extensions/settings.gradle.kts | 1 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/gradle-kotlin-extensions/src/test/kotlin/com/example/project/ExtensionFunctionsTests.kt | 58 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/gradle-missing-engine/build.gradle.kts | 38 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/gradle-missing-engine/settings.gradle.kts | 1 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/gradle-missing-engine/src/test/java/FooTests.java | 22 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/gradle-starter/build.gradle.kts | 42 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/gradle-starter/settings.gradle.kts | 1 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/gradle-starter/src/main/java/com/example/project/Calculator.java | 19 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/gradle-starter/src/test/java/com/example/project/CalculatorTests.java | 41 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter-api.expected.txt | 13 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter-engine.expected.txt | 11 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter-migrationsupport.expected.txt | 11 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter-params.expected.txt | 13 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter.expected.txt | 5 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-commons.expected.txt | 12 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-console.expected.txt | 13 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-engine.expected.txt | 16 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-jfr.expected.txt | 9 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-launcher.expected.txt | 17 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-reporting.expected.txt | 11 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-runner.expected.txt | 8 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-suite-api.expected.txt | 5 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-suite-commons.expected.txt | 8 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-suite-engine.expected.txt | 10 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-suite.expected.txt | 4 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-testkit.expected.txt | 10 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/jar-describe-module/junit-vintage-engine.expected.txt | 7 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/java-versions/pom.xml | 63 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/java-versions/src/test/java/JUnitPlatformCommonsTests.java | 37 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/maven-starter/pom.xml | 94 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/maven-starter/src/main/java/com/example/project/Calculator.java | 19 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/maven-starter/src/test/java/com/example/project/CalculatorTests.java | 41 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/maven-surefire-compatibility/pom.xml | 83 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/maven-surefire-compatibility/src/test/java/com/example/project/DummyTests.java | 26 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/multi-release-jar/default/pom.xml | 73 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/multi-release-jar/default/src/test/java/integration/integration/JupiterIntegrationTests.java | 54 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/multi-release-jar/default/src/test/java/integration/integration/ModuleUtilsTests.java | 64 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/reflection-tests/build.gradle.kts | 43 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/reflection-tests/settings.gradle.kts | 1 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/reflection-tests/src/test/java/ReflectionTestCase.java | 45 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/standalone/expected-err.txt | 20 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/standalone/expected-out.txt | 19 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/standalone/logging.properties | 3 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/standalone/src/standalone/JupiterIntegration.java | 38 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/standalone/src/standalone/JupiterParamsIntegration.java | 25 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/standalone/src/standalone/SuiteIntegration.java | 26 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/standalone/src/standalone/VintageIntegration.java | 39 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/vintage/build.gradle.kts | 33 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/vintage/pom.xml | 64 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/vintage/settings.gradle.kts | 1 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/vintage/src/test/java/DefaultPackageTest.java | 22 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/projects/vintage/src/test/java/com/example/vintage/VintageTest.java | 30 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/src/main/java/platform/tooling/support/Helper.java | 158 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/src/main/java/platform/tooling/support/MavenRepo.java | 60 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/src/main/java/platform/tooling/support/Request.java | 183 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/src/main/java/platform/tooling/support/ThirdPartyJars.java | 37 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/src/main/java/platform/tooling/support/package-info.java | 7 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/src/test/java/platform/tooling/support/HelperTests.java | 75 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/AntStarterTests.java | 66 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ArchUnitTests.java | 157 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/GraalVmStarterTests.java | 61 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/GradleKotlinExtensionsTests.java | 53 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/GradleMissingEngineTests.java | 67 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/GradleModuleFileTests.java | 168 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/GradleStarterTests.java | 60 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JarContainsManifestFirstTests.java | 46 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JarDescribeModuleTests.java | 81 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JavaVersionsTests.java | 71 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ManifestTests.java | 93 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/MavenEnvVars.java | 29 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/MavenPomFileTests.java | 78 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/MavenStarterTests.java | 58 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/MavenSurefireCompatibilityTests.java | 72 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ModularUserGuideTests.java | 209 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/MultiReleaseJarTests.java | 104 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/PackageCyclesDetectionTests.java | 52 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/Projects.java | 31 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ReflectionCompatibilityTests.java | 56 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/StandaloneTests.java | 578 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ToolProviderTests.java | 148 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageGradleIntegrationTests.java | 73 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageMavenIntegrationTests.java | 72 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/XmlAssertions.java | 158 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/src/test/resources/junit-platform.properties | 7 jtreg7-7.5.2+1+ds2/junit5/platform-tooling-support-tests/src/test/resources/log4j2-test.xml | 15 jtreg7-7.5.2+1+ds2/junit5/settings.gradle.kts | 114 jtreg7-7.5.2+1+ds2/libhamcrest-java/.gitignore | 18 jtreg7-7.5.2+1+ds2/libhamcrest-java/.travis.yml | 22 jtreg7-7.5.2+1+ds2/libhamcrest-java/BUILDING.txt | 17 jtreg7-7.5.2+1+ds2/libhamcrest-java/CHANGES.md | 135 jtreg7-7.5.2+1+ds2/libhamcrest-java/LICENSE.txt | 27 jtreg7-7.5.2+1+ds2/libhamcrest-java/README.md | 63 jtreg7-7.5.2+1+ds2/libhamcrest-java/build.gradle | 152 jtreg7-7.5.2+1+ds2/libhamcrest-java/build.xml.original | 289 jtreg7-7.5.2+1+ds2/libhamcrest-java/checkstyle.xml | 11 jtreg7-7.5.2+1+ds2/libhamcrest-java/docs/_config.yml | 1 jtreg7-7.5.2+1+ds2/libhamcrest-java/docs/_includes/head.html | 11 jtreg7-7.5.2+1+ds2/libhamcrest-java/docs/_layouts/default.html | 18 jtreg7-7.5.2+1+ds2/libhamcrest-java/docs/css/hamcrest.css | 44 jtreg7-7.5.2+1+ds2/libhamcrest-java/docs/css/pygments-default.css | 61 jtreg7-7.5.2+1+ds2/libhamcrest-java/docs/distributables.md | 151 jtreg7-7.5.2+1+ds2/libhamcrest-java/docs/index.md | 25 jtreg7-7.5.2+1+ds2/libhamcrest-java/docs/related.md | 30 jtreg7-7.5.2+1+ds2/libhamcrest-java/docs/tutorial.md | 175 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest-core/hamcrest-core.gradle | 18 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest-core/src/main/java/org/hamcrest/core/deprecated/HamcrestCoreIsDeprecated.java | 9 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest-core/src/main/java/org/hamcrest/core/deprecated/package-info.java | 5 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest-core/src/main/resources/hamcrest-core-is-deprecated.txt | 5 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest-integration/hamcrest-integration.gradle | 15 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest-integration/src/main/java/org/hamcrest/EasyMock2Matchers.java | 17 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest-integration/src/main/java/org/hamcrest/JMock1Matchers.java | 12 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest-integration/src/main/java/org/hamcrest/JavaLangMatcherAssert.java | 18 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest-integration/src/main/java/org/hamcrest/integration/EasyMock2Adapter.java | 43 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest-integration/src/main/java/org/hamcrest/integration/JMock1Adapter.java | 42 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest-library/hamcrest-library.gradle | 17 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest-library/src/main/java/org/hamcrest/library/deprecated/HamcrestLibraryIsDeprecated.java | 9 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest-library/src/main/java/org/hamcrest/library/deprecated/package-info.java | 5 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest-library/src/main/resources/hamcrest-library-is-deprecated.txt | 5 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/hamcrest.gradle | 24 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/BaseDescription.java | 152 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/BaseMatcher.java | 42 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/Condition.java | 69 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/CoreMatchers.java | 450 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/CustomMatcher.java | 37 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/CustomTypeSafeMatcher.java | 39 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/Description.java | 89 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/DiagnosingMatcher.java | 21 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/FeatureMatcher.java | 54 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/Matcher.java | 67 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/MatcherAssert.java | 29 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/Matchers.java | 1701 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/SelfDescribing.java | 16 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/StringDescription.java | 63 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/TypeSafeDiagnosingMatcher.java | 74 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/TypeSafeMatcher.java | 85 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/beans/HasProperty.java | 56 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/beans/HasPropertyWithValue.java | 192 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/beans/PropertyUtil.java | 51 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/beans/SamePropertyValuesAs.java | 159 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/beans/package.html | 7 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/collection/ArrayAsIterableMatcher.java | 45 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/collection/ArrayMatching.java | 175 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/collection/HasItemInArray.java | 40 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/collection/IsArray.java | 97 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/collection/IsArrayContainingInAnyOrder.java | 112 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/collection/IsArrayContainingInOrder.java | 95 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/collection/IsArrayWithSize.java | 58 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/collection/IsCollectionWithSize.java | 50 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/collection/IsEmptyCollection.java | 53 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/collection/IsEmptyIterable.java | 48 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/collection/IsIn.java | 127 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInAnyOrder.java | 156 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInOrder.java | 150 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInRelativeOrder.java | 119 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/collection/IsIterableWithSize.java | 53 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/collection/IsMapContaining.java | 129 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/collection/IsMapWithSize.java | 60 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/collection/package.html | 7 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/comparator/ComparatorMatcherBuilder.java | 178 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/core/AllOf.java | 61 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/core/AnyOf.java | 51 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/core/CombinableMatcher.java | 82 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/core/DescribedAs.java | 69 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/core/Every.java | 44 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/core/Is.java | 74 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/core/IsAnything.java | 48 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/core/IsCollectionContaining.java | 100 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/core/IsEqual.java | 97 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/core/IsInstanceOf.java | 91 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/core/IsIterableContaining.java | 133 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/core/IsNot.java | 57 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/core/IsNull.java | 74 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/core/IsSame.java | 51 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/core/ShortcutCombination.java | 33 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/core/StringContains.java | 48 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/core/StringEndsWith.java | 44 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/core/StringRegularExpression.java | 68 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/core/StringStartsWith.java | 42 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/core/SubstringMatcher.java | 47 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/core/package.html | 7 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/internal/ArrayIterator.java | 31 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/internal/NullSafety.java | 18 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/internal/ReflectiveTypeFinder.java | 70 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/internal/SelfDescribingValue.java | 17 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/internal/SelfDescribingValueIterator.java | 28 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/io/FileMatchers.java | 107 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/number/BigDecimalCloseTo.java | 63 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/number/IsCloseTo.java | 63 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/number/IsNaN.java | 38 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/number/OrderingComparison.java | 79 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/number/package.html | 7 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/object/HasEqualValues.java | 86 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/object/HasToString.java | 43 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/object/IsCompatibleType.java | 41 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/object/IsEventFrom.java | 76 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/object/package.html | 7 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/text/CharSequenceLength.java | 57 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/text/IsBlankString.java | 55 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/text/IsEmptyString.java | 77 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/text/IsEqualCompressingWhiteSpace.java | 74 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/text/IsEqualIgnoringCase.java | 54 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/text/MatchesPattern.java | 41 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/text/StringContainsInOrder.java | 70 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/text/package.html | 7 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/xml/HasXPath.java | 169 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/xml/package.html | 7 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/AbstractMatcherTest.java | 77 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/BaseDescriptionTest.java | 114 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/BaseMatcherTest.java | 26 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/CustomMatcherTest.java | 20 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/CustomTypeSafeMatcherTest.java | 41 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/FeatureMatcherTest.java | 68 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/MatcherAssertTest.java | 99 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/NullDescriptionTest.java | 18 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/TypeSafeDiagnosingMatcherTest.java | 81 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/TypeSafeMatcherTest.java | 41 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/beans/HasPropertyTest.java | 48 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/beans/HasPropertyWithValueTest.java | 184 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/beans/SamePropertyValuesAsTest.java | 131 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/collection/ArrayMatchingInAnyOrderTest.java | 43 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/collection/ArrayMatchingInOrderTest.java | 45 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/collection/HasItemInArrayTest.java | 76 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/collection/IsArrayContainingInAnyOrderTest.java | 43 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/collection/IsArrayContainingInOrderTest.java | 41 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/collection/IsArrayTest.java | 59 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/collection/IsArrayWithSizeTest.java | 36 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/collection/IsCollectionWithSizeTest.java | 77 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/collection/IsEmptyCollectionTest.java | 45 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/collection/IsEmptyIterableTest.java | 44 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/collection/IsInTest.java | 44 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/collection/IsIterableContainingInAnyOrderTest.java | 54 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/collection/IsIterableContainingInOrderTest.java | 77 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/collection/IsIterableContainingInRelativeOrderTest.java | 93 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/collection/IsIterableWithSizeTest.java | 37 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/collection/IsMapContainingKeyTest.java | 84 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/collection/IsMapContainingTest.java | 49 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/collection/IsMapContainingValueTest.java | 46 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/collection/IsMapWithSizeTest.java | 82 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/comparator/ComparatorMatcherBuilderTest.java | 128 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/comparator/ComparatorMatcherTest.java | 87 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/core/AllOfTest.java | 70 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/core/AnyOfTest.java | 62 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/core/CombinableTest.java | 68 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/core/DescribedAsTest.java | 49 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/core/EveryTest.java | 44 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/core/IsAnythingTest.java | 44 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/core/IsCollectionContainingTest.java | 103 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/core/IsEqualTest.java | 157 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/core/IsInstanceOfTest.java | 69 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/core/IsIterableContainingTest.java | 107 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/core/IsNotTest.java | 42 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/core/IsNullTest.java | 43 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/core/IsSameTest.java | 48 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/core/IsTest.java | 51 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/core/SampleBaseClass.java | 24 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/core/SampleSubClass.java | 9 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/core/StringContainsTest.java | 45 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/core/StringEndsWithTest.java | 45 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/core/StringMatchingTest.java | 35 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/core/StringRegularExpressionTest.java | 25 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/core/StringStartsWithTest.java | 46 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/io/FileMatchersTest.java | 91 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/number/BigDecimalCloseToTest.java | 45 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/number/IsCloseToTest.java | 32 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/number/IsNanTest.java | 43 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/number/OrderingComparisonTest.java | 80 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/object/HasEqualsValuesTest.java | 56 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/object/HasToStringTest.java | 55 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/object/IsCompatibleTypeTest.java | 53 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/object/IsEventFromTest.java | 52 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/object/MatchesPatternTest.java | 59 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/text/CharSequenceLengthTest.java | 38 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/text/IsBlankStringTest.java | 55 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/text/IsEmptyStringTest.java | 55 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/text/IsEqualCompressingWhiteSpaceTest.java | 44 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/text/IsEqualIgnoringCaseTest.java | 62 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/text/StringContainsInOrderTest.java | 33 jtreg7-7.5.2+1+ds2/libhamcrest-java/hamcrest/src/test/java/org/hamcrest/xml/HasXPathTest.java | 147 jtreg7-7.5.2+1+ds2/libhamcrest-java/settings.gradle | 12 jtreg7-7.5.2+1+ds2/make/CheckJavaOSVersion.java | 4 jtreg7-7.5.2+1+ds2/make/Defs.gmk | 22 jtreg7-7.5.2+1+ds2/make/Makefile | 30 jtreg7-7.5.2+1+ds2/make/Platform.gmk | 5 jtreg7-7.5.2+1+ds2/make/Rules.gmk | 33 jtreg7-7.5.2+1+ds2/make/build-support/asmtools/build.sh | 7 jtreg7-7.5.2+1+ds2/make/build-support/build-common.sh | 8 jtreg7-7.5.2+1+ds2/make/build-support/jtharness/build.sh | 6 jtreg7-7.5.2+1+ds2/make/build-support/version-numbers | 8 jtreg7-7.5.2+1+ds2/make/build.sh | 30 jtreg7-7.5.2+1+ds2/make/checkstyle/checkstyle-emacs.xsl | 24 jtreg7-7.5.2+1+ds2/make/checkstyle/checkstyle-jtreg.xml | 47 jtreg7-7.5.2+1+ds2/make/jtdiff.gmk | 4 jtreg7-7.5.2+1+ds2/make/jtreg.gmk | 25 jtreg7-7.5.2+1+ds2/opentest4j-reporting/.gitattributes | 6 jtreg7-7.5.2+1+ds2/opentest4j-reporting/.gitignore | 8 jtreg7-7.5.2+1+ds2/opentest4j-reporting/LICENSE.md | 195 jtreg7-7.5.2+1+ds2/opentest4j-reporting/README.adoc | 211 jtreg7-7.5.2+1+ds2/opentest4j-reporting/build.gradle.kts | 10 jtreg7-7.5.2+1+ds2/opentest4j-reporting/buildSrc/build.gradle.kts | 21 jtreg7-7.5.2+1+ds2/opentest4j-reporting/buildSrc/src/main/kotlin/java-conventions.gradle.kts | 112 jtreg7-7.5.2+1+ds2/opentest4j-reporting/buildSrc/src/main/kotlin/publishing-conventions.gradle.kts | 51 jtreg7-7.5.2+1+ds2/opentest4j-reporting/cli/build.gradle.kts | 23 jtreg7-7.5.2+1+ds2/opentest4j-reporting/cli/src/main/java/org/opentest4j/reporting/cli/ConvertCommand.java | 47 jtreg7-7.5.2+1+ds2/opentest4j-reporting/cli/src/main/java/org/opentest4j/reporting/cli/ReportingCli.java | 46 jtreg7-7.5.2+1+ds2/opentest4j-reporting/cli/src/main/java/org/opentest4j/reporting/cli/ValidateCommand.java | 94 jtreg7-7.5.2+1+ds2/opentest4j-reporting/cli/src/main/resources/log4j2.xml | 13 jtreg7-7.5.2+1+ds2/opentest4j-reporting/documentation/build.gradle.kts | 22 jtreg7-7.5.2+1+ds2/opentest4j-reporting/events/build.gradle.kts | 30 jtreg7-7.5.2+1+ds2/opentest4j-reporting/events/src/main/java/org/opentest4j/reporting/events/api/Appendable.java | 50 jtreg7-7.5.2+1+ds2/opentest4j-reporting/events/src/main/java/org/opentest4j/reporting/events/api/ChildElement.java | 39 jtreg7-7.5.2+1+ds2/opentest4j-reporting/events/src/main/java/org/opentest4j/reporting/events/api/Context.java | 83 jtreg7-7.5.2+1+ds2/opentest4j-reporting/events/src/main/java/org/opentest4j/reporting/events/api/DefaultDocumentWriter.java | 312 jtreg7-7.5.2+1+ds2/opentest4j-reporting/events/src/main/java/org/opentest4j/reporting/events/api/DocumentWriter.java | 70 jtreg7-7.5.2+1+ds2/opentest4j-reporting/events/src/main/java/org/opentest4j/reporting/events/api/Element.java | 113 jtreg7-7.5.2+1+ds2/opentest4j-reporting/events/src/main/java/org/opentest4j/reporting/events/api/Factory.java | 49 jtreg7-7.5.2+1+ds2/opentest4j-reporting/events/src/main/java/org/opentest4j/reporting/events/api/NamespaceRegistry.java | 176 jtreg7-7.5.2+1+ds2/opentest4j-reporting/events/src/main/java/org/opentest4j/reporting/events/core/Attachments.java | 35 jtreg7-7.5.2+1+ds2/opentest4j-reporting/events/src/main/java/org/opentest4j/reporting/events/core/CoreFactory.java | 207 jtreg7-7.5.2+1+ds2/opentest4j-reporting/events/src/main/java/org/opentest4j/reporting/events/core/CpuCores.java | 35 jtreg7-7.5.2+1+ds2/opentest4j-reporting/events/src/main/java/org/opentest4j/reporting/events/core/Data.java | 70 jtreg7-7.5.2+1+ds2/opentest4j-reporting/events/src/main/java/org/opentest4j/reporting/events/core/DirectorySource.java | 42 jtreg7-7.5.2+1+ds2/opentest4j-reporting/events/src/main/java/org/opentest4j/reporting/events/core/FilePosition.java | 37 jtreg7-7.5.2+1+ds2/opentest4j-reporting/events/src/main/java/org/opentest4j/reporting/events/core/FileSource.java | 55 jtreg7-7.5.2+1+ds2/opentest4j-reporting/events/src/main/java/org/opentest4j/reporting/events/core/HostName.java | 35 jtreg7-7.5.2+1+ds2/opentest4j-reporting/events/src/main/java/org/opentest4j/reporting/events/core/Infrastructure.java | 39 jtreg7-7.5.2+1+ds2/opentest4j-reporting/events/src/main/java/org/opentest4j/reporting/events/core/Metadata.java | 35 jtreg7-7.5.2+1+ds2/opentest4j-reporting/events/src/main/java/org/opentest4j/reporting/events/core/OperatingSystem.java | 35 jtreg7-7.5.2+1+ds2/opentest4j-reporting/events/src/main/java/org/opentest4j/reporting/events/core/Reason.java | 35 jtreg7-7.5.2+1+ds2/opentest4j-reporting/events/src/main/java/org/opentest4j/reporting/events/core/Result.java | 67 jtreg7-7.5.2+1+ds2/opentest4j-reporting/events/src/main/java/org/opentest4j/reporting/events/core/Sources.java | 35 jtreg7-7.5.2+1+ds2/opentest4j-reporting/events/src/main/java/org/opentest4j/reporting/events/core/Tag.java | 35 jtreg7-7.5.2+1+ds2/opentest4j-reporting/events/src/main/java/org/opentest4j/reporting/events/core/Tags.java | 34 jtreg7-7.5.2+1+ds2/opentest4j-reporting/events/src/main/java/org/opentest4j/reporting/events/core/UriSource.java | 42 jtreg7-7.5.2+1+ds2/opentest4j-reporting/events/src/main/java/org/opentest4j/reporting/events/core/UserName.java | 35 jtreg7-7.5.2+1+ds2/opentest4j-reporting/events/src/main/java/org/opentest4j/reporting/events/java/ClassSource.java | 56 jtreg7-7.5.2+1+ds2/opentest4j-reporting/events/src/main/java/org/opentest4j/reporting/events/java/ClasspathResourceSource.java | 56 jtreg7-7.5.2+1+ds2/opentest4j-reporting/events/src/main/java/org/opentest4j/reporting/events/java/FileEncoding.java | 36 jtreg7-7.5.2+1+ds2/opentest4j-reporting/events/src/main/java/org/opentest4j/reporting/events/java/HeapSize.java | 47 jtreg7-7.5.2+1+ds2/opentest4j-reporting/events/src/main/java/org/opentest4j/reporting/events/java/JavaFactory.java | 109 jtreg7-7.5.2+1+ds2/opentest4j-reporting/events/src/main/java/org/opentest4j/reporting/events/java/JavaVersion.java | 36 jtreg7-7.5.2+1+ds2/opentest4j-reporting/events/src/main/java/org/opentest4j/reporting/events/java/MethodSource.java | 60 jtreg7-7.5.2+1+ds2/opentest4j-reporting/events/src/main/java/org/opentest4j/reporting/events/java/PackageSource.java | 41 jtreg7-7.5.2+1+ds2/opentest4j-reporting/events/src/main/java/org/opentest4j/reporting/events/java/Throwable.java | 51 jtreg7-7.5.2+1+ds2/opentest4j-reporting/events/src/main/java/org/opentest4j/reporting/events/root/Event.java | 55 jtreg7-7.5.2+1+ds2/opentest4j-reporting/events/src/main/java/org/opentest4j/reporting/events/root/Events.java | 52 jtreg7-7.5.2+1+ds2/opentest4j-reporting/events/src/main/java/org/opentest4j/reporting/events/root/Finished.java | 50 jtreg7-7.5.2+1+ds2/opentest4j-reporting/events/src/main/java/org/opentest4j/reporting/events/root/Reported.java | 50 jtreg7-7.5.2+1+ds2/opentest4j-reporting/events/src/main/java/org/opentest4j/reporting/events/root/RootFactory.java | 65 jtreg7-7.5.2+1+ds2/opentest4j-reporting/events/src/main/java/org/opentest4j/reporting/events/root/Started.java | 77 jtreg7-7.5.2+1+ds2/opentest4j-reporting/events/src/test/java/DocumentWriterSample.java | 50 jtreg7-7.5.2+1+ds2/opentest4j-reporting/events/src/test/java/org/opentest4j/reporting/ArchitectureTests.java | 32 jtreg7-7.5.2+1+ds2/opentest4j-reporting/events/src/test/java/org/opentest4j/reporting/events/api/DocumentWriterTest.java | 81 jtreg7-7.5.2+1+ds2/opentest4j-reporting/gradle.properties | 2 jtreg7-7.5.2+1+ds2/opentest4j-reporting/schema/build.gradle.kts | 11 jtreg7-7.5.2+1+ds2/opentest4j-reporting/schema/src/docs/asciidoc/includes/events.xml | 17 jtreg7-7.5.2+1+ds2/opentest4j-reporting/schema/src/docs/asciidoc/includes/hierarchy.xml | 14 jtreg7-7.5.2+1+ds2/opentest4j-reporting/schema/src/main/java/org/opentest4j/reporting/schema/Namespace.java | 99 jtreg7-7.5.2+1+ds2/opentest4j-reporting/schema/src/main/java/org/opentest4j/reporting/schema/QualifiedName.java | 75 jtreg7-7.5.2+1+ds2/opentest4j-reporting/schema/src/main/resources/org/opentest4j/reporting/schema/core.xsd | 97 jtreg7-7.5.2+1+ds2/opentest4j-reporting/schema/src/main/resources/org/opentest4j/reporting/schema/events.xsd | 35 jtreg7-7.5.2+1+ds2/opentest4j-reporting/schema/src/main/resources/org/opentest4j/reporting/schema/hierarchy.xsd | 27 jtreg7-7.5.2+1+ds2/opentest4j-reporting/schema/src/main/resources/org/opentest4j/reporting/schema/java.xsd | 71 jtreg7-7.5.2+1+ds2/opentest4j-reporting/settings.gradle.kts | 15 jtreg7-7.5.2+1+ds2/opentest4j-reporting/tooling/build.gradle.kts | 18 jtreg7-7.5.2+1+ds2/opentest4j-reporting/tooling/src/main/java/org/opentest4j/reporting/tooling/converter/Converter.java | 35 jtreg7-7.5.2+1+ds2/opentest4j-reporting/tooling/src/main/java/org/opentest4j/reporting/tooling/converter/DefaultConverter.java | 240 jtreg7-7.5.2+1+ds2/opentest4j-reporting/tooling/src/main/java/org/opentest4j/reporting/tooling/validator/DefaultValidator.java | 244 jtreg7-7.5.2+1+ds2/opentest4j-reporting/tooling/src/main/java/org/opentest4j/reporting/tooling/validator/Location.java | 84 jtreg7-7.5.2+1+ds2/opentest4j-reporting/tooling/src/main/java/org/opentest4j/reporting/tooling/validator/Severity.java | 33 jtreg7-7.5.2+1+ds2/opentest4j-reporting/tooling/src/main/java/org/opentest4j/reporting/tooling/validator/ValidationMessage.java | 84 jtreg7-7.5.2+1+ds2/opentest4j-reporting/tooling/src/main/java/org/opentest4j/reporting/tooling/validator/ValidationResult.java | 57 jtreg7-7.5.2+1+ds2/opentest4j-reporting/tooling/src/main/java/org/opentest4j/reporting/tooling/validator/Validator.java | 34 jtreg7-7.5.2+1+ds2/opentest4j-reporting/tooling/src/test/java/org/opentest4j/reporting/tooling/converter/DefaultConverterTests.java | 155 jtreg7-7.5.2+1+ds2/opentest4j-reporting/tooling/src/test/java/org/opentest4j/reporting/tooling/validator/DefaultValidatorTests.java | 110 jtreg7-7.5.2+1+ds2/opentest4j/.gitattributes | 2 jtreg7-7.5.2+1+ds2/opentest4j/.github/PULL_REQUEST_TEMPLATE.md | 6 jtreg7-7.5.2+1+ds2/opentest4j/.gitignore | 23 jtreg7-7.5.2+1+ds2/opentest4j/.travis.yml | 37 jtreg7-7.5.2+1+ds2/opentest4j/CONTRIBUTING.md | 58 jtreg7-7.5.2+1+ds2/opentest4j/LICENSE | 202 jtreg7-7.5.2+1+ds2/opentest4j/README.md | 91 jtreg7-7.5.2+1+ds2/opentest4j/build.gradle | 263 jtreg7-7.5.2+1+ds2/opentest4j/etc/eclipse/eclipse-formatter-settings.xml | 295 jtreg7-7.5.2+1+ds2/opentest4j/etc/spotless/apache-license-2.0.java | 15 jtreg7-7.5.2+1+ds2/opentest4j/gradle.properties | 6 jtreg7-7.5.2+1+ds2/opentest4j/settings.gradle | 7 jtreg7-7.5.2+1+ds2/opentest4j/src/main/java/org/opentest4j/AssertionFailedError.java | 158 jtreg7-7.5.2+1+ds2/opentest4j/src/main/java/org/opentest4j/IncompleteExecutionException.java | 46 jtreg7-7.5.2+1+ds2/opentest4j/src/main/java/org/opentest4j/MultipleFailuresError.java | 121 jtreg7-7.5.2+1+ds2/opentest4j/src/main/java/org/opentest4j/TestAbortedException.java | 44 jtreg7-7.5.2+1+ds2/opentest4j/src/main/java/org/opentest4j/TestSkippedException.java | 44 jtreg7-7.5.2+1+ds2/opentest4j/src/main/java/org/opentest4j/ValueWrapper.java | 194 jtreg7-7.5.2+1+ds2/opentest4j/src/main/java/org/opentest4j/package-info.java | 7 jtreg7-7.5.2+1+ds2/opentest4j/src/module/java/org.opentest4j/module-info.java | 3 jtreg7-7.5.2+1+ds2/opentest4j/src/test/java/org/opentest4j/AssertionFailedErrorTests.java | 212 jtreg7-7.5.2+1+ds2/opentest4j/src/test/java/org/opentest4j/MultipleFailuresErrorTests.java | 143 jtreg7-7.5.2+1+ds2/opentest4j/src/test/java/org/opentest4j/ValueWrapperTests.java | 162 jtreg7-7.5.2+1+ds2/picocli/.gitattributes | 42 jtreg7-7.5.2+1+ds2/picocli/.github/workflows/gradle-wrapper-validation.yml | 10 jtreg7-7.5.2+1+ds2/picocli/.gitignore | 23 jtreg7-7.5.2+1+ds2/picocli/.travis.yml | 56 jtreg7-7.5.2+1+ds2/picocli/CONTRIBUTING.md | 50 jtreg7-7.5.2+1+ds2/picocli/LICENSE | 201 jtreg7-7.5.2+1+ds2/picocli/README.md | 376 jtreg7-7.5.2+1+ds2/picocli/RELEASE-NOTES.md | 8167 ++++ jtreg7-7.5.2+1+ds2/picocli/_config.yml | 1 jtreg7-7.5.2+1+ds2/picocli/bnd.bnd | 3 jtreg7-7.5.2+1+ds2/picocli/build.gradle | 153 jtreg7-7.5.2+1+ds2/picocli/dependabot.yml | 10 jtreg7-7.5.2+1+ds2/picocli/gradle.properties | 27 jtreg7-7.5.2+1+ds2/picocli/gradle/docs.gradle | 59 jtreg7-7.5.2+1+ds2/picocli/gradle/jacoco.gradle | 24 jtreg7-7.5.2+1+ds2/picocli/gradle/publish-mavencentral.gradle | 132 jtreg7-7.5.2+1+ds2/picocli/gradle/release-tasks.gradle | 145 jtreg7-7.5.2+1+ds2/picocli/logging.properties | 59 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/README.md | 9 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/build.gradle | 40 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/main/java/picocli/annotation/processing/tests/AnnotatedCommandSourceGenerator.java | 902 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/main/java/picocli/annotation/processing/tests/AnnotatedCommandSourceGeneratorProcessor.java | 155 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/main/java/picocli/annotation/processing/tests/CommandSpec2YamlProcessor.java | 36 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/main/java/picocli/annotation/processing/tests/CommandSpecYamlPrinter.java | 248 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/main/java/picocli/annotation/processing/tests/Resources.java | 43 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/main/java/picocli/annotation/processing/tests/TypeImporter.java | 375 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/main/resources/META-INF/services/javax.annotation.processing.Processor | 1 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/java/picocli/annotation/processing/tests/AbstractCommandSpecProcessorTest.java | 256 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/java/picocli/annotation/processing/tests/AnnotatedCommandSourceGeneratorProcessorTest.java | 73 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/java/picocli/annotation/processing/tests/AnnotatedCommandSourceGeneratorTest.java | 21 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/java/picocli/annotation/processing/tests/Example.java | 94 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/java/picocli/annotation/processing/tests/Issue1134Test.java | 40 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/java/picocli/annotation/processing/tests/Issue1137Test.java | 41 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/java/picocli/annotation/processing/tests/Issue1151Test.java | 50 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/java/picocli/annotation/processing/tests/Issue1316Test.java | 24 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/java/picocli/annotation/processing/tests/Issue1319Test.java | 24 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/java/picocli/annotation/processing/tests/Issue769Test.java | 44 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/java/picocli/annotation/processing/tests/Issue777Test.java | 60 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/java/picocli/annotation/processing/tests/MixeeTest.java | 104 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/java/picocli/annotation/processing/tests/TypeImporterTest.java | 67 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/java/picocli/annotation/processing/tests/YamlAssert.java | 148 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/java/picocli/codegen/aot/graalvm/processor/NativeImageConfigGeneratorProcessorTest.java | 346 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/java/picocli/terminal/Size.java | 319 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/FileList.java | 68 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/command-method-demo.properties | 17 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/expected-filelist-reflect.json | 57 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/generated/META-INF/native-image/picocli-generated/ParentCommandDemo-reflect-config.json | 23 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/generated/picocli/codegen/aot/graalvm/Example.java | 49 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/generated/picocli/examples/PopulateFlagsMain.java | 18 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/generated/picocli/issue769/MyMixin.java | 10 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/generated/picocli/issue769/SubCommand.java | 11 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/codegen/aot/graalvm/Example.java | 78 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/codegen/aot/graalvm/Example.txt | 49 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/codegen/graalvm/example/ExampleFull.java | 152 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/codegen/graalvm/example/ExampleInterface.java | 73 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/codegen/graalvm/example/FullExample-reflect-config.json | 57 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/codegen/graalvm/example/example-additional-interface-proxy.json | 5 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/codegen/graalvm/example/example-interface-proxy.json | 3 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/codegen/graalvm/example/example-interface-reflect.json | 52 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/codegen/graalvm/example/example-resource.json | 10 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/examples/PopulateFlagsMain.java | 128 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/examples/annotatedmethods/AnnotatedClassMethodOptions.java | 115 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/examples/annotatedmethods/AnnotatedInterfaceMethodOptions.java | 140 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/examples/annotatedmethods/CObjects.yaml | 301 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/examples/annotatedmethods/CObjectsWithDefaults.yaml | 301 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/examples/annotatedmethods/CPrimitives.yaml | 196 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/examples/annotatedmethods/CPrimitivesWithDefault.yaml | 196 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/examples/annotatedmethods/IFObjects.yaml | 301 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/examples/annotatedmethods/IFObjectsWithDefault.yaml | 301 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/examples/annotatedmethods/IFPrimitives.yaml | 196 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/examples/annotatedmethods/IFPrimitivesWithDefault.yaml | 196 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/examples/annotatedmethods/InvalidAnnotatedInterfaceMethodOptions.java | 32 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/examples/logging/LoggingMixin.java | 175 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/examples/logging/LoggingSub.java | 36 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/examples/logging/LoggingSubSub.java | 36 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/examples/logging/MyApp.java | 64 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/examples/messages/CommandWithBundle.java | 8 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/examples/messages/CommandWithBundle.yaml | 66 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/examples/mixin/CommandWithMixin.java | 29 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/examples/mixin/CommandWithMixin.yaml | 357 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/examples/mixin/CommonOption.java | 10 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/examples/subcommands/FileUtils.yaml | 139 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/examples/subcommands/ParentCommandDemo.java | 66 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/examples/validation/Invalid.java | 89 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/examples/validation/Invalid2.java | 9 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/examples/validation/Invalid3.java | 10 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/examples/validation/Invalid4.java | 25 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/examples/validation/InvalidSplit.java | 15 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/issue1134/Issue1134.java | 30 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/issue1134/Issue1134.yaml | 70 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/issue1137/Issue1137.java | 39 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/issue1137/Issue1137.yaml | 70 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/issue1151/Issue1151CommandWithManPageGeneratorSubcommand.java | 18 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/issue1151/issue1151-reflect-config.json | 57 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/issue1316/Example.java | 13 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/issue1319/InheritHelpApp.java | 16 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/issue769/MyMixin.java | 18 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/issue777/All.yaml | 273 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/issue777/Composite.yaml | 189 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/issue777/Composite2.yaml | 140 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/issue777/CompositeGroupDemo.java | 53 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/issue777/CompositeGroupDemo.yaml | 266 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/issue777/Dependent.yaml | 112 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/issue777/Exclusive.yaml | 112 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/issue777/Exclusive2.yaml | 112 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/issue777/MutuallyExclusiveOptionsDemo.java | 16 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/issue777/MutuallyExclusiveOptionsDemo.yaml | 119 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/issue793/Issue793.java | 38 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/issue793/issue793-reflect-config.json | 60 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/issue803/Issue803.java | 40 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/issue803/issue803-reflect-config.json | 48 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/issue850missingmixin/App.java | 53 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/issue850missingmixin/InitCommand.java | 60 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/issue850missingmixin/ProviderMixin.java | 81 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/issue850missingmixin/issue850-reflect-config.json | 54 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/ls/FileList.java | 70 jtreg7-7.5.2+1+ds2/picocli/picocli-annotation-processing-tests/src/test/resources/picocli/ls/expected-reflect.json | 57 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/README.adoc | 865 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/build.gradle | 82 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/main/java/picocli/codegen/annotation/processing/AbstractCommandSpecProcessor.java | 1121 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/main/java/picocli/codegen/annotation/processing/AnnotatedElementHolder.java | 64 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/main/java/picocli/codegen/annotation/processing/AnnotationValidator.java | 223 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/main/java/picocli/codegen/annotation/processing/CompileTimeTypeInfo.java | 258 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/main/java/picocli/codegen/annotation/processing/CompletionCandidatesMetaData.java | 87 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/main/java/picocli/codegen/annotation/processing/DefaultValueProviderMetaData.java | 85 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/main/java/picocli/codegen/annotation/processing/ITypeMetaData.java | 34 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/main/java/picocli/codegen/annotation/processing/MixinInfo.java | 89 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/main/java/picocli/codegen/annotation/processing/ParameterConsumerMetaData.java | 91 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/main/java/picocli/codegen/annotation/processing/TypeConverterMetaData.java | 91 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/main/java/picocli/codegen/annotation/processing/TypeUtil.java | 19 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/main/java/picocli/codegen/annotation/processing/TypedMember.java | 140 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/main/java/picocli/codegen/annotation/processing/VersionProviderMetaData.java | 83 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/main/java/picocli/codegen/aot/graalvm/DynamicProxyConfigGenerator.java | 188 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/main/java/picocli/codegen/aot/graalvm/JniConfigGenerator.java | 105 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/main/java/picocli/codegen/aot/graalvm/OutputFileMixin.java | 39 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/main/java/picocli/codegen/aot/graalvm/ReflectionConfigGenerator.java | 663 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/main/java/picocli/codegen/aot/graalvm/ResourceConfigGenerator.java | 175 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/main/java/picocli/codegen/aot/graalvm/processor/AbstractCompositeGeneratorProcessor.java | 51 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/main/java/picocli/codegen/aot/graalvm/processor/AbstractGenerator.java | 77 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/main/java/picocli/codegen/aot/graalvm/processor/IGenerator.java | 10 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/main/java/picocli/codegen/aot/graalvm/processor/NativeImageConfigGeneratorProcessor.java | 50 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/main/java/picocli/codegen/aot/graalvm/processor/ProcessorUtil.java | 43 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/main/java/picocli/codegen/aot/graalvm/processor/ProxyConfigGen.java | 34 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/main/java/picocli/codegen/aot/graalvm/processor/ReflectConfigGen.java | 23 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/main/java/picocli/codegen/aot/graalvm/processor/ResourceConfigGen.java | 45 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/main/java/picocli/codegen/docgen/manpage/ManPageGenerator.java | 815 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/main/java/picocli/codegen/util/Assert.java | 25 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/main/java/picocli/codegen/util/JulLogFormatter.java | 23 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/main/java/picocli/codegen/util/Util.java | 35 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/main/resources/META-INF/services/javax.annotation.processing.Processor | 1 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/test/java/picocli/codegen/aot/graalvm/DynamicProxyConfigGeneratorTest.java | 81 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/test/java/picocli/codegen/aot/graalvm/Example.java | 94 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/test/java/picocli/codegen/aot/graalvm/ExampleInterface.java | 74 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/test/java/picocli/codegen/aot/graalvm/Issue1274AbstractCommand.java | 16 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/test/java/picocli/codegen/aot/graalvm/Issue1274Command.java | 7 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/test/java/picocli/codegen/aot/graalvm/Issue622AbstractCommand.java | 14 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/test/java/picocli/codegen/aot/graalvm/Issue622App.java | 7 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/test/java/picocli/codegen/aot/graalvm/Issue622Command1.java | 7 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/test/java/picocli/codegen/aot/graalvm/Issue622Command2.java | 10 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/test/java/picocli/codegen/aot/graalvm/Issue622Command2Sub.java | 10 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/test/java/picocli/codegen/aot/graalvm/Issue793Test.java | 103 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/test/java/picocli/codegen/aot/graalvm/Issue930Example.java | 19 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/test/java/picocli/codegen/aot/graalvm/Issue930Factory.java | 17 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/test/java/picocli/codegen/aot/graalvm/ReflectionConfigGeneratorTest.java | 135 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/test/java/picocli/codegen/aot/graalvm/ResourceConfigGeneratorTest.java | 91 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/test/java/picocli/codegen/docgen/manpage/ManPageGeneratorTest.java | 507 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/test/resources/example-interface-proxy.json | 3 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/test/resources/example-interface-reflect.json | 52 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/test/resources/example-reflect.json | 67 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/test/resources/example-resource.json | 10 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/test/resources/import.manpage.txt.adoc | 107 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/test/resources/issue1274-reflect.json | 22 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/test/resources/issue622-reflect.json | 47 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/test/resources/logging.properties | 20 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/test/resources/manpagegenerator/main_class-gen-manpage.adoc | 92 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/test/resources/manpagegenerator/main_class.adoc | 58 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/test/resources/manpagegenerator/templates/main_class-gen-manpage.adoc | 20 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/test/resources/manpagegenerator/templates/main_class.adoc | 20 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/test/resources/manpagegenerator/templates/top-level-command-subcommand-gen-manpage.adoc | 20 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/test/resources/manpagegenerator/templates/top-level-command-subcommand.adoc | 20 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/test/resources/manpagegenerator/templates/top-level-command-visible.adoc | 20 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/test/resources/manpagegenerator/templates/top-level-command.adoc | 20 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/test/resources/manpagegenerator/top-level-command-subcommand-gen-manpage.adoc | 92 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/test/resources/manpagegenerator/top-level-command-subcommand.adoc | 61 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/test/resources/manpagegenerator/top-level-command-visible.adoc | 56 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/test/resources/manpagegenerator/top-level-command.adoc | 67 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/test/resources/myapp.manpage.adoc | 82 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/test/resources/picocli/codegen/aot/graalvm/exampleMultiplyResources.properties | 4 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/test/resources/picocli/codegen/aot/graalvm/exampleResources.properties | 4 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/test/resources/some/extra/bundle.properties | 1 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/test/resources/testEndOfOptions.manpage.adoc | 67 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/test/resources/testEndOfOptionsWithoutOptions.manpage.adoc | 53 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/test/resources/testHidden.manpage.adoc | 64 jtreg7-7.5.2+1+ds2/picocli/picocli-codegen/src/test/resources/testHiddenOptions.manpage.adoc | 48 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/README.md | 9 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/annotation-processing/example-gradle-project-kotlin-graal-nativeimage/.gitignore | 89 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/annotation-processing/example-gradle-project-kotlin-graal-nativeimage/README.md | 8 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/annotation-processing/example-gradle-project-kotlin-graal-nativeimage/build.gradle | 97 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/annotation-processing/example-gradle-project-kotlin-graal-nativeimage/src/main/kotlin/picocli/examples/kotlin/Checksum.kt | 45 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/annotation-processing/example-gradle-project/build.gradle | 29 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/annotation-processing/example-gradle-project/src/main/java/com/company/Main.java | 38 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/annotation-processing/example-maven-project-shading/pom.xml | 86 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/annotation-processing/example-maven-project-shading/src/main/java/com/company/Main.java | 38 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/annotation-processing/example-maven-project-simple/pom.xml | 68 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/annotation-processing/example-maven-project-simple/src/main/java/com/company/Main.java | 38 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/build.gradle | 82 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/generate-man-pages/example-gradle-project/build.gradle | 79 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/generate-man-pages/example-gradle-project/src/main/java/com/company/Main.java | 76 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/generate-man-pages/example-maven-project/pom.xml | 129 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/generate-man-pages/example-maven-project/src/main/java/com/company/Main.java | 76 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/groovy/picocli/examples/UserManualExample.groovy | 26 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/groovy/picocli/examples/UserManualScriptExample.groovy | 21 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/groovy/picocli/examples/checksum-with-banner.groovy | 33 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/groovy/picocli/examples/checksum.groovy | 32 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/groovy/picocli/examples/checksumscript.groovy | 22 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/groovy/picocli/examples/simple.groovy | 11 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/AutomaticHelpDemo.java | 22 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/Greet.java | 22 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/AutomaticHelpDemo.java | 56 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/AutomaticHelpDemo3.java | 42 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/Example.java | 53 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/Greet.java | 36 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/PopulateFlagsMain.java | 128 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/PopulateFlagsWithLongNamesMain.java | 103 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/PopulateHelpRequestedMain.java | 82 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/PopulateOptionsWithValuesMain.java | 158 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/PopulatePositionalParametersMain.java | 136 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/UserManualExamples.java | 39 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/VersionProviderDemo1.java | 88 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/VersionProviderDemo2.java | 78 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/arggroup/CompositeGroupDemo.java | 56 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/arggroup/DefaultValueBadExample.java | 19 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/arggroup/DefaultValueGoodExample.java | 19 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/arggroup/DependentOptionsDemo.java | 45 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/arggroup/Grades.java | 38 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/arggroup/MutuallyExclusiveOptionsDemo.java | 45 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/arggroup/OptionSectionDemo.java | 58 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/arggroup/RepeatingCompositeOptions.java | 77 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/arggroup/SO61203155.java | 82 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/arggroup/SO61963756.java | 42 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/atfile/AtFileGenerator.java | 140 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/autocomplete/CommandWithCompletionSubcommand.java | 45 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/casesensitivity/CaseInsensitiveDemo.java | 30 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/casesensitivity/POSIXOptionResembleDemo.java | 50 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/casesensitivity/ScopedCaseSensitivityDemo.java | 54 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/cjk/CheckSum.java | 46 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/cjk/JapaneseDemo.java | 18 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/color/ColorDemo.java | 19 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/completioncandidates/FileCompleterDemo.java | 32 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/customhelp/AlphabeticSubcommands.java | 63 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/customhelp/ConditionallyShowSubcommands.java | 49 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/customhelp/CustomOptionListAndSynopsis.java | 110 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/customhelp/CustomOptionListAndSynopsisWithInheritance.java | 77 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/customhelp/CustomParamList.java | 90 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/customhelp/CustomSynopsisNonPosix.java | 60 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/customhelp/EnvironmentVariablesSection.java | 100 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/customhelp/GroupingDemo.java | 127 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/customhelp/HideOptionParams.java | 94 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/customhelp/HideOptionParamsFromSynopsis.java | 68 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/customhelp/HideSomePositionalParams.java | 74 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/customhelp/ShowCommandHierarchy.java | 111 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/dateformat/DateFormatExample.java | 33 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/defaultprovider/PropertiesDefaultProvider.java | 200 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/defaultprovider/SimpleDemo.java | 55 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/defaultprovider/TwoPass.java | 98 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/env_var/App.java | 67 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/exceptionhandler/ExecutionExceptionHandlerDemo.java | 36 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/exceptionhandler/ExecutionExceptionHandlerDemo2.java | 53 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/exceptionhandler/ParameterExceptionHandlerDemo.java | 49 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/execute/ExecutionStrategyWithExecutionResult.java | 65 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/exitcode/CustomExitCodeCallable.java | 36 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/exitcode/CustomExitCodeCommandMethod.java | 37 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/exitcode/CustomExitCodeGenerator.java | 40 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/exitcode/ExitCodeExceptionMapperDemo.java | 46 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/exitcode/ExitCodeOnExecutionException.java | 32 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/exitcode/ExitCodeOnInvalidInput.java | 34 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/exitcode/ExitCodeOnSuccess.java | 42 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/git/Git.java | 125 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/git/GitCommit.java | 67 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/git/GitStatus.java | 43 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/i18n/I18NDemo.java | 34 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/i18n/Messages.properties | 32 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/i18n/Messages_de.properties | 40 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/i18n/localecontrol/LocaleControl.java | 62 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/i18n/localecontrol/bundle.properties | 28 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/i18n/localecontrol/bundle_de.properties | 33 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/inheritedoptions/Top.java | 48 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/interactive/InteractivePositionalParam.java | 51 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/interactive/PasswordDemo.java | 46 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/interactive/UserPasswordDemo.java | 34 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/jsr380/beanvalidation/User.java | 108 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/leftalign/LeftAlignOptions.java | 110 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/logging_mixin_advanced/LoggingMixin.java | 164 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/logging_mixin_advanced/LoggingSub.java | 29 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/logging_mixin_advanced/LoggingSubSub.java | 29 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/logging_mixin_advanced/MyApp.java | 55 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/logging_mixin_simple/LoggingMixin.java | 29 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/logging_mixin_simple/MyApp.java | 49 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/logging_mixin_simple/Sub.java | 28 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/mixin/CommandWithMixin.java | 29 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/mixin/CommonOption.java | 10 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/model/BasicResultProcessing.java | 62 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/model/ParseResultDemo.java | 57 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/negatableoptions/Demo.java | 31 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/optionaloptionparams/OptionalOptionParamDemo.java | 89 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/ordering/MakeArgOrderSignificant.java | 70 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/parseresult/ParseResultDemo.java | 52 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/passthrough/Find.java | 76 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/programmatic/Demo.java | 38 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/sharedoptions/Top.java | 86 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/subcommands/ParentCommandDemo.java | 67 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/subcommands/SubCmdsViaMethods.java | 46 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/subcommands/SubcommandDemo.java | 70 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/synopsis/ParametersBeforeOptions.java | 46 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/synopsis/RequiredMultiValueOptionDemo.java | 60 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/synopsis/Unsorted.java | 72 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/typeconverter/InetSocketAddressConverterDemo.java | 47 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/java/picocli/examples/typeconverter/InteractiveConverterDemo.java | 59 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/kotlin/picocli/examples/kotlin/Checksum.kt | 46 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/kotlin/picocli/examples/kotlin/MyApp.kt | 31 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/kotlin/picocli/examples/kotlin/factory/Example.kt | 27 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/kotlin/picocli/examples/kotlin/factory/MyCommandFactory.kt | 21 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/kotlin/picocli/examples/kotlin/globaloptions1105/TopCommand.kt | 126 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/kotlin/picocli/examples/kotlin/i18n/I18NDemo.kt | 42 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/kotlin/picocli/examples/kotlin/i18n/Messages.properties | 32 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/kotlin/picocli/examples/kotlin/i18n/Messages_de.properties | 40 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/kotlin/picocli/examples/kotlin/i18n/localecontrol/LocaleControl.kt | 60 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/kotlin/picocli/examples/kotlin/i18n/localecontrol/bundle.properties | 28 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/kotlin/picocli/examples/kotlin/i18n/localecontrol/bundle_de.properties | 33 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/kotlin/picocli/examples/kotlin/interactive/PasswordDemo.kt | 47 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/kotlin/picocli/examples/kotlin/optional/SingleOptions.kt | 23 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/kotlin/picocli/examples/kotlin/repeatablesubcommands/repeatable-subcmds-example.kts | 56 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/kotlin/picocli/examples/kotlin/subcommands/SubCmd.kt | 26 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/kotlin/picocli/examples/kotlin/subcommands/SubCmdsViaMethods.kt | 42 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/kotlin/picocli/examples/kotlin/subcommands/TopCmd.kt | 19 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/kotlin/picocli/examples/kotlin/sysprops/SystemPropertiesDemo.kt | 20 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/scala/picocli/examples/scala/Checksum.scala | 47 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/scala/picocli/examples/scala/HelloWorld.scala | 29 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/scala/picocli/examples/scala/subcommands/SubCmdsViaClasses/SubCmd1.scala | 17 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/scala/picocli/examples/scala/subcommands/SubCmdsViaClasses/SubCmd2.scala | 17 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/scala/picocli/examples/scala/subcommands/SubCmdsViaClasses/TopCmd.scala | 23 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/main/scala/picocli/examples/scala/subcommands/SubCmdsViaMethods.scala | 42 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/test/java/picocli/MapOptionsOptionalTest.java | 191 jtreg7-7.5.2+1+ds2/picocli/picocli-examples/src/test/java/picocli/OptionalTest.java | 95 jtreg7-7.5.2+1+ds2/picocli/picocli-groovy/README.md | 38 jtreg7-7.5.2+1+ds2/picocli/picocli-groovy/build.gradle | 49 jtreg7-7.5.2+1+ds2/picocli/picocli-groovy/src/main/java/picocli/groovy/PicocliBaseScript.java | 316 jtreg7-7.5.2+1+ds2/picocli/picocli-groovy/src/main/java/picocli/groovy/PicocliBaseScript2.java | 302 jtreg7-7.5.2+1+ds2/picocli/picocli-groovy/src/main/java/picocli/groovy/PicocliScript.java | 96 jtreg7-7.5.2+1+ds2/picocli/picocli-groovy/src/main/java/picocli/groovy/PicocliScript2.java | 97 jtreg7-7.5.2+1+ds2/picocli/picocli-groovy/src/main/java/picocli/groovy/PicocliScriptASTTransformation.java | 203 jtreg7-7.5.2+1+ds2/picocli/picocli-groovy/src/main/java/picocli/groovy/package-info.java | 4 jtreg7-7.5.2+1+ds2/picocli/picocli-groovy/src/test/groovy/picocli/groovy/ClosureInAnnotationsTest.groovy | 144 jtreg7-7.5.2+1+ds2/picocli/picocli-groovy/src/test/groovy/picocli/groovy/CommandLineTest.groovy | 43 jtreg7-7.5.2+1+ds2/picocli/picocli-groovy/src/test/groovy/picocli/groovy/MultipleCommandScriptTest.groovy | 94 jtreg7-7.5.2+1+ds2/picocli/picocli-groovy/src/test/groovy/picocli/groovy/MultipleCommandScriptTest2.groovy | 80 jtreg7-7.5.2+1+ds2/picocli/picocli-groovy/src/test/groovy/picocli/groovy/PicocliBaseScript2Subclass.groovy | 7 jtreg7-7.5.2+1+ds2/picocli/picocli-groovy/src/test/groovy/picocli/groovy/PicocliBaseScript2SubclassTest.groovy | 31 jtreg7-7.5.2+1+ds2/picocli/picocli-groovy/src/test/groovy/picocli/groovy/PicocliBaseScript2Test.groovy | 604 jtreg7-7.5.2+1+ds2/picocli/picocli-groovy/src/test/groovy/picocli/groovy/PicocliBaseScriptSubclass.groovy | 7 jtreg7-7.5.2+1+ds2/picocli/picocli-groovy/src/test/groovy/picocli/groovy/PicocliBaseScriptSubclassTest.groovy | 31 jtreg7-7.5.2+1+ds2/picocli/picocli-groovy/src/test/groovy/picocli/groovy/PicocliBaseScriptTest.groovy | 428 jtreg7-7.5.2+1+ds2/picocli/picocli-groovy/src/test/groovy/picocli/groovy/PicocliScriptASTTransformationTest.groovy | 434 jtreg7-7.5.2+1+ds2/picocli/picocli-groovy/src/test/groovy/picocli/groovy/ScriptExtendingPicocliBaseScript2Subclass.groovy | 18 jtreg7-7.5.2+1+ds2/picocli/picocli-groovy/src/test/groovy/picocli/groovy/ScriptExtendingPicocliBaseScriptSubclass.groovy | 18 jtreg7-7.5.2+1+ds2/picocli/picocli-groovy/src/test/groovy/picocli/groovy/ScriptWithCommandAnnotationTest.groovy | 20 jtreg7-7.5.2+1+ds2/picocli/picocli-groovy/src/test/groovy/picocli/groovy/ScriptWithCommandAnnotationTest2.groovy | 20 jtreg7-7.5.2+1+ds2/picocli/picocli-groovy/src/test/groovy/picocli/groovy/ScriptWithoutImports.groovy | 10 jtreg7-7.5.2+1+ds2/picocli/picocli-groovy/src/test/groovy/picocli/groovy/ScriptWithoutImports2.groovy | 10 jtreg7-7.5.2+1+ds2/picocli/picocli-groovy/src/test/groovy/picocli/groovy/SimpleCommandScript2Test.groovy | 48 jtreg7-7.5.2+1+ds2/picocli/picocli-groovy/src/test/groovy/picocli/groovy/SimpleCommandScriptTest.groovy | 49 jtreg7-7.5.2+1+ds2/picocli/picocli-shell-jline2/README.md | 268 jtreg7-7.5.2+1+ds2/picocli/picocli-shell-jline2/build.gradle | 32 jtreg7-7.5.2+1+ds2/picocli/picocli-shell-jline2/src/main/java/picocli/shell/jline2/PicocliJLineCompleter.java | 55 jtreg7-7.5.2+1+ds2/picocli/picocli-shell-jline2/src/test/java/picocli/shell/jline2/example/CustomFactory.java | 35 jtreg7-7.5.2+1+ds2/picocli/picocli-shell-jline2/src/test/java/picocli/shell/jline2/example/Example.java | 135 jtreg7-7.5.2+1+ds2/picocli/picocli-shell-jline2/src/test/java/picocli/shell/jline2/example/InteractiveParameterConsumer.java | 38 jtreg7-7.5.2+1+ds2/picocli/picocli-shell-jline3/README.md | 290 jtreg7-7.5.2+1+ds2/picocli/picocli-shell-jline3/build.gradle | 36 jtreg7-7.5.2+1+ds2/picocli/picocli-shell-jline3/src/main/java/picocli/shell/jline3/PicocliCommands.java | 310 jtreg7-7.5.2+1+ds2/picocli/picocli-shell-jline3/src/main/java/picocli/shell/jline3/PicocliJLineCompleter.java | 63 jtreg7-7.5.2+1+ds2/picocli/picocli-shell-jline3/src/test/java/picocli/shell/jline3/example/Example.java | 197 jtreg7-7.5.2+1+ds2/picocli/picocli-spring-boot-starter/README.md | 158 jtreg7-7.5.2+1+ds2/picocli/picocli-spring-boot-starter/build.gradle | 35 jtreg7-7.5.2+1+ds2/picocli/picocli-spring-boot-starter/src/main/java/picocli/spring/PicocliSpringFactory.java | 37 jtreg7-7.5.2+1+ds2/picocli/picocli-spring-boot-starter/src/main/java/picocli/spring/boot/autoconfigure/PicocliAutoConfiguration.java | 32 jtreg7-7.5.2+1+ds2/picocli/picocli-spring-boot-starter/src/main/resources/META-INF/spring.factories | 1 jtreg7-7.5.2+1+ds2/picocli/picocli-spring-boot-starter/src/test/java/picocli/spring/PicocliSpringFactoryTest.java | 86 jtreg7-7.5.2+1+ds2/picocli/picocli-spring-boot-starter/src/test/java/picocli/spring/boot/autoconfigure/PicocliAutoConfigurationTest.java | 119 jtreg7-7.5.2+1+ds2/picocli/picocli-spring-boot-starter/src/test/java/picocli/spring/boot/autoconfigure/sample/MyCommand.java | 64 jtreg7-7.5.2+1+ds2/picocli/picocli-spring-boot-starter/src/test/java/picocli/spring/boot/autoconfigure/sample/MySpringApp.java | 49 jtreg7-7.5.2+1+ds2/picocli/picocli-spring-boot-starter/src/test/java/picocli/spring/boot/autoconfigure/sample/ServiceDependency.java | 7 jtreg7-7.5.2+1+ds2/picocli/picocli-spring-boot-starter/src/test/java/picocli/spring/boot/autoconfigure/sample/SomeService.java | 13 jtreg7-7.5.2+1+ds2/picocli/pom.xml | 31 jtreg7-7.5.2+1+ds2/picocli/settings.gradle | 14 jtreg7-7.5.2+1+ds2/picocli/src/main/java/overview.html | 53 jtreg7-7.5.2+1+ds2/picocli/src/main/java/picocli/AutoComplete.java | 949 jtreg7-7.5.2+1+ds2/picocli/src/main/java/picocli/CommandLine.java |18477 ++++++++++ jtreg7-7.5.2+1+ds2/picocli/src/main/java/picocli/package-info.java | 28 jtreg7-7.5.2+1+ds2/picocli/src/main/java9/module-info.java | 29 jtreg7-7.5.2+1+ds2/picocli/src/test/dejagnu.tests/README.adoc | 62 jtreg7-7.5.2+1+ds2/picocli/src/test/dejagnu.tests/completion/basic.exp | 28 jtreg7-7.5.2+1+ds2/picocli/src/test/dejagnu.tests/completion/picocompletion-help.exp | 26 jtreg7-7.5.2+1+ds2/picocli/src/test/dejagnu.tests/completion/picocompletion.exp | 26 jtreg7-7.5.2+1+ds2/picocli/src/test/dejagnu.tests/config/bashrc | 59 jtreg7-7.5.2+1+ds2/picocli/src/test/dejagnu.tests/config/default.exp | 24 jtreg7-7.5.2+1+ds2/picocli/src/test/dejagnu.tests/config/inputrc | 18 jtreg7-7.5.2+1+ds2/picocli/src/test/dejagnu.tests/config/unix.exp | 7 jtreg7-7.5.2+1+ds2/picocli/src/test/dejagnu.tests/lib/completion.exp | 26 jtreg7-7.5.2+1+ds2/picocli/src/test/dejagnu.tests/lib/completions/basicExample.exp | 48 jtreg7-7.5.2+1+ds2/picocli/src/test/dejagnu.tests/lib/completions/picocompletion-demo-help.exp | 47 jtreg7-7.5.2+1+ds2/picocli/src/test/dejagnu.tests/lib/completions/picocompletion-demo.exp | 157 jtreg7-7.5.2+1+ds2/picocli/src/test/dejagnu.tests/lib/library.exp | 873 jtreg7-7.5.2+1+ds2/picocli/src/test/dejagnu.tests/lib/library.sh | 38 jtreg7-7.5.2+1+ds2/picocli/src/test/dejagnu.tests/run | 73 jtreg7-7.5.2+1+ds2/picocli/src/test/dejagnu.tests/runCompletion | 8 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/AbbreviationMatcherTest.java | 566 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/ArgGroupHelpRegressionTest.java | 119 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/ArgGroupParameterizedTest.java | 112 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/ArgGroupTest.java | 4048 ++ jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/ArgSplitTest.java | 759 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/ArityTest.java | 1835 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/AtFileTest.java | 802 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/AutoCompleteDejaGnuTest.java | 159 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/AutoCompleteHyphenatedCommandTest.java | 72 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/AutoCompleteTest.java | 1930 + jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/CaseAwareLinkedMapTest.java | 236 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/ColorSchemeTest.java | 290 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/CommandAnnotationInheritedTest.java | 77 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/CommandAnnotationInheritedTest2.java | 36 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/CommandAnnotationMethodTest.java | 86 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/CommandLineTest.java | 3517 + jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/CommandMethodTest.java | 1143 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/CommandModelTransformersTest.java | 217 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/CommandUserObjectTest.java | 89 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/CompletionCandidatesTest.java | 260 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/CustomLayoutDemo.java | 261 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/DefaultProviderTest.java | 366 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/Demo.java | 751 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/EndOfOptionsDelimiterTest.java | 366 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/ExecuteLegacyTest.java | 1071 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/ExecuteTest.java | 1629 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/FallbackTest.java | 111 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/HelpAnsiTest.java | 1060 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/HelpSubCommandTest.java | 504 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/HelpTest.java | 5060 ++ jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/I18nCommand.java | 40 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/I18nSubclass.java | 26 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/I18nSubclass2.java | 27 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/I18nSubcommand.java | 34 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/I18nSuperclass.java | 38 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/I18nTest.java | 731 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/InheritedOptionTest.java | 596 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/InnerClassFactory.java | 73 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/InteractiveArgTest.java | 959 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/InterpolatedModelTest.java | 345 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/InterpolatorTest.java | 255 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/Issue1225UnmatchedArgBadIndex.java | 68 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/Issue1309.java | 59 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/Issue1320.java | 84 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/Issue1351.java | 74 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/Issue776ArgGroupsIgnoredInMixinTest.java | 79 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/Issue779ExceptionWhenNestedGroupInMixin.java | 83 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/Issue787SubclassSubcommandStackOverflow.java | 103 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/LenientParsingTest.java | 361 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/MapOptionsTest.java | 159 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/MixinTest.java | 1084 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/ModelArgGroupSpecTest.java | 99 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/ModelArgSpecTest.java | 422 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/ModelCommandReflectionTest.java | 319 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/ModelCommandSpecTest.java | 1511 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/ModelFieldBindingTest.java | 69 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/ModelMessagesTest.java | 92 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/ModelMethodBindingBean.java | 17 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/ModelMethodBindingTest.java | 174 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/ModelOptionSpecTest.java | 450 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/ModelParseResultTest.java | 723 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/ModelPositionalParamSpecTest.java | 340 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/ModelRuntimeInfoTest.java | 63 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/ModelTypedMemberTest.java | 63 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/ModelUnmatchedArgsBindingTest.java | 158 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/ModelUsageMessageSpecTest.java | 298 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/NegatableOptionTest.java | 574 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/OptionMethodImplTest.java | 283 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/OptionMethodSpecTest.java | 322 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/OrderedOptionsTest.java | 73 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/ParameterConsumerTest.java | 156 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/ParameterPreprocessorTest.java | 201 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/ParentCommandTest.java | 131 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/PropertiesDefaultProviderTest.java | 254 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/RangeTest.java | 599 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/RepeatableSubcommandsTest.java | 881 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/ResourceBundlePropagationTest.java | 55 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/Size.java | 157 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/SplitSynopsisLabelTest.java | 73 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/StringPrintStream.java | 42 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/SubcommandTests.java | 2940 + jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/TestUtil.java | 239 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/TextTableTest.java | 67 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/TracerTest.java | 449 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/TypeConversionTest.java | 1336 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/UnmatchedArgumentExceptionTest.java | 240 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/UnmatchedOptionTest.java | 613 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/VersionProviderTest.java | 311 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/WindowsJansiDemo.java | 35 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/test/CommandLineExecution.java | 79 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/test/Execution.java | 106 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/test/ProcessExecution.java | 69 jtreg7-7.5.2+1+ds2/picocli/src/test/java/picocli/test/Supplier.java | 5 jtreg7-7.5.2+1+ds2/picocli/src/test/resources/argfile-simplified-quoted.txt | 13 jtreg7-7.5.2+1+ds2/picocli/src/test/resources/argfile-simplified.txt | 22 jtreg7-7.5.2+1+ds2/picocli/src/test/resources/argfile-with-nested-at-file.txt | 4 jtreg7-7.5.2+1+ds2/picocli/src/test/resources/argfile-with-recursive-at-file.txt | 4 jtreg7-7.5.2+1+ds2/picocli/src/test/resources/argfile1.txt | 7 jtreg7-7.5.2+1+ds2/picocli/src/test/resources/argfile2.txt | 11 jtreg7-7.5.2+1+ds2/picocli/src/test/resources/argfile3-multipleValuesPerLine.txt | 7 jtreg7-7.5.2+1+ds2/picocli/src/test/resources/argfile4-quotedValuesContainingWhitespace.txt | 6 jtreg7-7.5.2+1+ds2/picocli/src/test/resources/argfile5-escapedAtValues.txt | 1 jtreg7-7.5.2+1+ds2/picocli/src/test/resources/bashify_completion.bash | 159 jtreg7-7.5.2+1+ds2/picocli/src/test/resources/basic.bash | 162 jtreg7-7.5.2+1+ds2/picocli/src/test/resources/hyphenated_completion.bash | 204 jtreg7-7.5.2+1+ds2/picocli/src/test/resources/picocli/I18nSubclass2_Messages.properties | 30 jtreg7-7.5.2+1+ds2/picocli/src/test/resources/picocli/I18nSuperclass_Messages.properties | 40 jtreg7-7.5.2+1+ds2/picocli/src/test/resources/picocli/Issue1352ResourceBundle.properties | 1 jtreg7-7.5.2+1+ds2/picocli/src/test/resources/picocli/ResourceBundlePropagationTest.properties | 4 jtreg7-7.5.2+1+ds2/picocli/src/test/resources/picocli/SharedMessages.properties | 43 jtreg7-7.5.2+1+ds2/picocli/src/test/resources/picocli/SharedMessages_ja.properties | 44 jtreg7-7.5.2+1+ds2/picocli/src/test/resources/picocli/arggroup-localization.properties | 3 jtreg7-7.5.2+1+ds2/picocli/src/test/resources/picocli/command-method-demo.properties | 24 jtreg7-7.5.2+1+ds2/picocli/src/test/resources/picocli/exitcodes.properties | 4 jtreg7-7.5.2+1+ds2/picocli/src/test/resources/picocli/i18n/SG_cli.properties | 2 jtreg7-7.5.2+1+ds2/picocli/src/test/resources/picocompletion-demo-help_completion.bash | 342 jtreg7-7.5.2+1+ds2/picocli/src/test/resources/picocompletion-demo.bash | 14 jtreg7-7.5.2+1+ds2/picocli/src/test/resources/picocompletion-demo_completion.bash | 323 jtreg7-7.5.2+1+ds2/plugins/idea/.gitignore | 4 jtreg7-7.5.2+1+ds2/plugins/idea/README.md | 120 jtreg7-7.5.2+1+ds2/plugins/idea/build.gradle | 37 jtreg7-7.5.2+1+ds2/plugins/idea/gradle.properties | 7 jtreg7-7.5.2+1+ds2/plugins/idea/gradle/legal/gradle.md | 231 jtreg7-7.5.2+1+ds2/plugins/idea/gradle/wrapper/gradle-wrapper.properties | 5 jtreg7-7.5.2+1+ds2/plugins/idea/gradlew | 185 jtreg7-7.5.2+1+ds2/plugins/idea/gradlew.bat | 89 jtreg7-7.5.2+1+ds2/plugins/idea/settings.gradle | 2 jtreg7-7.5.2+1+ds2/plugins/idea/src/main/java/com/oracle/plugin/jtreg/components/JTRegApplicationComponent.java | 76 jtreg7-7.5.2+1+ds2/plugins/idea/src/main/java/com/oracle/plugin/jtreg/components/JTRegFileManagerListener.java | 257 jtreg7-7.5.2+1+ds2/plugins/idea/src/main/java/com/oracle/plugin/jtreg/configuration/JTRegConfiguration.java | 311 jtreg7-7.5.2+1+ds2/plugins/idea/src/main/java/com/oracle/plugin/jtreg/configuration/JTRegConfigurationConsoleProperties.java | 48 jtreg7-7.5.2+1+ds2/plugins/idea/src/main/java/com/oracle/plugin/jtreg/configuration/JTRegConfigurationRunnableState.java | 226 jtreg7-7.5.2+1+ds2/plugins/idea/src/main/java/com/oracle/plugin/jtreg/configuration/JTRegConfigurationType.java | 84 jtreg7-7.5.2+1+ds2/plugins/idea/src/main/java/com/oracle/plugin/jtreg/configuration/producers/JTRegClassConfigurationProducer.java | 66 jtreg7-7.5.2+1+ds2/plugins/idea/src/main/java/com/oracle/plugin/jtreg/configuration/producers/JTRegConfigurationProducer.java | 103 jtreg7-7.5.2+1+ds2/plugins/idea/src/main/java/com/oracle/plugin/jtreg/configuration/producers/JTRegDirectoryConfigurationProducer.java | 74 jtreg7-7.5.2+1+ds2/plugins/idea/src/main/java/com/oracle/plugin/jtreg/configuration/ui/JTRegConfigurable.form | 96 jtreg7-7.5.2+1+ds2/plugins/idea/src/main/java/com/oracle/plugin/jtreg/configuration/ui/JTRegConfigurable.java | 120 jtreg7-7.5.2+1+ds2/plugins/idea/src/main/java/com/oracle/plugin/jtreg/executors/JTRegDebuggerRunner.java | 73 jtreg7-7.5.2+1+ds2/plugins/idea/src/main/java/com/oracle/plugin/jtreg/runtime/JTRegTestListener.java | 126 jtreg7-7.5.2+1+ds2/plugins/idea/src/main/java/com/oracle/plugin/jtreg/service/JTRegService.java | 199 jtreg7-7.5.2+1+ds2/plugins/idea/src/main/java/com/oracle/plugin/jtreg/service/ui/JTRegServiceConfigurable.form | 83 jtreg7-7.5.2+1+ds2/plugins/idea/src/main/java/com/oracle/plugin/jtreg/service/ui/JTRegServiceConfigurable.java | 273 jtreg7-7.5.2+1+ds2/plugins/idea/src/main/java/com/oracle/plugin/jtreg/templates/JTRegTemplateProvider.java | 45 jtreg7-7.5.2+1+ds2/plugins/idea/src/main/java/com/oracle/plugin/jtreg/util/JTRegTagParser.java | 123 jtreg7-7.5.2+1+ds2/plugins/idea/src/main/java/com/oracle/plugin/jtreg/util/JTRegUtils.java | 350 jtreg7-7.5.2+1+ds2/plugins/idea/src/main/java/com/oracle/plugin/jtreg/util/MapSerializerUtil.java | 104 jtreg7-7.5.2+1+ds2/plugins/idea/src/main/java/com/oracle/plugin/jtreg/util/Tag.java | 73 jtreg7-7.5.2+1+ds2/plugins/idea/src/main/java/icons/JTRegPluginIcons.java | 36 jtreg7-7.5.2+1+ds2/plugins/idea/src/main/resources/META-INF/plugin.xml | 52 jtreg7-7.5.2+1+ds2/plugins/idea/src/main/resources/liveTemplates/jtreg.xml | 21 jtreg7-7.5.2+1+ds2/src/share/bin/jtreg.sh | 9 jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/diff/Help.java | 5 jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/diff/i18n.properties | 4 jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/regtest/agent/AgentServer.java | 12 jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/regtest/agent/AgentVerbose.java | 76 jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/regtest/agent/JUnitRunner.java | 87 jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/regtest/agent/MainActionHelper.java | 4 jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/regtest/agent/SearchPath.java | 2 jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/regtest/agent/TestNGRunner.java | 64 jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/regtest/config/Locations.java | 10 jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/regtest/config/ParseException.java | 4 jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/regtest/config/RegressionContext.java | 7 jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/regtest/config/RegressionEnvironment.java | 26 jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/regtest/config/RegressionParameters.java | 60 jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/regtest/config/RegressionTestFinder.java | 4 jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/regtest/config/RegressionTestSuite.java | 15 jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/regtest/config/TestManager.java | 17 jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/regtest/config/TestProperties.java | 14 jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/regtest/exec/Action.java | 63 jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/regtest/exec/Agent.java | 117 jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/regtest/exec/AppletAction.java | 3 jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/regtest/exec/BuildAction.java | 8 jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/regtest/exec/CompileAction.java | 65 jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/regtest/exec/MainAction.java | 36 jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/regtest/exec/ProcessCommand.java | 26 jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/regtest/exec/RegressionScript.java | 103 jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/regtest/exec/ScratchDirectory.java | 32 jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/regtest/exec/ShellAction.java | 14 jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/regtest/report/TestStats.java | 233 jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/regtest/report/XMLWriter.java | 3 jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/regtest/report/i18n.properties | 12 jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/regtest/tool/ExcludeFileVerifier.java | 147 jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/regtest/tool/Help.java | 3 jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/regtest/tool/Tool.java | 225 jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/regtest/tool/i18n.properties | 19 jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/regtest/util/ProcessUtils.java | 46 jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/regtest/util/StreamCopier.java | 2 jtreg7-7.5.2+1+ds2/src/share/doc/javatest/regtest/faq.md | 181 jtreg7-7.5.2+1+ds2/src/share/doc/javatest/regtest/tag-spec.html | 48 jtreg7-7.5.2+1+ds2/test/4499340/T4499340.gmk | 4 jtreg7-7.5.2+1+ds2/test/6533043/Error.java | 26 jtreg7-7.5.2+1+ds2/test/6533043/Fail.java | 25 jtreg7-7.5.2+1+ds2/test/6533043/Pass.java | 28 jtreg7-7.5.2+1+ds2/test/6533043/T6533043.gmk | 42 jtreg7-7.5.2+1+ds2/test/6533043/build.xml | 78 jtreg7-7.5.2+1+ds2/test/6533074/S.sh | 8 jtreg7-7.5.2+1+ds2/test/6533074/T.java | 30 jtreg7-7.5.2+1+ds2/test/6533074/T6533074.gmk | 43 jtreg7-7.5.2+1+ds2/test/6533074/build.xml | 54 jtreg7-7.5.2+1+ds2/test/6783087/T6783087.gmk | 4 jtreg7-7.5.2+1+ds2/test/7900112/T7900112.gmk | 2 jtreg7-7.5.2+1+ds2/test/README.md | 4 jtreg7-7.5.2+1+ds2/test/SecurityManager/SecurityManagerTests.gmk | 16 jtreg7-7.5.2+1+ds2/test/SecurityManager/pass/SimpleSecurityManagerTest.java | 3 jtreg7-7.5.2+1+ds2/test/TestWhiteSpaceFiles.gmk | 4 jtreg7-7.5.2+1+ds2/test/agentout/AgentOut.gmk | 6 jtreg7-7.5.2+1+ds2/test/agentvmtimeout/AgentVMTimeout.gmk | 59 jtreg7-7.5.2+1+ds2/test/agentvmtimeout/OneSecondTimeoutTest.java | 41 jtreg7-7.5.2+1+ds2/test/autovm/AutoVMTests.gmk | 4 jtreg7-7.5.2+1+ds2/test/badgroups/BadGroups.gmk | 6 jtreg7-7.5.2+1+ds2/test/badtests/BadTests.gmk | 23 jtreg7-7.5.2+1+ds2/test/badtests/ExitTest.java | 5 jtreg7-7.5.2+1+ds2/test/basic/Basic.gmk | 14 jtreg7-7.5.2+1+ds2/test/basic/Basic.java | 26 jtreg7-7.5.2+1+ds2/test/basic/ReportOnlyTest.gmk | 43 jtreg7-7.5.2+1+ds2/test/bootclasspath/BootClassPathTest.gmk | 4 jtreg7-7.5.2+1+ds2/test/buildPatternTest/BuildPatternTest.gmk | 4 jtreg7-7.5.2+1+ds2/test/buildTag/BuildTagTest.gmk | 4 jtreg7-7.5.2+1+ds2/test/classDirs/ClassDirsTest.gmk | 4 jtreg7-7.5.2+1+ds2/test/classIsolation/ClassIsolationTest.gmk | 10 jtreg7-7.5.2+1+ds2/test/compileArgFileTest/CompileArgFileTest.gmk | 4 jtreg7-7.5.2+1+ds2/test/compilejdk/CompileTests.gmk | 36 jtreg7-7.5.2+1+ds2/test/cpappend/CPAppendTests.gmk | 4 jtreg7-7.5.2+1+ds2/test/debug/DebugTest.gmk | 6 jtreg7-7.5.2+1+ds2/test/exclude/ExcludeTest.gmk | 4 jtreg7-7.5.2+1+ds2/test/exclusive/ExclusiveAccessTest.gmk | 7 jtreg7-7.5.2+1+ds2/test/exclusive/dir/Test.java | 35 jtreg7-7.5.2+1+ds2/test/exitCodes/ErrorAfterPass.java | 42 jtreg7-7.5.2+1+ds2/test/exitCodes/ExitCodeTest.gmk | 19 jtreg7-7.5.2+1+ds2/test/groups/GroupTest.gmk | 6 jtreg7-7.5.2+1+ds2/test/groups2/Group2Test.gmk | 6 jtreg7-7.5.2+1+ds2/test/i18n/i18n.com.sun.javatest.diff.gmk | 4 jtreg7-7.5.2+1+ds2/test/i18n/i18n.com.sun.javatest.regtest.gmk | 8 jtreg7-7.5.2+1+ds2/test/ignoreTag/IgnoreTagTest.gmk | 8 jtreg7-7.5.2+1+ds2/test/ignoresymbolfile/IgnoreSymbolFileTest.gmk | 4 jtreg7-7.5.2+1+ds2/test/interrupt/RunInterrupt.gmk | 8 jtreg7-7.5.2+1+ds2/test/javacVMOptions/Test.java | 6 jtreg7-7.5.2+1+ds2/test/jdk11/ExecuteTest.java | 42 jtreg7-7.5.2+1+ds2/test/jdk11/JDK11Test.gmk | 63 jtreg7-7.5.2+1+ds2/test/jdkModulesTest/JDKModulesTest.gmk | 4 jtreg7-7.5.2+1+ds2/test/jdkOptsTest/JDKOptsTest.gmk | 8 jtreg7-7.5.2+1+ds2/test/jdkVersion/JDKVersionTest.gmk | 6 jtreg7-7.5.2+1+ds2/test/jtrContentTest/Test.java | 31 jtreg7-7.5.2+1+ds2/test/jtrContentTest/VerifyHostname.gmk | 42 jtreg7-7.5.2+1+ds2/test/junit/JUnitLibTest.gmk | 4 jtreg7-7.5.2+1+ds2/test/junitQueryTest/JUnitQueryTest.gmk | 88 jtreg7-7.5.2+1+ds2/test/junitQueryTest/a/b/c/Test1.java | 42 jtreg7-7.5.2+1+ds2/test/junitTrace/JUnitTrace.gmk | 4 jtreg7-7.5.2+1+ds2/test/junitTrace/JupiterTempDir.java | 53 jtreg7-7.5.2+1+ds2/test/keywords/testKeywords.gmk | 8 jtreg7-7.5.2+1+ds2/test/libBuildArgs/LibBuildArgsTest.gmk | 6 jtreg7-7.5.2+1+ds2/test/libdirs/LibDirsTest.gmk | 4 jtreg7-7.5.2+1+ds2/test/match/MatchTest.gmk | 4 jtreg7-7.5.2+1+ds2/test/modlibs/ModLibsTest.gmk | 7 jtreg7-7.5.2+1+ds2/test/modlibs/compileAction/patch/CompilePatch.java | 3 jtreg7-7.5.2+1+ds2/test/modlibs/compileAction/patch/java.base/java/io/IOHelper2.jasm | 29 jtreg7-7.5.2+1+ds2/test/modlibs/expect-classes.txt | 1 jtreg7-7.5.2+1+ds2/test/modules/ModulesTest.gmk | 10 jtreg7-7.5.2+1+ds2/test/nativepath/TestNativePath.gmk | 4 jtreg7-7.5.2+1+ds2/test/notRunTests/ExcludeTest.java | 33 jtreg7-7.5.2+1+ds2/test/notRunTests/KeywordTest.java | 34 jtreg7-7.5.2+1+ds2/test/notRunTests/ModulesTest.java | 34 jtreg7-7.5.2+1+ds2/test/notRunTests/NoMatchTest.java | 33 jtreg7-7.5.2+1+ds2/test/notRunTests/NotRunTests.gmk | 72 jtreg7-7.5.2+1+ds2/test/notRunTests/PassTest.java | 33 jtreg7-7.5.2+1+ds2/test/notRunTests/RequiresTest.java | 34 jtreg7-7.5.2+1+ds2/test/notRunTests/StatusTest.java | 35 jtreg7-7.5.2+1+ds2/test/notRunTests/TEST.ROOT | 1 jtreg7-7.5.2+1+ds2/test/notRunTests/TimeLimitTest.java | 34 jtreg7-7.5.2+1+ds2/test/notRunTests/exclude.jtx | 29 jtreg7-7.5.2+1+ds2/test/notRunTests/match.jtx | 36 jtreg7-7.5.2+1+ds2/test/optionDecoder/OptionDecoderTest.gmk | 4 jtreg7-7.5.2+1+ds2/test/osTest/OSTest.gmk | 4 jtreg7-7.5.2+1+ds2/test/preview/PreviewTest.gmk | 12 jtreg7-7.5.2+1+ds2/test/preview/TEST.ROOT | 4 jtreg7-7.5.2+1+ds2/test/previewLeaking/TEST.ROOT | 3 jtreg7-7.5.2+1+ds2/test/previewLeaking/TestPreviewLeaking.gmk | 42 jtreg7-7.5.2+1+ds2/test/previewLeaking/lib/Lib.java | 24 jtreg7-7.5.2+1+ds2/test/previewLeaking/tag/PreviewTest.java | 58 jtreg7-7.5.2+1+ds2/test/processid/Test.java | 31 jtreg7-7.5.2+1+ds2/test/processid/TestVersionCheck.gmk | 39 jtreg7-7.5.2+1+ds2/test/rerun/RerunTest.gmk | 2 jtreg7-7.5.2+1+ds2/test/rerun/std/AppletTest.agentvm.out | 6 jtreg7-7.5.2+1+ds2/test/rerun/std/AppletTest.othervm.out | 6 jtreg7-7.5.2+1+ds2/test/rerun/std/BuildTest.agentvm.out | 4 jtreg7-7.5.2+1+ds2/test/rerun/std/BuildTest.othervm.out | 4 jtreg7-7.5.2+1+ds2/test/rerun/std/CleanTest.agentvm.out | 2 jtreg7-7.5.2+1+ds2/test/rerun/std/CleanTest.othervm.out | 2 jtreg7-7.5.2+1+ds2/test/rerun/std/CompileTest.agentvm.out | 3 jtreg7-7.5.2+1+ds2/test/rerun/std/CompileTest.othervm.out | 3 jtreg7-7.5.2+1+ds2/test/rerun/std/IgnoreTest.agentvm.out | 1 jtreg7-7.5.2+1+ds2/test/rerun/std/IgnoreTest.othervm.out | 1 jtreg7-7.5.2+1+ds2/test/rerun/std/JUnitTest.agentvm.out | 6 jtreg7-7.5.2+1+ds2/test/rerun/std/JUnitTest.othervm.out | 6 jtreg7-7.5.2+1+ds2/test/rerun/std/MainTest.agentvm.out | 6 jtreg7-7.5.2+1+ds2/test/rerun/std/MainTest.othervm.out | 6 jtreg7-7.5.2+1+ds2/test/rerun/std/ShellTest.agentvm.out | 2 jtreg7-7.5.2+1+ds2/test/rerun/std/ShellTest.othervm.out | 2 jtreg7-7.5.2+1+ds2/test/rerun/std/TestNGTest.agentvm.out | 6 jtreg7-7.5.2+1+ds2/test/rerun/std/TestNGTest.othervm.out | 6 jtreg7-7.5.2+1+ds2/test/rerun/testng/TestNGTest.agentvm.out | 6 jtreg7-7.5.2+1+ds2/test/rerun/testng/TestNGTest.othervm.out | 6 jtreg7-7.5.2+1+ds2/test/rerun2/RerunTest2.gmk | 4 jtreg7-7.5.2+1+ds2/test/sanityTest/SanityTest.gmk | 4 jtreg7-7.5.2+1+ds2/test/share/basic/driver/Exit.java | 5 jtreg7-7.5.2+1+ds2/test/share/basic/lib/jtreg/SkippedException.java | 30 jtreg7-7.5.2+1+ds2/test/share/basic/main/Exit.java | 14 jtreg7-7.5.2+1+ds2/test/share/basic/main/Skipped.java | 36 jtreg7-7.5.2+1+ds2/test/shell/testShell.gmk | 4 jtreg7-7.5.2+1+ds2/test/smartActionArgs/SmartActionArgs.gmk | 8 jtreg7-7.5.2+1+ds2/test/smartActionArgs/optAuto/Test.java | 4 jtreg7-7.5.2+1+ds2/test/smartActionArgs/optAuto/Test2.java | 4 jtreg7-7.5.2+1+ds2/test/smartActionArgs/optAuto/Test3.java | 39 jtreg7-7.5.2+1+ds2/test/smartActionArgs/optIn/Test3.java | 39 jtreg7-7.5.2+1+ds2/test/smartActionArgs/optOut/Test3.java | 35 jtreg7-7.5.2+1+ds2/test/statsTests/StatsTest.java | 21 jtreg7-7.5.2+1+ds2/test/statsTests/StatsTests.gmk | 73 jtreg7-7.5.2+1+ds2/test/statusFilter/StatusFilterTest.gmk | 14 jtreg7-7.5.2+1+ds2/test/tag-spec/TestTagSpec.gmk | 55 jtreg7-7.5.2+1+ds2/test/testJavacExitCodes/JavacExitCodeTests.gmk | 29 jtreg7-7.5.2+1+ds2/test/testThreadFactory/TestThreadFactory.gmk | 33 jtreg7-7.5.2+1+ds2/test/testng-junit/TestNGJUnitTest.gmk | 4 jtreg7-7.5.2+1+ds2/test/testng/TestNGLibTest.gmk | 4 jtreg7-7.5.2+1+ds2/test/testngFailureCount/FailingTest.java | 53 jtreg7-7.5.2+1+ds2/test/testngFailureCount/TestngFailureCount.gmk | 38 jtreg7-7.5.2+1+ds2/test/testngQueryTest/TestNGQueryTest.gmk | 14 jtreg7-7.5.2+1+ds2/test/testngTestDuration/Test.java | 57 jtreg7-7.5.2+1+ds2/test/testngTestDuration/TestngTestDuration.gmk | 44 jtreg7-7.5.2+1+ds2/test/testprops/TestPropsTest.gmk | 4 jtreg7-7.5.2+1+ds2/test/timeoutDefaultSeconds/TEST.ROOT | 1 jtreg7-7.5.2+1+ds2/test/timeoutDefaultSeconds/TimeoutDefaultSeconds.gmk | 42 jtreg7-7.5.2+1+ds2/test/timeoutDefaultSeconds/TimeoutDefaultSecondsWaiter.java | 43 jtreg7-7.5.2+1+ds2/test/timeoutDefaultSeconds/junit/JUnitTimeoutDefaultSecondsWaiter.java | 34 jtreg7-7.5.2+1+ds2/test/timeoutDefaultSeconds/junit/TEST.properties | 2 jtreg7-7.5.2+1+ds2/test/timeoutDefaultSeconds/one/TEST.properties | 1 jtreg7-7.5.2+1+ds2/test/timeoutDefaultSeconds/one/TimeoutDefaultSecondsWaiter.java | 37 jtreg7-7.5.2+1+ds2/test/timeoutHandler/TimeoutHandlerTimeoutTest.gmk | 4 jtreg7-7.5.2+1+ds2/test/timeouts/TimeoutTest.gmk | 6 jtreg7-7.5.2+1+ds2/test/verifyexclude/ProblemList/duplicate.txt | 2 jtreg7-7.5.2+1+ds2/test/verifyexclude/ProblemList/exist.txt | 1 jtreg7-7.5.2+1+ds2/test/verifyexclude/ProblemList/format.1.txt | 1 jtreg7-7.5.2+1+ds2/test/verifyexclude/ProblemList/format.2.txt | 1 jtreg7-7.5.2+1+ds2/test/verifyexclude/ProblemList/format.whitespace.txt | 1 jtreg7-7.5.2+1+ds2/test/verifyexclude/ProblemList/good.txt | 3 jtreg7-7.5.2+1+ds2/test/verifyexclude/ProblemList/id.txt | 1 jtreg7-7.5.2+1+ds2/test/verifyexclude/TEST.groups | 1 jtreg7-7.5.2+1+ds2/test/verifyexclude/VerifyExcludeTest.gmk | 282 jtreg7-7.5.2+1+ds2/test/verifyexclude/p/Pass.java | 28 jtreg7-7.5.2+1+ds2/test/verifyexclude/p/Pass2.java | 29 jtreg7-7.5.2+1+ds2/test/verifyexclude/p/g/Pass3.java | 28 jtreg7-7.5.2+1+ds2/test/versionCheck/TestVersionCheck.gmk | 20 jtreg7-7.5.2+1+ds2/testng/.editorconfig | 44 jtreg7-7.5.2+1+ds2/testng/.mailmap | 13 jtreg7-7.5.2+1+ds2/testng/ANNOUNCEMENT.txt | 110 jtreg7-7.5.2+1+ds2/testng/CHANGES.txt | 1740 jtreg7-7.5.2+1+ds2/testng/LICENSE.txt | 201 jtreg7-7.5.2+1+ds2/testng/README.md | 49 jtreg7-7.5.2+1+ds2/testng/bin/junitconverter.bat | 6 jtreg7-7.5.2+1+ds2/testng/bin/master.bat | 1 jtreg7-7.5.2+1+ds2/testng/bin/run-tests.sh | 14 jtreg7-7.5.2+1+ds2/testng/bin/slave.bat | 1 jtreg7-7.5.2+1+ds2/testng/bin/testng.bat | 5 jtreg7-7.5.2+1+ds2/testng/bin/testng.sh | 6 jtreg7-7.5.2+1+ds2/testng/build-logic/basics/build.gradle.kts | 3 jtreg7-7.5.2+1+ds2/testng/build-logic/basics/src/main/kotlin/testng.repositories.gradle.kts | 10 jtreg7-7.5.2+1+ds2/testng/build-logic/basics/src/main/kotlin/testng.reproducible-builds.gradle.kts | 7 jtreg7-7.5.2+1+ds2/testng/build-logic/basics/src/main/kotlin/testng.versioning.gradle.kts | 5 jtreg7-7.5.2+1+ds2/testng/build-logic/code-quality/build.gradle.kts | 12 jtreg7-7.5.2+1+ds2/testng/build-logic/code-quality/src/main/kotlin/testng.sonarqube.gradle.kts | 12 jtreg7-7.5.2+1+ds2/testng/build-logic/code-quality/src/main/kotlin/testng.style.gradle.kts | 13 jtreg7-7.5.2+1+ds2/testng/build-logic/code-quality/src/main/kotlin/testng.testing.gradle.kts | 40 jtreg7-7.5.2+1+ds2/testng/build-logic/jvm/build.gradle.kts | 14 jtreg7-7.5.2+1+ds2/testng/build-logic/jvm/src/main/kotlin/buildlogic/CopySpecExtensions.kt | 16 jtreg7-7.5.2+1+ds2/testng/build-logic/jvm/src/main/kotlin/testng.java-library.gradle.kts | 64 jtreg7-7.5.2+1+ds2/testng/build-logic/jvm/src/main/kotlin/testng.java-platform.gradle.kts | 4 jtreg7-7.5.2+1+ds2/testng/build-logic/jvm/src/main/kotlin/testng.java.gradle.kts | 28 jtreg7-7.5.2+1+ds2/testng/build-logic/jvm/src/main/kotlin/testng.kotlin-library.gradle.kts | 17 jtreg7-7.5.2+1+ds2/testng/build-logic/publishing/build.gradle.kts | 14 jtreg7-7.5.2+1+ds2/testng/build-logic/publishing/src/main/kotlin/buildlogic/ConfigurationExtensions.kt | 19 jtreg7-7.5.2+1+ds2/testng/build-logic/publishing/src/main/kotlin/buildlogic/CopySpecExtensions.kt | 16 jtreg7-7.5.2+1+ds2/testng/build-logic/publishing/src/main/kotlin/buildlogic/DependencyHandlerExtensions.kt | 34 jtreg7-7.5.2+1+ds2/testng/build-logic/publishing/src/main/kotlin/buildlogic/FirstLayerDependencies.kt | 89 jtreg7-7.5.2+1+ds2/testng/build-logic/publishing/src/main/kotlin/buildlogic/OptionalFeaturesExtension.kt | 100 jtreg7-7.5.2+1+ds2/testng/build-logic/publishing/src/main/kotlin/testng.local-maven-repo.gradle.kts | 40 jtreg7-7.5.2+1+ds2/testng/build-logic/publishing/src/main/kotlin/testng.maven-publish.gradle.kts | 51 jtreg7-7.5.2+1+ds2/testng/build-logic/publishing/src/main/kotlin/testng.merge-feature-jars.gradle.kts | 160 jtreg7-7.5.2+1+ds2/testng/build-logic/publishing/src/main/kotlin/testng.published-java-library.gradle.kts | 41 jtreg7-7.5.2+1+ds2/testng/build-logic/publishing/src/main/kotlin/testng.published-java-platform.gradle.kts | 13 jtreg7-7.5.2+1+ds2/testng/build-logic/settings.gradle.kts | 12 jtreg7-7.5.2+1+ds2/testng/build.gradle.kts | 56 jtreg7-7.5.2+1+ds2/testng/gradle.properties | 23 jtreg7-7.5.2+1+ds2/testng/gradlew | 185 jtreg7-7.5.2+1+ds2/testng/gradlew.bat | 89 jtreg7-7.5.2+1+ds2/testng/settings.gradle.kts | 41 jtreg7-7.5.2+1+ds2/testng/testng-ant/src/main/java/org/testng/TestNGAntTask.java | 1108 jtreg7-7.5.2+1+ds2/testng/testng-ant/src/test/java/test/ant/AntTest.java | 31 jtreg7-7.5.2+1+ds2/testng/testng-ant/src/test/java/test/ant/MyReporter.java | 21 jtreg7-7.5.2+1+ds2/testng/testng-ant/src/test/java/test/ant/SimpleSample.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-ant/src/test/resources/ant/build-reporter-config.xml | 17 jtreg7-7.5.2+1+ds2/testng/testng-ant/src/test/resources/ant/build-simple.xml | 13 jtreg7-7.5.2+1+ds2/testng/testng-ant/src/test/resources/ant/expected/ant-simple.test | 4 jtreg7-7.5.2+1+ds2/testng/testng-ant/testng-ant-build.gradle.kts | 11 jtreg7-7.5.2+1+ds2/testng/testng-api/testng-api-build.gradle.kts | 11 jtreg7-7.5.2+1+ds2/testng/testng-asserts/src/main/java/org/testng/Assert.java | 2213 + jtreg7-7.5.2+1+ds2/testng/testng-asserts/src/main/java/org/testng/FileAssert.java | 359 jtreg7-7.5.2+1+ds2/testng/testng-asserts/src/main/java/org/testng/asserts/Assertion.java | 763 jtreg7-7.5.2+1+ds2/testng/testng-asserts/src/main/java/org/testng/asserts/IAssert.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-asserts/src/main/java/org/testng/asserts/IAssertLifecycle.java | 40 jtreg7-7.5.2+1+ds2/testng/testng-asserts/src/main/java/org/testng/asserts/LoggingAssert.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-asserts/src/main/java/org/testng/asserts/SoftAssert.java | 49 jtreg7-7.5.2+1+ds2/testng/testng-asserts/src/main/java/org/testng/internal/EclipseInterface.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-asserts/src/test/java/org/testng/AssertTest.java | 665 jtreg7-7.5.2+1+ds2/testng/testng-asserts/src/test/java/test/assertion/AssertionTest.java | 58 jtreg7-7.5.2+1+ds2/testng/testng-asserts/src/test/java/test/assertion/MyRawAssertion.java | 66 jtreg7-7.5.2+1+ds2/testng/testng-asserts/src/test/java/test/assertion/SoftAssertTest.java | 98 jtreg7-7.5.2+1+ds2/testng/testng-asserts/src/test/java/test/asserttests/ArrayEqualityAssertTest.java | 334 jtreg7-7.5.2+1+ds2/testng/testng-asserts/src/test/java/test/asserttests/AssertTest.java | 483 jtreg7-7.5.2+1+ds2/testng/testng-asserts/testng-asserts-build.gradle.kts | 14 jtreg7-7.5.2+1+ds2/testng/testng-bom/testng-bom-build.gradle.kts | 19 jtreg7-7.5.2+1+ds2/testng/testng-collections/src/main/java/org/testng/collections/CollectionUtils.java | 22 jtreg7-7.5.2+1+ds2/testng/testng-collections/src/main/java/org/testng/collections/ListMultiMap.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-collections/src/main/java/org/testng/collections/Lists.java | 85 jtreg7-7.5.2+1+ds2/testng/testng-collections/src/main/java/org/testng/collections/Maps.java | 47 jtreg7-7.5.2+1+ds2/testng/testng-collections/src/main/java/org/testng/collections/MultiMap.java | 91 jtreg7-7.5.2+1+ds2/testng/testng-collections/src/main/java/org/testng/collections/Objects.java | 89 jtreg7-7.5.2+1+ds2/testng/testng-collections/src/main/java/org/testng/collections/SetMultiMap.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-collections/src/main/java/org/testng/collections/Sets.java | 33 jtreg7-7.5.2+1+ds2/testng/testng-collections/src/main/java/org/testng/util/Strings.java | 76 jtreg7-7.5.2+1+ds2/testng/testng-collections/testng-collections-build.gradle.kts | 3 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IAlterSuiteListener.java | 24 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IAnnotationTransformer.java | 79 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IAttributes.java | 31 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IClass.java | 40 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IClassListener.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IConfigurable.java | 13 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IConfigurationListener.java | 81 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IConfigurationListener2.java | 7 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IConfigureCallBack.java | 24 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IDataProviderInterceptor.java | 29 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IDataProviderListener.java | 45 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IDataProviderMethod.java | 28 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IDynamicGraph.java | 43 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IExecutionListener.java | 25 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IExecutionVisualiser.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IExpectedExceptionsHolder.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IHookCallBack.java | 24 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IHookable.java | 29 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IInjectorFactory.java | 36 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IInstanceInfo.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IInvokedMethod.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IInvokedMethodListener.java | 48 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IMethodInstance.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IMethodInterceptor.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IMethodSelector.java | 29 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IMethodSelectorContext.java | 31 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IModule.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IModuleFactory.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IObjectFactory.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IObjectFactory2.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IReporter.java | 38 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IResultMap.java | 21 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IRetryAnalyzer.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/ISuite.java | 94 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/ISuiteListener.java | 26 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/ISuiteResult.java | 8 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/ITest.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/ITestClass.java | 100 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/ITestClassFinder.java | 24 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/ITestContext.java | 82 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/ITestListener.java | 91 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/ITestMethodFinder.java | 67 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/ITestNGListener.java | 8 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/ITestNGListenerFactory.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/ITestNGMethod.java | 272 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/ITestObjectFactory.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/ITestResult.java | 131 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/Reporter.java | 177 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/SuiteRunState.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/TestNGException.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/AfterClass.java | 80 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/AfterGroups.java | 90 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/AfterMethod.java | 102 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/AfterSuite.java | 80 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/AfterTest.java | 80 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/BeforeClass.java | 80 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/BeforeGroups.java | 90 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/BeforeMethod.java | 102 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/BeforeSuite.java | 80 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/BeforeTest.java | 80 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/CustomAttribute.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/DataProvider.java | 51 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/Factory.java | 40 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/Guice.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/IAnnotation.java | 4 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/IConfigurationAnnotation.java | 70 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/IDataProviderAnnotation.java | 24 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/IFactoryAnnotation.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/IIgnoreAnnotation.java | 4 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/IListenersAnnotation.java | 10 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/IObjectFactoryAnnotation.java | 3 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/IParameterizable.java | 13 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/IParametersAnnotation.java | 24 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/ITestAnnotation.java | 103 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/ITestOrConfiguration.java | 43 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/Ignore.java | 32 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/Listeners.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/NoInjection.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/ObjectFactory.java | 13 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/Optional.java | 30 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/Parameters.java | 36 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/Test.java | 200 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/TestInstance.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/internal/ClassHelper.java | 397 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/internal/ConstructorOrMethod.java | 96 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/internal/IParameterInfo.java | 21 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/internal/PackageUtils.java | 301 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/internal/PropertyUtils.java | 151 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/internal/ReporterConfig.java | 103 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/internal/RuntimeBehavior.java | 130 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/internal/Systematiser.java | 123 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/internal/Utils.java | 623 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/internal/annotations/DisabledRetryAnalyzer.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/internal/annotations/IAnnotationFinder.java | 78 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/internal/annotations/IDataProvidable.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/internal/objects/InstanceCreator.java | 61 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/internal/thread/ThreadTimeoutException.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/log4testng/Logger.java | 467 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/reporters/Buffer.java | 7 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/reporters/FileStringBuffer.java | 143 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/reporters/IBuffer.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/reporters/IReporterConfig.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/reporters/PojoReporterConfig.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/reporters/RuntimeBehavior.java | 37 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/reporters/XMLReporterConfig.java | 252 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/reporters/XMLStringBuffer.java | 367 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/reporters/XMLUtils.java | 153 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/xml/CommentDisabledXmlWeaver.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/xml/DefaultXmlWeaver.java | 304 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/xml/IWeaveXml.java | 21 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/xml/XmlClass.java | 256 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/xml/XmlDefine.java | 69 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/xml/XmlDependencies.java | 36 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/xml/XmlGroups.java | 77 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/xml/XmlInclude.java | 150 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/xml/XmlMethodSelector.java | 124 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/xml/XmlMethodSelectors.java | 35 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/xml/XmlPackage.java | 138 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/xml/XmlRun.java | 49 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/xml/XmlScript.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/xml/XmlSuite.java | 949 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/xml/XmlTest.java | 685 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/xml/XmlUtils.java | 46 jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/xml/XmlWeaver.java | 90 jtreg7-7.5.2+1+ds2/testng/testng-core-api/testng-core-api-build.gradle.kts | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/AssertJUnit.java | 478 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/ClassMethodMap.java | 85 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/CommandLineArgs.java | 254 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/ConversionUtils.java | 32 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/DataProviderHolder.java | 44 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/DataProviderInvocationException.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/DependencyMap.java | 136 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/ITestRunnerFactory.java | 54 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/InstanceOrderingMethodInterceptor.java | 36 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/JarFileUtils.java | 133 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/PreserveOrderMethodInterceptor.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/SkipException.java | 69 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/SuiteResult.java | 47 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/SuiteRunner.java | 804 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/SuiteRunnerWorker.java | 195 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/TestClass.java | 285 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/TestException.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/TestListenerAdapter.java | 165 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/TestNG.java | 1978 + jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/TestNGUtils.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/TestRunner.java | 1301 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/TimeBombSkipException.java | 235 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/BaseClassFinder.java | 54 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/BaseTestMethod.java | 798 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/ClassImpl.java | 174 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/ClassInfoMap.java | 74 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/ClonedMethod.java | 362 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/Configuration.java | 159 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/ConfigurationGroupMethods.java | 137 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/ConfigurationMethod.java | 542 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/DataProviderMethod.java | 45 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/DefaultListenerFactory.java | 31 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/DefaultMethodSelectorContext.java | 32 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/DynamicGraph.java | 407 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/DynamicGraphHelper.java | 211 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/ExitCode.java | 94 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/ExitCodeListener.java | 79 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/FactoryMethod.java | 235 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/Graph.java | 319 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/GroupsHelper.java | 73 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/IConfigEavesdropper.java | 7 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/IConfiguration.java | 58 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/IContainer.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/IResultListener.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/IResultListener2.java | 5 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/ITestClassConfigInfo.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/InstanceInfo.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/MethodGroupsHelper.java | 269 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/MethodHelper.java | 501 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/MethodInheritance.java | 199 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/MethodInstance.java | 91 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/MethodSelectorDescriptor.java | 35 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/NoOpTestClass.java | 171 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/OverrideProcessor.java | 38 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/ParameterInfo.java | 28 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/Parameters.java | 946 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/PoolService.java | 59 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/RegexpExpectedExceptionsHolder.java | 57 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/ResultMap.java | 58 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/RunInfo.java | 70 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/ScriptMethodSelector.java | 62 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/ScriptSelectorFactory.java | 44 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/Tarjan.java | 56 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/TestListenerHelper.java | 200 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/TestMethodComparator.java | 26 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/TestMethodContainer.java | 50 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/TestNGClassFinder.java | 333 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/TestNGMethod.java | 226 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/TestNGMethodFinder.java | 267 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/Version.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/WrappedTestNGMethod.java | 376 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/XmlMethodSelector.java | 375 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/annotations/AnnotationHelper.java | 394 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/annotations/BaseAnnotation.java | 35 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/annotations/BaseBeforeAfter.java | 56 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/annotations/ConfigurationAnnotation.java | 199 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/annotations/DataProviderAnnotation.java | 42 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/annotations/DefaultAnnotationTransformer.java | 21 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/annotations/FactoryAnnotation.java | 52 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/annotations/IAfterClass.java | 3 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/annotations/IAfterGroups.java | 3 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/annotations/IAfterMethod.java | 3 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/annotations/IAfterSuite.java | 3 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/annotations/IAfterTest.java | 3 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/annotations/IAnnotationTransformer.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/annotations/IBaseBeforeAfter.java | 50 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/annotations/IBaseBeforeAfterMethod.java | 6 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/annotations/IBeforeClass.java | 3 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/annotations/IBeforeGroups.java | 3 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/annotations/IBeforeMethod.java | 3 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/annotations/IBeforeSuite.java | 3 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/annotations/IBeforeTest.java | 3 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/annotations/IListeners.java | 5 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/annotations/ITest.java | 5 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/annotations/IgnoreListener.java | 86 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/annotations/JDK15AnnotationFinder.java | 325 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/annotations/JDK15TagFactory.java | 595 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/annotations/ListenersAnnotation.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/annotations/ObjectFactoryAnnotation.java | 6 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/annotations/ParametersAnnotation.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/annotations/TestAnnotation.java | 192 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/annotations/TestOrConfiguration.java | 82 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/ant/AntReporterConfig.java | 50 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/collections/ArrayIterator.java | 34 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/collections/Ints.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/collections/OneToTwoDimArrayIterator.java | 33 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/collections/OneToTwoDimIterator.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/collections/Pair.java | 75 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/invokers/AbstractParallelWorker.java | 116 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/invokers/Arguments.java | 29 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/invokers/BaseInvoker.java | 113 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/invokers/ClassBasedParallelWorker.java | 120 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/invokers/ConfigInvoker.java | 619 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/invokers/ConfigMethodArguments.java | 135 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/invokers/ExceptionUtils.java | 53 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/invokers/ExpectedExceptionsHolder.java | 99 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/invokers/GroupConfigMethodArguments.java | 68 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/invokers/IConfigInvoker.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/invokers/IInvoker.java | 13 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/invokers/IMethodRunner.java | 29 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/invokers/ITestInvoker.java | 54 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/invokers/InstanceBasedParallelParallelWorker.java | 41 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/invokers/InvokeMethodRunnable.java | 85 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/invokers/InvokedMethod.java | 65 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/invokers/InvokedMethodListenerInvoker.java | 63 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/invokers/InvokedMethodListenerMethod.java | 13 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/invokers/Invoker.java | 63 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/invokers/MethodArguments.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/invokers/MethodInvocationHelper.java | 482 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/invokers/MethodRunner.java | 138 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/invokers/ParameterHandler.java | 123 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/invokers/ParameterHolder.java | 29 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/invokers/SuiteRunnerMap.java | 29 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/invokers/TestInvoker.java | 945 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/invokers/TestMethodArguments.java | 136 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/invokers/TestMethodWithDataProviderMethodWorker.java | 153 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/invokers/TestMethodWorker.java | 304 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/invokers/TestNgMethodUtils.java | 168 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/invokers/objects/GuiceContext.java | 36 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/junit/ArrayAsserts.java | 221 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/junit/ArrayComparisonFailure.java | 51 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/junit/ComparisonCriteria.java | 68 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/junit/ExactComparisonCriteria.java | 10 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/junit/InexactComparisonCriteria.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/objects/DefaultTestObjectFactory.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/objects/Dispenser.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/objects/GuiceBackedInjectorFactory.java | 24 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/objects/GuiceBasedObjectDispenser.java | 65 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/objects/GuiceHelper.java | 224 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/objects/IObjectDispenser.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/objects/ObjectFactoryImpl.java | 58 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/objects/SimpleObjectDispenser.java | 229 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/objects/pojo/BasicAttributes.java | 25 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/objects/pojo/CreationAttributes.java | 45 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/objects/pojo/DetailedAttributes.java | 65 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/reflect/AbstractMethodMatcher.java | 38 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/reflect/AbstractNodeMethodMatcher.java | 77 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/reflect/ArrayEndingMethodMatcher.java | 55 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/reflect/DataProviderMethodMatcher.java | 48 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/reflect/DirectMethodMatcher.java | 41 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/reflect/InjectableParameter.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/reflect/MethodMatcher.java | 22 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/reflect/MethodMatcherContext.java | 58 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/reflect/MethodMatcherException.java | 94 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/reflect/Parameter.java | 88 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/reflect/ReflectionRecipes.java | 499 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/thread/DefaultThreadPoolExecutorFactory.java | 61 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/thread/TestNGThreadFactory.java | 31 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/thread/ThreadExecutionException.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/thread/ThreadUtil.java | 87 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/thread/graph/GraphThreadPoolExecutor.java | 204 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/internal/thread/graph/SuiteWorkerFactory.java | 44 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/junit/IJUnitTestRunner.java | 47 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/junit/JUnit3TestClass.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/junit/JUnit3TestMethod.java | 29 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/junit/JUnit3TestRecognizer.java | 37 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/junit/JUnit4ConfigurationMethod.java | 29 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/junit/JUnit4SpockMethod.java | 47 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/junit/JUnit4TestClass.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/junit/JUnit4TestMethod.java | 48 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/junit/JUnit4TestRecognizer.java | 29 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/junit/JUnit4TestRunner.java | 256 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/junit/JUnitMethodFinder.java | 125 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/junit/JUnitTestClass.java | 146 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/junit/JUnitTestFinder.java | 51 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/junit/JUnitTestMethod.java | 39 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/junit/JUnitTestRecognizer.java | 7 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/junit/JUnitTestRunner.java | 258 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/log/TextFormatter.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/DotTestListener.java | 30 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/EmailableReporter.java | 533 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/EmailableReporter2.java | 874 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/ExitCodeListener.java | 70 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/FailedReporter.java | 321 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/Files.java | 76 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/HtmlHelper.java | 34 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/ICustomizeXmlReport.java | 13 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/JUnitReportReporter.java | 298 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/JUnitXMLReporter.java | 295 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/SuiteHTMLReporter.java | 758 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/TestHTMLReporter.java | 432 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/TextReporter.java | 204 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/VerboseReporter.java | 275 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/XMLConstants.java | 73 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/XMLReporter.java | 229 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/XMLSuiteResultWriter.java | 353 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/BannerPanel.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/BaseMultiSuitePanel.java | 41 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/BasePanel.java | 38 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/ChronologicalPanel.java | 101 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/GroupPanel.java | 48 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/INavigatorPanel.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/IPanel.java | 7 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/IgnoredMethodsPanel.java | 52 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/Main.java | 113 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/Model.java | 208 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/NavigatorPanel.java | 290 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/ReporterPanel.java | 49 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/ResultsByClass.java | 36 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/SuitePanel.java | 103 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/TestNgXmlPanel.java | 38 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/TestPanel.java | 50 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/TimesPanel.java | 162 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/util/StackTraceTools.java | 57 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/thread/IExecutorFactory.java | 71 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/thread/ITestNGThreadPoolExecutor.java | 10 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/thread/IThreadWorkerFactory.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/thread/IWorker.java | 30 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/util/RetryAnalyzerCount.java | 48 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/util/TimeUtils.java | 56 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/xml/IFileParser.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/xml/IPostProcessor.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/xml/ISuiteParser.java | 6 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/xml/LaunchSuite.java | 405 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/xml/Parser.java | 22 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/xml/SuiteGenerator.java | 57 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/xml/SuiteXmlParser.java | 28 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/xml/TestNGContentHandler.java | 813 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/xml/TestNGURLs.java | 22 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/xml/XMLParser.java | 66 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/xml/internal/Parser.java | 278 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/xml/internal/TestNamesMatcher.java | 84 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/xml/internal/XmlSuiteUtils.java | 100 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/testng-1.0.dtd.html | 206 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/resources/org/testng/header | 24 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/resources/org/testng/testng-reports.css | 326 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/resources/org/testng/testng-reports.js | 122 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/resources/org/testng/testng-reports1.css | 344 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/resources/org/testng/testng-reports2.js | 76 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/resources/testng-1.0.dtd | 213 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/resources/testng.css | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/resources/testngtasks | 1 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/groovy/test/groovy/EasyJUnitGroovySample.groovy | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/groovy/test/groovy/GroovyTest.groovy | 77 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/groovy/test/groovy/Issue2360Sample.java | 25 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/groovy/test/groovy/SpecialNameJUnitGroovySample.groovy | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/groovy/test/groovy/SpockSample.groovy | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/ConverterSample2.java | 24 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/ConverterSample4.java | 69 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/NoPackageTest.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/ReporterConfigTest.java | 24 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/groovy/transform/Internal.java | 10 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/DryRunSample.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/DryRunTest.java | 24 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/JarFileUtilsTest.java | 170 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/SampleIModule.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/ClassHelperTest.java | 151 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/ConsoleReporter.java | 40 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/DynamicGraphHelperTest.java | 259 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/DynamicGraphTest.java | 428 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/GroupsHelperTest.java | 48 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/MethodHelperTest.java | 44 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/MethodInstanceTest.java | 545 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/MethodMultiplyingInterceptor.java | 45 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/ParametersTest.java | 28 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/TestClassSample.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/TestListenerHelperTest.java | 80 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/UtilsTest.java | 44 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/conflistener/FailingAfterClass.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/conflistener/FailingAfterSuite.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/conflistener/FailingAfterTest.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/conflistener/FailingBeforeClass.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/conflistener/FailingBeforeSuite.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/conflistener/FailingBeforeTest.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/conflistener/testng.xml | 31 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/EdgeWeightTestSample1.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/EdgeWeightTestSample2.java | 32 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/FactoryTestClassSample.java | 30 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/FakeTestClass.java | 107 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/FakeWrappedFactoryMethod.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/HardDependencyTestClassSample.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/HardDependencyViaGroupsTestClassSample.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/IndependentTestClassSample.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/LotsOfEdgesTest.java | 386 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/SequentialClassA.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/SequentialClassB.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/SoftDependencyTestClassSample.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/testpackage/PackageTestClassA.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/testpackage/PackageTestClassBAbstract.java | 6 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/testpackage/PackageTestClassBB.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/invokers/ParameterHandlerTest.java | 79 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/issue1339/BabyPanda.java | 25 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/issue1339/GrandpaBear.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/issue1339/LittlePanda.java | 3 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/issue1339/PapaBear.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/issue1456/TestClassSample.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/issue2195/BaseClass.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/issue2195/TestClass.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/listeners/DummyListenerFactory.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/listeners/EmptyExecutionListener.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/listeners/TestClassDoublingupAsListenerFactory.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/listeners/TestClassWithCompositeListener.java | 10 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/listeners/TestClassWithListener.java | 6 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/listeners/TestClassWithMultipleListenerFactories.java | 6 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/listeners/parameterindex/ParameterIndexListenerTest.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/listeners/parameterindex/ParameterIndexTestListener.java | 25 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/listeners/parameterindex/TestWithProviderTest.java | 21 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/misamples/AbstractMoves.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/misamples/Batman.java | 13 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/misamples/IDance.java | 6 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/misamples/JohnTravoltaMoves.java | 7 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/misamples/MickJagger.java | 7 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/misamples/SuperHeroCapabilities.java | 10 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/objects/GuiceHelperTest.java | 69 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/objects/InstanceCreatorTest.java | 34 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/paramhandler/DataDrivenSampleTestClass.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/paramhandler/ExceptionThrowingDataDrivenSampleTestClass.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/paramhandler/FakeSuite.java | 143 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/paramhandler/FakeTestContext.java | 145 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/paramhandler/FakeTestNGMethod.java | 343 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/paramhandler/ParameterizedSampleTestClass.java | 10 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/jarfileutils/JarCreator.java | 54 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/jarfileutils/org/testng/SampleTest1.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/jarfileutils/org/testng/SampleTest2.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/jarfileutils/org/testng/SampleTest3.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/jarfileutils/org/testng/SampleTest4.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/jarfileutils/org/testng/SampleTest5.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/log4testng/LoggerTest.java | 236 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/reporters/FailedInformationOnConsoleReporter.java | 81 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/reporters/jq/TimesPanelTest.java | 32 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/util/StringsTest.java | 26 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/xml/FakeHttpXmlParser.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/xml/Issue1716TestSample.java | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/xml/ParserTest.java | 31 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/xml/SuiteXmlParserTest.java | 41 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/xml/XmlSuiteTest.java | 125 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/xml/XmlTestTest.java | 52 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/xml/internal/TestNamesMatcherTest.java | 109 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/xml/internal/XmlSuiteUtilsTest.java | 24 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/xml/issue1668/TestClassSample.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/xml/issue1674/Testclass.java | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/xml/issue435/Testclass.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/BaseDistributedTest.java | 49 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/BaseTest.java | 434 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/CheckSuitesInitializationTest.java | 38 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ClassConfigurations.java | 50 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/CommandLineTest.java | 175 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/CountSampleTest.java | 33 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/CountTest.java | 36 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/CtorCalledOnce.java | 36 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/EclipseTest.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/Exclude.java | 45 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/FileStringBufferTest.java | 30 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/GraphTest.java | 195 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/IndividualMethodsTest.java | 28 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/InvocationAndSuccessPercentageTest.java | 91 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/InvokedMethodListener.java | 24 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/InvokedMethodNameListener.java | 209 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/JUnit4Test.java | 75 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/JUnitTest1.java | 115 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/JUnitTestClassLoader.java | 119 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/MethodTest.java | 47 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/Misc.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/NestedStaticSampleTest.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/NestedStaticTest.java | 37 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ParameterConstructorTest.java | 51 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ReflectionHelperTest.java | 72 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ReporterApiTest.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ReturnValueSampleTest.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ReturnValueTest.java | 57 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/SampleInheritance.java | 41 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/SerializationTest.java | 26 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/SimpleBaseTest.java | 443 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/StaticTest.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/Test1.java | 147 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/Test2.java | 73 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/TestClassContainerForGitHubIssue1360.java | 57 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/TestHelper.java | 56 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/abstractconfmethod/B.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/abstractconfmethod/C.java | 13 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/abstractconfmethod/foo/A.java | 5 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/abstractmethods/AbstractTest.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/abstractmethods/CRUDTest.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/abstractmethods/CRUDTest2.java | 10 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/access/BasePrivateAccessConfigurationMethods.java | 24 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/access/PrivateAccessConfigurationMethods.java | 49 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/aftergroups/AfterGroupsBehaviorTest.java | 49 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/aftergroups/issue165/TestclassSampleWithFailedMember.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/aftergroups/issue165/TestclassSampleWithSkippedMember.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/aftergroups/issue1880/LocalConfigListener.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/aftergroups/issue1880/TestClassSample.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/alwaysrun/AlwaysRunAfter1.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/alwaysrun/AlwaysRunAfter2.java | 24 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/alwaysrun/AlwaysRunAfter3.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/alwaysrun/AlwaysRunBefore1.java | 51 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/alwaysrun/AlwaysRunTest.java | 57 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/AnnotationTransformerClassInvocationSampleTest.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/AnnotationTransformerClassSampleTest.java | 22 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/AnnotationTransformerDataProviderSampleTest.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/AnnotationTransformerFactorySampleTest.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/AnnotationTransformerInTestngXml.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/AnnotationTransformerInvocationCountTest.java | 33 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/AnnotationTransformerSampleTest.java | 40 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/AnnotationTransformerTest.java | 326 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/ConfigurationSampleTest.java | 32 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/ConfigurationTransformer.java | 36 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/DataProviderTransformer.java | 34 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/FactoryTransformer.java | 51 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/MyListenerTransformer.java | 38 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/MyParamTransformer.java | 30 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/MySuiteListener.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/MySuiteListener2.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/MyTimeOutTransformer.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/MyTransformer.java | 39 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/SimpleTest.java | 24 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/issue1790/TestClassSample1.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/issue1790/TestClassSample2.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/issue1790/TransformerImpl.java | 40 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/issue2312/RetryListener.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/issue2312/SampleTestClass.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/issue2536/data/nested/ClassContainer.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/issue2536/data/normal/NonGroupClass1.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/issue2536/data/normal/NonGroupClass2.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/issue2536/listeners/ExternalGroupManager.java | 54 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ant/AntSystemPropertySet.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ant/DontOverrideSuiteNameTest.java | 13 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ant/MultipleThreadTest.java | 132 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ant/NoPackageTest.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ant/TestCommandLineArgs.java | 40 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/attributes/AttributeTest.java | 35 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/attributes/issue2346/BaseTest.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/attributes/issue2346/IssueTest.java | 22 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/attributes/issue2346/LocalTestListener.java | 30 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/attributes/issue2346/SingleTest.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/beforegroups/BeforeGroupsTest.java | 152 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/beforegroups/issue118/TestclassSample.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/beforegroups/issue1694/BaseClassWithBeforeGroups.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/beforegroups/issue1694/ChildClassA.java | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/beforegroups/issue1694/ChildClassB.java | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/beforegroups/issue1694/ChildClassC.java | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/beforegroups/issue1694/ChildClassD.java | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/beforegroups/issue1694/ChildClassE.java | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/beforegroups/issue1694/ChildClassF.java | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/beforegroups/issue2229/AnotherTestClassSample.java | 52 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/beforegroups/issue2229/TestClassSample.java | 93 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/beforegroups/issue346/SampleTestClass.java | 35 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/bug90/Bug90Test.java | 28 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/bug90/Sample.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/bug92/Bug92Test.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/bug92/TestAlpha.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/bug92/TestBase.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/bug92/TestBravo.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/classgroup/First.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/classgroup/Second.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/cli/github1517/ExitCodeListenerBehaviorTest.java | 26 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/cli/github1517/TestClassWithConfigFailureSample.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/cli/github1517/TestClassWithConfigSkipAndFailureSample.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/cli/github1517/TestClassWithConfigSkipSample.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/commandline/CommandLineOverridesXml.java | 108 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/commandline/Issue987TestSample.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/commandline/OverrideSampleTest.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/commandline/issue341/LocalLogAggregator.java | 22 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/commandline/issue341/TestSampleA.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/commandline/issue341/TestSampleB.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/conffailure/ClassWithFailedBeforeSuite.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/conffailure/ClassWithFailedBeforeSuiteVerification.java | 26 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/conffailure/ClassWithFailedBeforeTestClass.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/conffailure/ClassWithFailedBeforeTestClassVerification.java | 31 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/conffailure/ConfigurationFailure.java | 55 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/conffailure/github990/AbstractBaseSample.java | 24 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/conffailure/github990/ChildClassSample.java | 6 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/AfterMethodWithGroupFiltersSampleTest.java | 40 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/AfterMethodWithGroupFiltersTest.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/Base.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/Base3.java | 21 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/BaseBeforeTestOrdering.java | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/BaseGroupsASampleTest.java | 10 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/BaseGroupsBSampleTest.java | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/BaseGroupsTest.java | 56 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/BeforeClassTest.java | 51 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/BeforeClassThreadA.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/BeforeClassThreadB.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/BeforeMethodTest.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/BeforeMethodWithGroupFiltersSampleTest.java | 41 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/BeforeMethodWithGroupFiltersTest.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/BeforeTestOrdering1Test.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/BeforeTestOrdering2Test.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/BeforeTestOrderingTest.java | 56 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationBaseTest.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationDisabledSampleTest.java | 26 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationGroupBothSampleTest.java | 45 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationGroupDataProviderSampleTest.java | 38 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationGroupInvocationCountSampleTest.java | 32 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationGroupIteratorDataProviderSampleTest.java | 40 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationGroups1SampleTest.java | 46 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationGroups2SampleTest.java | 60 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationGroups3SampleTest.java | 56 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationGroups4SampleTest.java | 39 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationGroups5SampleTest.java | 55 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationGroups6SampleTest.java | 47 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationGroups7SampleTest.java | 38 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationGroups8SampleTest.java | 49 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationGroupsTest.java | 40 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationInheritGroupsSampleTest.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationListenerSampleTest.java | 29 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationListenerTest.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationTest.java | 32 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationWithParameters.java | 22 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/GroupsTest.java | 57 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/MultipleBeforeGroupTest.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ReflectMethodParametrizedConfigurationMethodTest.java | 44 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/SingleConfigurationTest.java | 37 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/SuiteFactoryOnceSample1Test.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/SuiteFactoryOnceSample2Test.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/SuiteFactoryOnceTest.java | 21 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/github1338/BaseGitHub1338Sample.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/github1338/FirstGitHub1338Sample.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/github1338/SecondGitHub1338Sample.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/github1338/ThirdGitHub1338Sample.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/github1625/TestRunnerIssue1625.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/github1625/TestclassSampleUsingMocks.java | 35 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/github1625/TestclassSampleWithoutUsingMocks.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/github1700/BaseClassSample.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/github1700/ChildClassTestSample1.java | 10 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/github1700/ChildClassTestSample2.java | 10 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/github1700/RunTest.java | 21 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue1035/InvocationTracker.java | 45 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue1035/MyFactory.java | 24 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue1035/TestclassExample.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue1753/ChildClassSample.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue1753/IssueTest.java | 32 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue1753/LocalReporter.java | 37 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue1753/ParentClassSample.java | 24 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue2209/IssueTest.java | 59 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue2254/IssueTest.java | 63 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue2254/samples/SampleTestCase.java | 42 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue2400/DataStore.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue2400/IssueTest.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue2400/TestNGTestClass.java | 65 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue2400/TestRunnerCapabilities.java | 53 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue2426/IssueTest.java | 22 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue2426/MyMethodListener.java | 45 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue2426/SampleTestCase.java | 54 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue2432/Base.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue2432/IssueTest.java | 43 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue2432/Test1.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/sample/BaseSuiteTestSample.java | 21 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/sample/ConfigurationTestSample.java | 96 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/sample/ExternalConfigurationClassSample.java | 52 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/sample/MethodCallOrderTestSample.java | 74 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/sample/SuiteTestSample.java | 22 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configurationfailurepolicy/ClassWithFailedBeforeClassMethod.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configurationfailurepolicy/ClassWithFailedBeforeClassMethodAndAfterClass.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configurationfailurepolicy/ClassWithFailedBeforeClassMethodAndBeforeGroupsAfterClassAfterGroups.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configurationfailurepolicy/ClassWithFailedBeforeClassMethodAndBeforeMethodAfterMethodAfterClass.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configurationfailurepolicy/ClassWithFailedBeforeMethod.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configurationfailurepolicy/ClassWithFailedBeforeMethodAndMultipleInvocations.java | 24 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configurationfailurepolicy/ClassWithFailedBeforeMethodAndMultipleTests.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configurationfailurepolicy/ClassWithSkippingBeforeMethod.java | 24 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configurationfailurepolicy/ExtendsClassWithFailedBeforeClassMethod.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configurationfailurepolicy/ExtendsClassWithFailedBeforeMethod.java | 13 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configurationfailurepolicy/FactoryClassWithFailedBeforeClassMethod.java | 13 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configurationfailurepolicy/FactoryClassWithFailedBeforeMethod.java | 13 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configurationfailurepolicy/FactoryClassWithFailedBeforeMethodAndMultipleInvocations.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configurationfailurepolicy/FailurePolicyTest.java | 181 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/converter/ConverterSample1.java | 21 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/custom/CustomAttributeTest.java | 39 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/custom/CustomAttributesListener.java | 24 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/custom/CustomAttributesTransformer.java | 45 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/custom/TestClassSample.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/cyclic/AbstractGenericTests.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/cyclic/BaseIntegrationTest.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/cyclic/HibernateConcreteTests.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/cyclic/SomeConcreteTests.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/AnnotatedInheritedDataProviderBaseSample.java | 6 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/AnnotatedInheritedDataProviderSample.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/BooleanDataProviderSample.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/ClassDataProviderSample.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/ClassSample.java | 34 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/ConfigurationAndDataProvidersSample.java | 53 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/ConstructorInjectionProvider.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/ConstructorOrMethodSample.java | 51 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/ConstructorSample.java | 36 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/CreateDataTest.java | 25 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/DataProviderAsTestSample.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/DataProviderIntegrationSample.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/DataProviderRetryAnalyzer.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/DataProviderRetryTest.java | 26 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/DataProviderTest.java | 409 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/DataProviderWithErrorSample.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/DependentSample.java | 26 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/DuplicateDataProviderSample.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/EmptyDataProviderSample.java | 30 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/ExplicitDataProviderNameSample.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/FailedDataProviderSample.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/FailingDataProviderSample.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/FailingDataProviderTest.java | 48 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/FailingIterableDataProvider.java | 38 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/FailingIterableDataProviderTest.java | 47 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/FieldInjectionProvider.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/GitHub513Sample.java | 22 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/Github1509TestClassSample.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/ITestNGMethodSample.java | 21 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/IndicesFactorySample.java | 39 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/IndicesSample.java | 33 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/IndicesTest.java | 72 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/InheritedDataProvider.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/InheritedDataProviderSample.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/InnexistentDataProviderSample.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/InstanceDataProviderSample.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/InstanceDataProviderSampleFactory.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/InterceptorTest.java | 79 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/Jdk14IteratorSample.java | 13 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/MethodSample.java | 46 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/NonStaticProvider.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/OneDimDataProviderSample.java | 50 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/ParallelDataProvider2Sample.java | 26 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/ParallelDataProviderSample.java | 22 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/RawIteratorDataProviderSample.java | 30 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/StaticDataProviderSampleSample.java | 30 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/StaticDataProviderSampleWithoutGuiceSample.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/StaticProvider.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/TestContextSample.java | 37 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/TestContextTest.java | 46 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/TestInstanceFactory.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/TestInstanceSample.java | 39 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/TestNG411Sample.java | 49 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/UnnamedDataProviderSample.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/VarArgsDataProviderSample.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue128/DataProviderParametersMismatchTest.java | 52 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue128/GitHub128Sample.java | 63 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1691/DataProviderDefinitionAtClassLevelAndNoTestMethodUsage.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1691/DataProviderDefinitionCompletelyProvidedAtClassLevel.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1691/DataProviderDefinitionCompletelyProvidedAtClassLevelAndPartiallyAtMethodLevel.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1691/DataProviderDefinitionProvidedPartiallyAtClassLevel.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1691/SampleDataProvider.java | 22 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1691/withinheritance/BaseClassWithFullDefinitionOfDataProviderInClassLevel.java | 7 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1691/withinheritance/BaseClassWithFullDefinitionOfDataProviderInTestMethod.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1691/withinheritance/BaseClassWithPartialDefinitionOfDataProviderInTestMethod.java | 13 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1691/withinheritance/ChildClassHasFullDefinitionOfDataProviderAtClassLevel.java | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1691/withinheritance/ChildClassHasPartialDefinitionOfDataProviderAtClassLevel.java | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1691/withinheritance/ChildClassWithNoDataProviderInformationInTestMethod.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1987/BaseClassSample.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1987/DataProviderInBaseClass.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1987/DataProviderInDifferentClass.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1987/DataProviderInSameClass.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1987/DataProviderTrackingListener.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1987/IssueTest.java | 39 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2111/CountingListener.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2111/DataProviderHouse.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2111/LocalDataProviderInterceptor.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2111/TestClassExample.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2111/TestClassExamplePoweredByFactory.java | 13 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2111/TestClassExamplePoweredByFactoryUsingListener.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2111/TestClassSampleUsingListener.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2157/TestClassWithDataProviderThatThrowsExceptions.java | 49 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue217/IssueTest.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue217/SampleTestCase.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2255/IssueTest.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2255/SampleTestCase.java | 41 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2267/CustomListener.java | 25 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2267/IssueTest.java | 21 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2267/SampleTestCase.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2327/IssueTest.java | 26 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2327/SampleTestCase.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2504/IssueTest.java | 25 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2504/SampleTestCase.java | 26 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2504/SampleTestCaseListener.java | 24 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2565/Data.java | 22 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2565/SampleTestUsingConsumer.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2565/SampleTestUsingFunction.java | 28 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2565/SampleTestUsingPredicate.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2565/SampleTestUsingSupplier.java | 24 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/defaultmethods/DefaultMethodTest.java | 93 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/defaultmethods/InterfaceA.java | 25 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/defaultmethods/TestA.java | 3 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/defaultmethods/TestB.java | 3 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/defaultmethods/TestC.java | 3 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/BaseOrderMethodTest.java | 42 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/C1.java | 13 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/C2.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/ClassDependsOnGroups.java | 30 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/ClassWide1Test.java | 22 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/ClassWide2Test.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/DepBugSampleTest.java | 39 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/DepBugVerifyTest.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/DependencyFixTest.java | 25 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/DependentAlwaysRunTest.java | 45 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/DependentOnGroup1AlwaysRunSampleTest.java | 31 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/DependentOnGroup2AlwaysRunSampleTest.java | 34 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/DependentOnMethod1AlwaysRunSampleTest.java | 31 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/DependentTest.java | 230 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/DependentWithDataProviderSampleTest.java | 55 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/DependsOnProtectedMethodTest.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/DepthDependencyTest.java | 21 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/DifferentClassDependsOnGroupsTest1.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/DifferentClassDependsOnGroupsTest2.java | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/GitHub261AlphaSample.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/GitHub261BetaSample.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/GitHub261Test.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/GroupByInstancesSampleTest.java | 45 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/GroupByInstancesTest.java | 42 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/ImplicitGroupInclusion2SampleTest.java | 39 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/ImplicitGroupInclusion3SampleTest.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/ImplicitGroupInclusion4SampleTest.java | 47 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/ImplicitGroupInclusionSampleTest.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/ImplicitGroupInclusionTest.java | 78 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/ImplicitMethodInclusionSampleTest.java | 13 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/InstanceSkipSampleTest.java | 51 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/MissingGroupSampleTest.java | 33 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/MissingGroupTest.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/MissingMethodSampleTest.java | 29 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/MissingMethodTest.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/MultiGroup1SampleTest.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/MultiGroup2SampleTest.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/MultiGroupTest.java | 22 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/MultipleDependentSampleTest.java | 21 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/OrderMethodTest.java | 28 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/SD2.java | 34 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/SampleDependent1.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/SampleDependentConfigurationMethods.java | 26 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/SampleDependentMethods.java | 56 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/SampleDependentMethods2.java | 56 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/SampleDependentMethods3.java | 45 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/SampleDependentMethods4.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/SampleDependentMethods5.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/SampleDependentMethods6.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/SampleDependentTest.java | 39 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/Test1.java | 3 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/functionality1/Config.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/functionality1/Test1.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/functionality1/Test2.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/github1156/ASample.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/github1156/BSample.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/github1380/GitHub1380Sample.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/github1380/GitHub1380Sample2.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/github1380/GitHub1380Sample3.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/github1380/GitHub1380Sample4.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/issue1648/ClassASample.java | 28 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/issue1648/ClassBSample.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/issue1648/LogExtractor.java | 7 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/issue1648/TestOneSample.java | 3 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/issue1648/TestRunner.java | 39 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/issue1648/TestTwoSample.java | 3 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/xml/GroupDependencySampleTest.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/xml/GroupDependencyTest.java | 66 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependsongroup/DependsOnGroupsTest.java | 30 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependsongroup/FirstSampleTest.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependsongroup/SecondSampleTest.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependsongroup/TestFixture1.java | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependsongroup/TestFixture2.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependsongroup/ZeroSampleTest.java | 13 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependsongroup/suite.xml | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/enable/A.java | 73 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/enable/B.java | 74 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/enable/C.java | 74 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/enable/EnableTest.java | 72 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/enable/Issue420BaseTestCase.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/enable/Issue420FirstSample.java | 10 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/enable/Issue420SecondSample.java | 10 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/expectedexceptions/ExpectedExceptionsTest.java | 44 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/expectedexceptions/ParametersExceptionTest.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/expectedexceptions/SampleExceptions.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/expectedexceptions/SampleExceptions2.java | 53 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/expectedexceptions/WrappedExpectedExceptionTest.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/expectedexceptions/github1409/TestClassSample.java | 10 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/expectedexceptions/issue2074/FailingInterruptTest.java | 21 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/expectedexceptions/issue2074/IssueTest.java | 25 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/expectedexceptions/issue2235/ExampleTestCase.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/expectedexceptions/issue2235/IssueTest.java | 25 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/ArrayEmptyFactorySample.java | 22 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/BadMethodReturnTypeFactory.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/BaseFactory.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/BaseFactorySample.java | 29 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/ChildFactory.java | 3 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/DisabledFactory.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/DisabledFactoryTest.java | 24 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/DoubleFactory.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/EmptyFactoryDataProviderTest.java | 25 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/Factory2Test.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryAndTestMethodTest.java | 37 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryBaseSample.java | 25 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryDataProviderNotStaticSample.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryDataProviderSample.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryDataProviderStaticErrorSample.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryDataProviderStaticSample.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryDataProviderTest.java | 53 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryDataProviderWithNoArgCtorErrorSample.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryFailureNoInstancesSample.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryFailureSample.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryFailureTest.java | 38 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryInSeparateClassTest.java | 45 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryInSuperClassTest.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryIntegrationTest.java | 68 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryInterleavingTest.java | 35 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryOrderMainTest.java | 25 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryTest.java | 28 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryTest2.java | 33 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryWithDataProvider.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryWithDataProviderTest.java | 45 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryWithInstanceInfo2Sample.java | 29 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryWithInstanceInfoTest.java | 34 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/GitHub876Sample.java | 47 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/InterleavingFactorySample.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/InterleavingSample.java | 42 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/IteratorEmptyFactorySample.java | 24 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/MySample.java | 32 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/NestedFactorySample.java | 43 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/NestedStaticFactorySample.java | 44 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/NonPublicFactory.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/NotStaticDataProvider.java | 13 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/OddSample.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/OrderFactory.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/OrderSample.java | 32 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/StaticDataProvider.java | 13 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/TestClassAnnotationTest.java | 31 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/VerifyFactoryTest.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/VerifyFactoryWithInstanceInfoTest.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/classconf/XClassOrderWithFactory.java | 31 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/classconf/XClassOrderWithFactoryTest.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github1083/ArrayFactorySample.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github1083/ConstructorFactorySample.java | 29 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github1083/DataProviderArrayFactorySample.java | 33 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github1083/DataProviderInstanceInfoFactorySample.java | 38 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github1083/GitHub1083Test.java | 47 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github1083/InstanceInfoFactorySample.java | 32 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github1131/EmptyConstructorSample.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github1131/GitHub1131Test.java | 54 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github1131/IntConstructorSample.java | 25 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github1131/StringConstructorSample.java | 25 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github1631/DataProviderTransformer.java | 46 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github1631/ExternalDataProviders.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github1631/FactoryWithExternalDataProviderTests.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github1631/FactoryWithLocalDataProviderTests.java | 25 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github1631/GitHub1631Tests.java | 31 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github2428/FactoryTest.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github2428/IssueTest.java | 21 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github2428/Reporter.java | 29 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github328/ExcludedFactory.java | 24 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github328/GitHub328Test.java | 26 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/issue1041/FactoryAnnotatedConstructorExample.java | 52 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/issue1041/IssueTest.java | 29 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/issue1041/ResultExtractor.java | 47 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/issue1745/Github1745Test.java | 28 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/issue1745/SuiteXmlPoweredFactoryTest.java | 28 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/issue1745/TestClassSample.java | 40 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/issue1770/SampleTestBase.java | 13 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/issue1770/SampleTestFour.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/issue1924/IssueTest.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/issue1924/TestclassSample.java | 26 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/issue326/IssueTest.java | 54 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/issue326/LocalTrackingListener.java | 48 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/issue326/SampleTestClass.java | 55 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/issue553/Base.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/issue553/Concrete.java | 3 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/issue553/IssueTest.java | 24 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/nested/AbstractBaseSample.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/nested/BaseFactorySample.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/nested/FactoryWithAnonymousTestsSample.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/nested/GitHub1307Test.java | 25 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/sample/Factory2Sample.java | 66 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/sample/Factory2TestSample.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/FailedReporter2SampleTest.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/FailedReporterLocalTestClass.java | 25 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/FailedReporterParametersTest.java | 138 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/FailedReporterSampleTest.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/FailedReporterScenariosTest.java | 87 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/FailedReporterTest.java | 207 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue1297/depend/PassDependsOnFailureSample.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue1297/depend_on_group/GroupDependFailureSample.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue1297/depend_on_group/GroupDependPassSample.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue1297/depend_on_group/GroupDependSampleBase.java | 21 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue1297/depend_on_test/PassDependsOnPassSample.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue1297/groups/GroupsFailureSample.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue1297/groups/GroupsPassSample.java | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue1297/groups/GroupsSampleBase.java | 21 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue1297/inheritance/InheritanceFailureSample.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue1297/inheritance/InheritancePassSample.java | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue1297/inheritance/SampleBase.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue1297/straightforward/AllPassSample.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue1297/straightforward/FailureSample.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue2517/DataProviderWithFactoryFailedReporterSample.java | 28 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue2517/DataProviderWithFactoryFailedReporterTest.java | 54 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue2521/DataProviderWithFactoryMultiFailedReporterSample.java | 35 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue2521/DataProviderWithFactoryMultiFailedReporterTest.java | 54 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failures/Base0.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failures/Base1.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failures/BaseFailuresTest.java | 82 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failures/Child.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failures/DependentTest.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failures/FailuresTest.java | 105 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failures/issue1930/PrimeNumberChecker.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failures/issue1930/SimpleCliStatus.java | 26 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failures/issue1930/TestBase.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failures/issue1930/TestClassSample.java | 26 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1336/BaseClass.java | 41 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1336/TestNG1.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1336/TestNG1NoPriority.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1336/TestNG2.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1336/TestNG2NoPriority.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1336/TestNG3.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1336/TestNG3NoPriority.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1362/AfterGroupsTestInvolvingInterceptors.java | 43 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1362/LocalMethodInterceptor.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1362/TestSample.java | 30 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1405/JUnitTestClassSample.java | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1405/TestClassSample.java | 10 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1405/TestExclusionOfMainMethod.java | 26 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1417/AnotherTestClassSample.java | 46 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1417/TestClassSample.java | 21 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1417/TestParamsInjectionInBeforeClass.java | 24 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1417/YetAnotherTestClassSample.java | 48 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1461/MemoryLeakTestNg.java | 74 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1461/MyTestClassWithGlobalReferenceCounterSample.java | 37 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1490/DataProviderHouse.java | 28 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1490/FactoryPoweredDataProviderWithListenerAnnotationSample.java | 28 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1490/FactoryPoweredDataProviderWithoutListenerAnnotationSample.java | 25 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1490/InstanceBasedDataProviderWithListenerAnnotationSample.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1490/SimpleDataProviderWithListenerAnnotationSample.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1490/SimpleDataProviderWithListenerAnnotationSample1.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1490/SimpleDataProviderWithoutListenerAnnotationSample.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1490/StaticDataProviderWithListenerAnnotationSample.java | 28 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1490/TestInfo.java | 13 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1490/TwoFactoriesShareSameDataProviderSampleOne.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1490/TwoFactoriesShareSameDataProviderSampleTwo.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1490/TwoTestMethodsShareSameDataProviderSample.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1490/TwoTestMethodsShareSameDataProviderSampleTwo.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1490/VerifyDataProviderListener.java | 169 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github765/DuplicateCallsSample.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github765/ExcludeSyntheticMethodsFromTemplateCallsTest.java | 22 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github765/TestTemplate.java | 6 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github799/EnsureInstancesAreOrderedViaFactories.java | 63 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github799/InstanceTestSample.java | 37 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github799/MethodsTestSample.java | 28 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github799/ReverseOrderTestSample.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github799/TestSample.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/graph/GraphVisualiserTest.java | 38 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/graph/LocalVisualiser.java | 31 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/graph/TestSampleWithListener.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/graph/TestSampleWithoutListener.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groupbug/GroupBugTest.java | 35 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groupbug/ITCaseOne.java | 31 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groupbug/ITCaseTwo.java | 30 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groupinvocation/DummyTest.java | 36 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groupinvocation/DummyTest2.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groupinvocation/FailingBeforeGroupMethod.java | 10 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groupinvocation/GroupConfiguration.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groupinvocation/GroupSuiteSampleTest.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groupinvocation/GroupSuiteSampleTest2.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groupinvocation/GroupSuiteTest.java | 158 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groupinvocation/InvokerTest.java | 55 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groupinvocation/testng.xml | 34 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groups/issue182/ChildTest.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groups/issue182/IssueTest.java | 28 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groups/issue182/LocalListener.java | 24 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groups/issue182/ParentTest.java | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groups/issue1834/IssueTest.java | 49 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groups/issue1834/OutputGatheringListener.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groups/issue1834/TestSample.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groups/issue2152/IssueTest.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groups/issue2152/TestClassSample.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groups/issue2232/IssueTest.java | 85 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groups/issue2232/samples/SampleTest.java | 34 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groups/issue2232/samples/SampleTest2.java | 37 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/ExampleSingleton.java | 7 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/FakeInjector.java | 136 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/Guice1Test.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/Guice2Test.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/GuiceBase.java | 6 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/GuiceExampleModule.java | 13 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/GuiceInheritanceTest.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/GuiceModuleFactoryTest.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/GuiceNoModuleTest.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/GuiceParentModule.java | 21 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/GuiceParentModuleTest.java | 24 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/GuiceTest.java | 100 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/GuiceTestModule.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/ISingleton.java | 6 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/ModuleFactory.java | 22 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/MyContext.java | 6 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/MyContextImpl.java | 10 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/MyService.java | 6 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/MyServiceProvider.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/MySession.java | 3 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue2343/Person.java | 10 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue2343/SampleA.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue2343/SampleB.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue2343/modules/ParentModule.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue2355/AnotherParentModule.java | 38 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue2427/Test1.java | 13 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue2427/Test2.java | 13 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue2427/modules/TestAbstractModule.java | 28 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue2427/modules/TestModuleOne.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue2427/modules/TestModuleTwo.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue2427/modules/TestParentConfigModule.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue2570/GuiceModule.java | 37 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue2570/GuicePoweredConstructorInjectedRetry.java | 33 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue2570/GuicePoweredConstructorInjectedRetryForDPTest.java | 30 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue2570/GuicePoweredSetterInjectedRetry.java | 33 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue2570/SampleTestClass.java | 28 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue279/Car.java | 7 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue279/DummyReporter.java | 29 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue279/DummyReporterWithoutModuleFactory.java | 29 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue279/Greeter.java | 6 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue279/IssueTest.java | 54 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue279/MyListener.java | 28 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue279/MyListenerWithoutModuleFactory.java | 28 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue279/SampleModule.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue279/TestClassWithListener.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue279/TestClassWithoutListener.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue279/TestDIFactory.java | 13 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue279/TextGreeter.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue279/Vehicle.java | 5 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/jitbinding/FirstModuleSample.java | 25 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/jitbinding/JitBindingTest.java | 21 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/jitbinding/SecondModuleSample.java | 25 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/BaseConfigurable.java | 37 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/ConfigurableFailureTest.java | 21 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/ConfigurableListener.java | 21 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/ConfigurableSuccessTest.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/ConfigurableSuccessWithListenerTest.java | 44 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/HookFailureTest.java | 22 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/HookListener.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/HookSuccess599Test.java | 41 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/HookSuccess862Test.java | 37 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/HookSuccessTest.java | 35 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/HookSuccessWithListenerTest.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/HookableTest.java | 127 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/issue2251/AbstractBaseTestCase.java | 41 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/issue2251/IssueTest.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/issue2251/SampleTestCase.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/issue2257/IssueTest.java | 21 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/issue2257/TestClassSample.java | 60 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/issue2266/IssueTest.java | 22 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/issue2266/TestClassSample.java | 32 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ignore/ChildClassTestSample.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ignore/ChildSample.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ignore/IgnoreClassParentSample.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ignore/IgnoreClassSample.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ignore/IgnoreTest.java | 86 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ignore/IgnoreTestSample.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ignore/ParentClassTestSample.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ignore/ParentSample.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ignore/ignorePackage/IgnorePackageSample.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ignore/ignorePackage/package-info.java | 4 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ignore/ignorePackage/subPackage/SubPackageSample.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ignore/issue2396/FirstTest.java | 13 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ignore/issue2613/LocalClassListener.java | 24 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ignore/issue2613/SampleTestClassWithEnabledDisabledIgnoredTestMethods.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ignore/issue2613/SampleTestClassWithEnabledIgnoredTestMethods.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/BaseClassScope.java | 6 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/Child_1.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/ClassScopeTest.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/DChild_2.java | 31 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/InheritanceConfigTest.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/VerifyTest.java | 28 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/ZBase_0.java | 30 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/github949/ChildClassSample.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/github949/ChildClassWithAlwasyRunEnabledSample.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/github949/CommonBaseClass.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/github949/Github949Test.java | 30 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/github949/ParentClassSample.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/github949/ParentClassWithAlwasyRunEnabledSample.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/github980/ChildClassSample.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/github980/Github980Test.java | 35 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/github980/ParentClassSample.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/issue2489/IssueTest.java | 45 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/issue2489/tests/BaseClassA.java | 36 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/issue2489/tests/TestClassA.java | 40 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/testng234/ChildTest.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/testng234/ParentTest.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/testng234/PolymorphicFailureTest.java | 24 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/testng471/Class1.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/testng471/Class2.java | 24 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/testng471/Class3.java | 28 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/testng471/SuperClass1.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/testng471/SuperClass2.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/testng471/TestNG471.java | 50 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/testng739/A.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/testng739/B.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/testng739/BaseClass.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/testng739/TestNG739.java | 26 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inject/Github1298Test.java | 22 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inject/Github1649Test.java | 111 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inject/HappyPathNativeInjectionTestSample.java | 54 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inject/InjectAfterMethodWithTestResultSampleTest.java | 46 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inject/InjectAfterMethodWithTestResultTest.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inject/InjectBeforeAndAfterMethodsWithTestResultSampleTest.java | 67 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inject/InjectBeforeMethodTest.java | 42 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inject/InjectDataProviderTest.java | 46 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inject/InjectTestContextTest.java | 30 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inject/InjectTestResultTest.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inject/NativeInjectionTest.java | 92 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inject/NativeInjectionTestSamples.java | 61 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inject/NegativeNativeInjectionTestSample.java | 13 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inject/NoInjectionTest.java | 35 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inject/Sample.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/interleavedorder/BaseTestClass.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/interleavedorder/InterleavedInvocationTest.java | 45 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/interleavedorder/TestChild1.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/interleavedorder/TestChild2.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/interleavedorder/testng-order.xml | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/DataProviderBase.java | 24 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/DataProviderFalseFalseTest.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/DataProviderFalseTrueTest.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/DataProviderTrueFalseTest.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/DataProviderTrueTrueTest.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/FailedInvocationCount.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/FailedInvocationCount2.java | 29 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/FailedInvocationCountTest.java | 44 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/FirstAndLastTimeTest.java | 174 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/InvocationBase.java | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/InvocationCountFalseFalseTest.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/InvocationCountFalseTrueTest.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/InvocationCountTrueFalseTest.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/InvocationCountTrueTrueTest.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/issue1719/DummyReporter.java | 53 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/issue1719/IssueTest.java | 22 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/issue1719/TestclassSample.java | 28 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/issue426/SampleTestClassWithNoThreadPoolSizeDefined.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/issue426/SampleTestClassWithThreadPoolSizeDefined.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invokedmethodlistener/A.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invokedmethodlistener/B.java | 13 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invokedmethodlistener/Base.java | 54 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invokedmethodlistener/C.java | 13 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invokedmethodlistener/Failure.java | 7 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invokedmethodlistener/InvokedMethodListener.java | 24 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invokedmethodlistener/InvokedMethodListenerTest.java | 139 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invokedmethodlistener/InvokedMethodNameListener.java | 43 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invokedmethodlistener/MyListener.java | 57 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invokedmethodlistener/Sample.java | 32 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invokedmethodlistener/Sample2.java | 35 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invokedmethodlistener/Success.java | 7 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/issue107/Issue107Test.java | 52 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/issue107/MySuiteListener.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/issue107/TestTestngCounter.java | 26 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/issue1430/TestFileToClass.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/issue565/Issue565Test.java | 40 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/issue565/deadlock/ClassInGroupB.java | 13 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/issue565/deadlock/GeneratedClassFactory.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/issue565/deadlock/GeneratedClassInGroupA.java | 33 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/jarpackages/JarPackagesTest.java | 48 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/jarpackages/testng.xml | 10 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/jarpackages/tests/A.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/jarpackages/tests/B.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/jason/Main.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/jason/MainBase.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/jason/MainTest.java | 28 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/BaseTest.java | 40 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/JUnitConstructorTest.java | 35 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/JUnitEmptyTest.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/MainSuite.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/SetNameTest.java | 25 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/SetUpExceptionSampleTest.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/SetUpExceptionTest.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/Suite1.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/Suite2.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/Suite3.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/Suite4.java | 13 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/TestAa.java | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/TestAb.java | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/TestAc.java | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/TestAd.java | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/TestAe.java | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/TestAf.java | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/testsetup/ATest.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/testsetup/Data.java | 5 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/testsetup/LayerATestSuite.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/testsetup/LoggingTestSuite.java | 21 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/testsetup/SmokeSuite.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/testsetup/TestSuiteContainerWrapper.java | 40 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit4/BeforeClassJUnit4Sample.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit4/ClassRuleJUnit4Sample.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit4/InheritedTest.java | 4 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit4/JUnit4Child.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit4/JUnit4ParameterizedTest.java | 54 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit4/JUnit4Sample1.java | 10 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit4/JUnit4Sample2.java | 34 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit4/JUnit4SampleSuite.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit4/listeners/Issue323JUnitInvocationListener.java | 21 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit4/listeners/Issue323TestRunner.java | 21 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit4/listeners/Issue323TestSample.java | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junitreports/Issue1262TestSample.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junitreports/JUnitReportsTest.java | 218 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junitreports/LocalJUnitReportReporter.java | 31 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junitreports/LocalJUnitXMLReporter.java | 45 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junitreports/SimpleTestSample.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junitreports/TestClassContainerForGithubIssue1265.java | 47 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junitreports/TestSuiteHandler.java | 52 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junitreports/Testcase.java | 87 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junitreports/Testsuite.java | 96 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junitreports/TestsuiteRetriever.java | 5 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junitreports/TestsuiteXmlParser.java | 22 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junitreports/issue2124/TestClassSample.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junitreports/issue993/SampleTestClass.java | 30 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/justin/BaseTestCase.java | 49 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/justin/MonthTest.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/AggregateSampleTest.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/AlterSuiteListenerTest.java | 141 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/BaseAggregate.java | 6 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/BaseListener.java | 31 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/BaseWithListener.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ClassListenerSample.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ConfigurationListenerFailSampleTest.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ConfigurationListenerSkipSampleTest.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ConfigurationListenerSucceedSampleTest.java | 13 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ConfigurationListenerTest.java | 61 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/Derived1.java | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/Derived2.java | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/Derived3.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/EndMillisShouldNotBeZeroTest.java | 47 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ExecutionListener1SampleTest.java | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ExecutionListener2SampleTest.java | 10 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ExecutionListener3SampleTest.java | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ExecutionListenerAndSuiteListener.java | 32 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ExecutionListenerAndSuiteListenerTest.java | 22 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ExecutionListenerTest.java | 64 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/FailingSampleTest.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/GitHub911Listener.java | 51 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/GitHub911Sample.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/InterceptorInvokeTwiceSimulateListener.java | 26 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/L1.java | 3 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/L2.java | 3 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/L3.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/LListener.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/LSampleTest.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ListenerAssert.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ListenerInXmlTest.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ListenerTest.java | 433 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ListenersTest.java | 139 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/MultiListener.java | 153 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/MyClassListener.java | 37 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/MyInvokedMethodListener.java | 32 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/MyMethodInterceptor.java | 21 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/OrderedListenerSampleTest.java | 26 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ResultContextListener.java | 29 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ResultContextListenerSample.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ResultContextTest.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ResultEndMillisTest.java | 21 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ResultListener.java | 72 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/SetStatusListener.java | 40 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/SetStatusSample.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/SimpleListener.java | 21 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/SimpleSample.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/SuiteAndConfigurationListenerTest.java | 50 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/SuiteAndInvokedMethodListenerTest.java | 50 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/SuiteListener.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/SuiteListener2.java | 73 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/SuiteListenerSample.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/SuiteListenerSample2.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/TestAndClassListener.java | 52 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1029/Issue1029InvokedMethodListener.java | 34 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1029/Issue1029SampleTestClassWithDataDrivenMethod.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1029/Issue1029SampleTestClassWithFiveInstances.java | 26 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1029/Issue1029SampleTestClassWithFiveMethods.java | 31 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1029/Issue1029SampleTestClassWithOneMethod.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1130/ASample.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1130/BSample.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1130/BaseSample.java | 6 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1130/GitHub1130Test.java | 40 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1130/MyListener.java | 47 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1284/Listener1284.java | 31 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1284/Sample1284.java | 35 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1284/Sample1284B.java | 21 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1284/TestListeners.java | 39 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1296/GitHub1296Test.java | 29 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1296/MyConfigurationListener.java | 28 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1296/MyTest.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1319/TestResultInstanceCheckTest.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1319/TestSample.java | 86 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1393/Listener1393.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1465/ExampleClassListener.java | 63 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1465/ExampleClassSample.java | 31 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1465/IssueTest.java | 58 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1490/DataProviderInfoProvider.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1490/InstanceAwareLocalDataProviderListener.java | 35 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1490/LocalDataProviderListener.java | 33 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1602/IssueTest.java | 55 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1602/ListenerForIssue1602.java | 53 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1602/TestClassWithFailingConfigsSample.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1602/TestClassWithPassingConfigsSample.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1735/ExecutionListenerTest.java | 24 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1735/LocalExecutionListener.java | 28 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1735/TestClassSample.java | 10 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1735/TestClassTwoSample.java | 10 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/BaseTestCLass.java | 6 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/FatherTestClass.java | 10 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/ITestClassInterface.java | 6 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/ITestInheritedInterface.java | 6 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/ITestInterface.java | 6 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/ITestInterfaceSame.java | 6 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/ITestInterfaceSameInherit.java | 6 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/IssueTest.java | 111 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/SonTestClassSample.java | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/TestClassAndInterfaceInheritSample.java | 10 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/TestClassListener.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/TestClassListenersInheritSample.java | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/TestInterfaceListenersInheritSample.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/TestListener.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/TestMultiInheritSameAnnotationSample.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/TestMultiInheritSample.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/TestMultiLevelInheritSameAnnotationSample.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/TestMultiLevelInheritSample.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/packages/ITestInterfaceWithoutImpl.java | 6 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/packages/TestPackageListener.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/packages/TestWithoutImplSample.java | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2522/FirstTestSample.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2522/IssueTest.java | 88 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2522/SecondTestSample.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2522/SkipTestListener.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2522/SkipTestSample.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2522/TestListener.java | 33 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2558/CallHolder.java | 21 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2558/ClassMethodListenersHolder.java | 68 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2558/DataProviderListenersHolder.java | 39 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2558/ExecutionListenersHolder.java | 32 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2558/ReportersHolder.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2558/SuiteAlterListenersHolder.java | 24 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2558/SuiteListenersHolder.java | 33 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2558/TestClassSamples.java | 32 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2558/TestListenersHolder.java | 33 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github551/ConfigListener.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github551/Test551.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github551/TestWithFailingConfig.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github956/ListenerFor956.java | 38 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github956/TestClassContainer.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue1777/IssueTest.java | 59 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue1777/MyListener.java | 110 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue1777/TestClassSample.java | 30 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue1952/TestclassSample.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2043/SampleDataProvider.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2043/SampleTestClass.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2043/listeners/FailFastListener.java | 33 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2055/DynamicTestListener.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2055/TestClassSample.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2061/DynamicSuiteListener.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2061/DynamicTestListener.java | 5 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2061/ListenerEnabledBaseClass.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2061/TestClassSample.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2220/IssueTest.java | 35 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2220/Listener1.java | 31 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2220/TestClass01.java | 21 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2220/TestClass02.java | 21 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2328/ConfigListener.java | 36 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2328/IssueTest.java | 25 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2328/SampleWithConfiguration.java | 21 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2456/IssueTest.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2456/SimpleErrorSniffingListener.java | 32 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2456/TestClassSample.java | 22 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2638/DummyInvokedMethodListener.java | 30 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2638/TestClassASample.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2638/TestClassBSample.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ordering/Constants.java | 70 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ordering/ListenerInvocationDefaultBehaviorTest.java | 477 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ordering/ListenerInvocationListenerInvocationDisabledBehaviorTest.java | 462 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassPoweredByFactoryWithFailedMethod.java | 21 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithDataDrivenMethodPassAndFailedIterations.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithDataDrivenPassMethod.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithFailedAndSkippedConfigAndSkippedTestMethod.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithFailedConfigAndSkippedTestMethod.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithFailedMethod.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithFailedMethodHasRetryAnalyzer.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithFailedMethodMultipleInvocations.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithPassConfigAndMethod.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithPassFailMethods.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithPassMethod.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ordering/UniversalListener.java | 254 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/mannotation/MAnnotation2SampleTest.java | 90 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/mannotation/MAnnotationSampleTest.java | 130 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/mannotation/MBase.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/mannotation/MBaseCapture.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/mannotation/MChildCaptureTest.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/mannotation/MTest1.java | 94 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/mannotation/MTest2.java | 6 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/mannotation/MTest3.java | 35 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/mannotation/issue1976/IssueTest.java | 139 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/FastTestsFirstInterceptor.java | 30 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/FooTest.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/Issue392.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/Issue392Test.java | 39 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/Issue521.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/Issue521Test.java | 39 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/LockUpInterceptorSampleTest.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/MethodInterceptorTest.java | 116 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/NullMethodInterceptor.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/RemoveAMethodInterceptor.java | 57 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/issue1726/CustomInterceptorTest.java | 51 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/issue1726/Priority.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/issue1726/PriorityInterceptor.java | 33 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/issue1726/TestClassSample1.java | 21 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/issue1726/TestClassSample2.java | 21 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/multipleinterceptors/FirstInterceptor.java | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/multipleinterceptors/FooTest.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/multipleinterceptors/MethodNameFilterInterceptor.java | 36 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/multipleinterceptors/MultipleInterceptorsTest.java | 38 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/multipleinterceptors/SecondInterceptor.java | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/multipleinterceptors/ThirdInterceptor.java | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methods/SampleMethod1.java | 47 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methods/VerifyMethod1.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselection/DollarMethodSample.java | 21 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselection/MethodSelectionTest.java | 39 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselectors/AllTestsMethodSelector.java | 22 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselectors/ClassWithManyMethodsSample.java | 24 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselectors/CommandLineTest.java | 179 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselectors/MethodSelectorInSuiteTest.java | 80 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselectors/MethodSelectorTest.java | 100 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselectors/NoTest.java | 3 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselectors/NoTest1MethodSelector.java | 24 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselectors/NoTestSelector.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselectors/PrioritySampleTest.java | 13 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselectors/PriorityTest.java | 49 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselectors/SampleTest.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselectors/ScriptNegativeTest.java | 44 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselectors/ScriptTest.java | 30 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselectors/Test2MethodSelector.java | 28 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselectors/issue1985/FilteringMethodSelector.java | 34 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselectors/issue1985/TestClassSample.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/mixed/JUnit3Test1.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/mixed/JUnit4Test1.java | 13 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/mixed/MixedTest.java | 72 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/mixed/TestNGGroups.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/mixed/TestNGTest1.java | 13 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/morten/SampleTest.java | 35 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/morten/SampleTestFactory.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/multiple/Test1.java | 21 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/multiple/TestMultiple.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/multiple/ThisFactory.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/multiplelisteners/SimpleReporter.java | 29 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/multiplelisteners/Test1.java | 10 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/multiplelisteners/TestMaker.java | 46 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/name/BlankNameSample.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/name/ITestSample.java | 45 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/name/NameSample.java | 13 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/name/NameTest.java | 196 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/name/NoNameSample.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/name/SimpleITestSample.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/name/TestOnClassListener.java | 33 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/name/TestOnClassSample.java | 10 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/name/github1046/LocalTestNameGatherer.java | 35 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/name/github1046/TestClassSample.java | 51 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/name/github1046/TestCustomNamesForTests.java | 30 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/nested/GarfTest.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/nested/foo/AccountTypeEnum.java | 6 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/nested2/TmpA.java | 25 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/BadMethodObjectFactoryFactory.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/ClassObjectFactory.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/ClassObjectFactorySampleTest.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/CombinedTestAndObjectFactorySample.java | 37 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/CombinedTestAndObjectFactoryTest.java | 26 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/ContextAwareObjectFactoryFactory.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/CustomFactoryTest.java | 68 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/ISetValue.java | 5 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/LoggingObjectFactory.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/MyObjectFactoryFactory.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/ObjectFactory2Test.java | 39 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/ObjectFactoryTest.java | 78 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/SimpleSample.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/github1131/EmptyConstructorSample.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/github1131/IntConstructorSample.java | 25 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/github1131/MyObjectFactory.java | 24 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/github1131/StringConstructorSample.java | 25 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/github1827/GitHub1827Sample.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/issue2676/LocalSuiteAlteringListener.java | 13 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/issue2676/LoggingObjectFactorySample.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/issue2676/TestClassSample.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/order/OrderTest.java | 34 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/order/github288/Actual1Sample.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/order/github288/Actual2Sample.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/order/github288/BaseSample.java | 13 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/override/OverrideSampleTest.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/override/OverrideTest.java | 73 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/BeforeWithParameterSample.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/EnumParameterSample.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/InheritFromSuiteChild1.java | 22 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/InheritFromSuiteChild2.java | 21 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/InheritFromSuiteChild3.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/Issue1061Sample.java | 36 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/Issue1554TestClassSample.java | 25 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/OptionalParameterTest.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/Override1Sample.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/ParamInheritanceTest.java | 68 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/ParameterInjectAndOptionSample.java | 25 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/ParameterInjectAndOptionTest.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/ParameterOverrideTest.java | 71 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/ParameterSample.java | 26 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/ParameterTest.java | 134 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/ParametersPackageLevelMethodTest.java | 21 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/Sample.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/Shadow1Sample.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/Shadow2Sample.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/ShadowTest.java | 39 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/issue2238/ExampleTestCase.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/issue2238/IssueTest.java | 60 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/pholser/Captor.java | 35 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/pholser/Demo.java | 62 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/pholser/Saboteur.java | 37 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/pkg/PackageTest.java | 93 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/pkg2/Test1.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/pkg2/Test2.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/pkg2/Test3.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/preserveorder/A.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/preserveorder/B.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/preserveorder/C.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/preserveorder/Chuck3Sample.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/preserveorder/Chuck4Sample.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/preserveorder/ClassSample.java | 26 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/preserveorder/ClassSampleFactory.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/preserveorder/Issue1122Sample.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/preserveorder/PreserveOrderTest.java | 124 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/priority/PriorityTest.java | 116 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/priority/SampleTest01.java | 42 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/priority/SampleTest02.java | 43 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/priority/SampleTestBase.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/priority/WithPriorityAndDependsMethodsSample.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/priority/WithPrioritySample2Test.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/priority/WithPrioritySampleTest.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/priority/WithoutPrioritySampleTest.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/priority/issue2075/InterruptTest.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/priority/issue2137/IssueTest.java | 48 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/priority/issue2137/OrderListener.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/priority/parallel/EfficientPriorityParallelizationTest.java | 286 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/priority/parallel/EfficientPriorityParallelizationTest2.java | 294 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/priority/parallel/HighPriorityTestSample.java | 37 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/priority/parallel/LowPriorityTestSample.java | 84 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/privatemethod/PrivateMethodTest.java | 22 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reflect/ReflectionRecipesTest.java | 361 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reflect/TestContextJustForTesting.java | 122 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reflect/TestMethodMatcher.java | 251 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reflect/TestResultJustForTesting.java | 150 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reflect/XmlTestJustForTesting.java | 10 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/regression/BeforeTestFailingTest.java | 22 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/regression/MyTestngTest.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/regression/MyTestngTest2.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/regression/groupsordering/A.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/regression/groupsordering/B.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/regression/groupsordering/Base.java | 25 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/regression/groupsordering/testng.xml | 22 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/EmailableReporterTest.java | 155 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/FailedReporterTest.java | 215 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/GitHub1148Sample.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/GitHub148Sample.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/GitHub447Listener.java | 39 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/GitHub447Sample.java | 33 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/Issue1566Sample.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/Issue1659Sample.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/ListenerReporterSample.java | 25 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/ReportTest.java | 308 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/ReporterLogFailureSample.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/ReporterLogListener.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/ReporterLogSkippedSample.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/ReporterLogSuccessSample.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/ReporterLogTest.java | 39 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/ReporterSample.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/SampleA.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/SampleB.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/SimpleFailedSample.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/UniqueReporterInjectionSample1.java | 13 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/UniqueReporterInjectionSample2.java | 13 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/UniqueReporterInjectionTest.java | 37 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/XmlReporterTest.java | 79 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue1756/CustomTestNGReporter.java | 41 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue1756/SampleTestClass.java | 33 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2069/Dummy1.java | 13 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2069/Dummy2.java | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2069/Dummy3.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2069/Dummy4.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2069/IssueTest.java | 44 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2171/MyExampleListener.java | 24 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2171/TestClassExample.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2445/FailureTestFactory.java | 13 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2445/Test1.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2445/Test2.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2611/TestClassFailsAtBeforeGroupsWithBeforeGroupsSuiteTestSample.java | 32 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2611/TestClassFailsAtBeforeSuiteWithBeforeGroupsSuiteTestSample.java | 32 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2611/TestClassFailsAtBeforeTestWithBeforeGroupsSuiteTestSample.java | 32 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2611/TestClassWithBeforeGroupsSample.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2611/TestClassWithBeforeSuiteSample.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2611/TestClassWithBeforeTestSample.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2611/TestClassWithJustTestMethodsSample.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/EventualSuccess.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/ExitCodeTest.java | 47 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/FactoryTest.java | 32 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/ImmediateSuccess.java | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/InvocationCountTest.java | 179 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/Issue217TestClassSample.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/Issue217TestClassSampleWithOneDataProvider.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/MyFactory.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/MyRetry.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/PersistentFailure.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/RetryAnalyzerTest.java | 306 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/TestResultPruner.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/ComplexDataProviderWithObjectAndArraySample.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/DataProviderRetryAnalyzer.java | 31 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/DataProviderWithRetryAttemptsFailure.java | 26 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/DataProviderWithSingleParam.java | 43 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/DataProviderWithStringArraySample.java | 25 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/RetryAnalyzerWithComplexDataProviderTest.java | 77 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/RetryAnalyzerWithDataProviderTest.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/RetryAnalyzerWithoutDataProvider.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/RetryCountTest.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/issue2163/RetryAnalyzer.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/issue2163/TestClassPoweredByDataProviderSample.java | 26 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/github1519/MyAnalyzer.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/github1519/MyListener.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/github1519/TestClassSample.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/github1600/Github1600Analyzer.java | 25 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/github1600/Github1600Listener.java | 37 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/github1600/Github1600TestSample.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/github1706/DataDrivenSample.java | 24 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/github1706/LocalRetry.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/github1706/NativeInjectionSample.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/github1706/ParameterInjectionSample.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/github2669/FailedRetry.java | 21 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/github2669/RetryTestSample.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue1241/GitHub1241Sample.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue1241/MyRetry.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue1538/RetryForIssue1538.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue1538/TestClassSampleWithTestMethodDependencies.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue1697/DatadrivenSample.java | 22 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue1697/LocalReporter.java | 53 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue1697/RetryForDataDrivenTest.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue1697/SampleTestclass.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue1697/SimpleRetrier.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue1946/RetryAnalyzer.java | 38 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue1946/TestclassBase.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue1946/TestclassSample1.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue1946/TestclassSample2.java | 21 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue2148/ExceptionAfterMethodTestSample.java | 35 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue2148/IssueTest.java | 28 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue2148/RetryAnalyzer.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue2684/RerunAnalyzer.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue2684/SampleTestClassWithGroupConfigs.java | 54 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/AfterClassCalledAtEnd.java | 49 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/AllJUnitTests.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/BaseAfterClassCalledAtEnd.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/BaseSample1.java | 10 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/BaseSampleInheritance.java | 44 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/Basic1.java | 26 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/Basic2.java | 30 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/ConverterSample3.java | 83 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/InvocationCountTest.java | 75 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/JUnitSample1.java | 36 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/JUnitSample2.java | 30 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/JUnitSample3.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/JUnitSample4.java | 35 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/PartialGroupTest.java | 43 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/PartialGroupVerification.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/README.txt | 2 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/Sample1.java | 64 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/Sample2.java | 26 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/Scope.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/SetUpWithParameterTest.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sanitycheck/CheckSuiteNamesTest.java | 80 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sanitycheck/CheckTestNamesTest.java | 84 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sanitycheck/SampleTest1.java | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sanitycheck/SampleTest2.java | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sanitycheck/SampleTest3.java | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/serviceloader/MyConfigurationListener.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/serviceloader/ServiceLoaderSampleTest.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/serviceloader/ServiceLoaderTest.java | 91 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/serviceloader/TmpSuiteListener.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/simple/IncludedExcludedSampleTest.java | 46 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/simple/IncludedExcludedTest.java | 105 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/simple/SimpleSample.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/ReasonForSkipTest.java | 141 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/ReasonReporter.java | 51 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/TestClassWithFailedConfig.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/TestClassWithFailedConfigInParentClass.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/TestClassWithFailedMethod.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/TestClassWithFailedMethodInParentClass.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/TestClassWithGroupFailures.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/TestClassWithMultipleFailures.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/TestClassWithMultipleGroupFailures.java | 21 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/TestClassWithOnlyGlobalConfig.java | 10 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/TestClassWithOnlyTestMethods.java | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/github1632/AfterListenerSkipSample.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/github1632/BeforeListenerSkipSample.java | 29 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/github1632/IssueTest.java | 54 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/github1632/ListenerMarksMethodAsSkippedSample.java | 26 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/github1632/NoConfigAfterListenerSample.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/github1632/NoConfigBeforeListenerSample.java | 25 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/github1632/SkipMonitoringListener.java | 35 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/github1632/SkipTest.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/github1632/TestClassSample.java | 24 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/github1967/TestClassSample.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/issue2674/ConfigAwareTestNG.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/issue2674/TestClassSample.java | 22 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skipex/ConfigurationSkippedExceptionTest.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skipex/SkipAndExpectedSampleTest.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skipex/SkipAndExpectedTest.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skipex/SkippedExceptionTest.java | 47 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skipex/TestSkippedExceptionTest.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/suites/github1533/Github1533Test.java | 46 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/suites/github1533/SampleTestClassSample.java | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/suites/github1533/SuiteCounter.java | 29 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/suites/github1850/DuplicateChildSuitesInitializationTest.java | 60 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/suites/github1874/IssueTest.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/suites/github1874/TestClassSample.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/superclass/Base1.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/superclass/Base2.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/superclass/BaseSampleTest3.java | 10 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/superclass/Child1Test.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/superclass/Child2Test.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/superclass/ChildSampleTest3.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/superclass/MainTest.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/superclass/Test3.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/test111/AbstractTest.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/test111/Test1.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testnames/TestNamesFeature.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testnames/TestNamesTest.java | 26 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng106/FailingSuiteFixture.java | 13 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng106/Test1.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng106/Test2.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng106/TestNG106.java | 26 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng109/SkippedTestWithExpectedExceptionTest.java | 22 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng1231/ListenerOrderTestSample.java | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng1231/TestExecutionListenerInvocationOrder.java | 62 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng1232/ListenerTemplate.java | 72 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng1232/TestClassContainer.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng1232/TestListenerFor1232.java | 71 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng1232/TestListenerInstances.java | 55 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng1396/ParallelByInstancesInterceptorTest.java | 107 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng1396/SampleFor1396.java | 60 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng1396/TestNG1396HighPriority.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng173/ClassA.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng173/ClassB.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng173/TestNG173Test.java | 66 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng173/anotherpackage/ClassC.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng195/AfterMethodSampleTest.java | 26 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng195/AfterMethodTest.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng249/B.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng249/Base.java | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng249/VerifyTest.java | 39 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng285/BugBase.java | 24 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng285/Derived.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng285/TestNG285Test.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng317/ClassA.java | 59 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng317/ClassB.java | 44 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng317/VerifyTest.java | 26 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng37/NullParameterTest.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng37/testng-37.xml | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng387/FailedDPTest.java | 45 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng387/TestNG387.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng56/ParallelTest.java | 43 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng56/testng-56.xml | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng59/Test1.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng59/Test2.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng59/testng-59.xml | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng674/BeforeClassSkipExceptionTest.java | 106 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng674/ReportingListenerFor674.java | 28 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng674/TestClassSampleContainer.java | 113 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng93/SingleTestTest.java | 22 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng93/testng-93.xml | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/B.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/BaseSequentialSample.java | 24 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/BaseThreadTest.java | 81 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/DataProviderThreadPoolSizeSampleTest.java | 70 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/DataProviderThreadPoolSizeTest.java | 34 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/FactorySampleTest.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/FactoryTest.java | 46 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/Github1636Sample.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/Helper.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/MultiThreadedDependentSampleTest.java | 122 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/MultiThreadedDependentTest.java | 81 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/ParallelSuiteTest.java | 199 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/ParallelTestTest.java | 178 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/ParallelWithFactorySampleTest.java | 33 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/PriorityInSingleThreadTest.java | 32 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/Sample1.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/Sample2.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/SequentialSample2Test.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/SequentialSample3Test.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/SequentialSampleTest.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/SequentialTest.java | 99 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/SingleThreadForParallelMethodsTest.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/SingleThreadedSample2Test.java | 22 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/SingleThreadedSample3Test.java | 22 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/SingleThreadedSampleTest.java | 22 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/SuiteThreadCountTest.java | 33 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/Test1Test.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/Test2Test.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/TestThreadCountTest.java | 38 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/ThreadPoolSampleBugTest.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/ThreadPoolSizeBase.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/ThreadPoolSizeSampleTest.java | 10 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/ThreadPoolSizeTest.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/ThreadPoolSizeWithTimeOutTest.java | 32 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/ThreadTest.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/TrueParallelSampleTest.java | 40 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/TrueParallelTest.java | 48 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/issue188/Issue188TestSample.java | 45 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/issue188/IssueTest.java | 61 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/issue2361/AnotherChildClassExample.java | 6 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/issue2361/BaseTestClassExample.java | 45 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/issue2361/ChildClassExample.java | 6 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/issue2361/FactorySample.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/issue2361/IssueTest.java | 29 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/BaseParallelizationTest.java | 1102 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/ClassInstanceMethodKey.java | 32 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase1Scenario1.java | 218 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase1Scenario2.java | 801 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase2Scenario1.java | 478 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase2Scenario2.java | 802 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase3Scenario1.java | 256 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase3Scenario2.java | 645 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase4Scenario1.java | 1175 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase5Scenario1.java | 221 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase5Scenario2.java | 498 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase6Scenario1.java | 814 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase7Scenario1.java | 229 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase7Scenario2.java | 521 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase8Scenario1.java | 1028 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/TestNgRunStateListener.java | 121 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/TestNgRunStateTracker.java | 1049 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/ThreadAffinityTest.java | 126 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/issue1773/LogGatheringListener.java | 25 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/issue1773/MethodDependenciesSample1.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/issue1773/MethodDependenciesSample2.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/issue1773/PriorityTestSample1.java | 28 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/issue1773/PriorityTestSample2.java | 28 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/issue2110/TestClass.java | 40 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/issue2321/TestMultipleInstance.java | 30 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/FactoryForTestClassAFiveMethodsWithNoDepsTwoInstancesSample.java | 25 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/FactoryForTestClassBFourMethodsWithNoDepsFiveInstancesSample.java | 27 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/FactoryForTestClassCSixMethodsWithNoDepsThreeInstancesSample.java | 25 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/FactoryForTestClassDThreeMethodsWithNoDepsFourInstancesSample.java | 26 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/FactoryForTestClassFSixMethodsWithNoDepsSixInstancesSample.java | 28 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassAFiveMethodsWithDataProviderOnAllMethodsAndNoDepsSample.java | 165 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassAFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java | 166 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassAFiveMethodsWithFactoryUsingDataProviderAndNoDepsSample.java | 189 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassAFiveMethodsWithNoDepsSample.java | 139 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassBFourMethodsWithDataProviderOnAllMethodsAndNoDepsSample.java | 140 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassBFourMethodsWithFactoryUsingDataProviderAndNoDepsSample.java | 166 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassBFourMethodsWithNoDepsSample.java | 115 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassBSixMethodsWithDataProviderOnAllMethodsAndNoDepsSample.java | 189 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassBSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java | 190 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassCFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java | 166 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassCSixMethodsWithFactoryUsingDataProviderAndNoDepsSample.java | 211 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassCSixMethodsWithNoDepsSample.java | 163 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassDThreeMethodsWithDataProviderOnAllMethodsAndNoDepsSample.java | 116 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassDThreeMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java | 118 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassDThreeMethodsWithFactoryUsingDataProviderAndNoDepsSample.java | 143 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassDThreeMethodsWithNoDepsSample.java | 91 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassEFiveMethodsWithNoDepsSample.java | 139 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassEFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java | 142 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassFSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java | 190 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassFSixMethodsWithFactoryUsingDataProviderAndNoDepsSample.java | 211 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassFSixMethodsWithNoDepsSample.java | 162 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassGFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java | 142 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassGThreeMethodsWithNoDepsSample.java | 91 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassHFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java | 166 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassHFourMethodsWithNoDepsSample.java | 114 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassIFiveMethodsWithNoDepsSample.java | 139 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassIThreeMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java | 118 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassJFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java | 142 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassJFourMethodsWithNoDepsSample.java | 114 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassKFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java | 166 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassKFiveMethodsWithNoDepsSample.java | 139 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassLThreeMethodsWithNoDepsSample.java | 91 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassMFourMethodsWithNoDepsSample.java | 114 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassNFiveMethodsWithNoDepsSample.java | 139 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassOSixMethodsWithNoDepsSample.java | 162 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/testng.xml | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/timeout/GitHub1314Sample.java | 26 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/timeout/InvocationTimeOutSampleTest.java | 24 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/timeout/TestTimeOutSampleTest.java | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/timeout/TimeOutFromXmlTest.java | 90 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/timeout/TimeOutIntegrationTest.java | 42 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/timeout/TimeOutSample2Test.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/timeout/TimeOutSampleTest.java | 24 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/timeout/TimeOutTest.java | 108 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/timeout/TimeOutWithParallelSample.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/timeout/github1493/TestClassSample.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/timeout/github2440/TimeoutTest.java | 21 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/timeout/github2440/TimeoutWithNoExecutorTest.java | 29 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/timeout/github2672/TimeoutStacktraceTest.java | 42 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/timeout/github2672/TimeoutStacktraceTestSample.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/timeout/issue2009/TimeOutWithParallelSample.java | 10 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/A.java | 33 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/AA.java | 69 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/AFactory.java | 10 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/AnnotationTransformer.java | 61 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/AssertEqualsTest.java | 65 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/B.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/BListener.java | 22 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/Base.java | 10 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/BeforeGroupTest.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/C.java | 24 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/ChildTest.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/ConcreteTest.java | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/DataDrivenTest.java | 38 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/ExponentTest.java | 41 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/Fixturable.java | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/IgnoreUntil.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/ParamTest.java | 22 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/ParentTest.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/RegisterCommandTest.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/RetryAnalyzer.java | 13 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/StaticInitializerTest.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/Sub.java | 33 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/Test0.java | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/Test1.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/TestA.java | 37 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/TestB.java | 35 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/TestCaseFactory.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/TestFixture.java | 25 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/TestNGBug.java | 24 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/Test_TestListenerAppender.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/TimeBombTest.java | 33 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/Tmp.java | 25 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/Tn.java | 26 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/b/TmpB.java | 10 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/p1/ContainerTest.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/p2/ServiceTest.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/verify/Verify.java | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/verify/VerifyInterceptor.java | 68 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/verify/VerifyTest.java | 22 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/triangle/Base.java | 29 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/triangle/CheckCount.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/triangle/Child1.java | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/triangle/Child2.java | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/triangle/CountCalls.java | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/uniquesuite/BaseAfter.java | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/uniquesuite/BaseBefore.java | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/uniquesuite/TestAfter.java | 28 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/uniquesuite/TestAfter1.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/uniquesuite/TestAfter2.java | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/uniquesuite/TestBefore1.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/uniquesuite/TestBefore2.java | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/v6/A.java | 47 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/v6/B.java | 35 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/v6/C.java | 25 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/verify/Verifier.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/verify/Verify.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/verify/Verify2SampleTest.java | 48 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/verify/Verify3Base.java | 6 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/verify/Verify3SampleTest.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/verify/VerifyMethodInterceptor.java | 40 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/verify/VerifyNoListenersSampleTest.java | 31 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/verify/VerifySampleTest.java | 38 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/verify/VerifyTest.java | 46 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/verify/VerifyTestListener.java | 32 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/xml/TestNGContentHandlerTest.java | 29 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/xml/XMLStringBufferTest.java | 37 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/xml/XmlVerifyTest.java | 111 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/xml/issue2231/IssueTest.java | 46 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test_result/AfterListenerSample.java | 54 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test_result/BeforeListenerSample.java | 53 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test_result/GitHub1197Sample.java | 37 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test_result/OrderAbidingListener.java | 116 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test_result/ResultStatusTest.java | 66 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test_result/TestResultTest.java | 34 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test_result/issue1590/TestclassSample.java | 42 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test_result/issue2535/CalculatorTestSample.java | 38 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/testhelper/CompiledCode.java | 31 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/testhelper/OutputDirectoryPatch.java | 49 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/testhelper/SimpleCompiler.java | 42 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/testhelper/SourceCode.java | 43 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/kotlin/org/testng/BasicSample.kt | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/kotlin/org/testng/BasicTest.kt | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/1332.xml | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/1636.xml | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/188.xml | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/2532.xml | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/987.xml | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/META-INF/services/org.testng.IModule | 1 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/META-INF/services/org.testng.ITestNGListener | 2 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/META-INF/services/org.testng.xml.ISuiteParser | 1 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/a.xml | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/b.xml | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/checksuitesinitialization/child-suite1.xml | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/checksuitesinitialization/child-suite2.xml | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/checksuitesinitialization/children/child-suite-3.xml | 10 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/checksuitesinitialization/children/child-suite-4.xml | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/checksuitesinitialization/children/morechildren/child-suite-5.xml | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/checksuitesinitialization/parent-suite-with-duplicate-child.xml | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/checksuitesinitialization/parent-suite.xml | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/create-serviceloader-jar.sh | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/executionlistenersingletoncheck/child.xml | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/executionlistenersingletoncheck/parent.xml | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/groupinvocation/parent-suiteA.xml | 7 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/groupinvocation/parent-suiteB.xml | 7 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/groupinvocation/suiteA.xml | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/groupinvocation/suiteB.xml | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/hosts.properties | 2 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/jarfileutils/child.xml | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/jarfileutils/child/child.xml | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/jarfileutils/child/childofchild/childofchild.xml | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/jarfileutils/childofchild/childofchild.xml | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/jarfileutils/testng-tests.xml | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/jenkins-junit.xsd | 119 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/junit-suite.xml | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/listener-in-xml.xml | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/methodinterceptors/multipleinterceptors/multiple-interceptors.xml | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/methodselector-in-xml.xml | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/package.xml | 31 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parallel-suites/inherit-thread-count-child.yaml | 7 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parallel-suites/inherit-thread-count-parent.yaml | 5 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parallel-suites/simple-suite-parallel-0.xml | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parallel-suites/simple-suite-parallel-1.xml | 10 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parallel-suites/simple-suite-parallel-2.xml | 10 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parallel-suites/suite-parallel-0.xml | 16 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parallel-suites/suite-parallel-1.xml | 10 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parallel-suites/suite-parallel-2-1.xml | 10 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parallel-suites/suite-parallel-2-2-1.xml | 10 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parallel-suites/suite-parallel-2-2.xml | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parallel-suites/suite-parallel-2.xml | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parallel-suites/suite-parallel-3.xml | 10 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/param-inheritance/child-suite.xml | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/param-inheritance/parent-suite.xml | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parametertest/1417.xml | 24 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parametertest/child1-suite.xml | 13 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parametertest/child2-suite.xml | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parametertest/child3-suite.xml | 13 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parametertest/parent-suite.xml | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parent-module-suite.xml | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/sanitycheck/test-a.xml | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/sanitycheck/test-b.xml | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/sanitycheck/test-s-1.xml | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/sanitycheck/test-s-2.xml | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/sanitycheck/test-s-3.xml | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/sanitycheck/test-s-a.xml | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/sanitycheck/test-s-b.xml | 8 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/sanitycheck/test1.xml | 21 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/sanitycheck/test2.xml | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/sanitycheck/test3.xml | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/suite1-1.xml | 13 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/suite1-2.xml | 10 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/suite1.xml | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/test/listeners/github1284/github1284.xml | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/test/listeners/github1284/github1284_nolistener.xml | 13 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/test/listeners/github1284/github1284_withchildlistener.xml | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/test/listeners/github1284/github1284_withlistener.xml | 17 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/test/methodselectors/sampleTest.xml | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/test/methodselectors/sampleTestExclusions.xml | 18 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/test/timeout/issue575.xml | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/testnames/main-suite.xml | 22 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/testnames/upstream-suite.xml | 7 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/testng-all.xml | 99 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/testng-annconv.xml | 14 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/testng-ant.xml | 10 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/testng-configfailure.xml | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/testng-methodselectors.xml | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/testng-override.xml | 13 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/testng-package.xml | 19 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/testng-single.xml | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/testng-single.yaml | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/testng-single2.xml | 25 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/testng-single2.yaml | 48 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/testng.xml | 997 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/testng.yaml | 352 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/testng_convert.xml | 10 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/xml/badWithDoctype.xml | 5 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/xml/badWithoutDoctype.xml | 5 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/xml/github1533/child.xml | 9 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/xml/github1533/parent.xml | 7 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/xml/github2445/expected-failed-report.xml | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/xml/github2445/test-suite.xml | 11 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/xml/goodWithDoctype.xml | 5 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/xml/goodWithoutDoctype.xml | 5 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/xml/issue1668.xml | 20 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/xml/issue1674.xml | 28 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/xml/issue174.xml | 21 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/xml/issue435.xml | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/xml/simple-suite-with-method-desc.xml | 13 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/1787.xml | 23 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/2078.xml | 15 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/2078.yaml | 12 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/a1.xml | 56 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/a1.yaml | 25 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/a2.xml | 80 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/a2.yaml | 49 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/a3-a.xml | 10 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/a3-a.yaml | 6 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/a3-b.xml | 10 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/a3-b.yaml | 6 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/a3.xml | 10 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/a3.yaml | 4 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/a4-a.yaml | 3 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/a4-b.yaml | 3 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/a4.xml | 10 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/a4.yaml | 4 jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/suiteWithNonExistentTest.yaml | 5 jtreg7-7.5.2+1+ds2/testng/testng-core/testng-core-build.gradle.kts | 59 jtreg7-7.5.2+1+ds2/testng/testng-reflection-utils/src/main/java/org/testng/internal/reflect/ReflectionHelper.java | 115 jtreg7-7.5.2+1+ds2/testng/testng-reflection-utils/testng-reflection-utils-build.gradle.kts | 7 jtreg7-7.5.2+1+ds2/testng/testng-runner-api/src/main/java/org/testng/internal/Attributes.java | 32 jtreg7-7.5.2+1+ds2/testng/testng-runner-api/src/main/java/org/testng/internal/ITestResultNotifier.java | 36 jtreg7-7.5.2+1+ds2/testng/testng-runner-api/src/main/java/org/testng/internal/LiteWeightTestNGMethod.java | 540 jtreg7-7.5.2+1+ds2/testng/testng-runner-api/src/main/java/org/testng/internal/TestResult.java | 474 jtreg7-7.5.2+1+ds2/testng/testng-runner-api/src/main/java/org/testng/internal/XmlTestUtils.java | 29 jtreg7-7.5.2+1+ds2/testng/testng-runner-api/src/main/java/org/testng/internal/invokers/IInvocationStatus.java | 11 jtreg7-7.5.2+1+ds2/testng/testng-runner-api/testng-runner-api-build.gradle.kts | 7 jtreg7-7.5.2+1+ds2/testng/testng-runner-junit4/testng-runner-junit4-build.gradle.kts | 8 jtreg7-7.5.2+1+ds2/testng/testng-test-kit/src/main/java/testhelper/PerformanceUtils.java | 51 jtreg7-7.5.2+1+ds2/testng/testng-test-kit/testng-test-kit-build.gradle.kts | 3 jtreg7-7.5.2+1+ds2/testng/testng-test-osgi/LICENSE.pgjdbc | 23 jtreg7-7.5.2+1+ds2/testng/testng-test-osgi/gradle.properties | 2 jtreg7-7.5.2+1+ds2/testng/testng-test-osgi/src/test/java/org/testng/test/osgi/DefaultTestngOsgiOptions.java | 31 jtreg7-7.5.2+1+ds2/testng/testng-test-osgi/src/test/java/org/testng/test/osgi/PlainOsgiTest.java | 39 jtreg7-7.5.2+1+ds2/testng/testng-test-osgi/src/test/resources/exam.properties | 2 jtreg7-7.5.2+1+ds2/testng/testng-test-osgi/src/test/resources/logback-test.xml | 14 jtreg7-7.5.2+1+ds2/testng/testng-test-osgi/testng-test-osgi-build.gradle.kts | 86 jtreg7-7.5.2+1+ds2/testng/testng/src/test/java/org/testng/test/VerifyShadedJarWorksTest.java | 15 jtreg7-7.5.2+1+ds2/testng/testng/testng-build.gradle.kts | 99 jtreg7-7.5.2+1+ds2/testng/versions.properties | 96 jtreg7-7.5.2+1+ds2/univocity-parsers/.github/FUNDING.yml | 12 jtreg7-7.5.2+1+ds2/univocity-parsers/.gitignore | 10 jtreg7-7.5.2+1+ds2/univocity-parsers/LICENSE-2.0.html | 235 jtreg7-7.5.2+1+ds2/univocity-parsers/README.md | 31 jtreg7-7.5.2+1+ds2/univocity-parsers/pom.xml | 260 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/annotations/BooleanString.java | 53 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/annotations/Convert.java | 52 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/annotations/Copy.java | 84 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/annotations/EnumOptions.java | 79 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/annotations/FixedWidth.java | 87 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/annotations/Format.java | 65 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/annotations/HeaderTransformer.java | 167 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/annotations/Headers.java | 73 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/annotations/LowerCase.java | 41 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/annotations/Nested.java | 54 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/annotations/NullString.java | 46 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/annotations/Parsed.java | 99 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/annotations/Replace.java | 51 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/annotations/Trim.java | 42 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/annotations/UpperCase.java | 41 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/annotations/Validate.java | 85 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/annotations/helpers/AnnotationHelper.java | 1174 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/annotations/helpers/AnnotationRegistry.java | 140 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/annotations/helpers/FieldMapping.java | 425 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/annotations/helpers/MethodDescriptor.java | 180 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/annotations/helpers/MethodFilter.java | 86 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/annotations/helpers/TransformedHeader.java | 166 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/AbstractException.java | 138 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/AbstractParser.java | 1491 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/AbstractWriter.java | 2583 + jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/ArgumentUtils.java | 697 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/ColumnMap.java | 154 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/CommonParserSettings.java | 566 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/CommonSettings.java | 723 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/CommonWriterSettings.java | 231 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/Context.java | 144 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/ContextSnapshot.java | 50 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/ContextWrapper.java | 102 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/ConversionProcessor.java | 72 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/DataProcessingException.java | 325 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/DataValidationException.java | 83 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/DefaultContext.java | 156 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/DefaultConversionProcessor.java | 337 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/DefaultParsingContext.java | 108 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/DummyFormat.java | 41 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/Format.java | 241 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/Internal.java | 70 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/IterableResult.java | 34 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/LineReader.java | 75 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/NoopParsingContext.java | 151 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/NoopProcessorErrorHandler.java | 46 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/NoopRowProcessorErrorHandler.java | 41 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/NormalizedString.java | 628 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/ParserOutput.java | 404 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/ParsingContext.java | 150 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/ParsingContextSnapshot.java | 88 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/ParsingContextWrapper.java | 97 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/ProcessorErrorHandler.java | 60 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/ResultIterator.java | 35 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/RetryableErrorHandler.java | 101 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/RowProcessorErrorHandler.java | 48 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/StringCache.java | 147 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/TextParsingException.java | 171 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/TextWritingException.java | 156 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/beans/BeanHelper.java | 127 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/beans/PropertyWrapper.java | 98 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/fields/AbstractColumnMapping.java | 213 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/fields/AllIndexesSelector.java | 60 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/fields/ColumnMapper.java | 308 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/fields/ColumnMapping.java | 281 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/fields/ExcludeFieldEnumSelector.java | 64 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/fields/ExcludeFieldIndexSelector.java | 75 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/fields/ExcludeFieldNameSelector.java | 72 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/fields/FieldConversionMapping.java | 491 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/fields/FieldEnumSelector.java | 64 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/fields/FieldIndexSelector.java | 50 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/fields/FieldNameSelector.java | 86 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/fields/FieldSelector.java | 54 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/fields/FieldSet.java | 192 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/input/AbstractCharInputReader.java | 618 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/input/BomInput.java | 208 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/input/CharAppender.java | 303 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/input/CharInput.java | 42 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/input/CharInputReader.java | 205 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/input/DefaultCharAppender.java | 424 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/input/DefaultCharInputReader.java | 90 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/input/EOFException.java | 36 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/input/ElasticCharAppender.java | 100 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/input/ExpandingCharAppender.java | 211 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/input/InputAnalysisProcess.java | 37 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/input/LineSeparatorDetector.java | 65 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/input/LookaheadCharInputReader.java | 267 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/input/NoopCharAppender.java | 345 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/input/WriterCharAppender.java | 185 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/input/concurrent/CharBucket.java | 81 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/input/concurrent/ConcurrentCharInputReader.java | 120 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/input/concurrent/ConcurrentCharLoader.java | 198 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/input/concurrent/Entry.java | 49 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/input/concurrent/FixedInstancePool.java | 109 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/iterators/ParserIterator.java | 118 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/iterators/RecordIterator.java | 39 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/iterators/RowIterator.java | 38 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/AbstractRowProcessor.java | 28 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/BatchedColumnProcessor.java | 50 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/BatchedObjectColumnProcessor.java | 55 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/BeanListProcessor.java | 66 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/BeanProcessor.java | 50 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/BeanWriterProcessor.java | 92 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/ColumnProcessor.java | 54 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/CompositeRowProcessor.java | 35 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/ConcurrentRowProcessor.java | 65 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/CustomMatcher.java | 30 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/InputValueSwitch.java | 72 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/MasterDetailListProcessor.java | 57 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/MasterDetailProcessor.java | 68 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/MasterDetailRecord.java | 87 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/MultiBeanListProcessor.java | 60 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/MultiBeanProcessor.java | 48 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/MultiBeanRowProcessor.java | 51 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/NoopRowProcessor.java | 31 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/ObjectColumnProcessor.java | 60 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/ObjectRowListProcessor.java | 63 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/ObjectRowProcessor.java | 38 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/ObjectRowWriterProcessor.java | 83 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/OutputValueSwitch.java | 362 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/RowListProcessor.java | 60 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/RowPlacement.java | 33 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/RowProcessor.java | 84 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/RowProcessorSwitch.java | 33 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/RowWriterProcessor.java | 61 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/RowWriterProcessorSwitch.java | 157 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/core/AbstractBatchedColumnProcessor.java | 136 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/core/AbstractBatchedObjectColumnProcessor.java | 165 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/core/AbstractBeanListProcessor.java | 112 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/core/AbstractBeanProcessor.java | 76 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/core/AbstractColumnProcessor.java | 110 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/core/AbstractConcurrentProcessor.java | 237 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/core/AbstractInputValueSwitch.java | 289 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/core/AbstractListProcessor.java | 105 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/core/AbstractMasterDetailListProcessor.java | 117 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/core/AbstractMasterDetailProcessor.java | 179 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/core/AbstractMultiBeanListProcessor.java | 129 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/core/AbstractMultiBeanProcessor.java | 153 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/core/AbstractMultiBeanRowProcessor.java | 89 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/core/AbstractObjectColumnProcessor.java | 137 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/core/AbstractObjectListProcessor.java | 112 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/core/AbstractObjectProcessor.java | 69 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/core/AbstractProcessor.java | 39 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/core/AbstractProcessorSwitch.java | 165 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/core/BatchedColumnReader.java | 57 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/core/BeanConversionProcessor.java | 915 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/core/ColumnOrderDependent.java | 33 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/core/ColumnReader.java | 91 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/core/ColumnSplitter.java | 259 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/core/CompositeProcessor.java | 83 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/core/NoopProcessor.java | 31 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/processor/core/Processor.java | 85 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/record/AbstractRecordFactory.java | 41 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/record/MetaData.java | 52 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/record/Record.java | 1326 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/record/RecordFactory.java | 52 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/record/RecordImpl.java | 662 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/record/RecordMetaData.java | 220 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/record/RecordMetaDataImpl.java | 487 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/routine/AbstractRoutines.java | 1031 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/common/routine/InputDimension.java | 53 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/conversions/BigDecimalConversion.java | 52 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/conversions/BigIntegerConversion.java | 52 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/conversions/BooleanConversion.java | 179 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/conversions/ByteConversion.java | 50 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/conversions/CalendarConversion.java | 142 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/conversions/CharacterConversion.java | 57 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/conversions/Conversion.java | 67 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/conversions/Conversions.java | 732 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/conversions/DateConversion.java | 160 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/conversions/DoubleConversion.java | 50 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/conversions/EnumConversion.java | 269 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/conversions/EnumSelector.java | 51 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/conversions/FloatConversion.java | 49 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/conversions/FormattedBigDecimalConversion.java | 94 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/conversions/FormattedConversion.java | 35 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/conversions/FormattedDateConversion.java | 83 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/conversions/IntegerConversion.java | 49 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/conversions/LongConversion.java | 49 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/conversions/LowerCaseConversion.java | 53 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/conversions/NullConversion.java | 135 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/conversions/NullStringConversion.java | 79 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/conversions/NumericConversion.java | 246 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/conversions/ObjectConversion.java | 135 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/conversions/RegexConversion.java | 67 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/conversions/ShortConversion.java | 49 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/conversions/ToStringConversion.java | 43 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/conversions/TrimConversion.java | 101 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/conversions/UpperCaseConversion.java | 53 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/conversions/ValidatedConversion.java | 153 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/conversions/Validator.java | 38 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/csv/Csv.java | 89 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/csv/CsvFormat.java | 248 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/csv/CsvFormatDetector.java | 424 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/csv/CsvParser.java | 803 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/csv/CsvParserSettings.java | 509 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/csv/CsvRoutines.java | 82 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/csv/CsvWriter.java | 434 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/csv/CsvWriterSettings.java | 350 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/csv/UnescapedQuoteHandling.java | 66 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/fixed/FieldAlignment.java | 61 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/fixed/FixedWidthFieldLengths.java | 59 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/fixed/FixedWidthFields.java | 812 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/fixed/FixedWidthFormat.java | 106 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/fixed/FixedWidthParser.java | 359 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/fixed/FixedWidthParserSettings.java | 443 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/fixed/FixedWidthRoutines.java | 89 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/fixed/FixedWidthWriter.java | 337 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/fixed/FixedWidthWriterSettings.java | 345 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/fixed/Lookup.java | 198 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/tsv/TsvFormat.java | 101 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/tsv/TsvParser.java | 114 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/tsv/TsvParserSettings.java | 103 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/tsv/TsvRoutines.java | 82 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/tsv/TsvWriter.java | 197 jtreg7-7.5.2+1+ds2/univocity-parsers/src/main/java/com/univocity/parsers/tsv/TsvWriterSettings.java | 109 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/ParserTestCase.java | 68 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/annotations/AnnotationHelperTest.java | 65 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/annotations/meta/Clean.java | 46 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/annotations/meta/CleanBeanTest.java | 36 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/annotations/meta/ContentCleaner.java | 75 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/annotations/meta/IntArray.java | 29 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/annotations/meta/MetaAnnotationTest.java | 79 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/annotations/meta/MyReplacement.java | 38 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/annotations/meta/MyReplacementUpperCase.java | 38 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/annotations/meta/ReplacementBean.java | 40 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/common/AbstractWriterTest.java | 162 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/common/DataProcessingExceptionTest.java | 107 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/common/NormalizedStringTest.java | 237 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/common/fields/ExcludeFieldEnumSelectorTest.java | 35 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/common/fields/ExcludeFieldNameSelectorTest.java | 35 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/common/fields/ExcludeIndexSelectorTest.java | 35 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/common/fields/FieldEnumSelectorTest.java | 35 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/common/fields/FieldIndexSelectorTest.java | 35 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/common/fields/FieldNameSelectorTest.java | 49 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/common/fields/TestEnum.java | 20 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/common/input/DefaultCharInputReaderTest.java | 85 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/common/input/ExpandingCharAppenderTest.java | 229 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/common/input/LookaheadCharInputReaderTest.java | 70 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/common/input/WriterCharAppenderTest.java | 52 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/common/processor/AnnotatedBeanProcessorTest.java | 199 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/common/processor/BatchedColumnProcessorTest.java | 85 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/common/processor/BatchedObjectColumnProcessorTest.java | 91 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/common/processor/BeanWriterProcessorTest.java | 103 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/common/processor/ColumnProcessorTest.java | 73 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/common/processor/ConcurrentRowProcessorTest.java | 122 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/common/processor/MasterDetailProcessorTest.java | 112 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/common/processor/MultiBeanListProcessorTest.java | 146 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/common/processor/ObjectColumnProcessorTest.java | 78 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/common/processor/ObjectRowListProcessorTest.java | 168 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/common/processor/ObjectRowWriterProcessorTest.java | 127 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/common/record/RecordImplTest.java | 274 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/common/routine/AbstractRoutinesTest.java | 268 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/csv/CsvFormatDetectorTest.java | 134 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/csv/CsvParserTest.java | 911 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/csv/CsvWriterTest.java | 626 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/csv/ProfilerTest.java | 173 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/csv/TestUtils.java | 84 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/csv/UnescapedQuoteHandlingTest.java | 100 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/examples/AnotherTestBean.java | 72 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/examples/Car.java | 91 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/examples/CsvParserExamples.java | 826 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/examples/CsvWriterExamples.java | 59 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/examples/Example.java | 129 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/examples/FixedWidthParserExamples.java | 415 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/examples/FixedWidthWriterExamples.java | 218 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/examples/RecordExamples.java | 148 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/examples/RoutineExamples.java | 222 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/examples/SettingsExamples.java | 200 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/examples/TestBean.java | 88 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/examples/TsvParserExamples.java | 317 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/examples/WordsToSetConversion.java | 97 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/examples/WriterExamples.java | 540 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/examples/annotation/Address.java | 41 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/examples/annotation/AddressBook.java | 36 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/examples/annotation/AddressTypeTransformer.java | 35 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/examples/annotation/AnnotationExamples.java | 203 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/examples/annotation/BetterOffender.java | 43 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/examples/annotation/DatesRepetitive.java | 54 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/examples/annotation/DatesWithMetaAnnotation.java | 48 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/examples/annotation/MyCompanyDate.java | 35 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/examples/annotation/Offender.java | 40 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/examples/annotation/Profile.java | 89 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/examples/annotation/ProfileByFieldName.java | 39 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/examples/annotation/ProfileByFieldPosition.java | 40 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/examples/annotation/ProfileByMultipleFieldNames.java | 40 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/examples/annotation/ProfileWithDate.java | 43 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/examples/annotation/Splitter.java | 52 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/examples/samples/CsvSearchExample.java | 93 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/fixed/FixedWidthParserTest.java | 350 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/fixed/FixedWidthWriterTest.java | 483 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_1.java | 59 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_100.java | 43 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_106.java | 70 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_109.java | 55 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_111.java | 166 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_112.java | 75 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_113.java | 44 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_116.java | 101 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_121.java | 66 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_128.java | 57 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_13.java | 255 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_131.java | 42 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_132.java | 59 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_136.java | 63 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_138.java | 75 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_139.java | 94 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_14.java | 91 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_140.java | 74 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_143.java | 190 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_146.java | 84 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_149.java | 93 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_150.java | 105 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_154.java | 113 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_156.java | 80 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_158.java | 43 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_159.java | 264 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_16.java | 51 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_160.java | 101 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_161.java | 52 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_165.java | 83 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_176.java | 52 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_177.java | 58 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_178.java | 84 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_18.java | 72 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_180.java | 78 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_182.java | 79 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_183.java | 79 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_184.java | 72 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_185.java | 54 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_186.java | 71 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_188.java | 63 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_19.java | 81 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_191.java | 71 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_194.java | 82 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_196.java | 51 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_197.java | 41 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_198.java | 51 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_201.java | 74 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_209.java | 297 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_21.java | 96 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_212.java | 57 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_214.java | 84 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_219.java | 33 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_224.java | 59 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_228.java | 84 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_23.java | 130 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_230.java | 134 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_231.java | 57 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_24.java | 100 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_247.java | 49 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_250.java | 66 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_251.java | 116 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_253.java | 62 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_254.java | 50 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_255.java | 146 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_256.java | 143 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_258.java | 75 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_26.java | 70 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_260.java | 90 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_266.java | 64 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_27.java | 203 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_271.java | 197 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_272.java | 54 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_274.java | 100 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_276.java | 50 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_280.java | 60 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_283.java | 237 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_287.java | 317 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_29.java | 123 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_294.java | 73 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_296.java | 117 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_299.java | 53 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_3.java | 87 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_30.java | 67 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_303.java | 68 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_305.java | 58 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_306.java | 63 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_309.java | 53 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_31.java | 138 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_314.java | 56 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_315.java | 128 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_316.java | 54 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_32.java | 49 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_328.java | 55 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_33.java | 68 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_336.java | 55 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_337.java | 83 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_34.java | 55 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_349.java | 86 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_35.java | 75 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_352.java | 46 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_353.java | 80 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_356.java | 75 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_357.java | 43 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_362.java | 52 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_37.java | 65 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_378.java | 45 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_383.java | 60 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_384.java | 68 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_39.java | 151 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_394.java | 51 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_404.java | 47 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_405.java | 49 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_409.java | 81 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_414.java | 36 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_415.java | 53 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_416.java | 30 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_420.java | 61 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_424.java | 28 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_427.java | 57 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_432.java | 62 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_438.java | 40 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_46.java | 94 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_48.java | 135 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_50.java | 114 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_52.java | 70 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_60.java | 55 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_61.java | 58 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_62.java | 82 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_66.java | 178 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_69.java | 43 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_7.java | 63 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_75.java | 52 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_8.java | 42 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_85.java | 57 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_89.java | 39 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_92.java | 65 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_93.java | 59 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/github/Github_97.java | 38 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/support/Ticket_1.java | 96 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/support/Ticket_10.java | 42 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/support/Ticket_11.java | 34 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/support/Ticket_12.java | 160 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/support/Ticket_13.java | 77 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/support/Ticket_14.java | 79 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/support/Ticket_2.java | 151 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/support/Ticket_3.java | 79 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/support/Ticket_4.java | 71 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/support/Ticket_5.java | 65 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/support/Ticket_6.java | 53 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/support/Ticket_7.java | 70 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/support/Ticket_8.java | 60 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/issues/support/Ticket_9.java | 54 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/tsv/TsvParserTest.java | 554 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/java/com/univocity/parsers/tsv/TsvWriterTest.java | 411 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/csv/essential-dos.csv | 23 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/csv/essential-mac.csv | 1 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/csv/essential.csv | 23 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/csv/iterating_test.csv | 6 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/csv/test.csv | 1 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/annotation/addresses.txt | 3 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/annotation/basic_profile.txt | 3 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/annotation/basic_profile_2.txt | 3 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/annotation/dates.txt | 3 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/annotation/offender_profiles.txt | 3 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/bean_test.csv | 3 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/bean_test.tsv | 3 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/bean_test.txt | 6 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/escape.csv | 2 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/european.csv | 7 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/example.csv | 15 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/example.tsv | 13 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/example.txt | 13 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/AnnotationExamples/parseAddressBook.txt | 2 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/AnnotationExamples/parseBetterOffenders.txt | 2 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/AnnotationExamples/parseDates.txt | 2 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/AnnotationExamples/parseDatesWithMetaAnnotation.txt | 2 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/AnnotationExamples/parseOffenders.txt | 2 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/AnnotationExamples/parseProfile.txt | 2 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/AnnotationExamples/parseProfileByFieldName.txt | 2 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/AnnotationExamples/parseProfileByFieldPosition.txt | 2 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/AnnotationExamples/parseProfileByMultipleFieldNames.txt | 4 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/AnnotationExamples/parseProfileWithDate.txt | 2 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/CsvParserExamples/example001ParseAll | 13 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/CsvParserExamples/example002IteratorOverCsv.txt | 7 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/CsvParserExamples/example002ReadSimpleCsv | 7 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/CsvParserExamples/example002RecordIteratorOverCsv.txt | 7 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/CsvParserExamples/example003ReadCsvWithRowProcessor | 13 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/CsvParserExamples/example004ReadCsvAndConvertValues | 6 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/CsvParserExamples/example005UsingAnnotations | 1 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/CsvParserExamples/example006MasterDetail | 8 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/CsvParserExamples/example007Columns | 6 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/CsvParserExamples/example008CustomConversionAnnotation | 2 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/CsvParserExamples/example009ParallelProcessing | 2 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/CsvParserExamples/example010Escaping | 2 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/CsvParserExamples/example011ErrorHandling | 6 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/CsvParserExamples/example011ErrorHandlingWithRetry.txt | 7 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/CsvParserExamples/example012FormatAutodetection | 29 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/CsvParserExamples/example013ParseKeepingEscapeSequences | 11 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/CsvParserExamples/example014ParseMultipleBeansInSingleRow | 9 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/CsvParserExamples/example015QuoteAndEscapeHandling | 25 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/CsvParserExamples/example016ParseReadingComments | 13 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/CsvParserExamples/example017ParseMultiSchema | 2 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/CsvParserExamples/example018ParseAllRecords | 5 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/CsvParserExamples/example019IterateOverRecords | 5 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/CsvWriterExamples/example001Quoting | 8 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/FixedWidthParserExamples/example001ParseAll | 13 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/FixedWidthParserExamples/example002ReadSimpleFixedWidth | 7 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/FixedWidthParserExamples/example003ReadFixedWidthWithRowProcessor | 13 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/FixedWidthParserExamples/example004ReadFixedWidthAndConvertValues | 6 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/FixedWidthParserExamples/example005UsingAnnotations | 1 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/FixedWidthParserExamples/example006MasterDetail | 8 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/FixedWidthParserExamples/example007BatchedColumns | 13 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/FixedWidthParserExamples/example008BeanListToStringList | 3 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/FixedWidthParserExamples/example009ParseWithLookahead | 10 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/FixedWidthParserExamples/example010ParseWithDefaultAndLookahead | 10 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/FixedWidthParserExamples/example011ParseWithLookbehind | 10 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/FixedWidthWriterExamples/example001WriteWithAlignmentAndPadding | 7 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/FixedWidthWriterExamples/example002WriteWithLookahead | 5 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/FixedWidthWriterExamples/example003WriteWithLookaheadAndDefault | 5 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/FixedWidthWriterExamples/example004WriteWithLookbehind | 5 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/Github_184/testContextWithRoutineIterateBeans.txt | 5 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/Github_276/testKeepPaddingFlag.txt | 13 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/RecordExamples/example001ParseRecords | 1 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/RecordExamples/example002RecordMetadata | 5 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/RecordExamples/example003RecordToMap | 11 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/RoutineExamples/example001IterateOverBeans | 2 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/RoutineExamples/example002GetAllBeansAndWrite | 3 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/RoutineExamples/example003ParseAndWrite | 6 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/RoutineExamples/example004DumpResultSet | 4 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/RoutineExamples/example005DumpResultSetWithCustomHeaders.txt | 4 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/RoutineExamples/example006DumpResultSetWithSelection.txt | 4 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/RowObjectExample/example013ReadCsvWithRowProcessorUsingRowObjects | 18 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/SettingsExamples/example001ColumnSelection | 10 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/SettingsExamples/example002ColumnSelectionWithNoReordering | 10 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/SettingsExamples/example003ColumnSelectionByIndex | 10 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/SettingsExamples/example004LotsOfDifferentSettings | 19 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/SettingsExamples/example005FixedWidthSettings | 12 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/TsvParserExamples/example001ParseAll | 13 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/TsvParserExamples/example002ReadSimpleTsv | 7 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/TsvParserExamples/example003ReadTsvWithRowProcessor | 13 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/TsvParserExamples/example004ReadTsvAndConvertValues | 6 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/TsvParserExamples/example005UsingAnnotations | 1 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/TsvParserExamples/example006MasterDetail | 8 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/TsvParserExamples/example007ConvertColumns | 6 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/TsvParserExamples/example008ParseLine | 2 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/TsvParserExamples/example009ParseJoinedLines | 11 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/WriterExamples/example001WriteSimpleCsv | 7 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/WriterExamples/example002WriteCsvOneByOne | 12 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/WriterExamples/example003WriteCsvWithFieldSelection | 5 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/WriterExamples/example004WriteFixedWidthUsingConversions | 3 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/WriterExamples/example005WriteFixedWidthUsingAnnotatedBean | 4 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/WriterExamples/example006WriteSimpleTsv | 6 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/WriterExamples/example007WriteValues | 2 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/WriterExamples/example008WriteWithHeaderAnnotation | 4 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/WriterExamples/example009WriteMapWithTypeConversion | 4 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/WriterExamples/example010MultiSchemaWrite | 4 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/WriterExamples/example011MultiSchemaWriteWithBeans | 4 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/expectedOutputs/WriterExamples/example012WriteMapWithHeaderMapping | 4 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/master_detail.csv | 11 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/master_detail.tsv | 11 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/master_detail.txt | 11 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/multi_schema.csv | 5 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/multi_schema.txt | 5 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/examples/multi_schema2.txt | 5 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/fixed/essential-dos.txt | 12 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/fixed/essential-mac.txt | 1 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/fixed/essential.txt | 12 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/fixed/essential_1-dos.txt | 10 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/fixed/essential_1-mac.txt | 1 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/fixed/essential_1.txt | 10 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/fixed/essential_2-dos.txt | 10 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/fixed/essential_2-mac.txt | 1 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/fixed/essential_2.txt | 10 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/fixed/essential_3-dos.txt | 10 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/fixed/essential_3-mac.txt | 1 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/fixed/essential_3.txt | 10 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/issues/github_1/input.csv | 3 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/issues/github_177/input.csv | 13 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/issues/github_194/uk-500.csv | 1 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/issues/github_247/input-100.txt | 2 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/issues/github_7/input.csv | 4 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/issues/ticket_3/input.csv | 3 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/tsv/essential-dos.tsv | 22 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/tsv/essential-mac.tsv | 1 jtreg7-7.5.2+1+ds2/univocity-parsers/src/test/resources/tsv/essential.tsv | 22 6799 files changed, 649268 insertions(+), 5003 deletions(-) dpkg-source: warning: cannot verify inline signature for /srv/release.debian.org/tmp/tmpnualc4dp/jtreg7_7.3.1+1-1~deb12u1.dsc: no acceptable signature found dpkg-source: warning: cannot verify inline signature for /srv/release.debian.org/tmp/tmpnualc4dp/jtreg7_7.5.2+1+ds2-3~deb12u1.dsc: no acceptable signature found diff -Nru jtreg7-7.3.1+1/.github/workflows/gradle-wrapper-validation.yml jtreg7-7.5.2+1+ds2/.github/workflows/gradle-wrapper-validation.yml --- jtreg7-7.3.1+1/.github/workflows/gradle-wrapper-validation.yml 2023-08-15 15:26:56.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/.github/workflows/gradle-wrapper-validation.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -name: 'Validate Gradle Wrapper' -on: - push: - branches-ignore: - - master - - pr/* - -jobs: - validation: - name: 'Validation' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: gradle/wrapper-validation-action@v1 diff -Nru jtreg7-7.3.1+1/.github/workflows/test.yml jtreg7-7.5.2+1+ds2/.github/workflows/test.yml --- jtreg7-7.3.1+1/.github/workflows/test.yml 2023-08-15 15:26:56.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/.github/workflows/test.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -name: Build and Test JTReg - -on: - push: - branches-ignore: - - master - - pr/* - -jobs: - - linux-x64: - runs-on: ubuntu-latest - - steps: - - name: 'Check out repository' - uses: actions/checkout@v3 - with: - fetch-depth: 1 - - - name: 'Set up Java Development Kit' - uses: actions/setup-java@v3 - with: - distribution: 'oracle' - java-version: '17' - - - name: 'Build JTReg' - shell: bash - run: | - java --version - bash make/build.sh - - - name: 'Run initial tests (goal: quick-test)' - shell: bash - env: - MAKE_ARGS: quick-test - HEADLESS: 1 - run: | - bash make/build.sh --skip-download - - - name: 'Run all tests (goal: test)' - shell: bash - env: - MAKE_ARGS: test - HEADLESS: 1 - run: | - bash make/build.sh --skip-download diff -Nru jtreg7-7.3.1+1/.jcheck/conf jtreg7-7.5.2+1+ds2/.jcheck/conf --- jtreg7-7.3.1+1/.jcheck/conf 2023-08-15 15:26:56.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/.jcheck/conf 2025-10-28 19:26:35.000000000 +0000 @@ -7,7 +7,7 @@ error=author,committer,reviewers,merge,issues,executable,symlink,message,whitespace [repository] -tags=jtreg(?:4\.1-b[0-9]{2}|5\.[01]-b[0-9]{2}|6|-[6789](?:\.[0-9]+)?\+[0-9]+) +tags=jtreg(?:4\.1-b[0-9]{2}|5\.[01]-b[0-9]{2}|6|-[6789](?:\.[0-9]+)*\+[0-9]+) branches= [census] diff -Nru jtreg7-7.3.1+1/CHANGELOG.md jtreg7-7.5.2+1+ds2/CHANGELOG.md --- jtreg7-7.3.1+1/CHANGELOG.md 2023-08-15 15:26:56.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/CHANGELOG.md 2025-10-28 19:26:35.000000000 +0000 @@ -1,7 +1,73 @@ -## [Unreleased](https://git.openjdk.org/jtreg/compare/jtreg-7.3.1+1...master) +## [Unreleased](https://git.openjdk.org/jtreg/compare/jtreg-7.5.2+1...master) _nothing noteworthy, yet_ +## [7.5.2](https://git.openjdk.org/jtreg/compare/jtreg-7.5.1+1...jtreg-7.5.2+1) + +* Support `${test.main.class}` for Java source files in smart arguments [CODETOOLS-7903981](https://bugs.openjdk.org/browse/CODETOOLS-7903981) + +* Make default timeout seconds configurable [CODETOOLS-7903961](https://bugs.openjdk.org/browse/CODETOOLS-7903961) + +* Restore propagation of preview flag into library code [CODETOOLS-7903971](https://bugs.openjdk.org/browse/CODETOOLS-7903971) + +* Add support for `.jasm` and `.jcod` file in patched modules [CODETOOLS-7903955](https://bugs.openjdk.org/browse/CODETOOLS-7903955) + +* Use scratch directory for JUnit's `@TempDir` annotation by default [CODETOOLS-7903953](https://bugs.openjdk.org/browse/CODETOOLS-7903953) + + +## [7.5.1](https://git.openjdk.org/jtreg/compare/jtreg-7.5+1...jtreg-7.5.1+1) + +* Support running individual parameterized tests and @Nested test classes [CODETOOLS-7903930](https://bugs.openjdk.org/browse/CODETOOLS-7903930) + +* Remove problematic implementation for `LIBRARY.properties` support [CODETOOLS-7903940](https://bugs.openjdk.org/browse/CODETOOLS-7903940) + +* Add `test.thread.factory` property to filter tests based on test thread factory value [CODETOOLS-7903931](https://bugs.openjdk.org/browse/CODETOOLS-7903931) + +* Fix and improve `--verify-exclude` feature + [CODETOOLS-7903883](https://bugs.openjdk.org/browse/CODETOOLS-7903883) + [CODETOOLS-7903935](https://bugs.openjdk.org/browse/CODETOOLS-7903935) + +## [7.5](https://git.openjdk.org/jtreg/compare/jtreg-7.4+1...jtreg-7.5+1) + +* Restore `jtdiff` tool [CODETOOLS-7903760](https://bugs.openjdk.org/browse/CODETOOLS-7903760) + +* Add support for `LIBRARY.properties` file in the directory specified in the `@library` tag [CODETOOLS-7903775](https://bugs.openjdk.org/browse/CODETOOLS-7903775) + +* The verbose option given at the command-line is now propagated to test agents, including the JUnit test runner. + [CODETOOLS-7903443](https://bugs.openjdk.org/browse/CODETOOLS-7903443) + [CODETOOLS-7903745](https://bugs.openjdk.org/browse/CODETOOLS-7903745) + +* Report test duration information in JUnit and TestNG-based tests + [CODETOOLS-7903752](https://bugs.openjdk.org/browse/CODETOOLS-7903752) + [CODETOOLS-7903753](https://bugs.openjdk.org/browse/CODETOOLS-7903753) + +* Improve message when test times out in Agent VM mode [CODETOOLS-7902346](https://bugs.openjdk.org/browse/CODETOOLS-7902346) + +* Log time spent waiting to acquire exclusive access lock [CODETOOLS-7903188](https://bugs.openjdk.org/browse/CODETOOLS-7903188) + +* Speed-up error reporting on hosts with slow hostname lookups [CODETOOLS-7903746](https://bugs.openjdk.org/browse/CODETOOLS-7903746) + +* Updated jtreg to bundle JUnit 5.11.0 [CODETOOLS-7903821](https://bugs.openjdk.org/browse/CODETOOLS-7903821) + +## [7.4](https://git.openjdk.org/jtreg/compare/jtreg-7.3.1+1...jtreg-7.4+1) + +* Remove support for `jtdiff` [CODETOOLS-7903622](https://bugs.openjdk.org/browse/CODETOOLS-7903622) + +* jtreg now verifies ProblemList files [CODETOOLS-7903659](https://bugs.openjdk.org/browse/CODETOOLS-7903659) + +* jtreg no longer ignores VM exit code when test process reports status with "STATUS: " line [CODETOOLS-7903621](https://bugs.openjdk.org/browse/CODETOOLS-7903621) + +* Use SOURCE_BUILD_EPOCH to support reproducible builds + [CODETOOLS-7903539](https://bugs.openjdk.org/browse/CODETOOLS-7903539) + +* Updated jtreg to bundle JUnit 5.10.2 [CODETOOLS-7903578](https://bugs.openjdk.org/browse/CODETOOLS-7903578) + +* jtreg, when communicating with the AgentServer in agentvm mode, will now bind to loopback address. + [CODETOOLS-7903686](https://bugs.openjdk.org/browse/CODETOOLS-7903686) + +* jtreg, in certain cases, would incorrectly report a test as PASSED when the test process would exit with a non-zero exit code. + [CODETOOLS-7903621](https://bugs.openjdk.org/browse/CODETOOLS-7903621) + ## [7.3.1](https://git.openjdk.org/jtreg/compare/jtreg-7.3+1...jtreg-7.3.1+1) * Fixed setting default environment variables on Windows @@ -10,7 +76,7 @@ ## [7.3](https://git.openjdk.org/jtreg/compare/jtreg-7.2+1...jtreg-7.3+1) * Updated set of default environment variables set for tests on Unix-like platforms. - * Includes `DBUS_SESSION_BUS_ADDRESS`, `WAYLAND_DISPLAY`, and `XDG-*` + * Includes `DBUS_SESSION_BUS_ADDRESS`, `WAYLAND_DISPLAY`, and `XDG-*` [CODETOOLS-7903400](https://bugs.openjdk.org/browse/CODETOOLS-7903400) * Updated external dependencies. @@ -21,7 +87,7 @@ * AgentServer log() does not flush [CODETOOLS-7903470](https://bugs.openjdk.org/browse/CODETOOLS-7903470) * System.out and System.err messages are missing in jtr file when a test times out in agentvm mode [CODETOOLS-7903441](https://bugs.openjdk.org/browse/CODETOOLS-7903441) * Timeout refired %s times message confusing [CODETOOLS-7902485](https://bugs.openjdk.org/browse/CODETOOLS-7902485) - + * Fixed race-condition when running tests with a multi-module setup * [CODETOOLS-7903507](https://bugs.openjdk.org/browse/CODETOOLS-7903507) @@ -196,7 +262,7 @@ * Support `@enablePreview`. * [CODETOOLS-7902654](https://bugs.openjdk.org/browse/CODETOOLS-7902654) -* Use https://git.openjdk.java.net for CODE_TOOLS_URL. +* Use https://git.openjdk.org for CODE_TOOLS_URL. * [CODETOOLS-7902637](https://bugs.openjdk.org/browse/CODETOOLS-7902637) * Ignore specified lines in `@compile/fail/ref=`. diff -Nru jtreg7-7.3.1+1/CONTRIBUTING.md jtreg7-7.5.2+1+ds2/CONTRIBUTING.md --- jtreg7-7.3.1+1/CONTRIBUTING.md 2023-08-15 15:26:56.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/CONTRIBUTING.md 2025-10-28 19:26:35.000000000 +0000 @@ -2,7 +2,7 @@ JTReg is part of the OpenJDK [CodeTools] Project. -Please see for how to contribute. +Please see for how to contribute. -[CodeTools]: https://openjdk.java.net/projects/code-tools +[CodeTools]: https://openjdk.org/projects/code-tools diff -Nru jtreg7-7.3.1+1/README.md jtreg7-7.5.2+1+ds2/README.md --- jtreg7-7.3.1+1/README.md 2023-08-15 15:26:56.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/README.md 2025-10-28 19:26:35.000000000 +0000 @@ -12,8 +12,8 @@ * For details on running JDK tests using the JDK _make test_ framework, see [Using "make test" (the run-test framework)][make-test]. -[faq]: https://openjdk.java.net/jtreg/faq.html -[tagspec]: https://openjdk.java.net/jtreg/tag-spec.html +[faq]: https://openjdk.org/jtreg/faq.html +[tagspec]: https://openjdk.org/jtreg/tag-spec.html [make-test]: https://github.com/openjdk/jdk/blob/master/doc/testing.md ## Using IntelliJ IDEA diff -Nru jtreg7-7.3.1+1/apiguardian/.github/workflows/main.yml jtreg7-7.5.2+1+ds2/apiguardian/.github/workflows/main.yml --- jtreg7-7.3.1+1/apiguardian/.github/workflows/main.yml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/apiguardian/.github/workflows/main.yml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,57 @@ +name: CI + +on: + push: + branches: + - main + - 'releases/*' + pull_request: + branches: + - '*' + +jobs: + + gradle: + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-java@v1 + with: + java-version: 11 + - uses: eskatos/gradle-command-action@v1 + with: + arguments: --stacktrace build + + publish_artifacts: + name: Publish Snapshot Artifacts + needs: gradle + runs-on: ubuntu-latest + if: github.event_name == 'push' && github.repository == 'apiguardian-team/apiguardian' && (startsWith(github.ref, 'refs/heads/releases/') || github.ref == 'refs/heads/main') + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 11 + - name: 'Publish' + env: + ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }} + ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }} + run: ./gradlew publish -x check + + update_documentation: + name: Update Snapshot Documentation + needs: gradle + runs-on: ubuntu-latest + if: github.event_name == 'push' && github.repository == 'apiguardian-team/apiguardian' && github.ref == 'refs/heads/main' + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 11 + - name: 'Upload Documentation' + env: + GRGIT_USER: ${{ secrets.GH_TOKEN }} + run: ./gradlew gitPublishPush -x check diff -Nru jtreg7-7.3.1+1/apiguardian/.gitignore jtreg7-7.5.2+1+ds2/apiguardian/.gitignore --- jtreg7-7.3.1+1/apiguardian/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/apiguardian/.gitignore 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,22 @@ +# Gradle +.gradle +build/ + +# Ignore Gradle GUI config +gradle-app.setting + +# Eclipse +.classpath +.settings/ +.project +bin/ + +# IntelliJ +*.iml +*.ipr +*.iws +*.uml +.idea/ + +# Misc +*.log diff -Nru jtreg7-7.3.1+1/apiguardian/LICENSE jtreg7-7.5.2+1+ds2/apiguardian/LICENSE --- jtreg7-7.3.1+1/apiguardian/LICENSE 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/apiguardian/LICENSE 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + 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. diff -Nru jtreg7-7.3.1+1/apiguardian/README.md jtreg7-7.5.2+1+ds2/apiguardian/README.md --- jtreg7-7.3.1+1/apiguardian/README.md 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/apiguardian/README.md 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,29 @@ +# @API Guardian + +[![CI Status](https://github.com/apiguardian-team/apiguardian/workflows/CI/badge.svg)](https://github.com/apiguardian-team/apiguardian/actions) + +Library that provides the `@API` annotation that is used to annotate public types, methods, constructors, and fields within a framework or application in order to publish their status and level of stability and to indicate how they are intended to be used by consumers of the API. + +## How to use it + +The @API Guardian library is deployed to Maven Central. You can simply add it as a dependency: + +### Apache Maven +```xml + + org.apiguardian + apiguardian-api + 1.1.2 + +``` + +### Gradle + +```gradle +repositories { + mavenCentral() +} +dependencies { + compileOnlyApi("org.apiguardian:apiguardian-api:1.1.2") +} +``` diff -Nru jtreg7-7.3.1+1/apiguardian/build.gradle.kts jtreg7-7.5.2+1+ds2/apiguardian/build.gradle.kts --- jtreg7-7.3.1+1/apiguardian/build.gradle.kts 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/apiguardian/build.gradle.kts 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,218 @@ +import java.time.OffsetDateTime +import java.time.format.DateTimeFormatter + +plugins { + id("java") + id("eclipse") + id("idea") + id("maven-publish") + id("signing") + id("biz.aQute.bnd.builder") version "5.3.0" + id("net.nemerosa.versioning") version "2.14.0" + id("org.ajoberstar.git-publish") version "3.0.0" + id("io.github.gradle-nexus.publish-plugin") version "1.1.0" +} + +val buildTimeAndDate = OffsetDateTime.now() +val buildDate = DateTimeFormatter.ISO_LOCAL_DATE.format(buildTimeAndDate) +val buildTime = DateTimeFormatter.ofPattern("HH:mm:ss.SSSZ").format(buildTimeAndDate) +val builtByValue = project.findProperty("builtBy") ?: project.property("defaultBuiltBy") + +val isSnapshot = project.version.toString().contains("SNAPSHOT") +val docsVersion = if (isSnapshot) "snapshot" else project.version +val docsDir = File(buildDir, "ghpages-docs") +val replaceCurrentDocs = project.hasProperty("replaceCurrentDocs") + +description = "@API Guardian" +val moduleName = "org.apiguardian.api" + +repositories { + mavenCentral() +} + +java { + withJavadocJar() + withSourcesJar() +} + +val moduleSourceDir = file("src/module/java") + +tasks { + compileJava { + options.release.set(6) + } + + val compileModule by registering(JavaCompile::class) { + source(moduleSourceDir) + destinationDir = file("$buildDir/classes/java/modules") + classpath = files(compileJava.map { it.classpath }) + inputs.property("moduleName", moduleName) + inputs.property("moduleVersion", project.version) + options.release.set(9) + options.compilerArgs = listOf( + "--module-version", project.version as String, + "--module-source-path", moduleSourceDir.toString(), + "--patch-module", "$moduleName=${sourceSets.main.get().allJava.srcDirs.joinToString(":")}", + "--module", moduleName + ) + } + + jar { + fun normalizeVersion(versionLiteral: String): String { + val regex = Regex("(\\d+\\.\\d+\\.\\d+).*") + val match = regex.matchEntire(versionLiteral) + require(match != null) { + "Version '$versionLiteral' does not match version pattern, e.g. 1.0.0-QUALIFIER" + } + return match.groupValues[1] + } + manifest { + attributes( + "Created-By" to "${System.getProperty("java.version")} (${System.getProperty("java.vendor")} ${System.getProperty("java.vm.version")})", + "Built-By" to builtByValue, + "Build-Date" to buildDate, + "Build-Time" to buildTime, + "Build-Revision" to versioning.info.commit, + "Specification-Title" to project.name, + "Specification-Version" to normalizeVersion(project.version.toString()), + "Specification-Vendor" to "apiguardian.org", + "Implementation-Title" to project.name, + "Implementation-Version" to project.version, + "Implementation-Vendor" to "apiguardian.org", + "Bundle-Name" to project.name, + "Bundle-Description" to project.description, + "Bundle-DocURL" to "https://github.com/apiguardian-team/apiguardian", + "Bundle-Vendor" to "apiguardian.org", + "-exportcontents" to "org.apiguardian.api", + "Bundle-SymbolicName" to moduleName + ) + } + from(files(compileModule.map { "${it.destinationDir}/${moduleName}" })) { + include("module-info.class") + } + } + + javadoc { + (options as StandardJavadocDocletOptions).apply { + memberLevel = JavadocMemberLevel.PROTECTED + isAuthor = true + header = "@API Guardian" + addStringOption("Xdoclint:html,syntax,reference", "-quiet") + links("https://docs.oracle.com/en/java/javase/11/docs/api/") + } + } + + named("sourcesJar") { + from("${moduleSourceDir}/${moduleName}") { + include("module-info.java") + } + } + + named("javadocJar") { + from(javadoc.map { File(it.destinationDir, "element-list") }) { + // For compatibility with older tools, e.g. NetBeans 11 + rename { "package-list" } + } + } + + withType().configureEach { + from(rootDir) { + include("LICENSE") + into("META-INF") + } + } + + val prepareDocsForUploadToGhPages by registering(Copy::class) { + dependsOn(javadoc) + outputs.dir(docsDir) + + from("$buildDir/docs") { + include("javadoc/**") + } + from("$buildDir/docs/javadoc") { + // For compatibility with pre JDK 10 versions of the Javadoc tool + include("element-list") + rename { "api/package-list" } + } + into("${docsDir}/${docsVersion}") + filesMatching("javadoc/**") { + path = path.replace("javadoc/", "api/") + } + includeEmptyDirs = false + } + + val createCurrentDocsFolder by registering(Copy::class) { + dependsOn(prepareDocsForUploadToGhPages) + enabled = replaceCurrentDocs + outputs.dir("${docsDir}/current") + + from("${docsDir}/${docsVersion}") + into("${docsDir}/current") + } + + gitPublishCommit { + dependsOn(prepareDocsForUploadToGhPages, createCurrentDocsFolder) + } +} + +if (!isSnapshot) { + signing { + sign(publishing.publications) + } +} + +nexusPublishing { + packageGroup.set(group.toString()) + repositories { + sonatype() + } +} + +publishing { + publications { + create("maven") { + from(components["java"]) + pom { + name.set("${project.group}:${project.name}") + description.set("@API Guardian") + url.set("https://github.com/apiguardian-team/apiguardian") + scm { + connection.set("scm:git:git://github.com/apiguardian-team/apiguardian.git") + developerConnection.set("scm:git:git://github.com/apiguardian-team/apiguardian.git") + url.set("https://github.com/apiguardian-team/apiguardian") + } + licenses { + license { + name.set("The Apache License, Version 2.0") + url.set("http://www.apache.org/licenses/LICENSE-2.0.txt") + } + } + developers { + developer { + id.set("apiguardian") + name.set("@API Guardian Team") + email.set("team@apiguardian.org") + } + } + } + } + } +} + +gitPublish { + repoUri.set("https://github.com/apiguardian-team/apiguardian.git") + branch.set("gh-pages") + + contents { + from(docsDir) + into("docs") + } + + preserve { + include("**/*") + exclude("docs/$docsVersion/**") + if (replaceCurrentDocs) { + exclude("docs/current/**") + } + } +} diff -Nru jtreg7-7.3.1+1/apiguardian/gradle.properties jtreg7-7.5.2+1+ds2/apiguardian/gradle.properties --- jtreg7-7.3.1+1/apiguardian/gradle.properties 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/apiguardian/gradle.properties 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,5 @@ +group = org.apiguardian +version = 1.1.2 + +defaultBuiltBy = @API Guardian Team +releaseBranch = master diff -Nru jtreg7-7.3.1+1/apiguardian/gradlew jtreg7-7.5.2+1+ds2/apiguardian/gradlew --- jtreg7-7.3.1+1/apiguardian/gradlew 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/apiguardian/gradlew 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 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 +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MSYS* | MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff -Nru jtreg7-7.3.1+1/apiguardian/gradlew.bat jtreg7-7.5.2+1+ds2/apiguardian/gradlew.bat --- jtreg7-7.3.1+1/apiguardian/gradlew.bat 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/apiguardian/gradlew.bat 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff -Nru jtreg7-7.3.1+1/apiguardian/settings.gradle.kts jtreg7-7.5.2+1+ds2/apiguardian/settings.gradle.kts --- jtreg7-7.3.1+1/apiguardian/settings.gradle.kts 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/apiguardian/settings.gradle.kts 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,5 @@ +rootProject.name = "apiguardian-api" + +require(JavaVersion.current().isJava11) { + "The @API Guardian build requires Java 11. Currently executing with Java ${JavaVersion.current()}." +} diff -Nru jtreg7-7.3.1+1/apiguardian/src/main/java/org/apiguardian/api/API.java jtreg7-7.5.2+1+ds2/apiguardian/src/main/java/org/apiguardian/api/API.java --- jtreg7-7.3.1+1/apiguardian/src/main/java/org/apiguardian/api/API.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/apiguardian/src/main/java/org/apiguardian/api/API.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,126 @@ +/* + * Copyright 2002-2017 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. + */ + +package org.apiguardian.api; + +import static java.lang.annotation.ElementType.CONSTRUCTOR; +import static java.lang.annotation.ElementType.FIELD; +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.ElementType.PACKAGE; +import static java.lang.annotation.ElementType.TYPE; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +import java.lang.annotation.Documented; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +/** + * {@code @API} is used to annotate public types, methods, constructors, and + * fields within a framework or application in order to publish their + * {@link #status} and level of stability and to indicate how they are intended + * to be used by {@link #consumers} of the API. + * + *

If {@code @API} is present on a type, it is considered to hold for all + * public members of the type as well. However, a member of such an annotated + * type is allowed to declare a {@link Status} of lower stability. For example, + * a class annotated with {@code @API(status = STABLE)} may declare a constructor + * for internal usage that is annotated with {@code @API(status = INTERNAL)}. + * + *

If {@code @API} is present on a package, it is considered to hold for all + * public types in its package. The same rules for lowered stability apply as + * if they were specified on a type. + * + * @since 1.0 + */ +@Target({ TYPE, METHOD, CONSTRUCTOR, FIELD, PACKAGE }) +@Retention(RUNTIME) +@Documented +public @interface API { + + /** + * The current {@linkplain Status status} of the API. + */ + Status status(); + + /** + * The version of the API when the {@link #status} was last changed. + * + *

Defaults to an empty string, signifying that the since + * version is unknown. + */ + String since() default ""; + + /** + * List of packages belonging to intended consumers. + * + *

The supplied packages can be fully qualified package names or + * patterns containing asterisks that will be used as wildcards. + * + *

Defaults to {@code "*"}, signifying that the API is intended to be + * consumed by any package. + */ + String[] consumers() default "*"; + + /** + * Indicates the status of an API element and therefore its level of + * stability as well. + */ + enum Status { + + /** + * Must not be used by any external code. Might be removed without prior + * notice. + */ + INTERNAL, + + /** + * Should no longer be used. Might disappear in the next minor release. + * + *

This status is usually used in combination with the standard annotation + * {@link Deprecated @Deprecated} because that annotation is recognized by + * IDEs and the compiler. However, there are also cases where this status + * can be used on its own, for example when transitioning a {@link #MAINTAINED} + * feature to an {@link #INTERNAL} one. + */ + DEPRECATED, + + /** + * Intended for new, experimental features where the publisher of the + * API is looking for feedback. + * + *

Use with caution. Might be promoted to {@link #MAINTAINED} or + * {@link #STABLE} in the future, but might also be removed without + * prior notice. + */ + EXPERIMENTAL, + + /** + * Intended for features that will not be changed in a backwards-incompatible + * way for at least the next minor release of the current major version. + * If scheduled for removal, such a feature will be demoted to + * {@link #DEPRECATED} first. + */ + MAINTAINED, + + /** + * Intended for features that will not be changed in a backwards-incompatible + * way in the current major version. + */ + STABLE; + + } + +} diff -Nru jtreg7-7.3.1+1/apiguardian/src/module/java/org.apiguardian.api/module-info.java jtreg7-7.5.2+1+ds2/apiguardian/src/module/java/org.apiguardian.api/module-info.java --- jtreg7-7.3.1+1/apiguardian/src/module/java/org.apiguardian.api/module-info.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/apiguardian/src/module/java/org.apiguardian.api/module-info.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,3 @@ +module org.apiguardian.api { + exports org.apiguardian.api; +} diff -Nru jtreg7-7.3.1+1/debian/apiguardian/poms jtreg7-7.5.2+1+ds2/debian/apiguardian/poms --- jtreg7-7.3.1+1/debian/apiguardian/poms 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/apiguardian/poms 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1 @@ +build/debian/apiguardian-api.pom --artifact=build/libs/apiguardian-api-*.jar --java-lib diff -Nru jtreg7-7.3.1+1/debian/apiguardian/rules jtreg7-7.5.2+1+ds2/debian/apiguardian/rules --- jtreg7-7.3.1+1/debian/apiguardian/rules 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/apiguardian/rules 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,16 @@ +#!/usr/bin/make -f + +%: + dh $@ --buildsystem=gradle --with maven-repo-helper + +override_dh_auto_clean: + dh_auto_clean + # Remove the build.gradle file we created during configure + rm -f build.gradle settings.gradle + +override_dh_auto_configure: + # Until the Debian Gradle toolchain has Kotlin support, + # copy the (patched) build.gradle.kts to build.gradle + cp build.gradle.kts build.gradle + cp settings.gradle.kts settings.gradle + dh_auto_configure diff -Nru jtreg7-7.3.1+1/debian/changelog jtreg7-7.5.2+1+ds2/debian/changelog --- jtreg7-7.3.1+1/debian/changelog 2024-01-26 14:42:34.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/changelog 2026-04-25 10:14:48.000000000 +0000 @@ -1,8 +1,156 @@ -jtreg7 (7.3.1+1-1~deb12u1) bookworm-security; urgency=medium +jtreg7 (7.5.2+1+ds2-3~deb12u1) bookworm-security; urgency=medium - * Rebuild for bookworm, needed for latest OpenJDK 17.x release + * Rebuild for Bookworm, required by the latest OpenJDK 17 security + release - -- Moritz Mühlenhoff Fri, 26 Jan 2024 15:42:34 +0100 + -- Moritz Mühlenhoff Sat, 25 Apr 2026 12:14:48 +0200 + +jtreg7 (7.5.2+1+ds2-3) unstable; urgency=medium + + * d/p/codetools-7904157-proposed.patch: override compile + timeout to resolve the test failure due to the compilation + timing out with the default timeout (Closes: #1128796). + + -- Vladimir Petko Mon, 23 Feb 2026 17:42:54 +1300 + +jtreg7 (7.5.2+1+ds2-2) unstable; urgency=medium + + * d/p/codetools-7904152.patch: skip security policy tests + with Java 25 (CODETOOLS-7904152). + + -- Vladimir Petko Mon, 16 Feb 2026 10:53:39 +1300 + +jtreg7 (7.5.2+1+ds2-1) unstable; urgency=medium + + * d/{control, copyright,p/testng-build-with-gradle.patch}: drop + snakeyaml dependency (Closes: #1117950). + * Add patches to resolve test ftbfs (Closes: #1115694): + - d/p/codetools-7904101.patch: capture all stdout/stderr output + from the agent vm to the log file. + - d/p/codetools-7904104-proposed.patch: do not interrupt main + thread if the agent process is killed. + - d/p/codetools-7904105-proposed.patch: synchronize test result + updates. + - d/p/codetools-7904106-proposed.patch: use different work + directories for TestNativePath. + - d/p/codetools-7904107-proposed.patch: add a separate target to + filter log files. + * d/flush_stream.patch: drop patch, it is replaced by + d/p/codetools-7904101.patch. + * d/watch: update repack version. + + -- Vladimir Petko Thu, 23 Oct 2025 08:54:01 +1300 + +jtreg7 (7.5.2+1+ds1-2) unstable; urgency=medium + + * d/copyright: revert FSF address change. + * d/s/lintian-overrides, d/jtreg7.lintian-overrides: add override for + the old FSF address. + + -- Vladimir Petko Thu, 21 Aug 2025 08:17:51 +1200 + +jtreg7 (7.5.2+1+ds1-1) unstable; urgency=medium + + [ Vladimir Petko ] + * New upstream release 7.5.2+1. + - d/watch: set major jtreg version to 7, update junit5 download + url. + - refresh patches. + - d/picocli/maven.rules: replace groovy version with 'debian'. + - d/p/preview-test.patch: enable --enable-preview tests for + Java > 11. + * d/control: update Standards Version to 4.7.2 (no changes). + * Add lintian overrides. + * d/copyright: update FSF address. + + [ tony mancill ] + * Add flush-alarm.patch + + -- Vladimir Petko Mon, 04 Aug 2025 10:39:03 +1200 + +jtreg7 (7.5.1+1+ds1-3) unstable; urgency=medium + + * d/t/self-test: pass JAVA_SPECIFICATION_VERSION to make to fix + autopkgtest regression (Closes: #1102171). + + -- Vladimir Petko Tue, 08 Apr 2025 08:14:26 +1200 + +jtreg7 (7.5.1+1+ds1-2) unstable; urgency=medium + + * Fix ftbfs in backports (Closes: #1102171): + - d/p/jline3-01-ignore-warnings.patch: ignore builtins warnings. + - d/rules: use upstream expression from make/build.sh to set + JAVA_SPECIFICATION_VERSION. Add JAVA_SPECIFICATION_VERSION + make parameter. + + -- Vladimir Petko Sun, 06 Apr 2025 12:28:18 +1200 + +jtreg7 (7.5.1+1+ds1-1) unstable; urgency=medium + + * New upstream release 7.5.1 build 1. + - d/watch: update junit5 to 5.11.4. + - d/watch: update opentest4j-reporting to 1.0.1-M2. + * d/p/{codetools-7903760, java21-codetools-7903645}.patch: drop + patches applied upstream. + * d/junit5: add generated JRE.java source. + + -- Vladimir Petko Thu, 06 Feb 2025 10:11:14 +1300 + +jtreg7 (7.4+1+ds1-1) unstable; urgency=medium + + * New upstream release 7.4 build 1. + * d/p/opentest4j-reporting-01-gradle-compatibility.patch: set + source/target compatibility 8 to support openjdk-11 jtreg tests + (Closes: #1071976). + * d/p/watch: update watch for the new upstream release. + * d/p/codetools-7903760.patch: apply upstream patch to revert + jtdiff removal. + * d/p/reproducible-build.patch: refresh patch. + * d/p/java21-this-escape.patch: drop patch applied upstream. + * d/rules: create build/test/ directory. + + -- Vladimir Petko Wed, 03 Jul 2024 14:34:39 +1200 + +jtreg7 (7.3.1+1+ds1-2) unstable; urgency=medium + + [ Pushkar Kulkarni ] + * d/t/self-test: Update jar paths for autopkgtests + (Closes: #1070740). + + -- Vladimir Petko Thu, 09 May 2024 08:52:53 +1200 + +jtreg7 (7.3.1+1+ds1-1) unstable; urgency=medium + + * Team upload + + [ Vladimir Petko ] + * Vendor jtreg7 dependencies: apiguardian, hawt-jni, jansi1, jline3, + junit4, junit5, libhamcrest-java, opentest4j, opentest4j-reporting, + picocli, testng7, univocity-parsers to allow backports + (Closes: #1068629). + - d/watch: build MUT original tarball. + - d/component-scripts: add scripts to build the bundled components. + - d/copyright: include bundled components copyrights. + * d/control: downgrade debhelper compatibility level to 11 for + backports. + * d/rules: fix man page generation by using the version option. + * Repack original tarball to drop excluded files. + + -- tony mancill Mon, 06 May 2024 19:55:00 -0700 + +jtreg7 (7.3.1+1-2) unstable; urgency=medium + + * Team upload. + + [ Vladimir Petko ] + * d/p/java21-*: add Java 21 compatibility patches: fix this-escape + warning, disable tests failing due to SecurityManager changes + (Closes: #1057512). + + [ Emmanuel Bourg ] + * Added the Vcs-* fields + + -- Emmanuel Bourg Tue, 09 Apr 2024 14:39:35 +0200 jtreg7 (7.3.1+1-1) unstable; urgency=medium diff -Nru jtreg7-7.3.1+1/debian/compat jtreg7-7.5.2+1+ds2/debian/compat --- jtreg7-7.3.1+1/debian/compat 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/compat 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1 @@ +11 diff -Nru jtreg7-7.3.1+1/debian/component-scripts/build-components.sh jtreg7-7.5.2+1+ds2/debian/component-scripts/build-components.sh --- jtreg7-7.3.1+1/debian/component-scripts/build-components.sh 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/component-scripts/build-components.sh 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,25 @@ +#!/bin/sh +if [ -z ${DH_VERBOSE+x} ]; then + set -e +else + set -ex +fi + +package=$1 +shift +package_dir=`pwd` + +for component in $@; do + # mh_* only work from the current directory. + # in order to give it context copy debian/ into component directory + # this includes the local maven repo + debian/component-scripts/setup-component.sh ${package} ${component} + + cd ${component} + + make -f debian/rules binary + + cd ${package_dir} + mkdir -p ${component}/debian/${package}/usr/share/maven-repo + rsync -Lav ${component}/debian/${package}/usr/share/maven-repo ${package_dir}/debian/built-components +done \ No newline at end of file diff -Nru jtreg7-7.3.1+1/debian/component-scripts/clean-components.sh jtreg7-7.5.2+1+ds2/debian/component-scripts/clean-components.sh --- jtreg7-7.3.1+1/debian/component-scripts/clean-components.sh 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/component-scripts/clean-components.sh 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,24 @@ +#!/bin/sh +if [ -z ${DH_VERBOSE+x} ]; then + set -e +else + set -ex +fi + +package=$1 +shift +package_dir=`pwd` + +for component in $@; do + # mh_* only work from the current directory. + # in order to give it context copy debian/ into component directory + # this includes the local maven repo + + debian/component-scripts/setup-component.sh ${package} ${component} + + (cd ${component} && make -f debian/rules clean) + + rm -rf ${component}/debian +done + +rm -rf debian/built-components diff -Nru jtreg7-7.3.1+1/debian/component-scripts/setup-component.sh jtreg7-7.5.2+1+ds2/debian/component-scripts/setup-component.sh --- jtreg7-7.3.1+1/debian/component-scripts/setup-component.sh 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/component-scripts/setup-component.sh 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,14 @@ +#!/bin/sh + +package=$1 +component=$2 + +mkdir -p ${component}/debian/ +cp debian/control ${component}/debian +cp debian/changelog ${component}/debian +cp debian/compat ${component}/debian +cp debian/maven.properties ${component}/debian +cp debian/${component}/poms ${component}/debian/${package}.poms +cp debian/${component}/maven.rules ${component}/debian/ +cp debian/${component}/maven.ignoreRules ${component}/debian/ +cp debian/${component}/rules ${component}/debian/ diff -Nru jtreg7-7.3.1+1/debian/control jtreg7-7.5.2+1+ds2/debian/control --- jtreg7-7.3.1+1/debian/control 2023-08-24 16:28:41.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/control 2026-02-23 04:42:48.000000000 +0000 @@ -5,22 +5,45 @@ Uploaders: Matthias Klose Build-Depends: ant, - debhelper-compat (=13), + debhelper (>=11), default-jdk, help2man, javahelp2, javahelper, - libjtharness-java (>= 6.0), - libxalan2-java, - libhamcrest-java, - libtestng7-java, libasmtools-java, libjcommander-java, libslf4j-java, - junit5, libguice-java, - zip -Standards-Version: 4.6.2 + libjline2-java, + zip, + libjansi-native-java (>= 1.7), + libmaven-bundle-plugin-java, + maven-repo-helper, + maven-debian-helper, + gradle-debian-helper (>= 1.4), + groovy (>= 2.4.10), + libjna-java, + libjuniversalchardet-java, + libmaven-dependency-plugin-java, + libmaven-source-plugin-java, + libbuild-helper-maven-plugin-java, + junit, + libeasymock-java, + libjmock-java, + rsync, + libmaven-shade-plugin-java, + libassertj-core-java, + libjtharness-java (>= 6.0), + libfindbugs-java, + libbsh-java, + libasm-java, + libcommons-lang-java, + libmaven-plugin-tools-java, + libplexus-component-metadata-java, + libxbean-java, +Standards-Version: 4.7.2 +Vcs-Git: https://salsa.debian.org/java-team/jtreg7.git +Vcs-Browser: https://salsa.debian.org/java-team/jtreg7 Homepage: https://openjdk.java.net/jtreg Rules-Requires-Root: no @@ -32,13 +55,10 @@ javahelp2, libjtharness-java (>= 6.0), libxalan2-java, - libhamcrest-java, libasmtools-java, libjcommander-java, libslf4j-java, - junit5, libguice-java, - libtestng7-java Conflicts: jtreg, jtreg6 Description: Regression Test Harness for the OpenJDK platform jtreg is the test harness used by the OpenJDK test framework. diff -Nru jtreg7-7.3.1+1/debian/copyright jtreg7-7.5.2+1+ds2/debian/copyright --- jtreg7-7.3.1+1/debian/copyright 2023-05-23 02:28:12.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/copyright 2026-02-23 04:42:48.000000000 +0000 @@ -1,9 +1,55 @@ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -# Exclude directories containing -# - Intellij IDEA plugin -# - Github Actions -# - checkstyle -Files-Excluded: plugins .github make/checkstyle +Files-Excluded: + plugins + .github + make/checkstyle +Files-Excluded-apiguardian: + gradle +Files-Excluded-jline3: + demo/wget.exe + .mvn +Files-Excluded-junit4: + lib + mvnw + mvnw.cmd + .mvn + *.jar + *.zip + apache-maven + .classpath + .project + .settings + .travis.yml + src/site +Files-Excluded-junit5: + gradlew* + gradle/wrapper + documentation +Files-Excluded-libhamcrest-java: + gradlew* + gradle/wrapper + docs/javadoc +Files-Excluded-opentest4j: + gradlew* + gradle +Files-Excluded-opentest4j-reporting: + gradlew* + gradle + .github/* +Files-Excluded-picocli: + docs + gradle/wrapper + gradlew* +Files-Excluded-testng: + .gitignore + .gitattributes + .github/* + gradle/* + testng-core/src/main/java/org/testng/internal/Yaml.java + testng-core/src/test/java/test/yaml/YamlTest.java + testng-core/src/main/java/org/testng/Converter.java + testng-core/src/main/java/org/testng/internal/YamlParser.java + testng-core/src/main/resources/META-INF/services/org.testng.xml.ISuiteParser Upstream-Name: jtreg Source: https://github.com/openjdk/jtreg/ @@ -55,6 +101,89 @@ the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. +Files: hawt-jni/* +Copyright: 2009-2014, FuseSource Corp. + 2004-2008, IBM Corporation and others +License: Eclipse-Public-License-v1.0 + +Files: hawt-jni/hawtjni-example/pom.xml + hawt-jni/hawtjni-generator/pom.xml + hawt-jni/hawtjni-maven-plugin/* + hawt-jni/hawtjni-runtime/pom.xml + hawt-jni/hawtjni-website/* +Copyright: 2009-2014, FuseSource Corp +License: Apache-2.0 + +Files: hawt-jni/hawtjni-generator/src/main/resources/windows/stdint.h +Copyright: 2006-2008, Alexander Chemeris +License: BSD-3-clause + +Files: jansi1/* +Copyright: 2009-2017 the original author(s) +License: Apache-2.0 + +Files: jline3/* +Copyright: 2000-2005, Dieter Wimberger + 2002-2017, Guillaume Nodet + 2002-2016, Matti Rintanikkola + 2002-2016, Jason Dillon +License: BSD-3-clause + +Files: jline3/builtins/* + jline3/reader/src/main/java/org/jline/reader/EOFError.java + jline3/reader/src/main/java/org/jline/reader/SyntaxError.java + jline3/terminal-jna/src/main/java/org/jline/terminal/impl/jna/win/AnsiOutputStream.java +Copyright: 2002-2016, Guillaume Nodet +License: Apache-2.0 + +Files: junit4/* +Copyright: 2006-2020 Junit contributors +License: EPL-1 + +Files: junit5/* +Copyright: 2015-2019, Sam Brannen + 2015-2019, Marc Philipp + 2016-2019, Christian Stein + 2015-2017, Johannes Link + 2016-2018, Matthias Merdes + 2016-2018, Konstantin Lutovich + 2016-2017, Stefan Bechtold + 2016-2017, Stefan Birkner + 2016-2017, Jonathan Bluett-Duncan + 2015-2016, Jens Schauder + 2016-2018, Nicolai Parlog +License: EPL-2.0 + +Files: libhamcrest-java/* +Copyright: 2000-2006, www.hamcrest.org +License: BSD-3-clause + +Files: opentest4j-reporting/* +Copyright: 2021-2022, Marc Philipp +License: Apache-2.0 + +Files: picocli/* +Copyright: 2017-2018, Remko Popma + 2017, Jim White + 2017, Robert Zenz +License: Apache-2.0 + +Files: picocli/src/main/java/picocli/CommandLine.java +Copyright: 2017-2018, Remko Popma + 2007, Burt Beckwith +License: Apache-2.0 +Comment: + File contains code snippet released under Apache-2.0 on a blog, + http://www.nearinfinity.com/blogs/seth_schroeder/groovy_cosine_similarity_in_grails.html + +Files: testng/* +Copyright: 2013, Cedric Beust +License: Apache-2.0 + +Files: univocity-parsers/* +Copyright: 2013-2019, Univocity Software Pty Ltd +License: Apache-2.0 + Files: debian/* Copyright: 2023 Canonical Ltd. 2011 Guillaume Mazoyer @@ -74,3 +203,810 @@ . On Debian systems, the complete text of the GNU General Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". + +Files: debian/jansi1/* +Copyright: 2010, Miguel Landaeta + 2016-2017, Markus Koschany +License: Apache-2.0 + +Files: debian/jline3/* +Copyright: 2019, Saif Abdul Cassim + 2020, Samyak Jain +License: BSD-3-clause +Comment: + The Debian packaging is licensed under the same terms as the upstream project. + +Files: debian/junit4/* +Copyright: 2007, Florian Weimer + 2008-2012, Michael Koch, Varun Hiremath, Damien Raude-Morvan, Ludovic + Claude, Torsten Werner, Jakub Adam, Niels Thykier + 2013-2020, tony mancill, Emmanuel Bourg, Markus Koschany +License: EPL-1 + +Files: debian/junit5/* +Copyright: 2019, Emmanuel Bourg +License: EPL-2.0 + +Files: debian/libhamcrest-java/* +Copyright: 2008, Varun Hiremath +License: GPL + On Debian systems, the complete text of the GPL License can be + found in `/usr/share/common-licenses/GPL'. + +Files: debian/opentest4j-reporting/* +Copyright: 2022, Emmanuel Bourg +License: Apache-2.0 + +Files: debian/picocli/* +Copyright: 2018, Miroslav Kravec + 2021-2022, tony mancill +License: Apache-2.0 + +Files: debian/testng/* +Copyright: 2013, Eugene Zhukov + 2023, Canonical Ltd. +License: Apache-2.0 + +Files: debian/univocity-parsers/* +Copyright: 2019, Emmanuel Bourg +License: Apache-2.0 + +License: Apache-2.0 + 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. + . + The full text of the Apache 2.0 license is distributed in + /usr/share/common-licenses/Apache-2.0 on Debian systems. + +License: BSD-3-clause + Redistribution and use in source and binary forms, with or + without modification, are permitted provided that the following + conditions are met: + . + Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + . + Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with + the distribution. + . + Neither the name of JLine nor the names of its contributors + may be used to endorse or promote products derived from this + software without specific prior written permission. + . + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, + BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO + EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + OF THE POSSIBILITY OF SUCH DAMAGE. + +License: EPL-1 + Eclipse Public License - v 1.0 + . + THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC + LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM + CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. + . + 1. DEFINITIONS + . + "Contribution" means: + . + a) in the case of the initial Contributor, the initial code and + documentation distributed under this Agreement, and + b) in the case of each subsequent Contributor: + . + i) changes to the Program, and + . + ii) additions to the Program; + . + where such changes and/or additions to the Program originate from and are + distributed by that particular Contributor. A Contribution 'originates' + from a Contributor if it was added to the Program by such Contributor + itself or anyone acting on such Contributor's behalf. Contributions do + not include additions to the Program which: (i) are separate modules of + software distributed in conjunction with the Program under their own + license agreement, and (ii) are not derivative works of the Program. + . + "Contributor" means any person or entity that distributes the Program. + . + "Licensed Patents " mean patent claims licensable by a Contributor which are + necessarily infringed by the use or sale of its Contribution alone or when + combined with the Program. + . + "Program" means the Contributions distributed in accordance with this Agreement. + . + "Recipient" means anyone who receives the Program under this Agreement, + including all Contributors. + . + 2. GRANT OF RIGHTS + . + a) Subject to the terms of this Agreement, each Contributor hereby grants + Recipient a non-exclusive, worldwide, royalty-free copyright license to + reproduce, prepare derivative works of, publicly display, publicly perform, + distribute and sublicense the Contribution of such Contributor, if any, and + such derivative works, in source code and object code form. + . + b) Subject to the terms of this Agreement, each Contributor hereby grants + Recipient a non-exclusive, worldwide, royalty-free patent license under + Licensed Patents to make, use, sell, offer to sell, import and otherwise + transfer the Contribution of such Contributor, if any, in source code and + object code form. This patent license shall apply to the combination of the + Contribution and the Program if, at the time the Contribution is added by the + Contributor, such addition of the Contribution causes such combination to be + covered by the Licensed Patents. The patent license shall not apply to any + other combinations which include the Contribution. No hardware per se is + licensed hereunder. + . + c) Recipient understands that although each Contributor grants the + licenses to its Contributions set forth herein, no assurances are provided by + any Contributor that the Program does not infringe the patent or other + intellectual property rights of any other entity. Each Contributor disclaims + any liability to Recipient for claims brought by any other entity based on + infringement of intellectual property rights or otherwise. As a condition to + exercising the rights and licenses granted hereunder, each Recipient hereby + assumes sole responsibility to secure any other intellectual property rights + needed, if any. For example, if a third party patent license is required to + allow Recipient to distribute the Program, it is Recipient's responsibility to + acquire that license before distributing the Program. + . + d) Each Contributor represents that to its knowledge it has sufficient + copyright rights in its Contribution, if any, to grant the copyright license + set forth in this Agreement. + . + 3. REQUIREMENTS + . + A Contributor may choose to distribute the Program in object code form under + its own license agreement, provided that: + . + a) it complies with the terms and conditions of this Agreement; and + . + b) its license agreement: + . + i) effectively disclaims on behalf of all Contributors all warranties and + conditions, express and implied, including warranties or conditions of title + and non-infringement, and implied warranties or conditions of merchantability + and fitness for a particular purpose; + . + ii) effectively excludes on behalf of all Contributors all liability for + damages, including direct, indirect, special, incidental and consequential + damages, such as lost profits; + . + iii) states that any provisions which differ from this Agreement are + offered by that Contributor alone and not by any other party; and + . + iv) states that source code for the Program is available from such + Contributor, and informs licensees how to obtain it in a reasonable manner on + or through a medium customarily used for software exchange. + . + When the Program is made available in source code form: + . + a) it must be made available under this Agreement; and + . + b) a copy of this Agreement must be included with each copy of the + Program. + . + Contributors may not remove or alter any copyright notices contained within the + Program. + . + Each Contributor must identify itself as the originator of its Contribution, if + any, in a manner that reasonably allows subsequent Recipients to identify the + originator of the Contribution. + . + 4. COMMERCIAL DISTRIBUTION + . + Commercial distributors of software may accept certain responsibilities with + respect to end users, business partners and the like. While this license is + intended to facilitate the commercial use of the Program, the Contributor who + includes the Program in a commercial product offering should do so in a manner + which does not create potential liability for other Contributors. Therefore, if + a Contributor includes the Program in a commercial product offering, such + Contributor ("Commercial Contributor") hereby agrees to defend and indemnify + every other Contributor ("Indemnified Contributor") against any losses, damages + and costs (collectively "Losses") arising from claims, lawsuits and other legal + actions brought by a third party against the Indemnified Contributor to the + extent caused by the acts or omissions of such Commercial Contributor in + connection with its distribution of the Program in a commercial product + offering. The obligations in this section do not apply to any claims or Losses + relating to any actual or alleged intellectual property infringement. In order + to qualify, an Indemnified Contributor must: a) promptly notify the Commercial + Contributor in writing of such claim, and b) allow the Commercial Contributor + to control, and cooperate with the Commercial Contributor in, the defense and + any related settlement negotiations. The Indemnified Contributor may + participate in any such claim at its own expense. + . + For example, a Contributor might include the Program in a commercial product + offering, Product X. That Contributor is then a Commercial Contributor. If that + Commercial Contributor then makes performance claims, or offers warranties + related to Product X, those performance claims and warranties are such + Commercial Contributor's responsibility alone. Under this section, the + Commercial Contributor would have to defend claims against the other + Contributors related to those performance claims and warranties, and if a court + requires any other Contributor to pay any damages as a result, the Commercial + Contributor must pay those damages. + . + 5. NO WARRANTY + . + EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR + IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, + NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each + Recipient is solely responsible for determining the appropriateness of using + and distributing the Program and assumes all risks associated with its exercise + of rights under this Agreement, including but not limited to the risks and + costs of program errors, compliance with applicable laws, damage to or loss of + data, programs or equipment, and unavailability or interruption of operations. + . + 6. DISCLAIMER OF LIABILITY + . + EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY + CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST + PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS + GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + . + 7. GENERAL + . + If any provision of this Agreement is invalid or unenforceable under applicable + law, it shall not affect the validity or enforceability of the remainder of the + terms of this Agreement, and without further action by the parties hereto, such + provision shall be reformed to the minimum extent necessary to make such + provision valid and enforceable. + . + If Recipient institutes patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging that the + Program itself (excluding combinations of the Program with other software or + hardware) infringes such Recipient's patent(s), then such Recipient's rights + granted under Section 2(b) shall terminate as of the date such litigation is + filed. + . + All Recipient's rights under this Agreement shall terminate if it fails to + comply with any of the material terms or conditions of this Agreement and does + not cure such failure in a reasonable period of time after becoming aware of + such noncompliance. If all Recipient's rights under this Agreement terminate, + Recipient agrees to cease use and distribution of the Program as soon as + reasonably practicable. However, Recipient's obligations under this Agreement + and any licenses granted by Recipient relating to the Program shall continue + and survive. + . + Everyone is permitted to copy and distribute copies of this Agreement, but in + order to avoid inconsistency the Agreement is copyrighted and may only be + modified in the following manner. The Agreement Steward reserves the right to + publish new versions (including revisions) of this Agreement from time to time. + No one other than the Agreement Steward has the right to modify this Agreement. + The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to + serve as the Agreement Steward to a suitable separate entity. Each new version + of the Agreement will be given a distinguishing version number. The Program + (including Contributions) may always be distributed subject to the version of + the Agreement under which it was received. In addition, after a new version of + the Agreement is published, Contributor may elect to distribute the Program + (including its Contributions) under the new version. Except as expressly stated + in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to + the intellectual property of any Contributor under this Agreement, whether + expressly, by implication, estoppel or otherwise. All rights in the Program not + expressly granted under this Agreement are reserved. + . + This Agreement is governed by the laws of the State of New York and the + intellectual property laws of the United States of America. No party to this + Agreement will bring a legal action under this Agreement more than one year + after the cause of action arose. Each party waives its rights to a jury trial + in any resulting litigation. + +License: EPL-2.0 + Eclipse Public License - v 2.0 + . + THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE + PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION + OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. + . + 1. DEFINITIONS + . + "Contribution" means: + . + a) in the case of the initial Contributor, the initial content + Distributed under this Agreement, and + . + b) in the case of each subsequent Contributor: + i) changes to the Program, and + ii) additions to the Program; + where such changes and/or additions to the Program originate from + and are Distributed by that particular Contributor. A Contribution + "originates" from a Contributor if it was added to the Program by + such Contributor itself or anyone acting on such Contributor's behalf. + Contributions do not include changes or additions to the Program that + are not Modified Works. + . + "Contributor" means any person or entity that Distributes the Program. + . + "Licensed Patents" mean patent claims licensable by a Contributor which + are necessarily infringed by the use or sale of its Contribution alone + or when combined with the Program. + . + "Program" means the Contributions Distributed in accordance with this + Agreement. + . + "Recipient" means anyone who receives the Program under this Agreement + or any Secondary License (as applicable), including Contributors. + . + "Derivative Works" shall mean any work, whether in Source Code or other + form, that is based on (or derived from) the Program and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. + . + "Modified Works" shall mean any work in Source Code or other form that + results from an addition to, deletion from, or modification of the + contents of the Program, including, for purposes of clarity any new file + in Source Code form that contains any contents of the Program. Modified + Works shall not include works that contain only declarations, + interfaces, types, classes, structures, or files of the Program solely + in each case in order to link to, bind by name, or subclass the Program + or Modified Works thereof. + . + "Distribute" means the acts of a) distributing or b) making available + in any manner that enables the transfer of a copy. + . + "Source Code" means the form of a Program preferred for making + modifications, including but not limited to software source code, + documentation source, and configuration files. + . + "Secondary License" means either the GNU General Public License, + Version 2.0, or any later versions of that license, including any + exceptions or additional permissions as identified by the initial + Contributor. + . + 2. GRANT OF RIGHTS + . + a) Subject to the terms of this Agreement, each Contributor hereby + grants Recipient a non-exclusive, worldwide, royalty-free copyright + license to reproduce, prepare Derivative Works of, publicly display, + publicly perform, Distribute and sublicense the Contribution of such + Contributor, if any, and such Derivative Works. + . + b) Subject to the terms of this Agreement, each Contributor hereby + grants Recipient a non-exclusive, worldwide, royalty-free patent + license under Licensed Patents to make, use, sell, offer to sell, + import and otherwise transfer the Contribution of such Contributor, + if any, in Source Code or other form. This patent license shall + apply to the combination of the Contribution and the Program if, at + the time the Contribution is added by the Contributor, such addition + of the Contribution causes such combination to be covered by the + Licensed Patents. The patent license shall not apply to any other + combinations which include the Contribution. No hardware per se is + licensed hereunder. + . + c) Recipient understands that although each Contributor grants the + licenses to its Contributions set forth herein, no assurances are + provided by any Contributor that the Program does not infringe the + patent or other intellectual property rights of any other entity. + Each Contributor disclaims any liability to Recipient for claims + brought by any other entity based on infringement of intellectual + property rights or otherwise. As a condition to exercising the + rights and licenses granted hereunder, each Recipient hereby + assumes sole responsibility to secure any other intellectual + property rights needed, if any. For example, if a third party + patent license is required to allow Recipient to Distribute the + Program, it is Recipient's responsibility to acquire that license + before distributing the Program. + . + d) Each Contributor represents that to its knowledge it has + sufficient copyright rights in its Contribution, if any, to grant + the copyright license set forth in this Agreement. + . + e) Notwithstanding the terms of any Secondary License, no + Contributor makes additional grants to any Recipient (other than + those set forth in this Agreement) as a result of such Recipient's + receipt of the Program under the terms of a Secondary License + (if permitted under the terms of Section 3). + . + 3. REQUIREMENTS + . + 3.1 If a Contributor Distributes the Program in any form, then: + . + a) the Program must also be made available as Source Code, in + accordance with section 3.2, and the Contributor must accompany + the Program with a statement that the Source Code for the Program + is available under this Agreement, and informs Recipients how to + obtain it in a reasonable manner on or through a medium customarily + used for software exchange; and + . + b) the Contributor may Distribute the Program under a license + different than this Agreement, provided that such license: + i) effectively disclaims on behalf of all other Contributors all + warranties and conditions, express and implied, including + warranties or conditions of title and non-infringement, and + implied warranties or conditions of merchantability and fitness + for a particular purpose; + . + ii) effectively excludes on behalf of all other Contributors all + liability for damages, including direct, indirect, special, + incidental and consequential damages, such as lost profits; + . + iii) does not attempt to limit or alter the recipients' rights + in the Source Code under section 3.2; and + . + iv) requires any subsequent distribution of the Program by any + party to be under a license that satisfies the requirements + of this section 3. + . + 3.2 When the Program is Distributed as Source Code: + . + a) it must be made available under this Agreement, or if the + Program (i) is combined with other material in a separate file or + files made available under a Secondary License, and (ii) the initial + Contributor attached to the Source Code the notice described in + Exhibit A of this Agreement, then the Program may be made available + under the terms of such Secondary Licenses, and + . + b) a copy of this Agreement must be included with each copy of + the Program. + . + 3.3 Contributors may not remove or alter any copyright, patent, + trademark, attribution notices, disclaimers of warranty, or limitations + of liability ("notices") contained within the Program from any copy of + the Program which they Distribute, provided that Contributors may add + their own appropriate notices. + . + 4. COMMERCIAL DISTRIBUTION + . + Commercial distributors of software may accept certain responsibilities + with respect to end users, business partners and the like. While this + license is intended to facilitate the commercial use of the Program, + the Contributor who includes the Program in a commercial product + offering should do so in a manner which does not create potential + liability for other Contributors. Therefore, if a Contributor includes + the Program in a commercial product offering, such Contributor + ("Commercial Contributor") hereby agrees to defend and indemnify every + other Contributor ("Indemnified Contributor") against any losses, + damages and costs (collectively "Losses") arising from claims, lawsuits + and other legal actions brought by a third party against the Indemnified + Contributor to the extent caused by the acts or omissions of such + Commercial Contributor in connection with its distribution of the Program + in a commercial product offering. The obligations in this section do not + apply to any claims or Losses relating to any actual or alleged + intellectual property infringement. In order to qualify, an Indemnified + Contributor must: a) promptly notify the Commercial Contributor in + writing of such claim, and b) allow the Commercial Contributor to control, + and cooperate with the Commercial Contributor in, the defense and any + related settlement negotiations. The Indemnified Contributor may + participate in any such claim at its own expense. + . + For example, a Contributor might include the Program in a commercial + product offering, Product X. That Contributor is then a Commercial + Contributor. If that Commercial Contributor then makes performance + claims, or offers warranties related to Product X, those performance + claims and warranties are such Commercial Contributor's responsibility + alone. Under this section, the Commercial Contributor would have to + defend claims against the other Contributors related to those performance + claims and warranties, and if a court requires any other Contributor to + pay any damages as a result, the Commercial Contributor must pay + those damages. + . + 5. NO WARRANTY + . + EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT + PERMITTED BY APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN "AS IS" + BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR + IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF + TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR + PURPOSE. Each Recipient is solely responsible for determining the + appropriateness of using and distributing the Program and assumes all + risks associated with its exercise of rights under this Agreement, + including but not limited to the risks and costs of program errors, + compliance with applicable laws, damage to or loss of data, programs + or equipment, and unavailability or interruption of operations. + . + 6. DISCLAIMER OF LIABILITY + . + EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT + PERMITTED BY APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS + SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST + PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE + EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGES. + . + 7. GENERAL + . + If any provision of this Agreement is invalid or unenforceable under + applicable law, it shall not affect the validity or enforceability of + the remainder of the terms of this Agreement, and without further + action by the parties hereto, such provision shall be reformed to the + minimum extent necessary to make such provision valid and enforceable. + . + If Recipient institutes patent litigation against any entity + (including a cross-claim or counterclaim in a lawsuit) alleging that the + Program itself (excluding combinations of the Program with other software + or hardware) infringes such Recipient's patent(s), then such Recipient's + rights granted under Section 2(b) shall terminate as of the date such + litigation is filed. + . + All Recipient's rights under this Agreement shall terminate if it + fails to comply with any of the material terms or conditions of this + Agreement and does not cure such failure in a reasonable period of + time after becoming aware of such noncompliance. If all Recipient's + rights under this Agreement terminate, Recipient agrees to cease use + and distribution of the Program as soon as reasonably practicable. + However, Recipient's obligations under this Agreement and any licenses + granted by Recipient relating to the Program shall continue and survive. + . + Everyone is permitted to copy and distribute copies of this Agreement, + but in order to avoid inconsistency the Agreement is copyrighted and + may only be modified in the following manner. The Agreement Steward + reserves the right to publish new versions (including revisions) of + this Agreement from time to time. No one other than the Agreement + Steward has the right to modify this Agreement. The Eclipse Foundation + is the initial Agreement Steward. The Eclipse Foundation may assign the + responsibility to serve as the Agreement Steward to a suitable separate + entity. Each new version of the Agreement will be given a distinguishing + version number. The Program (including Contributions) may always be + Distributed subject to the version of the Agreement under which it was + received. In addition, after a new version of the Agreement is published, + Contributor may elect to Distribute the Program (including its + Contributions) under the new version. + . + Except as expressly stated in Sections 2(a) and 2(b) above, Recipient + receives no rights or licenses to the intellectual property of any + Contributor under this Agreement, whether expressly, by implication, + estoppel or otherwise. All rights in the Program not expressly granted + under this Agreement are reserved. Nothing in this Agreement is intended + to be enforceable by any entity that is not a Contributor or Recipient. + No third-party beneficiary rights are created under this Agreement. + . + Exhibit A - Form of Secondary Licenses Notice + . + "This Source Code may also be made available under the following + Secondary Licenses when the conditions for such availability set forth + in the Eclipse Public License, v. 2.0 are satisfied: {name license(s), + version(s), and exceptions or additional permissions here}." + . + Simply including a copy of this Agreement, including this Exhibit A + is not sufficient to license the Source Code under Secondary Licenses. + . + If it is not possible or desirable to put the notice in a particular + file, then You may include the notice in a location (such as a LICENSE + file in a relevant directory) where a recipient would be likely to + look for such a notice. + . + You may add additional accurate notices of copyright ownership. + +License: Eclipse-Public-License-v1.0 + Eclipse Public License - v 1.0 + . + THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE + PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE + PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. + . + 1. DEFINITIONS + . + "Contribution" means: + . + a) in the case of the initial Contributor, the initial code and + documentation distributed under this Agreement, and + b) in the case of each subsequent Contributor: + . + i) changes to the Program, and + . + ii) additions to the Program; + . + where such changes and/or additions to the Program originate from and are + distributed by that particular Contributor. A Contribution 'originates' + from a Contributor if it was added to the Program by such Contributor + itself or anyone acting on such Contributor's behalf. Contributions do not + include additions to the Program which: (i) are separate modules of + software distributed in conjunction with the Program under their own + license agreement, and (ii) are not derivative works of the Program. + . + "Contributor" means any person or entity that distributes the Program. + . + "Licensed Patents " mean patent claims licensable by a Contributor which + are necessarily infringed by the use or sale of its Contribution alone or + when combined with the Program. + . + "Program" means the Contributions distributed in accordance with this + Agreement. + . + "Recipient" means anyone who receives the Program under this Agreement, + including all Contributors. + . + 2. GRANT OF RIGHTS + . + a) Subject to the terms of this Agreement, each Contributor hereby grants + Recipient a non-exclusive, worldwide, royalty-free copyright license to + reproduce, prepare derivative works of, publicly display, publicly + perform, distribute and sublicense the Contribution of such Contributor, + if any, and such derivative works, in source code and object code form. + . + b) Subject to the terms of this Agreement, each Contributor hereby grants + Recipient a non-exclusive, worldwide, royalty-free patent license under + Licensed Patents to make, use, sell, offer to sell, import and otherwise + transfer the Contribution of such Contributor, if any, in source code and + object code form. This patent license shall apply to the combination of + the Contribution and the Program if, at the time the Contribution is added + by the Contributor, such addition of the Contribution causes such + combination to be covered by the Licensed Patents. The patent license + shall not apply to any other combinations which include the Contribution. + No hardware per se is licensed hereunder. + . + c) Recipient understands that although each Contributor grants the + licenses to its Contributions set forth herein, no assurances are provided + by any Contributor that the Program does not infringe the patent or other + intellectual property rights of any other entity. Each Contributor + disclaims any liability to Recipient for claims brought by any other + entity based on infringement of intellectual property rights or otherwise. + As a condition to exercising the rights and licenses granted hereunder, + each Recipient hereby assumes sole responsibility to secure any other + intellectual property rights needed, if any. For example, if a third party + patent license is required to allow Recipient to distribute the Program, + it is Recipient's responsibility to acquire that license before + distributing the Program. + . + d) Each Contributor represents that to its knowledge it has sufficient + copyright rights in its Contribution, if any, to grant the copyright + license set forth in this Agreement. + . + 3. REQUIREMENTS + . + A Contributor may choose to distribute the Program in object code form + under its own license agreement, provided that: + . + a) it complies with the terms and conditions of this Agreement; and + . + b) its license agreement: + . + i) effectively disclaims on behalf of all Contributors all warranties and + conditions, express and implied, including warranties or conditions of + title and non-infringement, and implied warranties or conditions of + merchantability and fitness for a particular purpose; + . + ii) effectively excludes on behalf of all Contributors all liability for + damages, including direct, indirect, special, incidental and consequential + damages, such as lost profits; + . + iii) states that any provisions which differ from this Agreement are + offered by that Contributor alone and not by any other party; and + . + iv) states that source code for the Program is available from such + Contributor, and informs licensees how to obtain it in a reasonable manner + on or through a medium customarily used for software exchange. + . + When the Program is made available in source code form: + . + a) it must be made available under this Agreement; and + . + b) a copy of this Agreement must be included with each copy of the + Program. + . + Contributors may not remove or alter any copyright notices contained + within the Program. + . + Each Contributor must identify itself as the originator of its + Contribution, if any, in a manner that reasonably allows subsequent + Recipients to identify the originator of the Contribution. + . + 4. COMMERCIAL DISTRIBUTION + . + Commercial distributors of software may accept certain responsibilities + with respect to end users, business partners and the like. While this + license is intended to facilitate the commercial use of the Program, the + Contributor who includes the Program in a commercial product offering + should do so in a manner which does not create potential liability for + other Contributors. Therefore, if a Contributor includes the Program in a + commercial product offering, such Contributor ("Commercial Contributor") + hereby agrees to defend and indemnify every other Contributor + ("Indemnified Contributor") against any losses, damages and costs + (collectively "Losses") arising from claims, lawsuits and other legal + actions brought by a third party against the Indemnified Contributor to + the extent caused by the acts or omissions of such Commercial Contributor + in connection with its distribution of the Program in a commercial product + offering. The obligations in this section do not apply to any claims or + Losses relating to any actual or alleged intellectual property + infringement. In order to qualify, an Indemnified Contributor must: a) + promptly notify the Commercial Contributor in writing of such claim, and + b) allow the Commercial Contributor to control, and cooperate with the + Commercial Contributor in, the defense and any related settlement + negotiations. The Indemnified Contributor may participate in any such + claim at its own expense. + . + For example, a Contributor might include the Program in a commercial + product offering, Product X. That Contributor is then a Commercial + Contributor. If that Commercial Contributor then makes performance claims, + or offers warranties related to Product X, those performance claims and + warranties are such Commercial Contributor's responsibility alone. Under + this section, the Commercial Contributor would have to defend claims + against the other Contributors related to those performance claims and + warranties, and if a court requires any other Contributor to pay any + damages as a result, the Commercial Contributor must pay those damages. + . + 5. NO WARRANTY + . + EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED + ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER + EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR + CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A + PARTICULAR PURPOSE. Each Recipient is solely responsible for determining + the appropriateness of using and distributing the Program and assumes all + risks associated with its exercise of rights under this Agreement , + including but not limited to the risks and costs of program errors, + compliance with applicable laws, damage to or loss of data, programs or + equipment, and unavailability or interruption of operations. + . + 6. DISCLAIMER OF LIABILITY + . + EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY + CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING + WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION + OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + . + 7. GENERAL + . + If any provision of this Agreement is invalid or unenforceable under + applicable law, it shall not affect the validity or enforceability of the + remainder of the terms of this Agreement, and without further action by + the parties hereto, such provision shall be reformed to the minimum extent + necessary to make such provision valid and enforceable. + . + If Recipient institutes patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Program itself + (excluding combinations of the Program with other software or hardware) + infringes such Recipient's patent(s), then such Recipient's rights granted + under Section 2(b) shall terminate as of the date such litigation is + filed. + . + All Recipient's rights under this Agreement shall terminate if it fails to + comply with any of the material terms or conditions of this Agreement and + does not cure such failure in a reasonable period of time after becoming + aware of such noncompliance. If all Recipient's rights under this + Agreement terminate, Recipient agrees to cease use and distribution of the + Program as soon as reasonably practicable. However, Recipient's + obligations under this Agreement and any licenses granted by Recipient + relating to the Program shall continue and survive. + . + Everyone is permitted to copy and distribute copies of this Agreement, but + in order to avoid inconsistency the Agreement is copyrighted and may only + be modified in the following manner. The Agreement Steward reserves the + right to publish new versions (including revisions) of this Agreement from + time to time. No one other than the Agreement Steward has the right to + modify this Agreement. The Eclipse Foundation is the initial Agreement + Steward. The Eclipse Foundation may assign the responsibility to serve as + the Agreement Steward to a suitable separate entity. Each new version of + the Agreement will be given a distinguishing version number. The Program + (including Contributions) may always be distributed subject to the version + of the Agreement under which it was received. In addition, after a new + version of the Agreement is published, Contributor may elect to distribute + the Program (including its Contributions) under the new version. Except as + expressly stated in Sections 2(a) and 2(b) above, Recipient receives no + rights or licenses to the intellectual property of any Contributor under + this Agreement, whether expressly, by implication, estoppel or otherwise. + All rights in the Program not expressly granted under this Agreement are + reserved. + . + This Agreement is governed by the laws of the State of New York and the + intellectual property laws of the United States of America. No party to + this Agreement will bring a legal action under this Agreement more than + one year after the cause of action arose. Each party waives its rights to + a jury trial in any resulting litigation. diff -Nru jtreg7-7.3.1+1/debian/gbp-export.sh jtreg7-7.5.2+1+ds2/debian/gbp-export.sh --- jtreg7-7.3.1+1/debian/gbp-export.sh 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/gbp-export.sh 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,3 @@ +#!/bin/sh + +gbp export-orig --pristine-tar --component=opentest4j --component=apiguardian --component=hawt-jni --component=jansi1 --component=jline3 --component=junit4 --component=junit5 --component=libhamcrest-java --component=opentest4j-reporting --component=picocli --component=testng --component=univocity-parsers --compression=gzip diff -Nru jtreg7-7.3.1+1/debian/gbp-import.sh jtreg7-7.5.2+1+ds2/debian/gbp-import.sh --- jtreg7-7.3.1+1/debian/gbp-import.sh 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/gbp-import.sh 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,3 @@ +#!/bin/sh + +gbp import-orig --pristine-tar --component=opentest4j --component=apiguardian --component=hawt-jni --component=jansi1 --component=jline3 --component=junit4 --component=junit5 --component=libhamcrest-java --component=opentest4j-reporting --component=picocli --component=testng --component=univocity-parsers $* diff -Nru jtreg7-7.3.1+1/debian/hawt-jni/maven.ignoreRules jtreg7-7.5.2+1+ds2/debian/hawt-jni/maven.ignoreRules --- jtreg7-7.3.1+1/debian/hawt-jni/maven.ignoreRules 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/hawt-jni/maven.ignoreRules 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,13 @@ + +org.fusesource.hawtjni hawtjni-example jar * * * +org.fusesource.hawtjni hawtjni-website pom * * * +org.apache.maven maven-artifact-manager * * * * +org.apache.maven.plugins maven-eclipse-plugin * * * * +org.apache.maven.plugins maven-idea-plugin * * * * +org.apache.maven.plugins maven-javadoc-plugin * * * * +org.apache.maven.plugins maven-project-info-reports-plugin * * * * +org.apache.maven.plugins maven-shade-plugin * * * * +org.apache.maven.plugins maven-surefire-plugin * * * * +org.codehaus.mojo jxr-maven-plugin * * * * +org.codehaus.mojo surefire-report-maven-plugin * * * * +org.codehaus.plexus plexus-maven-plugin * * * * diff -Nru jtreg7-7.3.1+1/debian/hawt-jni/maven.properties jtreg7-7.5.2+1+ds2/debian/hawt-jni/maven.properties --- jtreg7-7.3.1+1/debian/hawt-jni/maven.properties 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/hawt-jni/maven.properties 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,6 @@ +# Include here properties to pass to Maven during the build. +# For example: +# maven.test.skip=true + +maven.test.skip=true +project.build.sourceEncoding=UTF-8 diff -Nru jtreg7-7.3.1+1/debian/hawt-jni/maven.rules jtreg7-7.5.2+1+ds2/debian/hawt-jni/maven.rules --- jtreg7-7.3.1+1/debian/hawt-jni/maven.rules 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/hawt-jni/maven.rules 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,6 @@ + +org.apache.maven maven-plugin-api * s/.*/3.x/ * * +org.apache.maven maven-artifact * s/.*/3.x/ * * +org.apache.maven s/maven-project/maven-compat/ * s/.*/3.x/ * * +org.fusesource.hawtjni hawtjni-project pom s/.*/debian/ * * +org.fusesource.hawtjni hawtjni-runtime jar s/.*/debian/ * * diff -Nru jtreg7-7.3.1+1/debian/hawt-jni/poms jtreg7-7.5.2+1+ds2/debian/hawt-jni/poms --- jtreg7-7.3.1+1/debian/hawt-jni/poms 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/hawt-jni/poms 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,33 @@ +# List of POM files for the package +# Format of this file is: +# [option]* +# where option can be: +# --ignore: ignore this POM and its artifact if any +# --ignore-pom: don't install the POM. To use on POM files that are created +# temporarily for certain artifacts such as Javadoc jars. [mh_install, mh_installpoms] +# --no-parent: remove the tag from the POM +# --package=: an alternative package to use when installing this POM +# and its artifact +# --has-package-version: to indicate that the original version of the POM is the same as the upstream part +# of the version for the package. +# --keep-elements=: a list of XML elements to keep in the POM +# during a clean operation with mh_cleanpom or mh_installpom +# --artifact=: path to the build artifact associated with this POM, +# it will be installed when using the command mh_install. [mh_install] +# --java-lib: install the jar into /usr/share/java to comply with Debian +# packaging guidelines +# --usj-name=: name to use when installing the library in /usr/share/java +# --usj-version=: version to use when installing the library in /usr/share/java +# --no-usj-versionless: don't install the versionless link in /usr/share/java +# --dest-jar=: the destination for the real jar. +# It will be installed with mh_install. [mh_install] +# --classifier=: Optional, the classifier for the jar. Empty by default. +# --site-xml=: Optional, the location for site.xml if it needs to be installed. +# Empty by default. [mh_install] +# +pom.xml --no-parent --has-package-version +hawtjni-runtime/pom.xml --has-package-version +hawtjni-generator/pom.xml --has-package-version --package=libhawtjni-generator-java +hawtjni-maven-plugin/pom.xml --has-package-version --package=libhawtjni-maven-plugin-java +hawtjni-example/pom.xml --ignore +hawtjni-website/pom.xml --ignore diff -Nru jtreg7-7.3.1+1/debian/hawt-jni/rules jtreg7-7.5.2+1+ds2/debian/hawt-jni/rules --- jtreg7-7.3.1+1/debian/hawt-jni/rules 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/hawt-jni/rules 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,4 @@ +#!/usr/bin/make -f + +%: + dh $@ diff -Nru jtreg7-7.3.1+1/debian/jansi1/maven.ignoreRules jtreg7-7.5.2+1+ds2/debian/jansi1/maven.ignoreRules --- jtreg7-7.3.1+1/debian/jansi1/maven.ignoreRules 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/jansi1/maven.ignoreRules 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,32 @@ +# Maven ignore rules - ignore some Maven dependencies and plugins +# Format of this file is: +# [group] [artifact] [type] [version] [classifier] [scope] +# where each element can be either +# - the exact string, for example org.apache for the group, or 3.1 +# for the version. In this case, the element is simply matched +# and left as it is +# - * (the star character, alone). In this case, anything will +# match and be left as it is. For example, using * on the +# position of the artifact field will match any artifact id +# All elements much match before a rule can be applied +# Example rule: match jar with groupid= junit, artifactid= junit +# and version starting with 3., this dependency is then removed +# from the POM +# junit junit jar s/3\\..*/3.x/ + +junit junit * * * * +org.apache.maven.plugins maven-javadoc-plugin * * * * +org.apache.maven.plugins maven-site-plugin * * * * +org.apache.maven.plugins maven-surefire-plugin * * * * +org.apache.maven.plugins maven-dependency-plugin * * * * +org.codehaus.mojo exec-maven-plugin * * * * +org.fusesource.jansi jansi-linux32 * * * * +org.fusesource.jansi jansi-linux64 * * * * +org.fusesource.jansi jansi-osx * * * * +org.fusesource.jansi jansi-windows32 * * * * +org.fusesource.jansi jansi-windows64 * * * * +org.fusesource.jansi jansi-freebsd32 * * * * +org.fusesource.jansi jansi-freebsd64 * * * * +org.fusesource.mvnplugins fuse-jxr-skin * * * * +org.fusesource.mvnplugins maven-uberize-plugin * * * * +org.fusesource.mvnplugins fuse-javadoc-skin * * * * diff -Nru jtreg7-7.3.1+1/debian/jansi1/maven.rules jtreg7-7.5.2+1+ds2/debian/jansi1/maven.rules --- jtreg7-7.3.1+1/debian/jansi1/maven.rules 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/jansi1/maven.rules 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,4 @@ +org.fusesource.hawtjni hawtjni-runtime jar s/.*/debian/ * * +org.fusesource.jansi example jar s/.*/debian/ * * +org.fusesource.jansi jansi-project pom s/.*/1.x/ * * +org.fusesource.jansi jansi jar s/.*/1.x/ * * diff -Nru jtreg7-7.3.1+1/debian/jansi1/poms jtreg7-7.5.2+1+ds2/debian/jansi1/poms --- jtreg7-7.3.1+1/debian/jansi1/poms 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/jansi1/poms 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,4 @@ +# jansi1 +pom.xml --no-parent --has-package-version +jansi/pom.xml --has-package-version --java-lib --usj-name=jansi1 +example/pom.xml --ignore \ No newline at end of file diff -Nru jtreg7-7.3.1+1/debian/jansi1/rules jtreg7-7.5.2+1+ds2/debian/jansi1/rules --- jtreg7-7.3.1+1/debian/jansi1/rules 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/jansi1/rules 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,14 @@ +#!/usr/bin/make -f + +%: + dh $@ + +override_dh_auto_configure: + dh_auto_configure $@ + rsync -Lav ../debian/built-components/ debian/ || true + +override_dh_auto_install: + dh_auto_install + rm -Rf debian/libjansi1-java/usr/share/maven-repo/org/fusesource/jansi/jansi/1.18 + rm -Rf debian/libjansi1-java/usr/share/maven-repo/org/fusesource/jansi/jansi-project/1.18 + rm -Rf debian/libjansi1-java/usr/share/java/jansi1-1.18.jar diff -Nru jtreg7-7.3.1+1/debian/jline3/maven.ignoreRules jtreg7-7.5.2+1+ds2/debian/jline3/maven.ignoreRules --- jtreg7-7.3.1+1/debian/jline3/maven.ignoreRules 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/jline3/maven.ignoreRules 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,7 @@ + +junit junit * * * * +org.apache.maven.plugins maven-enforcer-plugin * * * * +org.apache.maven.plugins maven-javadoc-plugin * * * * +org.apache.maven.plugins maven-source-plugin * * * * +org.easymock easymock * * * * +org.apache.sshd sshd-core * * * * diff -Nru jtreg7-7.3.1+1/debian/jline3/maven.rules jtreg7-7.5.2+1+ds2/debian/jline3/maven.rules --- jtreg7-7.3.1+1/debian/jline3/maven.rules 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/jline3/maven.rules 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,2 @@ +junit junit jar s/4\..*/4.x/ * * +org.fusesource.jansi jansi jar s/.*/1.x/ * * diff -Nru jtreg7-7.3.1+1/debian/jline3/poms jtreg7-7.5.2+1+ds2/debian/jline3/poms --- jtreg7-7.3.1+1/debian/jline3/poms 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/jline3/poms 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,10 @@ +pom.xml --no-parent --has-package-version +builtins/pom.xml --java-lib --has-package-version --usj-name=jline3-builtins +demo/pom.xml --ignore +jline/pom.xml --java-lib --has-package-version --usj-name=jline3 +reader/pom.xml --java-lib --has-package-version --usj-name=jline3-reader +remote-ssh/pom.xml --ignore +remote-telnet/pom.xml --ignore +terminal/pom.xml --java-lib --has-package-version --usj-name=jline3-terminal +terminal-jansi/pom.xml --java-lib --has-package-version --usj-name=jline3-terminal-jansi +terminal-jna/pom.xml --java-lib --has-package-version --usj-name=jline3-terminal-jna diff -Nru jtreg7-7.3.1+1/debian/jline3/rules jtreg7-7.5.2+1+ds2/debian/jline3/rules --- jtreg7-7.3.1+1/debian/jline3/rules 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/jline3/rules 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,13 @@ +#!/usr/bin/make -f + +%: + dh $@ + +override_dh_auto_configure: + dh_auto_configure $@ + rsync -Lav ../debian/built-components/ debian/ || true + +override_dh_auto_build: + dh_auto_build -- source:jar package -DskipTests + +override_dh_auto_test: diff -Nru jtreg7-7.3.1+1/debian/jtreg7.install jtreg7-7.5.2+1+ds2/debian/jtreg7.install --- jtreg7-7.3.1+1/debian/jtreg7.install 2023-05-23 02:28:12.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/jtreg7.install 2026-01-11 23:06:11.000000000 +0000 @@ -1,4 +1,4 @@ -build/images/jtreg/lib/jtreg.jar /usr/share/java +build/images/jtreg/lib/*.jar /usr/share/jtreg/lib build/images/jtreg/doc/jtreg/tag-spec.html /usr/share/doc/jtreg build/images/jtreg/doc/jtreg/usage.txt /usr/share/doc/jtreg build/images/jtreg/bin/jtdiff /usr/share/jtreg/bin diff -Nru jtreg7-7.3.1+1/debian/jtreg7.links jtreg7-7.5.2+1+ds2/debian/jtreg7.links --- jtreg7-7.3.1+1/debian/jtreg7.links 2023-05-23 02:28:12.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/jtreg7.links 2026-01-11 23:06:11.000000000 +0000 @@ -1,22 +1,2 @@ usr/share/jtreg/bin/jtreg /usr/bin/jtreg usr/share/jtreg/bin/jtdiff /usr/bin/jtdiff - -usr/share/java/hamcrest-core.jar /usr/share/jtreg/lib/hamcrest-core.jar -usr/share/java/javatest.jar /usr/share/jtreg/lib/javatest.jar -usr/share/java/jcommander.jar /usr/share/jtreg/lib/jcommander.jar -usr/share/java/jh.jar /usr/share/jtreg/lib/jh.jar -usr/share/java/jtreg.jar /usr/share/jtreg/lib/jtreg.jar -usr/share/java/junit-platform-console-standalone.jar /usr/share/jtreg/lib/junit-platform-console-standalone.jar -usr/share/java/testng.jar /usr/share/jtreg/lib/testng.jar -usr/share/java/asmtools.jar /usr/share/jtreg/lib/asmtools.jar -usr/share/java/guice.jar /usr/share/jtreg/lib/guice.jar - -usr/share/java/hamcrest-core.jar /usr/share/jtreg/share/java/hamcrest-core.jar -usr/share/java/javatest.jar /usr/share/jtreg/share/java/javatest.jar -usr/share/java/jcommander.jar /usr/share/jtreg/share/java/jcommander.jar -usr/share/java/jh.jar /usr/share/jtreg/share/java/jh.jar -usr/share/java/jtreg.jar /usr/share/jtreg/share/java/jtreg.jar -usr/share/java/junit-platform-console-standalone.jar /usr/share/jtreg/share/java/junit-platform-console-standalone.jar -usr/share/java/testng.jar /usr/share/jtreg/share/java/testng.jar -usr/share/java/asmtools.jar /usr/share/jtreg/share/java/asmtools.jar -usr/share/java/guice.jar /usr/share/jtreg/share/java/guice.jar diff -Nru jtreg7-7.3.1+1/debian/jtreg7.lintian-overrides jtreg7-7.5.2+1+ds2/debian/jtreg7.lintian-overrides --- jtreg7-7.3.1+1/debian/jtreg7.lintian-overrides 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/jtreg7.lintian-overrides 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,6 @@ +# libhamscrest-java packaging license d/copyright contains +# symlink. The license information copied verbatim. +jtreg7 binary: copyright-refers-to-symlink-license usr/share/common-licenses/GPL + +# jtreg uses old style GPL license +jtreg7 binary: old-fsf-address-in-copyright-file diff -Nru jtreg7-7.3.1+1/debian/junit4/maven.ignoreRules jtreg7-7.5.2+1+ds2/debian/junit4/maven.ignoreRules --- jtreg7-7.3.1+1/debian/junit4/maven.ignoreRules 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/junit4/maven.ignoreRules 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,9 @@ +org.apache.maven.doxia doxia-module-markdown * * * * +org.apache.maven.plugins maven-enforcer-plugin * * * * +org.apache.maven.plugins maven-release-plugin * * * * +org.apache.maven.plugins maven-source-plugin * * * * +org.codehaus.mojo animal-sniffer-maven-plugin * * * * +com.google.code.maven-replacer-plugin replacer * * * * +* maven-site-plugin * * * * +com.github.stephenc.wagon wagon-gitsite * * * * +* maven-project-info-reports-plugin * * * * diff -Nru jtreg7-7.3.1+1/debian/junit4/maven.rules jtreg7-7.5.2+1+ds2/debian/junit4/maven.rules --- jtreg7-7.3.1+1/debian/junit4/maven.rules 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/junit4/maven.rules 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,2 @@ +junit junit jar s/4\..*/4.x/ +org.hamcrest s/hamcrest-core/hamcrest/ * s/.*/debian/ * * diff -Nru jtreg7-7.3.1+1/debian/junit4/poms jtreg7-7.5.2+1+ds2/debian/junit4/poms --- jtreg7-7.3.1+1/debian/junit4/poms 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/junit4/poms 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1 @@ +pom.xml --no-parent --java-lib --has-package-version --usj-name=junit4 \ No newline at end of file diff -Nru jtreg7-7.3.1+1/debian/junit4/rules jtreg7-7.5.2+1+ds2/debian/junit4/rules --- jtreg7-7.3.1+1/debian/junit4/rules 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/junit4/rules 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,8 @@ +#!/usr/bin/make -f + +%: + dh $@ --with javahelper + +override_dh_auto_configure: + dh_auto_configure $@ + rsync -Lav ../debian/built-components/ debian/ || true diff -Nru jtreg7-7.3.1+1/debian/junit5/junit-jupiter-api/build/generated/sources/jte/main/org/junit/jupiter/api/condition/JRE.java jtreg7-7.5.2+1+ds2/debian/junit5/junit-jupiter-api/build/generated/sources/jte/main/org/junit/jupiter/api/condition/JRE.java --- jtreg7-7.3.1+1/debian/junit5/junit-jupiter-api/build/generated/sources/jte/main/org/junit/jupiter/api/condition/JRE.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/junit5/junit-jupiter-api/build/generated/sources/jte/main/org/junit/jupiter/api/condition/JRE.java 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,299 @@ +/* + * Copyright 2015-2024 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.jupiter.api.condition; + +import static org.apiguardian.api.API.Status.STABLE; + +import java.lang.reflect.Method; +import java.util.EnumSet; + +import org.apiguardian.api.API; +import org.junit.platform.commons.logging.Logger; +import org.junit.platform.commons.logging.LoggerFactory; +import org.junit.platform.commons.util.ReflectionUtils; +import org.junit.platform.commons.util.StringUtils; + +/** + * Enumeration of Java Runtime Environment (JRE) versions. + * + *

If the current JRE version cannot be detected — for example, if the + * {@code java.version} JVM system property is undefined — then none of + * the constants defined in this enum will be considered to be the + * {@linkplain #isCurrentVersion current JRE version}. + * + * @since 5.1 + * @see #JAVA_8 + * @see #JAVA_9 + * @see #JAVA_10 + * @see #JAVA_11 + * @see #JAVA_12 + * @see #JAVA_13 + * @see #JAVA_14 + * @see #JAVA_15 + * @see #JAVA_16 + * @see #JAVA_17 + * @see #JAVA_18 + * @see #JAVA_19 + * @see #JAVA_20 + * @see #JAVA_21 + * @see #JAVA_22 + * @see #JAVA_23 + * @see #JAVA_24 + * @see #JAVA_25 + * @see #OTHER + * @see EnabledOnJre + * @see DisabledOnJre + * @see EnabledForJreRange + * @see DisabledForJreRange + */ +@API(status = STABLE, since = "5.1") +public enum JRE { + + /** + * Java 8. + */ + JAVA_8, + + /** + * Java 9. + */ + JAVA_9, + + /** + * Java 10. + */ + JAVA_10, + + /** + * Java 11. + */ + JAVA_11, + + /** + * Java 12. + * + * @since 5.4 + */ + @API(status = STABLE, since = "5.4") + JAVA_12, + + /** + * Java 13. + * + * @since 5.4 + */ + @API(status = STABLE, since = "5.4") + JAVA_13, + + /** + * Java 14. + * + * @since 5.5 + */ + @API(status = STABLE, since = "5.5") + JAVA_14, + + /** + * Java 15. + * + * @since 5.6 + */ + @API(status = STABLE, since = "5.6") + JAVA_15, + + /** + * Java 16. + * + * @since 5.7 + */ + @API(status = STABLE, since = "5.7") + JAVA_16, + + /** + * Java 17. + * + * @since 5.7.1 + */ + @API(status = STABLE, since = "5.7.1") + JAVA_17, + + /** + * Java 18. + * + * @since 5.8.1 + */ + @API(status = STABLE, since = "5.8.1") + JAVA_18, + + /** + * Java 19. + * + * @since 5.9 + */ + @API(status = STABLE, since = "5.9") + JAVA_19, + + /** + * Java 20. + * + * @since 5.9 + */ + @API(status = STABLE, since = "5.9") + JAVA_20, + + /** + * Java 21. + * + * @since 5.9.2 + */ + @API(status = STABLE, since = "5.9.2") + JAVA_21, + + /** + * Java 22. + * + * @since 5.10 + */ + @API(status = STABLE, since = "5.10") + JAVA_22, + + /** + * Java 23. + * + * @since 5.11 + */ + @API(status = STABLE, since = "5.11") + JAVA_23, + + /** + * Java 24. + * + * @since 5.11 + */ + @API(status = STABLE, since = "5.11") + JAVA_24, + + /** + * Java 25. + * + * @since 5.11.4 + */ + @API(status = STABLE, since = "5.11.4") + JAVA_25, + + /** + * A JRE version other than {@link #JAVA_8}, {@link #JAVA_9}, + * {@link #JAVA_10}, {@link #JAVA_11}, {@link #JAVA_12}, + * {@link #JAVA_13}, {@link #JAVA_14}, {@link #JAVA_15}, + * {@link #JAVA_16}, {@link #JAVA_17}, {@link #JAVA_18}, + * {@link #JAVA_19}, {@link #JAVA_20}, {@link #JAVA_21}, + * {@link #JAVA_22}, {@link #JAVA_23}, {@link #JAVA_24}, + * or {@link #JAVA_25}. + */ + OTHER; + + private static final Logger logger = LoggerFactory.getLogger(JRE.class); + + private static final JRE CURRENT_VERSION = determineCurrentVersion(); + + private static JRE determineCurrentVersion() { + String javaVersion = System.getProperty("java.version"); + boolean javaVersionIsBlank = StringUtils.isBlank(javaVersion); + + if (javaVersionIsBlank) { + logger.debug( + () -> "JVM system property 'java.version' is undefined. It is therefore not possible to detect Java 8."); + } + + if (!javaVersionIsBlank && javaVersion.startsWith("1.8")) { + return JAVA_8; + } + + try { + // java.lang.Runtime.version() is a static method available on Java 9+ + // that returns an instance of java.lang.Runtime.Version which has the + // following method: public int major() + Method versionMethod = Runtime.class.getMethod("version"); + Object version = ReflectionUtils.invokeMethod(versionMethod, null); + Method majorMethod = version.getClass().getMethod("major"); + int major = (int) ReflectionUtils.invokeMethod(majorMethod, version); + switch (major) { + case 9: + return JAVA_9; + case 10: + return JAVA_10; + case 11: + return JAVA_11; + case 12: + return JAVA_12; + case 13: + return JAVA_13; + case 14: + return JAVA_14; + case 15: + return JAVA_15; + case 16: + return JAVA_16; + case 17: + return JAVA_17; + case 18: + return JAVA_18; + case 19: + return JAVA_19; + case 20: + return JAVA_20; + case 21: + return JAVA_21; + case 22: + return JAVA_22; + case 23: + return JAVA_23; + case 24: + return JAVA_24; + case 25: + return JAVA_25; + default: + return OTHER; + } + } + catch (Exception ex) { + logger.debug(ex, () -> "Failed to determine the current JRE version via java.lang.Runtime.Version."); + } + + // null signals that the current JRE version is "unknown" + return null; + } + + /** + * @return {@code true} if this {@code JRE} is known to be the + * Java Runtime Environment version for the currently executing JVM or if + * the version is {@link #OTHER} + */ + public boolean isCurrentVersion() { + return this == CURRENT_VERSION; + } + + /** + * @return the {@link JRE} for the currently executing JVM, potentially + * {@link #OTHER} + * + * @since 5.7 + */ + @API(status = STABLE, since = "5.7") + public static JRE currentVersion() { + return CURRENT_VERSION; + } + + static boolean isCurrentVersionWithinRange(JRE min, JRE max) { + return EnumSet.range(min, max).contains(CURRENT_VERSION); + } + +} diff -Nru jtreg7-7.3.1+1/debian/junit5/maven.ignoreRules jtreg7-7.5.2+1+ds2/debian/junit5/maven.ignoreRules --- jtreg7-7.3.1+1/debian/junit5/maven.ignoreRules 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/junit5/maven.ignoreRules 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,5 @@ +org.jetbrains.kotlin kotlin-maven-plugin +org.jetbrains.kotlin kotlin-stdlib +org.junit.platform junit-platform-jfr +org.junit.platform junit-platform-testkit +org.mockito mockito-junit-jupiter \ No newline at end of file diff -Nru jtreg7-7.3.1+1/debian/junit5/maven.rules jtreg7-7.5.2+1+ds2/debian/junit5/maven.rules --- jtreg7-7.3.1+1/debian/junit5/maven.rules 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/junit5/maven.rules 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,2 @@ +junit junit * s/.*/4.x/ * * +* * * ${platform.version} * * diff -Nru jtreg7-7.3.1+1/debian/junit5/poms jtreg7-7.5.2+1+ds2/debian/junit5/poms --- jtreg7-7.3.1+1/debian/junit5/poms 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/junit5/poms 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,21 @@ +# junit5 + +pom.xml +junit-bom/pom.xml +junit-jupiter/pom.xml --java-lib +junit-jupiter-api/pom.xml --java-lib +junit-jupiter-engine/pom.xml --java-lib +junit-jupiter-migrationsupport/pom.xml --java-lib +junit-jupiter-params/pom.xml --java-lib +junit-platform-commons/pom.xml --java-lib +junit-platform-console/pom.xml --java-lib +junit-platform-console-standalone/pom.xml --java-lib +junit-platform-engine/pom.xml --java-lib +junit-platform-launcher/pom.xml --java-lib +junit-platform-reporting/pom.xml --java-lib +junit-platform-runner/pom.xml --java-lib +junit-platform-suite/pom.xml --java-lib +junit-platform-suite-api/pom.xml --java-lib +junit-platform-suite-commons/pom.xml --java-lib +junit-platform-suite-engine/pom.xml --java-lib +junit-vintage-engine/pom.xml --java-lib diff -Nru jtreg7-7.3.1+1/debian/junit5/rules jtreg7-7.5.2+1+ds2/debian/junit5/rules --- jtreg7-7.3.1+1/debian/junit5/rules 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/junit5/rules 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,9 @@ +#!/usr/bin/make -f + +%: + dh $@ --buildsystem=maven --with javahelper + +override_dh_auto_build: + rsync -Lav ../debian/built-components/ debian/ || true + rsync -Lav ../debian/junit5/junit-jupiter-api/build/generated/sources/jte/main junit-jupiter-api/src/main/java + dh_auto_build $@ diff -Nru jtreg7-7.3.1+1/debian/libhamcrest-java/maven.rules jtreg7-7.5.2+1+ds2/debian/libhamcrest-java/maven.rules --- jtreg7-7.3.1+1/debian/libhamcrest-java/maven.rules 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/libhamcrest-java/maven.rules 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,3 @@ + +jmock jmock * s/.*/1.x/ * * +junit junit * s/.*/4.x/ * * diff -Nru jtreg7-7.3.1+1/debian/libhamcrest-java/poms jtreg7-7.5.2+1+ds2/debian/libhamcrest-java/poms --- jtreg7-7.3.1+1/debian/libhamcrest-java/poms 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/libhamcrest-java/poms 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,2 @@ +hamcrest/build/debian/hamcrest.pom --java-lib --artifact=hamcrest/build/libs/hamcrest-*.jar --relocate=org.hamcrest:hamcrest-core,org.hamcrest:hamcrest-all,org.hamcrest:hamcrest-library +hamcrest-integration/build/debian/hamcrest-integration.pom --java-lib --artifact=hamcrest-integration/build/libs/hamcrest-integration-*.jar diff -Nru jtreg7-7.3.1+1/debian/libhamcrest-java/rules jtreg7-7.5.2+1+ds2/debian/libhamcrest-java/rules --- jtreg7-7.3.1+1/debian/libhamcrest-java/rules 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/libhamcrest-java/rules 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,7 @@ +#!/usr/bin/make -f + +%: + dh $@ --buildsystem=gradle --with maven-repo-helper + +override_dh_auto_build: + dh_auto_build -- jar diff -Nru jtreg7-7.3.1+1/debian/maven.properties jtreg7-7.5.2+1+ds2/debian/maven.properties --- jtreg7-7.3.1+1/debian/maven.properties 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/maven.properties 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,6 @@ +# Include here properties to pass to Maven during the build. +# For example: +# maven.test.skip=true +maven.compiler.release=8 +maven.test.skip=true +project.build.sourceEncoding=UTF-8 diff -Nru jtreg7-7.3.1+1/debian/opentest4j/maven.rules jtreg7-7.5.2+1+ds2/debian/opentest4j/maven.rules --- jtreg7-7.3.1+1/debian/opentest4j/maven.rules 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/opentest4j/maven.rules 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1 @@ +junit junit * s/.*/4.x/ * * diff -Nru jtreg7-7.3.1+1/debian/opentest4j/poms jtreg7-7.5.2+1+ds2/debian/opentest4j/poms --- jtreg7-7.3.1+1/debian/opentest4j/poms 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/opentest4j/poms 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1 @@ +build/debian/opentest4j.pom --artifact=./build/libs/opentest4j-*.jar --java-lib diff -Nru jtreg7-7.3.1+1/debian/opentest4j/rules jtreg7-7.5.2+1+ds2/debian/opentest4j/rules --- jtreg7-7.3.1+1/debian/opentest4j/rules 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/opentest4j/rules 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,4 @@ +#!/usr/bin/make -f + +%: + dh $@ --buildsystem=gradle --with maven-repo-helper diff -Nru jtreg7-7.3.1+1/debian/opentest4j-reporting/maven.rules jtreg7-7.5.2+1+ds2/debian/opentest4j-reporting/maven.rules --- jtreg7-7.3.1+1/debian/opentest4j-reporting/maven.rules 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/opentest4j-reporting/maven.rules 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,3 @@ + +org.opentest4j.reporting s/schema/open-test-reporting-schema/ * s/.*/debian/ * * +org.opentest4j.reporting s/events/open-test-reporting-events/ * s/.*/debian/ * * diff -Nru jtreg7-7.3.1+1/debian/opentest4j-reporting/poms jtreg7-7.5.2+1+ds2/debian/opentest4j-reporting/poms --- jtreg7-7.3.1+1/debian/opentest4j-reporting/poms 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/opentest4j-reporting/poms 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,2 @@ +schema/build/debian/schema.pom --has-package-version --java-lib --usj-name=opentest4j-reporting-schema --artifact=schema/build/libs/schema-*.jar +events/build/debian/events.pom --has-package-version --java-lib --usj-name=opentest4j-reporting-events --artifact=events/build/libs/events-*.jar diff -Nru jtreg7-7.3.1+1/debian/opentest4j-reporting/rules jtreg7-7.5.2+1+ds2/debian/opentest4j-reporting/rules --- jtreg7-7.3.1+1/debian/opentest4j-reporting/rules 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/opentest4j-reporting/rules 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,10 @@ +#!/usr/bin/make -f + +%: + dh $@ --buildsystem=gradle --with maven-repo-helper + +override_dh_auto_test: + +override_dh_auto_configure: + dh_auto_configure $@ + rsync -Lav ../debian/built-components/ debian/ || true \ No newline at end of file diff -Nru jtreg7-7.3.1+1/debian/patches/apiguardian-01-build_gradle.patch jtreg7-7.5.2+1+ds2/debian/patches/apiguardian-01-build_gradle.patch --- jtreg7-7.3.1+1/debian/patches/apiguardian-01-build_gradle.patch 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/patches/apiguardian-01-build_gradle.patch 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,399 @@ +Description: patch build.gradle.kts to Groovy-based build.gradle for Debian +Forwarded: not-needed +Comment: this file is based on the build.gradle from apiguardian 1.1.0 + +--- a/apiguardian/build.gradle.kts ++++ b/apiguardian/build.gradle.kts +@@ -1,218 +1,206 @@ +-import java.time.OffsetDateTime +-import java.time.format.DateTimeFormatter ++import java.text.SimpleDateFormat ++ ++buildscript { ++ dependencies { ++ // Create OSGI bundles ++ classpath "biz.aQute.bnd:biz.aQute.bnd.gradle:4.3.1" ++ } ++} + + plugins { +- id("java") +- id("eclipse") +- id("idea") +- id("maven-publish") +- id("signing") +- id("biz.aQute.bnd.builder") version "5.3.0" +- id("net.nemerosa.versioning") version "2.14.0" +- id("org.ajoberstar.git-publish") version "3.0.0" +- id("io.github.gradle-nexus.publish-plugin") version "1.1.0" +-} +- +-val buildTimeAndDate = OffsetDateTime.now() +-val buildDate = DateTimeFormatter.ISO_LOCAL_DATE.format(buildTimeAndDate) +-val buildTime = DateTimeFormatter.ofPattern("HH:mm:ss.SSSZ").format(buildTimeAndDate) +-val builtByValue = project.findProperty("builtBy") ?: project.property("defaultBuiltBy") +- +-val isSnapshot = project.version.toString().contains("SNAPSHOT") +-val docsVersion = if (isSnapshot) "snapshot" else project.version +-val docsDir = File(buildDir, "ghpages-docs") +-val replaceCurrentDocs = project.hasProperty("replaceCurrentDocs") ++ id 'java' ++ id 'eclipse' ++ id 'idea' ++ id 'maven' ++ id 'signing' ++} ++ ++apply plugin: 'biz.aQute.bnd.builder' ++ ++// https://reproducible-builds.org/docs/source-date-epoch/ ++String source_date_epoch = System.getenv("SOURCE_DATE_EPOCH"); ++if (source_date_epoch != null) { ++ TimeZone.setDefault(TimeZone.getTimeZone("UTC")) ++} ++Date buildTimeAndDate = source_date_epoch == null ? ++ new Date() : ++ new Date(1000 * Long.parseLong(source_date_epoch)) ++ext { ++ buildDate = new SimpleDateFormat('yyyy-MM-dd').format(buildTimeAndDate) ++ buildTime = new SimpleDateFormat('HH:mm:ss.SSSZ').format(buildTimeAndDate) ++ builtByValue = project.hasProperty('builtBy') ? project.builtBy : project.defaultBuiltBy ++} + +-description = "@API Guardian" +-val moduleName = "org.apiguardian.api" ++description = '@API Guardian' ++def moduleName = 'org.apiguardian.api' + + repositories { + mavenCentral() + } + +-java { +- withJavadocJar() +- withSourcesJar() +-} +- +-val moduleSourceDir = file("src/module/java") +- +-tasks { +- compileJava { +- options.release.set(6) +- } +- +- val compileModule by registering(JavaCompile::class) { +- source(moduleSourceDir) +- destinationDir = file("$buildDir/classes/java/modules") +- classpath = files(compileJava.map { it.classpath }) +- inputs.property("moduleName", moduleName) +- inputs.property("moduleVersion", project.version) +- options.release.set(9) +- options.compilerArgs = listOf( +- "--module-version", project.version as String, +- "--module-source-path", moduleSourceDir.toString(), +- "--patch-module", "$moduleName=${sourceSets.main.get().allJava.srcDirs.joinToString(":")}", +- "--module", moduleName +- ) +- } +- +- jar { +- fun normalizeVersion(versionLiteral: String): String { +- val regex = Regex("(\\d+\\.\\d+\\.\\d+).*") +- val match = regex.matchEntire(versionLiteral) +- require(match != null) { +- "Version '$versionLiteral' does not match version pattern, e.g. 1.0.0-QUALIFIER" +- } +- return match.groupValues[1] +- } +- manifest { +- attributes( +- "Created-By" to "${System.getProperty("java.version")} (${System.getProperty("java.vendor")} ${System.getProperty("java.vm.version")})", +- "Built-By" to builtByValue, +- "Build-Date" to buildDate, +- "Build-Time" to buildTime, +- "Build-Revision" to versioning.info.commit, +- "Specification-Title" to project.name, +- "Specification-Version" to normalizeVersion(project.version.toString()), +- "Specification-Vendor" to "apiguardian.org", +- "Implementation-Title" to project.name, +- "Implementation-Version" to project.version, +- "Implementation-Vendor" to "apiguardian.org", +- "Bundle-Name" to project.name, +- "Bundle-Description" to project.description, +- "Bundle-DocURL" to "https://github.com/apiguardian-team/apiguardian", +- "Bundle-Vendor" to "apiguardian.org", +- "-exportcontents" to "org.apiguardian.api", +- "Bundle-SymbolicName" to moduleName +- ) +- } +- from(files(compileModule.map { "${it.destinationDir}/${moduleName}" })) { +- include("module-info.class") +- } +- } ++compileJava { ++ options.compilerArgs = ['--release', '8'] ++} + +- javadoc { +- (options as StandardJavadocDocletOptions).apply { +- memberLevel = JavadocMemberLevel.PROTECTED +- isAuthor = true +- header = "@API Guardian" +- addStringOption("Xdoclint:html,syntax,reference", "-quiet") +- links("https://docs.oracle.com/en/java/javase/11/docs/api/") +- } +- } +- +- named("sourcesJar") { +- from("${moduleSourceDir}/${moduleName}") { +- include("module-info.java") +- } ++task compileModule(type: JavaCompile) { ++ def moduleSrcDir = file('src/module/java') ++ source(moduleSrcDir) ++ destinationDir = file("$buildDir/classes/java/modules") ++ classpath = compileJava.classpath ++ inputs.property("moduleName", moduleName) ++ inputs.property("moduleVersion", project.version) ++ options.compilerArgs = [ ++ '--release', '9', ++ '--module-version', project.version as String, ++ '--module-source-path', moduleSrcDir.toString(), ++ '--patch-module', "$moduleName=${sourceSets.main.allJava.srcDirs.join(':')}", ++ '--module', moduleName ++ ] ++} ++ ++def normalizeVersion = { versionLiteral -> ++ try { ++ (versionLiteral =~ /(\d+)\.(\d+)\.(\d+).*/)[0][1..3].join('.') ++ } catch (e) { ++ throw new GradleException("Version '$versionLiteral' does not match version pattern, e.g. 1.0.0-QUALIFIER", e) + } ++} + +- named("javadocJar") { +- from(javadoc.map { File(it.destinationDir, "element-list") }) { +- // For compatibility with older tools, e.g. NetBeans 11 +- rename { "package-list" } +- } ++jar { ++ manifest { ++ attributes( ++ 'Created-By': "${System.properties['java.version']} (${System.properties['java.vendor']} ${System.properties['java.vm.version']})".toString(), ++ 'Built-By': builtByValue, ++ 'Build-Date': buildDate, ++ 'Build-Time': buildTime, ++ 'Specification-Title': project.name, ++ 'Specification-Version': normalizeVersion(project.version), ++ 'Specification-Vendor': 'apiguardian.org', ++ 'Implementation-Title': project.name, ++ 'Implementation-Version': project.version, ++ 'Implementation-Vendor': 'apiguardian.org', ++ 'Bundle-Name': project.name, ++ 'Bundle-Description': project.description, ++ 'Bundle-DocURL': 'https://github.com/apiguardian-team/apiguardian', ++ 'Bundle-Vendor': 'apiguardian.org', ++ '-exportcontents': 'org.apiguardian.api', ++ 'Bundle-SymbolicName': moduleName ++ ) + } +- +- withType().configureEach { +- from(rootDir) { +- include("LICENSE") +- into("META-INF") +- } ++ from(files("${compileModule.destinationDir}/$moduleName").builtBy(compileModule)) { ++ include('module-info.class') + } ++} + +- val prepareDocsForUploadToGhPages by registering(Copy::class) { +- dependsOn(javadoc) +- outputs.dir(docsDir) +- +- from("$buildDir/docs") { +- include("javadoc/**") +- } +- from("$buildDir/docs/javadoc") { +- // For compatibility with pre JDK 10 versions of the Javadoc tool +- include("element-list") +- rename { "api/package-list" } +- } +- into("${docsDir}/${docsVersion}") +- filesMatching("javadoc/**") { +- path = path.replace("javadoc/", "api/") +- } +- includeEmptyDirs = false +- } ++javadoc { ++ options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED ++ options.author = true ++ options.header = '@API Guardian' ++ options.addStringOption('Xdoclint:html,syntax,reference', '-quiet') ++ options.links 'https://docs.oracle.com/en/java/javase/11/docs/api/' ++} + +- val createCurrentDocsFolder by registering(Copy::class) { +- dependsOn(prepareDocsForUploadToGhPages) +- enabled = replaceCurrentDocs +- outputs.dir("${docsDir}/current") ++task sourcesJar(type: Jar, dependsOn: classes) { ++ classifier = 'sources' ++ from sourceSets.main.allSource ++} + +- from("${docsDir}/${docsVersion}") +- into("${docsDir}/current") +- } ++task javadocJar(type: Jar) { ++ classifier = 'javadoc' ++ from javadoc ++} + +- gitPublishCommit { +- dependsOn(prepareDocsForUploadToGhPages, createCurrentDocsFolder) +- } ++artifacts { ++ archives sourcesJar ++ archives javadocJar + } + +-if (!isSnapshot) { ++def signArtifacts = !project.version.contains('SNAPSHOT') ++ ++if (signArtifacts) { + signing { +- sign(publishing.publications) ++ sign configurations.archives + } + } + +-nexusPublishing { +- packageGroup.set(group.toString()) ++uploadArchives { ++ ++ dependsOn check ++ + repositories { +- sonatype() +- } +-} ++ mavenDeployer { ++ ++ if (signArtifacts) { ++ beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } ++ } ++ ++ def ossrhUsername = rootProject.hasProperty('ossrhUsername') ? rootProject.ossrhUsername : '' ++ def ossrhPassword = rootProject.hasProperty('ossrhPassword') ? rootProject.ossrhPassword : '' ++ ++ repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { ++ authentication(userName: ossrhUsername, password: ossrhPassword) ++ } ++ ++ snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { ++ authentication(userName: ossrhUsername, password: ossrhPassword) ++ } ++ ++ pom.project { ++ name "${project.group}:${project.name}" ++ packaging 'jar' ++ description "@API Guardian" ++ url 'https://github.com/apiguardian-team/apiguardian' + +-publishing { +- publications { +- create("maven") { +- from(components["java"]) +- pom { +- name.set("${project.group}:${project.name}") +- description.set("@API Guardian") +- url.set("https://github.com/apiguardian-team/apiguardian") + scm { +- connection.set("scm:git:git://github.com/apiguardian-team/apiguardian.git") +- developerConnection.set("scm:git:git://github.com/apiguardian-team/apiguardian.git") +- url.set("https://github.com/apiguardian-team/apiguardian") ++ connection 'scm:git:git://github.com/apiguardian-team/apiguardian.git' ++ developerConnection 'scm:git:git://github.com/apiguardian-team/apiguardian.git' ++ url 'https://github.com/apiguardian-team/apiguardian' + } ++ + licenses { + license { +- name.set("The Apache License, Version 2.0") +- url.set("http://www.apache.org/licenses/LICENSE-2.0.txt") ++ name 'The Apache License, Version 2.0' ++ url 'http://www.apache.org/licenses/LICENSE-2.0.txt' + } + } ++ + developers { + developer { +- id.set("apiguardian") +- name.set("@API Guardian Team") +- email.set("team@apiguardian.org") ++ id 'apiguardian' ++ name '@API Guardian Team' ++ email 'team@apiguardian.org' + } + } + } ++ ++ pom.whenConfigured { p -> ++ p.dependencies = p.dependencies.findAll { dep -> dep.scope != 'test' } ++ } + } + } + } + +-gitPublish { +- repoUri.set("https://github.com/apiguardian-team/apiguardian.git") +- branch.set("gh-pages") +- +- contents { +- from(docsDir) +- into("docs") +- } ++def docsVersion = project.version.contains('SNAPSHOT') ? 'snapshot' : project.version ++def docsDir = new File(buildDir, 'ghpages-docs') + +- preserve { +- include("**/*") +- exclude("docs/$docsVersion/**") +- if (replaceCurrentDocs) { +- exclude("docs/current/**") +- } ++task prepareDocsForUploadToGhPages(dependsOn: [javadoc], type: Copy) { ++ outputs.dir docsDir ++ ++ from("$buildDir/docs") { ++ include 'javadoc/**' + } ++ into "${docsDir}/${docsVersion}" ++ filesMatching('javadoc/**') { fileCopyDetails -> ++ fileCopyDetails.path = fileCopyDetails.path.replace('javadoc/', 'api/') ++ } ++ includeEmptyDirs = false + } ++ ++task createCurrentDocsFolder(dependsOn: prepareDocsForUploadToGhPages, type: Copy) { ++ outputs.dir "${docsDir}/current" ++ ++ from "${docsDir}/${docsVersion}" ++ into "${docsDir}/current" ++} ++ ++createCurrentDocsFolder.onlyIf { project.hasProperty('replaceCurrentDocs') } +--- a/apiguardian/settings.gradle.kts ++++ b/apiguardian/settings.gradle.kts +@@ -1,5 +1,6 @@ + rootProject.name = "apiguardian-api" + +-require(JavaVersion.current().isJava11) { +- "The @API Guardian build requires Java 11. Currently executing with Java ${JavaVersion.current()}." ++if (!JavaVersion.current().isJava11Compatible()) { ++ throw new GradleException('The @API Guardian build requires Java 11. ' + ++ "Currently executing with Java ${JavaVersion.current()}.") + } diff -Nru jtreg7-7.3.1+1/debian/patches/codetools-7904101-proposed.patch jtreg7-7.5.2+1+ds2/debian/patches/codetools-7904101-proposed.patch --- jtreg7-7.3.1+1/debian/patches/codetools-7904101-proposed.patch 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/patches/codetools-7904101-proposed.patch 2026-02-23 04:42:48.000000000 +0000 @@ -0,0 +1,411 @@ +Description: intermittent failure in StreamsTest.agentvm.ok + FileDescriptor test intermittently fails because the agent's process output + capture lacks synchronisation. + This PR fixes the issue: + - Agent VM prints the "process output separator" to stderr and stdout + before and after the action. + - The main vm uses the marker to stop reading the stream for the current + test result section (or a general agent log). + - The main vm restarts reading the log after updating the test section (or clearing it) + until the next marker or the process is shut down. +Author: Vladimir Petko +Origin: upstream, https://github.com/openjdk/jtreg/pull/295 +Bug: https://bugs.openjdk.org/browse/CODETOOLS-7904101 +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1115694 +Last-Update: 2025-10-28 + +--- /dev/null ++++ b/src/share/classes/com/sun/javatest/regtest/agent/AgentProcessLogger.java +@@ -0,0 +1,149 @@ ++/* ++ * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. Oracle designates this ++ * particular file as subject to the "Classpath" exception as provided ++ * by Oracle in the LICENSE file that accompanied this code. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ */ ++ ++package com.sun.javatest.regtest.agent; ++ ++import java.io.BufferedReader; ++import java.io.IOException; ++import java.io.InputStreamReader; ++import java.io.PrintWriter; ++import java.util.Map; ++import java.util.concurrent.ExecutionException; ++import java.util.concurrent.ExecutorService; ++import java.util.concurrent.Executors; ++import java.util.concurrent.Future; ++import java.util.concurrent.TimeUnit; ++import java.util.concurrent.TimeoutException; ++import java.util.function.BiConsumer; ++import java.util.function.Function; ++ ++/** ++ * Handles stdout/stderr process output from the agent. ++ */ ++public class AgentProcessLogger { ++ ++ /** ++ * Constructs a thread pool to handle agent process output ++ * and creates stdout and stderr readers ++ * ++ * @param p agent process ++ */ ++ public AgentProcessLogger(Process p) { ++ executorService = Executors.newFixedThreadPool(2, runnable -> { ++ Thread th = new Thread(runnable); ++ th.setDaemon(true); ++ return th; ++ }); ++ stdOut = new BufferedReader(new InputStreamReader(p.getInputStream())); ++ stdErr = new BufferedReader(new InputStreamReader(p.getErrorStream())); ++ } ++ ++ /** ++ * Starts logging output and error streams to the specified consumer ++ * ++ * @param logConsumer log consumer, has two parameters - stream name and ++ * the log line ++ */ ++ public void startLogging(BiConsumer logConsumer, ++ Map processStreamWriters, ++ Function mappingFunction) { ++ if (inputDone != null || errorDone != null) { ++ throw new RuntimeException("call stopLogging first"); ++ } ++ if (processStreamWriters != null) { ++ processStreamWriters.computeIfAbsent("stdout", mappingFunction); ++ processStreamWriters.computeIfAbsent("stderr", mappingFunction); ++ } ++ inputDone = executorService.submit(() -> captureLog("stdout", stdOut, logConsumer)); ++ errorDone = executorService.submit(() -> captureLog("stderr", stdErr, logConsumer)); ++ } ++ ++ ++ /** ++ * Waits for the logging tasks to finish ++ * ++ * @param timeout shutdown timeout ++ * @param timeUnit shutdown time unit ++ * ++ * @throws ExecutionException the logger threw an unexpected exception ++ * @throws InterruptedException the logger was interrupted ++ * @throws TimeoutException logging task failed to stop within 60 seconds ++ */ ++ public void stopLogging(int timeout, TimeUnit timeUnit) throws ExecutionException, InterruptedException, TimeoutException { ++ inputDone.get(timeout, timeUnit); ++ errorDone.get(timeout, timeUnit); ++ inputDone = null; ++ errorDone = null; ++ } ++ ++ /** ++ * Wait for logging tasks to finish and shutdown the thread pool ++ * ++ * @param timeout shutdown timeout ++ * @param timeUnit shutdown time unit ++ */ ++ public void shutdown(int timeout, TimeUnit timeUnit) { ++ try { ++ stopLogging(timeout, timeUnit); ++ } catch (ExecutionException | InterruptedException | TimeoutException ex) { ++ // ignore exception, the process is terminating ++ } ++ executorService.shutdown(); ++ } ++ ++ /** ++ * Forward log lines to the consumer, stop forwarding on the separator ++ * line ++ * ++ * @param streamName name of the stream ++ * @param reader process's stream reader ++ */ ++ private Void captureLog(String streamName, BufferedReader reader, BiConsumer consumer) { ++ try { ++ String line; ++ while ((line = reader.readLine()) != null) { ++ int endMarker = line.indexOf(AgentServer.PROCESS_OUTPUT_SEPARATOR); ++ if (endMarker < 0) { ++ consumer.accept(streamName, line); ++ continue; ++ } ++ if (endMarker > 0) { ++ line = line.substring(0, endMarker); ++ consumer.accept(streamName, line); ++ } ++ break; ++ } ++ } catch (IOException ex) { ++ // ignore the exception, the reader might be closed ++ } ++ return null; ++ } ++ ++ private final ExecutorService executorService; ++ private final BufferedReader stdOut; ++ private final BufferedReader stdErr; ++ private Future inputDone; ++ private Future errorDone; ++} +--- a/src/share/classes/com/sun/javatest/regtest/agent/AgentServer.java ++++ b/src/share/classes/com/sun/javatest/regtest/agent/AgentServer.java +@@ -30,9 +30,11 @@ + import java.io.DataInputStream; + import java.io.DataOutputStream; + import java.io.File; ++import java.io.FileDescriptor; + import java.io.FileWriter; + import java.io.IOException; + import java.io.OutputStream; ++import java.io.OutputStreamWriter; + import java.io.PrintStream; + import java.io.PrintWriter; + import java.io.Writer; +@@ -93,6 +95,9 @@ + public static final byte KEEPALIVE = 5; + public static final byte CLOSE = 6; + ++ public static final String PROCESS_OUTPUT_SEPARATOR = ++ "------ This line is the stdout/stderr output separator ------"; ++ + /** + * Send KEEPALIVE bytes periodically to a stream. + * The bytes are written every {@code WRITE_TIMEOUT} milliseconds. +@@ -236,6 +241,7 @@ + try { + int op; + while ((op = in.read()) != -1) { ++ writeProcessOutputSeparator(); + switch (op) { + case DO_COMPILE: + doCompile(); +@@ -252,6 +258,8 @@ + throw new Error("Agent.Server: unexpected op: " + op); + } + out.flush(); ++ // signal end of section output for the log writer ++ writeProcessOutputSeparator(); + } + } finally { + keepAlive.finished(); +@@ -260,6 +268,20 @@ + } + } + ++ private void writeProcessOutputSeparator() { ++ try { ++ processStdOut.write(PROCESS_OUTPUT_SEPARATOR); ++ processStdOut.write(System.lineSeparator()); ++ processStdOut.flush(); ++ processStdErr.write(PROCESS_OUTPUT_SEPARATOR); ++ processStdErr.write(System.lineSeparator()); ++ processStdErr.flush(); ++ } ++ catch (IOException e ){ ++ // ignore exception as the agent process may be killed ++ } ++ } ++ + private void doCompile() throws IOException { + if (traceServer) { + traceOut.println("Agent.Server.doCompile"); +@@ -388,7 +410,8 @@ + private final PrintWriter logWriter; + private final int id; + private final Map writers = new EnumMap<>(OutputKind.class); +- ++ private final OutputStreamWriter processStdOut = new FileWriter(FileDescriptor.out); ++ private final OutputStreamWriter processStdErr = new FileWriter(FileDescriptor.err); + /** + * Create an output stream for output to be sent back to the client via the server connection. + * @param kind the kind of stream +--- a/src/share/classes/com/sun/javatest/regtest/exec/Agent.java ++++ b/src/share/classes/com/sun/javatest/regtest/exec/Agent.java +@@ -26,15 +26,12 @@ + package com.sun.javatest.regtest.exec; + + +-import java.io.BufferedReader; + import java.io.DataInputStream; + import java.io.DataOutputStream; + import java.io.EOFException; + import java.io.File; + import java.io.FileWriter; + import java.io.IOException; +-import java.io.InputStream; +-import java.io.InputStreamReader; + import java.io.PrintStream; + import java.io.PrintWriter; + import java.lang.reflect.Method; +@@ -60,13 +57,16 @@ + import java.util.TreeSet; + import java.util.WeakHashMap; + import java.util.concurrent.CountDownLatch; ++import java.util.concurrent.ExecutionException; + import java.util.concurrent.TimeUnit; ++import java.util.concurrent.TimeoutException; + + import com.sun.javatest.Status; + import com.sun.javatest.TestResult; + import com.sun.javatest.WorkDirectory; + import com.sun.javatest.regtest.TimeoutHandler; + import com.sun.javatest.regtest.agent.ActionHelper; ++import com.sun.javatest.regtest.agent.AgentProcessLogger; + import com.sun.javatest.regtest.agent.AgentServer; + import com.sun.javatest.regtest.agent.Alarm; + import com.sun.javatest.regtest.agent.Flags; +@@ -164,8 +164,8 @@ + env.putAll(envVars); + agentServerProcess = process = pb.start(); + agentServerPid = ProcessUtils.getProcessId(process); +- copyAgentProcessStream("stdout", process.getInputStream()); +- copyAgentProcessStream("stderr", process.getErrorStream()); ++ processLogger = new AgentProcessLogger(process); ++ startAgentLog(); + + try { + final int ACCEPT_TIMEOUT = (int) (60 * 1000 * timeoutFactor); +@@ -202,29 +202,11 @@ + } + + /** +- * Reads the output written by an agent process, and copies it either to +- * the current TestResult object (when one is available) or to the agent's +- * log file, if output is found while there is no test using the agent. +- * +- * @param name the name of the stream +- * @param in the stream ++ * Writes process input and error stream to the agent log. + */ +- void copyAgentProcessStream(final String name, final InputStream in) { +- Thread t = new Thread() { +- @Override +- public void run() { +- try (BufferedReader inReader = new BufferedReader(new InputStreamReader(in))) { +- String line; +- while ((line = inReader.readLine()) != null) { +- handleProcessStreamLine(name, line); +- } +- } catch (IOException e) { +- // ignore +- } +- } +- }; +- t.setDaemon(true); +- t.start(); ++ private void startAgentLog() { ++ processLogger.startLogging( (String stream, String logLine) -> log(stream + ": " + logLine), ++ null, null); + } + + /** +@@ -258,30 +240,24 @@ + * + * @param section the test result section to be used, or {@code null} + */ +- private synchronized void captureProcessStreams(TestResult.Section section) { ++ private synchronized void captureProcessStreams(TestResult.Section section, int timeout, TimeUnit timeUnit) ++ throws InterruptedException, ExecutionException, TimeoutException { ++ processLogger.stopLogging(timeout, timeUnit); + currentTestResultSection = section; + if (currentTestResultSection == null) { + for (PrintWriter pw : processStreamWriters.values()) { + pw.close(); + } + processStreamWriters.clear(); +- } +- } +- +- /** +- * Saves a line of output that was written by the agent to stdout (fd1) or stderr (fd2). +- * If there is a current test result section, the line is saved there; +- * otherwise it is written to the agent log file. +- * +- * @param name the name of the stream from which the line was read +- * @param line the line that was read +- */ +- private synchronized void handleProcessStreamLine(String name, String line) { +- if (currentTestResultSection == null) { +- log(name + ": " + line); ++ startAgentLog(); + } else { +- processStreamWriters.computeIfAbsent(name, currentTestResultSection::createOutput) +- .println(line); ++ processLogger.startLogging((String name, String line) -> { ++ Objects.requireNonNull(currentTestResultSection); ++ Objects.requireNonNull(processStreamWriters); ++ Objects.requireNonNull(name); ++ Objects.requireNonNull(line); ++ processStreamWriters.get(name).println(line); ++ }, processStreamWriters, currentTestResultSection::createOutput); + } + } + +@@ -391,17 +367,25 @@ + } + keepAlive.setEnabled(false); + try { +- captureProcessStreams(trs); + synchronized (out) { + agentAction.send(); + } + trace(actionName + ": request sent"); +- return readResults(trs); +- } catch (IOException e) { ++ // The agent sends process output separator in response ++ // to receiving a command. Wait for the separator and ++ // redirect log to the test result section ++ captureProcessStreams(trs, timeout, TimeUnit.SECONDS); ++ Status aResult = readResults(trs); ++ // The agent will be disposed on exception. ++ // Reset the agent log only if the agent can be reused. ++ // The agent will send process output separator on ++ // command execution. ++ captureProcessStreams(null, timeout, TimeUnit.SECONDS); ++ return aResult; ++ } catch (InterruptedException | TimeoutException | ExecutionException | IOException e) { + trace(actionName + ": error " + e); + throw new Fault(e); + } finally { +- captureProcessStreams(null); + alarm.cancel(); + keepAlive.setEnabled(true); + if (alarm.didFire()) { +@@ -486,7 +470,9 @@ + alarm.cancel(); + Thread.interrupted(); // clear any interrupted status + } +- ++ // Ensure that thread pool threads are shut down ++ // and the agent log is fully written ++ processLogger.shutdown(60, TimeUnit.SECONDS); + log("Closed"); + } + +@@ -618,6 +604,7 @@ + final List vmOpts; + final File execDir; + final Process process; ++ final AgentProcessLogger processLogger; + final DataInputStream in; + final DataOutputStream out; + final KeepAlive keepAlive; diff -Nru jtreg7-7.3.1+1/debian/patches/codetools-7904104-proposed.patch jtreg7-7.5.2+1+ds2/debian/patches/codetools-7904104-proposed.patch --- jtreg7-7.3.1+1/debian/patches/codetools-7904104-proposed.patch 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/patches/codetools-7904104-proposed.patch 2026-02-23 04:42:48.000000000 +0000 @@ -0,0 +1,35 @@ +Description: intermittent test failure in TimeoutDefaultSecondsWaiter + victim.interrupt() is not needed if the process exits successfully + after the kill signal. This PR only calls interrupt() if the process + fails to exit or the wait is interrupted for some reason. + This allows TimeoutDefaultSecondsWaiter tests to pass. + Alternative: update assertion in TimeoutDefaultSecondsWaiter test. +Author: Vladimir Petko +Origin: upstream, https://github.com/openjdk/jtreg/pull/296 +Bug: https://bugs.openjdk.org/browse/CODETOOLS-7904104 +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1115694 +Last-Update: 2025-10-28 + +--- a/src/share/classes/com/sun/javatest/regtest/exec/ProcessCommand.java ++++ b/src/share/classes/com/sun/javatest/regtest/exec/ProcessCommand.java +@@ -329,9 +329,17 @@ public void run() { + + timeoutHandlerDone.countDown(); + +- // JDK 1.8 introduces a Process.waitFor(timeout) method which could +- // be used here. We need run on 1.5 so using interrupt() instead. +- victim.interrupt(); ++ // unlock the main thread if the process fails ++ // to exit ++ try { ++ if (!process.waitFor(timeout, TimeUnit.SECONDS)) { ++ victim.interrupt(); ++ } ++ } ++ catch (InterruptedException e) { ++ log.println("Interrupted exception: " + e); ++ victim.interrupt(); ++ } + } + }; + timeoutHandlerThread.setName("Timeout Handler for " + cmd.get(0)); diff -Nru jtreg7-7.3.1+1/debian/patches/codetools-7904105-proposed.patch jtreg7-7.5.2+1+ds2/debian/patches/codetools-7904105-proposed.patch --- jtreg7-7.3.1+1/debian/patches/codetools-7904105-proposed.patch 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/patches/codetools-7904105-proposed.patch 2026-02-23 04:42:48.000000000 +0000 @@ -0,0 +1,42 @@ +Description: intermittent test failure in CleanupDirTests.agentvm.conc + jtharness does not synchronize calls to Observer. Synchronized keyword + needs to be added when processing shared state. +Author: Vladimir Petko +Origin: upstream, https://github.com/openjdk/jtreg/pull/297 +Bug: https://bugs.openjdk.org/browse/CODETOOLS-7904105 +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1115694 +Last-Update: 2025-10-28 + +--- a/src/share/classes/com/sun/javatest/regtest/report/TestStats.java ++++ b/src/share/classes/com/sun/javatest/regtest/report/TestStats.java +@@ -99,7 +99,7 @@ + } + + @Override +- public void finishedTest(TestResult tr) { ++ public synchronized void finishedTest(TestResult tr) { + add(tr); + } + +--- a/src/share/classes/com/sun/javatest/regtest/report/XMLWriter.java ++++ b/src/share/classes/com/sun/javatest/regtest/report/XMLWriter.java +@@ -365,7 +365,7 @@ + } + + @Override +- public void finishedTest(TestResult tr) { ++ public synchronized void finishedTest(TestResult tr) { + try { + super.finishedTest(tr); + new XMLWriter(tr, mustVerify, harnessOut, harnessErr).toXML(); +--- a/src/share/classes/com/sun/javatest/regtest/tool/Tool.java ++++ b/src/share/classes/com/sun/javatest/regtest/tool/Tool.java +@@ -1946,7 +1946,7 @@ + + h.addObserver(new BasicObserver() { + @Override +- public void error(String msg) { ++ public synchronized void error(String msg) { + Tool.this.error(msg); + } + }); diff -Nru jtreg7-7.3.1+1/debian/patches/codetools-7904106-proposed.patch jtreg7-7.5.2+1+ds2/debian/patches/codetools-7904106-proposed.patch --- jtreg7-7.3.1+1/debian/patches/codetools-7904106-proposed.patch 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/patches/codetools-7904106-proposed.patch 2026-02-23 04:42:48.000000000 +0000 @@ -0,0 +1,75 @@ +Description: TestNativePath: use different work directories + Both agentvm and othervm targets in TestNativePath use the same work path + $(BUILDTESTDIR)/nativepath.othervm/work. + This causes intermittent test failures when the tests are run in parallel. +Author: Vladimir Petko +Origin: upstream, https://github.com/openjdk/jtreg/pull/298 +Bug: https://bugs.openjdk.org/browse/CODETOOLS-7904106 +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1115694 +Last-Update: 2025-10-28 + +--- a/test/nativepath/TestNativePath.gmk ++++ b/test/nativepath/TestNativePath.gmk +@@ -38,16 +38,16 @@ + -jdk:$(JDKHOME) \ + -nativepath:$(NATIVEPATH) \ + -vmoption:-Dcorrect.nativepath=$(NATIVEPATH) \ +- -w:$(BUILDTESTDIR)/nativepath.othervm/work \ +- -r:$(BUILDTESTDIR)/nativepath.othervm/report \ ++ -w:$(@:%.ok=%nativepath.othervm)/work \ ++ -r:$(@:%.ok=%nativepath.othervm)/report \ + -verbose:fail \ + $(@:$(BUILDTESTDIR)/TestNativePath.%.ok=-%) \ + $(TESTDIR)/nativepath/NativesOK.java + + $(JTREG_IMAGEDIR)/bin/jtreg $(JTREG_OPTS) \ + -jdk:$(JDKHOME) \ +- -w:$(BUILDTESTDIR)/nativepath.othervm2/work \ +- -r:$(BUILDTESTDIR)/nativepath.othervm2/report \ ++ -w:$(@:%.ok=%nativepath.othervm2)/work \ ++ -r:$(@:%.ok=%nativepath.othervm2)/report \ + -verbose:fail \ + $(@:$(BUILDTESTDIR)/TestNativePath.%.ok=-%) \ + $(TESTDIR)/nativepath/NativesEmpty.java +@@ -82,8 +82,8 @@ + # should yield an error + $(JTREG_IMAGEDIR)/bin/jtreg $(JTREG_OPTS) \ + -jdk:$(JDKHOME) \ +- -w:$(BUILDTESTDIR)/nativepath.othervm2/work \ +- -r:$(BUILDTESTDIR)/nativepath.othervm2/report \ ++ -w:$(@:%.ok=%nativepath.othervm2)/work \ ++ -r:$(@:%.ok=%nativepath.othervm2)/report \ + -verbose:fail \ + $(TESTDIR)/nativepath/NativesOK.java \ + 2>&1 | grep -q "Use -nativepath to specify the location of native code" +@@ -91,8 +91,8 @@ + # Exclude all tests with native code + $(JTREG_IMAGEDIR)/bin/jtreg $(JTREG_OPTS) \ + -jdk:$(JDKHOME) \ +- -w:$(BUILDTESTDIR)/nativepath.othervm2/work \ +- -r:$(BUILDTESTDIR)/nativepath.othervm2/report \ ++ -w:$(@:%.ok=%nativepath.othervm2)/work \ ++ -r:$(@:%.ok=%nativepath.othervm2)/report \ + -k:!native \ + -verbose:fail \ + $(TESTDIR)/nativepath/NativesOK.java \ +@@ -103,15 +103,15 @@ + -jdk:$(JDKHOME) \ + -nativepath:$(NATIVEPATH) \ + -e:CORRECTNATIVEPATH=$(NATIVEPATH) \ +- -w:$(BUILDTESTDIR)/nativepath.shell/work \ +- -r:$(BUILDTESTDIR)/nativepath.shell/report \ ++ -w:$(@:%.ok=%nativepath.shell)/work \ ++ -r:$(@:%.ok=%nativepath.shell)/report \ + -verbose:fail \ + $(TESTDIR)/nativepath/NativesOKShell.sh + + $(JTREG_IMAGEDIR)/bin/jtreg $(JTREG_OPTS) \ + -jdk:$(JDKHOME) \ +- -w:$(BUILDTESTDIR)/nativepath.shell/work \ +- -r:$(BUILDTESTDIR)/nativepath.shell/report \ ++ -w:$(@:%.ok=%nativepath.shell)/work \ ++ -r:$(@:%.ok=%nativepath.shell)/report \ + -verbose:fail \ + $(TESTDIR)/nativepath/NativesEmptyShell.sh + diff -Nru jtreg7-7.3.1+1/debian/patches/codetools-7904107-proposed.patch jtreg7-7.5.2+1+ds2/debian/patches/codetools-7904107-proposed.patch --- jtreg7-7.3.1+1/debian/patches/codetools-7904107-proposed.patch 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/patches/codetools-7904107-proposed.patch 2026-02-23 04:42:48.000000000 +0000 @@ -0,0 +1,38 @@ +Description: AgentOut.othervm.ok should not access $(BUILDTESTDIR)/AgentOut.agentvm + AgentOut.othervm.ok tries to access $(BUILDTESTDIR)/AgentOut.agentvm. + This should only happen in AgentOut.agentvm.ok. + Add a new target to filter log lines that depends on AgentOut.agentvm.ok. +Author: Vladimir Petko +Origin: upstream, https://github.com/openjdk/jtreg/pull/299 +Bug: https://bugs.openjdk.org/browse/CODETOOLS-7904107 +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1115694 +Last-Update: 2025-10-28 + +--- a/test/agentout/AgentOut.gmk ++++ b/test/agentout/AgentOut.gmk +@@ -78,6 +78,10 @@ + < $$i \ + > `dirname $$i`-filtered/`basename $$i` ; \ + done ++ # ++ echo "run at `date`" > $@ ++ ++$(BUILDTESTDIR)/AgentOut.agentvm/logs-filtered.ok: $(BUILDTESTDIR)/AgentOut.agentvm.ok + # merge direct and stderr from agent CompileTest to match stderr from othervm CompileTest + $(CAT) $(BUILDTESTDIR)/AgentOut.agentvm/logs-filtered/CompileTest-direct.log \ + $(BUILDTESTDIR)/AgentOut.agentvm/logs-filtered/CompileTest-System.err.log \ +@@ -85,12 +89,10 @@ + $(MV) $(BUILDTESTDIR)/AgentOut.agentvm/logs-filtered/tmp.log \ + $(BUILDTESTDIR)/AgentOut.agentvm/logs-filtered/CompileTest-System.err.log + $(CAT) < $(DEV_NULL) > $(BUILDTESTDIR)/AgentOut.agentvm/logs-filtered/CompileTest-direct.log +- # +- echo "run at `date`" > $@ + + $(BUILDTESTDIR)/AgentOut.ok: \ +- $(BUILDTESTDIR)/AgentOut.agentvm.ok \ +- $(BUILDTESTDIR)/AgentOut.othervm.ok ++ $(BUILDTESTDIR)/AgentOut.othervm.ok \ ++ $(BUILDTESTDIR)/AgentOut.agentvm/logs-filtered.ok + $(DIFF) --strip-trailing-cr --recursive \ + $(BUILDTESTDIR)/AgentOut.agentvm/logs-filtered \ + $(BUILDTESTDIR)/AgentOut.othervm/logs-filtered diff -Nru jtreg7-7.3.1+1/debian/patches/codetools-7904152.patch jtreg7-7.5.2+1+ds2/debian/patches/codetools-7904152.patch --- jtreg7-7.3.1+1/debian/patches/codetools-7904152.patch 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/patches/codetools-7904152.patch 2026-02-23 04:42:48.000000000 +0000 @@ -0,0 +1,73 @@ +Description: 7904152: jtreg tests fail with openjdk 25 + The policy tests try to set the Security manager on the command-line + causing the Security Manager error. + The last supported JDK that allows setting the security manager is 21. +Author: Vladimir Petko +Origin: upstream, https://github.com/openjdk/jtreg/commit/da8892fb26a51fc5d4c3d4e3be74384aa29f64ce +Bug: https://bugs.openjdk.org/browse/CODETOOLS-7904152 +Last-Update: 2026-02-16 + +--- a/doc/building.md ++++ b/doc/building.md +@@ -118,7 +118,13 @@ + ``` + + Some tests depend on specific versions of JDK being available, specified +-by the following variables: `JDK8HOME`, `JDK9HOME`, `JDK14HOME`, `JDK18HOME`. ++by the following variables: ++- `JDK8HOME` ++- `JDK9HOME` ++- `JDK14HOME` ++- `JDK18HOME` ++- `JDK21HOME` ++- `JDK25HOME` + A test that requires any of these version of JDK will be skipped if the + variable is not set. + +--- a/make/Makefile ++++ b/make/Makefile +@@ -60,6 +60,12 @@ + ifndef JDK18HOME + @echo "Warning: JDK18HOME not set; some tests may not have been executed" + endif ++ifndef JDK21HOME ++ @echo "Warning: JDK21HOME not set; some tests may not have been executed" ++endif ++ifndef JDK25HOME ++ @echo "Warning: JDK25HOME not set; some tests may not have been executed" ++endif + ifdef HEADLESS + @echo "Warning: HEADLESS is set; some tests may not have been executed" + endif +@@ -110,6 +116,12 @@ + ifdef JDK18HOME + @echo "JDK18HOME = $(JDK18HOME)" + endif ++ifdef JDK21HOME ++ @echo "JDK21HOME = $(JDK21HOME)" ++endif ++ifdef JDK25HOME ++ @echo "JDK25HOME = $(JDK25HOME)" ++endif + @echo "JDKHOME = $(JDKHOME)" + @echo "JAVATEST_HOME = $(JAVATEST_HOME)" + ifneq ($(JTHARNESS_HOME), $(JAVATEST_HOME)) +--- a/test/policy/PolicyTest.gmk ++++ b/test/policy/PolicyTest.gmk +@@ -31,7 +31,7 @@ + $(RM) $(@:%.ok=%) ; $(MKDIR) $(@:%.ok=%) + $(JTREG_IMAGEDIR)/bin/jtreg $(JTREG_OPTS) \ + -w:$(@:%.ok=%)/work -r:$(@:%.ok=%)/report \ +- -jdk:$(JDKHOME) \ ++ -jdk:$(JDK21HOME) \ + -agentvm \ + -retain:all \ + $(TESTDIR)/policy/ \ +@@ -44,5 +44,6 @@ + $(GREP) 'grant.*testng[^ ]*.jar' $(@:%.ok=%)/work/TestNG/simple.policy_new + echo "test passed at `date`" > $@ + ++ifdef JDK21HOME + TESTS.jtreg += $(BUILDTESTDIR)/PolicyTest.ok +- ++endif diff -Nru jtreg7-7.3.1+1/debian/patches/codetools-7904157-proposed.patch jtreg7-7.5.2+1+ds2/debian/patches/codetools-7904157-proposed.patch --- jtreg7-7.3.1+1/debian/patches/codetools-7904157-proposed.patch 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/patches/codetools-7904157-proposed.patch 2026-02-23 04:42:48.000000000 +0000 @@ -0,0 +1,18 @@ +Description: Set compile timeout for TimeoutDefaultSecondsWaiter on zero vm + The TimeoutDefaultSecondsWaiter test fails on zero vm because the + compilation times out. Add override for the compilation timeout. +Author: Vladimir Petko +Bug: https://bugs.openjdk.org/browse/CODETOOLS-7904157 +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1128796 +Last-Update: 2026-02-23 + +--- a/test/timeoutDefaultSeconds/TimeoutDefaultSecondsWaiter.java ++++ b/test/timeoutDefaultSeconds/TimeoutDefaultSecondsWaiter.java +@@ -30,6 +30,7 @@ + /* + * @test id=one + * @summary Test should be interrupted after 1 second, configured in main action ++ * @compile/timeout=1 TimeoutDefaultSecondsWaiter.java + * @run main/timeout=1 TimeoutDefaultSecondsWaiter + */ + public class TimeoutDefaultSecondsWaiter { diff -Nru jtreg7-7.3.1+1/debian/patches/do-not-export-headless-display.patch jtreg7-7.5.2+1+ds2/debian/patches/do-not-export-headless-display.patch --- jtreg7-7.3.1+1/debian/patches/do-not-export-headless-display.patch 2023-05-23 02:28:12.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/patches/do-not-export-headless-display.patch 2026-01-11 23:06:11.000000000 +0000 @@ -8,9 +8,9 @@ --- a/test/basic/Basic.gmk +++ b/test/basic/Basic.gmk @@ -55,7 +55,13 @@ - + #---------------------------------------------------------------------- - + +ifdef HEADLESS +ENVVARS="DISPLAY=" +TEST_ENV="-Djava.awt.headless=true" @@ -18,7 +18,7 @@ ENVVARS="DISPLAY=$${DISPLAY:-`uname -n`:0.0}" +TEST_ENV="-Djava.awt.headless=false" +endif - + ifeq ($(OS_NAME), windows) BASIC_TESTS := $(shell cygpath -m $(abspath $(TESTDIR)/share/basic) ) @@ -89,6 +95,7 @@ diff -Nru jtreg7-7.3.1+1/debian/patches/flush-alarm.patch jtreg7-7.5.2+1+ds2/debian/patches/flush-alarm.patch --- jtreg7-7.3.1+1/debian/patches/flush-alarm.patch 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/patches/flush-alarm.patch 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,15 @@ +Description: Flush alarm output + Addresses sporadic FTBFS during builds on some systems related + to 'missing "Timeout signalled" action timeout message' errors. +Author: Vladimir Petko +Forwarded: not-needed +--- a/src/share/classes/com/sun/javatest/regtest/agent/Alarm.java ++++ b/src/share/classes/com/sun/javatest/regtest/agent/Alarm.java +@@ -147,6 +147,7 @@ + } else if (count % 100 == 0) { + msgOut.println(String.format("Timeout refired %d times", count)); + } ++ msgOut.flush(); + } + count++; + fired = true; diff -Nru jtreg7-7.3.1+1/debian/patches/hawt-jni-02-commons-lang-dependency.patch jtreg7-7.5.2+1+ds2/debian/patches/hawt-jni-02-commons-lang-dependency.patch --- jtreg7-7.3.1+1/debian/patches/hawt-jni-02-commons-lang-dependency.patch 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/patches/hawt-jni-02-commons-lang-dependency.patch 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,17 @@ +Description: Adds the missing dependency on commons-lang +Author: Emmanuel Bourg +Forwarded: https://github.com/fusesource/hawtjni/issues/58 +--- a/hawt-jni/hawtjni-generator/pom.xml ++++ b/hawt-jni/hawtjni-generator/pom.xml +@@ -62,6 +62,11 @@ + commons-cli + 1.0 + ++ ++ commons-lang ++ commons-lang ++ debian ++ + + + diff -Nru jtreg7-7.3.1+1/debian/patches/java21-codetools-7903646.patch jtreg7-7.5.2+1+ds2/debian/patches/java21-codetools-7903646.patch --- jtreg7-7.3.1+1/debian/patches/java21-codetools-7903646.patch 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/patches/java21-codetools-7903646.patch 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,24 @@ +Description: Disable tests failing due to SecurityManager changes in agentvm + In agentvm mode, the agent JVM does not set security manager for Java 18 + and + does not intercept System.exit() calls. + This causes agentvm mode behave differently from othervm - tests failing with + 'Unexpected test exit' produce an 'Unexpected EOF' error or a SocketException + error. + Disable affected tests pending bug fix as it requires discussion with upstream + on the best way to fix it. +Author: Vladimir Petko +Bug: https://bugs.openjdk.org/browse/CODETOOLS-7903646 +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1057512 +Forwarded: not-needed +Last-Update: 2024-01-26 +--- a/test/basic/Basic.gmk ++++ b/test/basic/Basic.gmk +@@ -108,6 +108,6 @@ + echo $@ passed at `date` > $@ + + INITIAL_TESTS += \ +- $(BUILDTESTDIR)/Basic.othervm.ok \ +- $(BUILDTESTDIR)/Basic.agentvm.ok ++ $(BUILDTESTDIR)/Basic.othervm.ok ++# $(BUILDTESTDIR)/Basic.agentvm.ok + diff -Nru jtreg7-7.3.1+1/debian/patches/jline3-01-ignore-warnings.patch jtreg7-7.5.2+1+ds2/debian/patches/jline3-01-ignore-warnings.patch --- jtreg7-7.3.1+1/debian/patches/jline3-01-ignore-warnings.patch 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/patches/jline3-01-ignore-warnings.patch 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,49 @@ +Description: Removed -Werror tag +Author: Saif Abdul Cassim +Forwarded: not-needed +--- a/jline3/pom.xml ++++ b/jline3/pom.xml +@@ -306,7 +306,6 @@ + true + + -Xlint:all,-options +- -Werror + -profile + compact1 + +--- a/jline3/jline/pom.xml ++++ b/jline3/jline/pom.xml +@@ -226,7 +226,6 @@ + + + -Xlint:all,-options +- -Werror + -profile + compact1 + +@@ -243,7 +242,6 @@ + + + -Xlint:all,-options +- -Werror + -profile + compact3 + +--- a/jline3/builtins/pom.xml ++++ b/jline3/builtins/pom.xml +@@ -59,7 +59,6 @@ + + + -Xlint:all,-options +- -Werror + -profile + compact1 + +@@ -76,7 +75,6 @@ + + + -Xlint:all,-options +- -Werror + -profile + compact3 + diff -Nru jtreg7-7.3.1+1/debian/patches/jline3-02-ignore-remote-modules.patch jtreg7-7.5.2+1+ds2/debian/patches/jline3-02-ignore-remote-modules.patch --- jtreg7-7.3.1+1/debian/patches/jline3-02-ignore-remote-modules.patch 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/patches/jline3-02-ignore-remote-modules.patch 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,59 @@ +Description: Ignore the remote-telnet and remote-ssh modules +Author: Saif Abdul Cassim +Forwarded: not-needed +--- a/jline3/jline/pom.xml ++++ b/jline3/jline/pom.xml +@@ -98,22 +98,6 @@ + false + ${project.build.directory}/generated-sources + +- +- org.jline +- jline-remote-ssh +- sources +- jar +- false +- ${project.build.directory}/generated-sources +- +- +- org.jline +- jline-remote-telnet +- sources +- jar +- false +- ${project.build.directory}/generated-sources +- + + + +@@ -156,22 +140,6 @@ + ${project.build.directory}/generated-resources + **/*.class + +- +- org.jline +- jline-remote-ssh +- jar +- false +- ${project.build.directory}/generated-resources +- **/*.class +- +- +- org.jline +- jline-remote-telnet +- jar +- false +- ${project.build.directory}/generated-resources +- **/*.class +- + + + +@@ -257,7 +225,6 @@ + *;-noimport:=true + + com.sun.jna*, +- org.apache.sshd*, + org.fusesource.jansi;version="[1.12,2)", + org.fusesource.jansi.internal;version="[1.6,2)", + * diff -Nru jtreg7-7.3.1+1/debian/patches/jline3-03-java21-compatibility.patch jtreg7-7.5.2+1+ds2/debian/patches/jline3-03-java21-compatibility.patch --- jtreg7-7.3.1+1/debian/patches/jline3-03-java21-compatibility.patch 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/patches/jline3-03-java21-compatibility.patch 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,136 @@ +Description: Support building on JDK 21 + Workaround [this-escape] warnings raised for constructors calling methods that can be + overridden in a subclass. +Author: Guillaume Nodet +Origin: upstream, https://github.com/jline/jline3/commit/05ee05dbc7b9c5ba9df8358d8a9fc58227101ed0 +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1061529 +Forwarded: not-needed +Applied-Upstream: 05ee05dbc7b9c5ba9df8358d8a9fc58227101ed0 +Last-Update: 2024-01-26 +--- a/jline3/builtins/src/main/java/org/jline/builtins/Completers.java ++++ b/jline3/builtins/src/main/java/org/jline/builtins/Completers.java +@@ -366,6 +366,7 @@ + this(Arrays.asList(nodes)); + } + ++ @SuppressWarnings("this-escape") + public TreeCompleter(List nodes) { + StringBuilder sb = new StringBuilder(); + addRoots(sb, nodes); +--- a/jline3/builtins/src/main/java/org/jline/builtins/Tmux.java ++++ b/jline3/builtins/src/main/java/org/jline/builtins/Tmux.java +@@ -188,6 +188,7 @@ + Discard, SelfInsert, Mouse + } + ++ @SuppressWarnings("this-escape") + public Tmux(Terminal terminal, PrintStream err, Consumer runner) throws IOException { + this.terminal = terminal; + this.err = err; +--- a/jline3/reader/src/main/java/org/jline/reader/impl/LineReaderImpl.java ++++ b/jline3/reader/src/main/java/org/jline/reader/impl/LineReaderImpl.java +@@ -205,7 +205,7 @@ + + protected KillRing killRing = new KillRing(); + +- protected UndoTree undo = new UndoTree<>(this::setBuffer); ++ protected UndoTree undo; + protected boolean isUndo; + + /* +@@ -246,6 +246,7 @@ + this(terminal, appName, null); + } + ++ @SuppressWarnings("this-escape") + public LineReaderImpl(Terminal terminal, String appName, Map variables) { + Objects.requireNonNull(terminal, "terminal can not be null"); + this.terminal = terminal; +@@ -260,6 +261,7 @@ + } + this.keyMaps = defaultKeyMaps(); + ++ undo = new UndoTree<>(this::setBuffer); + builtinWidgets = builtinWidgets(); + widgets = new HashMap<>(builtinWidgets); + bindingReader = new BindingReader(terminal.reader()); +--- a/jline3/reader/src/main/java/org/jline/reader/impl/UndoTree.java ++++ b/jline3/reader/src/main/java/org/jline/reader/impl/UndoTree.java +@@ -20,6 +20,7 @@ + private final Node parent; + private Node current; + ++ @SuppressWarnings("this-escape") + public UndoTree(Consumer s) { + state = s; + parent = new Node(null); +--- a/jline3/reader/src/main/java/org/jline/reader/impl/history/DefaultHistory.java ++++ b/jline3/reader/src/main/java/org/jline/reader/impl/history/DefaultHistory.java +@@ -42,6 +42,7 @@ + public DefaultHistory() { + } + ++ @SuppressWarnings("this-escape") + public DefaultHistory(LineReader reader) { + attach(reader); + } +--- a/jline3/remote-telnet/src/main/java/org/jline/builtins/telnet/ConnectionData.java ++++ b/jline3/remote-telnet/src/main/java/org/jline/builtins/telnet/ConnectionData.java +@@ -81,6 +81,7 @@ + * + * @param sock Socket of the inbound connection. + */ ++ @SuppressWarnings("this-escape") + public ConnectionData(Socket sock, ConnectionManager cm) { + socket = sock; + connectionManager = cm; +--- a/jline3/remote-telnet/src/main/java/org/jline/builtins/telnet/ConnectionManager.java ++++ b/jline3/remote-telnet/src/main/java/org/jline/builtins/telnet/ConnectionManager.java +@@ -75,6 +75,7 @@ + private boolean lineMode = false; + private boolean stopping = false; + ++ @SuppressWarnings("this-escape") + public ConnectionManager() { + threadGroup = new ThreadGroup(toString() + "Connections"); + closedConnections = new Stack(); +--- a/jline3/terminal/src/main/java/org/jline/terminal/Attributes.java ++++ b/jline3/terminal/src/main/java/org/jline/terminal/Attributes.java +@@ -138,6 +138,7 @@ + public Attributes() { + } + ++ @SuppressWarnings("this-escape") + public Attributes(Attributes attr) { + copy(attr); + } +--- a/jline3/terminal/src/main/java/org/jline/terminal/Size.java ++++ b/jline3/terminal/src/main/java/org/jline/terminal/Size.java +@@ -16,6 +16,7 @@ + public Size() { + } + ++ @SuppressWarnings("this-escape") + public Size(int columns, int rows) { + this(); + setColumns(columns); +--- a/jline3/terminal/src/main/java/org/jline/utils/Display.java ++++ b/jline3/terminal/src/main/java/org/jline/utils/Display.java +@@ -44,6 +44,7 @@ + protected final boolean delayedWrapAtEol; + protected final boolean cursorDownIsNewLine; + ++ @SuppressWarnings("this-escape") + public Display(Terminal terminal, boolean fullscreen) { + this.terminal = terminal; + this.fullScreen = fullscreen; +--- a/jline3/builtins/src/main/java/org/jline/builtins/Nano.java ++++ b/jline3/builtins/src/main/java/org/jline/builtins/Nano.java +@@ -940,6 +940,7 @@ + this(terminal, root.toPath()); + } + ++ @SuppressWarnings("this-escape") + public Nano(Terminal terminal, Path root) { + this.terminal = terminal; + this.root = root; diff -Nru jtreg7-7.3.1+1/debian/patches/jtdiff-version.patch jtreg7-7.5.2+1+ds2/debian/patches/jtdiff-version.patch --- jtreg7-7.3.1+1/debian/patches/jtdiff-version.patch 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/patches/jtdiff-version.patch 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,17 @@ +Description: Remove comma from jtdiff version string + jtdiff version string comma confuses help2man causing a lintian warning and a + corrupted man page. +Author: Vladimir Petko +Forwarded: not-needed +Last-Update: 2023-11-03 +--- a/src/share/classes/com/sun/javatest/diff/i18n.properties ++++ b/src/share/classes/com/sun/javatest/diff/i18n.properties +@@ -79,7 +79,7 @@ + help.output.title.arg= + help.output.title.desc=Title to use for the results + +-help.version.txt={0}, version {1} {2} {3}\nInstalled in {4}\nRunning on platform version {5} from {6}.\nBuilt with {7} on {8}. ++help.version.txt={0} version {1}-{2}+{3}\nInstalled in {4}\nRunning on platform version {5} from {6}.\nBuilt with {7} on {8}. + help.version.unknown=(unknown) + + html.diffs.count={0} differences diff -Nru jtreg7-7.3.1+1/debian/patches/junit4-Version.patch jtreg7-7.5.2+1+ds2/debian/patches/junit4-Version.patch --- jtreg7-7.3.1+1/debian/patches/junit4-Version.patch 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/patches/junit4-Version.patch 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,16 @@ +From: Markus Koschany +Date: Sun, 1 Nov 2020 19:20:34 +0100 +Subject: Version + +Forwarded: no +--- a/junit4/src/main/java/junit/runner/Version.java ++++ b/junit4/src/main/java/junit/runner/Version.java +@@ -9,7 +9,7 @@ + } + + public static String id() { +- return "4.13.2-SNAPSHOT"; ++ return "4.13.2"; + } + + public static void main(String[] args) { diff -Nru jtreg7-7.3.1+1/debian/patches/junit4-exclude-dependency-sources.patch jtreg7-7.5.2+1+ds2/debian/patches/junit4-exclude-dependency-sources.patch --- jtreg7-7.3.1+1/debian/patches/junit4-exclude-dependency-sources.patch 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/patches/junit4-exclude-dependency-sources.patch 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,30 @@ +From: Emmanuel Bourg +Date: Sun, 1 Nov 2020 19:17:42 +0100 +Subject: Don't include hamcrest in the Javadoc (the source artifact isn't + available) + +Forwarded: not-needed +--- + pom.xml | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/junit4/pom.xml ++++ b/junit4/pom.xml +@@ -314,7 +314,7 @@ + 32m + 128m + true +- true ++ false + + org.hamcrest:hamcrest-core:* + +@@ -437,7 +437,7 @@ + 32m + 128m + true +- true ++ false + + org.hamcrest:hamcrest-core:* + diff -Nru jtreg7-7.3.1+1/debian/patches/junit4-hamcrest-compatibility.patch jtreg7-7.5.2+1+ds2/debian/patches/junit4-hamcrest-compatibility.patch --- jtreg7-7.3.1+1/debian/patches/junit4-hamcrest-compatibility.patch 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/patches/junit4-hamcrest-compatibility.patch 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,24 @@ +Description: Fixes the compatibility with the version of Hamcrest in Debian +Author: Emmanuel Bourg +Forwarded: not-needed +--- a/junit4/src/main/java/org/junit/matchers/JUnitMatchers.java ++++ b/junit4/src/main/java/org/junit/matchers/JUnitMatchers.java +@@ -57,7 +57,7 @@ + */ + @Deprecated + public static Matcher> everyItem(final Matcher elementMatcher) { +- return CoreMatchers.everyItem(elementMatcher); ++ return CoreMatchers.everyItem((Matcher) elementMatcher); + } + + /** +--- a/junit4/src/test/java/org/junit/tests/experimental/theories/runner/WithDataPointMethod.java ++++ b/junit4/src/test/java/org/junit/tests/experimental/theories/runner/WithDataPointMethod.java +@@ -109,6 +109,6 @@ + } + + private Matcher> empty() { +- return everyItem(nullValue(Failure.class)); ++ return everyItem((Matcher) nullValue(Failure.class)); + } + } diff -Nru jtreg7-7.3.1+1/debian/patches/junit4-java17-compatibility.patch jtreg7-7.5.2+1+ds2/debian/patches/junit4-java17-compatibility.patch --- jtreg7-7.3.1+1/debian/patches/junit4-java17-compatibility.patch 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/patches/junit4-java17-compatibility.patch 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,50 @@ +Description: Disable doclint and change the source level to fix the build failure with OpenJDK 17 +Author: Emmanuel Bourg +Forwarded: https://github.com/junit-team/junit4/issues/1696 +Bug-Debian: https://bugs.debian.org/981830 +--- a/junit4/pom.xml ++++ b/junit4/pom.xml +@@ -533,14 +533,14 @@ + + + -Xlint:unchecked +- -Xdoclint:accessibility,reference,syntax ++ -Xdoclint:none + + + + + maven-javadoc-plugin + +- -Xdoclint:accessibility -Xdoclint:reference ++ -Xdoclint:none + + + +@@ -550,7 +550,7 @@ + + maven-javadoc-plugin + +- -Xdoclint:accessibility -Xdoclint:reference ++ -Xdoclint:none + + + +@@ -570,7 +570,7 @@ + + maven-javadoc-plugin + +- 1.6 ++ 8 + + + +@@ -580,7 +580,7 @@ + + maven-javadoc-plugin + +- 1.6 ++ 8 + + + diff -Nru jtreg7-7.3.1+1/debian/patches/junit5-15-deprecated.patch jtreg7-7.5.2+1+ds2/debian/patches/junit5-15-deprecated.patch --- jtreg7-7.3.1+1/debian/patches/junit5-15-deprecated.patch 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/patches/junit5-15-deprecated.patch 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,16 @@ +Description: call to AllDefaultPossibilitiesBuilder(boolean) is deprecated +Author: tony mancill +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=975225 +Forwarded: no +Last-Update: 2022-02-06 + +--- a/junit5/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/DefensiveAllDefaultPossibilitiesBuilder.java ++++ b/junit5/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/DefensiveAllDefaultPossibilitiesBuilder.java +@@ -46,7 +46,6 @@ + + @SuppressWarnings("deprecation") + DefensiveAllDefaultPossibilitiesBuilder() { +- super(true); + annotatedBuilder = new DefensiveAnnotatedBuilder(this); + junit4Builder = new DefensiveJUnit4Builder(); + ignoredBuilder = new NullIgnoredBuilder(); diff -Nru jtreg7-7.3.1+1/debian/patches/junit5-16-maven-build.patch jtreg7-7.5.2+1+ds2/debian/patches/junit5-16-maven-build.patch --- jtreg7-7.3.1+1/debian/patches/junit5-16-maven-build.patch 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/patches/junit5-16-maven-build.patch 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,1117 @@ +Description: Alternative build system using Maven replacing Gradle until + a more recent version is available in Debian +Author: Emmanuel Bourg +Origin: https://github.com/ebourg/junit5-maven-build +Forwarded: not-needed +--- /dev/null ++++ b/junit5/junit-bom/pom.xml +@@ -0,0 +1,111 @@ ++ ++ 4.0.0 ++ ++ org.junit ++ junit-parent ++ 5.9.2 ++ ../pom.xml ++ ++ org.junit ++ junit-bom ++ 5.9.2 ++ pom ++ JUnit 5 (Bill of Materials) ++ This Bill of Materials POM can be used to ease dependency management when referencing multiple JUnit artifacts using Gradle or Maven. ++ ++ ++ ++ ++ org.junit.jupiter ++ junit-jupiter ++ ${project.version} ++ ++ ++ org.junit.jupiter ++ junit-jupiter-api ++ ${project.version} ++ ++ ++ org.junit.jupiter ++ junit-jupiter-engine ++ ${project.version} ++ ++ ++ org.junit.jupiter ++ junit-jupiter-migrationsupport ++ ${project.version} ++ ++ ++ org.junit.jupiter ++ junit-jupiter-params ++ ${project.version} ++ ++ ++ org.junit.platform ++ junit-platform-commons ++ ${platform.version} ++ ++ ++ org.junit.platform ++ junit-platform-console ++ ${platform.version} ++ ++ ++ org.junit.platform ++ junit-platform-engine ++ ${platform.version} ++ ++ ++ org.junit.platform ++ junit-platform-jfr ++ ${platform.version} ++ ++ ++ org.junit.platform ++ junit-platform-launcher ++ ${platform.version} ++ ++ ++ org.junit.platform ++ junit-platform-reporting ++ ${platform.version} ++ ++ ++ org.junit.platform ++ junit-platform-runner ++ ${platform.version} ++ ++ ++ org.junit.platform ++ junit-platform-suite ++ ${platform.version} ++ ++ ++ org.junit.platform ++ junit-platform-suite-api ++ ${platform.version} ++ ++ ++ org.junit.platform ++ junit-platform-suite-commons ++ ${platform.version} ++ ++ ++ org.junit.platform ++ junit-platform-suite-engine ++ ${platform.version} ++ ++ ++ org.junit.platform ++ junit-platform-testkit ++ ${platform.version} ++ ++ ++ org.junit.vintage ++ junit-vintage-engine ++ ${project.version} ++ ++ ++ ++ +--- /dev/null ++++ b/junit5/junit-jupiter-api/pom.xml +@@ -0,0 +1,63 @@ ++ ++ 4.0.0 ++ ++ org.junit ++ junit-parent ++ 5.9.2 ++ ../pom.xml ++ ++ org.junit.jupiter ++ junit-jupiter-api ++ 5.9.2 ++ JUnit Jupiter API ++ Module "junit-jupiter-api" of JUnit 5. ++ ++ ++ 1.5.31 ++ ++ ++ ++ ++ org.opentest4j ++ opentest4j ++ 1.2.0 ++ ++ ++ org.junit.platform ++ junit-platform-commons ++ ${platform.version} ++ ++ ++ org.jetbrains.kotlin ++ kotlin-stdlib ++ ${kotlin.version} ++ provided ++ ++ ++ ++ ++ ++ ++ org.jetbrains.kotlin ++ kotlin-maven-plugin ++ ${kotlin.version} ++ ++ ++ compile ++ process-sources ++ ++ compile ++ ++ ++ ++ src/main/java ++ src/main/kotlin ++ ++ ++ ++ ++ ++ ++ ++ +--- /dev/null ++++ b/junit5/junit-jupiter-engine/pom.xml +@@ -0,0 +1,47 @@ ++ ++ 4.0.0 ++ ++ org.junit ++ junit-parent ++ 5.9.2 ++ ../pom.xml ++ ++ org.junit.jupiter ++ junit-jupiter-engine ++ 5.9.2 ++ JUnit Jupiter Engine ++ Module "junit-jupiter-engine" of JUnit 5. ++ ++ ++ ++ org.junit.platform ++ junit-platform-engine ++ 1.9.1 ++ ++ ++ org.junit.jupiter ++ junit-jupiter-api ++ ${project.version} ++ ++ ++ ++ org.junit.platform ++ junit-platform-suite-api ++ ${platform.version} ++ test ++ ++ ++ org.junit.platform ++ junit-platform-testkit ++ ${platform.version} ++ test ++ ++ ++ org.mockito ++ mockito-junit-jupiter ++ 4.1.0 ++ test ++ ++ ++ +--- /dev/null ++++ b/junit5/junit-jupiter-migrationsupport/pom.xml +@@ -0,0 +1,28 @@ ++ ++ 4.0.0 ++ ++ org.junit ++ junit-parent ++ 5.9.2 ++ ../pom.xml ++ ++ org.junit.jupiter ++ junit-jupiter-migrationsupport ++ 5.9.2 ++ JUnit Jupiter Migration Support ++ Module "junit-jupiter-migrationsupport" of JUnit 5. ++ ++ ++ ++ junit ++ junit ++ 4.x ++ ++ ++ org.junit.jupiter ++ junit-jupiter-api ++ ${project.version} ++ ++ ++ +--- /dev/null ++++ b/junit5/junit-jupiter-params/pom.xml +@@ -0,0 +1,60 @@ ++ ++ 4.0.0 ++ ++ org.junit ++ junit-parent ++ 5.9.2 ++ ../pom.xml ++ ++ org.junit.jupiter ++ junit-jupiter-params ++ 5.9.2 ++ JUnit Jupiter Params ++ Module "junit-jupiter-params" of JUnit 5. ++ ++ ++ ++ org.junit.jupiter ++ junit-jupiter-api ++ ${project.version} ++ ++ ++ ++ com.univocity ++ univocity-parsers ++ 2.9.1 ++ ++ ++ ++ ++ ++ ++ org.apache.maven.plugins ++ maven-shade-plugin ++ 3.3.0 ++ ++ ++ package ++ ++ shade ++ ++ ++ ++ ++ com.univocity:univocity-parsers ++ ++ ++ ++ ++ com.univocity ++ org.junit.jupiter.params.shadow.com.univocity ++ ++ ++ ++ ++ ++ ++ ++ ++ +--- /dev/null ++++ b/junit5/junit-jupiter/pom.xml +@@ -0,0 +1,35 @@ ++ ++ 4.0.0 ++ ++ org.junit ++ junit-parent ++ 5.9.2 ++ ../pom.xml ++ ++ org.junit.jupiter ++ junit-jupiter ++ 5.9.2 ++ JUnit Jupiter (Aggregator) ++ Module "junit-jupiter" of JUnit 5. ++ ++ ++ ++ org.junit.jupiter ++ junit-jupiter-api ++ ${project.version} ++ ++ ++ org.junit.jupiter ++ junit-jupiter-params ++ ${project.version} ++ ++ ++ org.junit.jupiter ++ junit-jupiter-engine ++ ${project.version} ++ runtime ++ ++ ++ ++ +--- /dev/null ++++ b/junit5/junit-platform-commons/pom.xml +@@ -0,0 +1,16 @@ ++ ++ 4.0.0 ++ ++ org.junit ++ junit-parent ++ 5.9.2 ++ ../pom.xml ++ ++ org.junit.platform ++ junit-platform-commons ++ 1.9.1 ++ JUnit Platform Commons ++ Module "junit-platform-commons" of JUnit 5. ++ ++ +--- /dev/null ++++ b/junit5/junit-platform-console-standalone/pom.xml +@@ -0,0 +1,106 @@ ++ ++ 4.0.0 ++ ++ org.junit ++ junit-parent ++ 5.9.2 ++ ../pom.xml ++ ++ org.junit.platform ++ junit-platform-console-standalone ++ 1.9.1 ++ JUnit Platform Console Standalone ++ Module "junit-platform-console-standalone" of JUnit 5. ++ ++ ++ ++ org.junit.platform ++ junit-platform-console ++ ${project.version} ++ ++ ++ org.junit.platform ++ junit-platform-reporting ++ ${project.version} ++ ++ ++ org.junit.platform ++ junit-platform-suite ++ ${project.version} ++ ++ ++ org.junit.jupiter ++ junit-jupiter-engine ++ ${parent.version} ++ ++ ++ org.junit.jupiter ++ junit-jupiter-params ++ ${parent.version} ++ ++ ++ org.junit.vintage ++ junit-vintage-engine ++ ${parent.version} ++ ++ ++ ++ ++ ++ ++ org.apache.maven.plugins ++ maven-jar-plugin ++ 3.3.0 ++ ++ ++ ++ org.junit.platform.console.ConsoleLauncher ++ ++ ++ ++ ++ ++ org.apache.maven.plugins ++ maven-shade-plugin ++ 3.3.0 ++ ++ ++ package ++ ++ shade ++ ++ ++ ++ ++ *:* ++ ++ ++ com.univocity:univocity-parsers ++ info.picocli:picocli ++ org.opentest4j.reporting:open-test-reporting-events ++ ++ ++ ++ ++ *:* ++ ++ **/module-info.class ++ **/package-info.class ++ META-INF/LICENSE-open-test-reporting.md ++ META-INF/maven/** ++ org/opentest4j/reporting/schema/* ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +--- /dev/null ++++ b/junit5/junit-platform-console/pom.xml +@@ -0,0 +1,71 @@ ++ ++ 4.0.0 ++ ++ org.junit ++ junit-parent ++ 5.9.2 ++ ../pom.xml ++ ++ org.junit.platform ++ junit-platform-console ++ 1.9.1 ++ JUnit Platform Console ++ Module "junit-platform-console" of JUnit 5. ++ ++ ++ ++ org.junit.platform ++ junit-platform-reporting ++ ${project.version} ++ ++ ++ info.picocli ++ picocli ++ 4.6.2 ++ ++ ++ ++ ++ ++ ++ org.apache.maven.plugins ++ maven-jar-plugin ++ 3.3.0 ++ ++ ++ ++ org.junit.platform.console.ConsoleLauncher ++ ++ ++ ++ ++ ++ org.apache.maven.plugins ++ maven-shade-plugin ++ 3.3.0 ++ ++ ++ package ++ ++ shade ++ ++ ++ ++ ++ info.picocli:picocli ++ ++ ++ ++ ++ picocli ++ org.junit.platform.console.shadow.picocli ++ ++ ++ ++ ++ ++ ++ ++ ++ +--- /dev/null ++++ b/junit5/junit-platform-engine/pom.xml +@@ -0,0 +1,28 @@ ++ ++ 4.0.0 ++ ++ org.junit ++ junit-parent ++ 5.9.2 ++ ../pom.xml ++ ++ org.junit.platform ++ junit-platform-engine ++ 1.9.1 ++ JUnit Platform Engine API ++ Module "junit-platform-engine" of JUnit 5. ++ ++ ++ ++ org.opentest4j ++ opentest4j ++ 1.2.0 ++ ++ ++ org.junit.platform ++ junit-platform-commons ++ ${project.version} ++ ++ ++ +--- /dev/null ++++ b/junit5/junit-platform-launcher/pom.xml +@@ -0,0 +1,23 @@ ++ ++ 4.0.0 ++ ++ org.junit ++ junit-parent ++ 5.9.2 ++ ../pom.xml ++ ++ org.junit.platform ++ junit-platform-launcher ++ 1.9.1 ++ JUnit Platform Launcher ++ Module "junit-platform-launcher" of JUnit 5. ++ ++ ++ ++ org.junit.platform ++ junit-platform-engine ++ ${project.version} ++ ++ ++ +--- /dev/null ++++ b/junit5/junit-platform-reporting/pom.xml +@@ -0,0 +1,60 @@ ++ ++ 4.0.0 ++ ++ org.junit ++ junit-parent ++ 5.9.2 ++ ../pom.xml ++ ++ org.junit.platform ++ junit-platform-reporting ++ 1.9.1 ++ JUnit Platform Reporting ++ Module "junit-platform-reporting" of JUnit 5. ++ ++ ++ ++ org.junit.platform ++ junit-platform-launcher ++ ${project.version} ++ ++ ++ org.opentest4j.reporting ++ open-test-reporting-events ++ 0.1.0-M1 ++ ++ ++ ++ ++ ++ ++ org.apache.maven.plugins ++ maven-shade-plugin ++ 3.3.0 ++ ++ ++ package ++ ++ shade ++ ++ ++ ++ ++ org.opentest4j.reporting:open-test-reporting-events ++ ++ ++ ++ ++ org.opentest4j.reporting ++ org.junit.platform.reporting.shadow.org.opentest4j.reporting ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +--- /dev/null ++++ b/junit5/junit-platform-runner/pom.xml +@@ -0,0 +1,39 @@ ++ ++ 4.0.0 ++ ++ org.junit ++ junit-parent ++ 5.9.2 ++ ../pom.xml ++ ++ org.junit.platform ++ junit-platform-runner ++ 1.9.1 ++ JUnit Platform Runner ++ Module "junit-platform-runner" of JUnit 5. ++ ++ ++ ++ junit ++ junit ++ 4.13.2 ++ ++ ++ org.junit.platform ++ junit-platform-launcher ++ ${project.version} ++ ++ ++ org.junit.platform ++ junit-platform-suite-api ++ ${project.version} ++ ++ ++ org.junit.platform ++ junit-platform-suite-commons ++ ${project.version} ++ ++ ++ ++ +--- /dev/null ++++ b/junit5/junit-platform-suite-api/pom.xml +@@ -0,0 +1,24 @@ ++ ++ 4.0.0 ++ ++ org.junit ++ junit-parent ++ 5.9.2 ++ ../pom.xml ++ ++ org.junit.platform ++ junit-platform-suite-api ++ 1.9.1 ++ JUnit Platform Suite API ++ Module "junit-platform-suite-api" of JUnit 5. ++ ++ ++ ++ org.junit.platform ++ junit-platform-commons ++ ${project.version} ++ ++ ++ ++ +--- /dev/null ++++ b/junit5/junit-platform-suite-commons/pom.xml +@@ -0,0 +1,34 @@ ++ ++ 4.0.0 ++ ++ org.junit ++ junit-parent ++ 5.9.2 ++ ../pom.xml ++ ++ org.junit.platform ++ junit-platform-suite-commons ++ 1.9.1 ++ JUnit Platform Suite Commons ++ Module "junit-platform-suite-commons" of JUnit 5. ++ ++ ++ ++ org.junit.platform ++ junit-platform-launcher ++ ${project.version} ++ ++ ++ org.junit.platform ++ junit-platform-engine ++ ${project.version} ++ ++ ++ org.junit.platform ++ junit-platform-suite-api ++ ${project.version} ++ ++ ++ ++ +--- /dev/null ++++ b/junit5/junit-platform-suite-engine/pom.xml +@@ -0,0 +1,34 @@ ++ ++ 4.0.0 ++ ++ org.junit ++ junit-parent ++ 5.9.2 ++ ../pom.xml ++ ++ org.junit.platform ++ junit-platform-suite-engine ++ 1.9.1 ++ JUnit Platform Suite Engine ++ Module "junit-platform-suite-engine" of JUnit 5. ++ ++ ++ ++ org.junit.platform ++ junit-platform-engine ++ ${project.version} ++ ++ ++ org.junit.platform ++ junit-platform-suite-api ++ ${project.version} ++ ++ ++ org.junit.platform ++ junit-platform-suite-commons ++ ${project.version} ++ ++ ++ ++ +--- /dev/null ++++ b/junit5/junit-platform-suite/pom.xml +@@ -0,0 +1,29 @@ ++ ++ 4.0.0 ++ ++ org.junit ++ junit-parent ++ 5.9.2 ++ ../pom.xml ++ ++ org.junit.platform ++ junit-platform-suite ++ 1.9.1 ++ JUnit Platform Suite (Aggregator) ++ Module "junit-platform-suite" of JUnit 5. ++ ++ ++ ++ org.junit.platform ++ junit-platform-suite-api ++ ${project.version} ++ ++ ++ org.junit.platform ++ junit-platform-suite-engine ++ ${project.version} ++ ++ ++ ++ +--- /dev/null ++++ b/junit5/junit-vintage-engine/pom.xml +@@ -0,0 +1,29 @@ ++ ++ 4.0.0 ++ ++ org.junit ++ junit-parent ++ 5.9.2 ++ ../pom.xml ++ ++ org.junit.vintage ++ junit-vintage-engine ++ 5.9.2 ++ JUnit Vintage Engine ++ Module "junit-vintage-engine" of JUnit 5. ++ ++ ++ ++ org.junit.platform ++ junit-platform-engine ++ ${platform.version} ++ ++ ++ junit ++ junit ++ 4.13.2 ++ ++ ++ ++ +--- /dev/null ++++ b/junit5/pom.xml +@@ -0,0 +1,218 @@ ++ ++ 4.0.0 ++ org.junit ++ junit-parent ++ 5.9.2 ++ pom ++ JUnit 5 (Parent) ++ ++ https://junit.org/junit5/ ++ ++ ++ ++ Eclipse Public License v2.0 ++ https://www.eclipse.org/legal/epl-v20.html ++ ++ ++ ++ ++ ++ bechte ++ Stefan Bechtold ++ stefan.bechtold@me.com ++ ++ ++ jlink ++ Johannes Link ++ business@johanneslink.net ++ ++ ++ marcphilipp ++ Marc Philipp ++ mail@marcphilipp.de ++ ++ ++ mmerdes ++ Matthias Merdes ++ matthias.merdes@heidelpay.com ++ ++ ++ sbrannen ++ Sam Brannen ++ sam@sambrannen.com ++ ++ ++ sormuras ++ Christian Stein ++ sormuras@gmail.com ++ ++ ++ juliette-derancourt ++ Juliette de Rancourt ++ derancourt.juliette@gmail.com ++ ++ ++ ++ ++ scm:git:git://github.com/junit-team/junit5.git ++ scm:git:git://github.com/junit-team/junit5.git ++ https://github.com/junit-team/junit5 ++ ++ ++ ++ UTF-8 ++ 1.9.1 ++ ++ ++ ++ junit-bom ++ junit-jupiter ++ junit-jupiter-api ++ junit-jupiter-engine ++ junit-jupiter-migrationsupport ++ junit-jupiter-params ++ junit-platform-commons ++ junit-platform-console ++ junit-platform-console-standalone ++ junit-platform-engine ++ junit-platform-launcher ++ junit-platform-reporting ++ junit-platform-runner ++ junit-platform-suite ++ junit-platform-suite-api ++ junit-platform-suite-commons ++ junit-platform-suite-engine ++ junit-vintage-engine ++ ++ ++ ++ ++ ++ ++ maven-compiler-plugin ++ 3.10.1 ++ ++ ++ default-compile ++ compile ++ ++ compile ++ ++ ++ 8 ++ 8 ++ ++ ++ ++ compile-java-9 ++ compile ++ ++ compile ++ ++ ++ 9 ++ ++ ${project.basedir}/src/main/java9 ++ ++ true ++ ++ ++ ++ ++ ++ ++ 17 ++ 17 ++ ++ ++ ++ org.apache.maven.plugins ++ maven-jar-plugin ++ 3.3.0 ++ ++ ++ false ++ ++ true ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ org.codehaus.mojo ++ build-helper-maven-plugin ++ 3.2.0 ++ ++ ++ generate-resources ++ ++ add-resource ++ ++ ++ ++ ++ ../ ++ META-INF/ ++ ++ LICENSE.md ++ LICENSE-notice.md ++ ++ ++ ++ . ++ META-INF/ ++ ++ LICENSE-*.md ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ org.apiguardian ++ apiguardian-api ++ 1.1.2 ++ ++ ++ ++ diff -Nru jtreg7-7.3.1+1/debian/patches/junit5-17-backward-compatibility.patch jtreg7-7.5.2+1+ds2/debian/patches/junit5-17-backward-compatibility.patch --- jtreg7-7.3.1+1/debian/patches/junit5-17-backward-compatibility.patch 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/patches/junit5-17-backward-compatibility.patch 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,49 @@ +Description: Restores the compatibility with the previous versions +Author: Emmanuel Bourg +Forwarded: not-needed +--- a/junit5/junit-platform-runner/src/main/java/org/junit/platform/runner/JUnitPlatform.java ++++ b/junit5/junit-platform-runner/src/main/java/org/junit/platform/runner/JUnitPlatform.java +@@ -109,7 +109,6 @@ + * the {@code junit-platform-suite-engine} module; to be removed in JUnit Platform 2.0 + */ + @API(status = DEPRECATED, since = "1.8") +-@Deprecated + public class JUnitPlatform extends Runner implements Filterable { + + // @formatter:off +--- a/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestPlan.java ++++ b/junit5/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestPlan.java +@@ -96,6 +96,33 @@ + return testPlan; + } + ++ @API(status = INTERNAL, since = "1.0") ++ public static TestPlan from(Collection engineDescriptors) { ++ return from(engineDescriptors, new ConfigurationParameters() { ++ @Override ++ public Optional get(String key) { ++ return Optional.empty(); ++ } ++ ++ @Override ++ public Optional getBoolean(String key) { ++ return Optional.empty(); ++ } ++ ++ @Override ++ @SuppressWarnings("deprecation") ++ public int size() { ++ return 0; ++ } ++ ++ @Override ++ public Set keySet() { ++ return java.util.Collections.emptySet(); ++ } ++ ++ }); ++ } ++ + @API(status = INTERNAL, since = "1.4") + protected TestPlan(boolean containsTests, ConfigurationParameters configurationParameters) { + this.containsTests = containsTests; diff -Nru jtreg7-7.3.1+1/debian/patches/libhamcrest-java-04-gradle-build.patch jtreg7-7.5.2+1+ds2/debian/patches/libhamcrest-java-04-gradle-build.patch --- jtreg7-7.3.1+1/debian/patches/libhamcrest-java-04-gradle-build.patch 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/patches/libhamcrest-java-04-gradle-build.patch 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,70 @@ +Description: Changes the build to work with the version of Gradle in Debian +Author: Emmanuel Bourg +Forwarded: not-needed +--- a/libhamcrest-java/settings.gradle ++++ b/libhamcrest-java/settings.gradle +@@ -1,4 +1,3 @@ +-enableFeaturePreview('STABLE_PUBLISHING') + + include 'hamcrest', + 'hamcrest-core', +--- a/libhamcrest-java/build.gradle ++++ b/libhamcrest-java/build.gradle +@@ -57,6 +57,7 @@ + } + } + ++/* + def pomConfigurationFor(String pomName, String pomDescription) { + return { + name = pomName +@@ -91,6 +92,7 @@ + } + } + } ++*/ + + def publishToOssrh = project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword') + +@@ -102,9 +104,6 @@ + artifactId hamcrestProject.name + artifact hamcrestProject.sourcesJar + artifact hamcrestProject.javadocJar +- pom pomConfigurationFor( +- 'Hamcrest', +- 'Core API and libraries of hamcrest matcher framework.') + } + + def hamcrestCoreProject = project(':hamcrest-core') +@@ -113,9 +112,6 @@ + artifactId hamcrestCoreProject.name + artifact hamcrestCoreProject.sourcesJar + artifact hamcrestCoreProject.javadocJar +- pom pomConfigurationFor( +- 'Hamcrest Core', +- 'Core Hamcrest API - deprecated, please use "hamcrest" instead') + } + + def hamcrestLibraryProject = project(':hamcrest-library') +@@ -124,9 +120,6 @@ + artifactId hamcrestLibraryProject.name + artifact hamcrestLibraryProject.sourcesJar + artifact hamcrestLibraryProject.javadocJar +- pom pomConfigurationFor( +- 'Hamcrest Library', +- 'A library of Hamcrest matchers - deprecated, please use "hamcrest" instead') + } + } + repositories { +@@ -144,9 +137,11 @@ + } + } + ++/* + signing { + required { publishToOssrh } + sign publishing.publications.hamcrest + sign publishing.publications.hamcrestCore + sign publishing.publications.hamcrestLibrary + } ++*/ diff -Nru jtreg7-7.3.1+1/debian/patches/libhamcrest-java-05-backward-compatibility.patch jtreg7-7.5.2+1+ds2/debian/patches/libhamcrest-java-05-backward-compatibility.patch --- jtreg7-7.3.1+1/debian/patches/libhamcrest-java-05-backward-compatibility.patch 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/patches/libhamcrest-java-05-backward-compatibility.patch 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,23 @@ +Description: Restores the compatibility with Hamcrest 1.x +Author: Emmanuel Bourg +Forwarded: not-needed +--- /dev/null ++++ b/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/Factory.java +@@ -0,0 +1,17 @@ ++package org.hamcrest; ++ ++import static java.lang.annotation.ElementType.METHOD; ++import java.lang.annotation.Retention; ++import static java.lang.annotation.RetentionPolicy.RUNTIME; ++import java.lang.annotation.Target; ++ ++/** ++ * Marks a Hamcrest static factory method so tools recognise them. ++ * A factory method is an equivalent to a named constructor. ++ * ++ * @author Joe Walnes ++ */ ++@Retention(RUNTIME) ++@Target({METHOD}) ++public @interface Factory { ++} diff -Nru jtreg7-7.3.1+1/debian/patches/libhamcrest-java-06-type-inference-fix.patch jtreg7-7.5.2+1+ds2/debian/patches/libhamcrest-java-06-type-inference-fix.patch --- jtreg7-7.3.1+1/debian/patches/libhamcrest-java-06-type-inference-fix.patch 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/patches/libhamcrest-java-06-type-inference-fix.patch 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,116 @@ +Description: Fixes the type inference errors when building with the source/target level set to Java 8 +Author: Emmanuel Bourg +Forwarded: not-needed +--- a/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/core/AllOf.java ++++ b/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/core/AllOf.java +@@ -46,7 +46,7 @@ + *

assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
+ */ + public static Matcher allOf(Iterable> matchers) { +- return new AllOf<>(matchers); ++ return new AllOf<>((java.util.List) matchers); + } + + /** +@@ -56,6 +56,6 @@ + */ + @SafeVarargs + public static Matcher allOf(Matcher... matchers) { +- return allOf(Arrays.asList(matchers)); ++ return allOf((java.util.List) Arrays.asList(matchers)); + } + } +--- a/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/core/AnyOf.java ++++ b/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/core/AnyOf.java +@@ -36,7 +36,7 @@ + *
assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))
+ */ + public static AnyOf anyOf(Iterable> matchers) { +- return new AnyOf<>(matchers); ++ return new AnyOf<>((java.util.List) matchers); + } + + /** +@@ -46,6 +46,6 @@ + */ + @SafeVarargs + public static AnyOf anyOf(Matcher... matchers) { +- return anyOf(Arrays.asList(matchers)); ++ return anyOf((java.util.List) Arrays.asList(matchers)); + } + } +--- a/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/collection/ArrayMatching.java ++++ b/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/collection/ArrayMatching.java +@@ -67,7 +67,7 @@ + */ + @SafeVarargs + public static Matcher arrayContainingInAnyOrder(Matcher... itemMatchers) { +- return arrayContainingInAnyOrder(asList(itemMatchers)); ++ return arrayContainingInAnyOrder((List) asList(itemMatchers)); + } + + /** +--- a/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInAnyOrder.java ++++ b/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInAnyOrder.java +@@ -98,7 +98,7 @@ + */ + @SafeVarargs + public static Matcher> containsInAnyOrder(Matcher... itemMatchers) { +- return containsInAnyOrder(Arrays.asList(itemMatchers)); ++ return containsInAnyOrder((List) Arrays.asList(itemMatchers)); + } + + /** +--- a/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/collection/IsArrayContainingInOrder.java ++++ b/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/collection/IsArrayContainingInOrder.java +@@ -73,7 +73,7 @@ + * the matchers that must be satisfied by the items in the examined array + */ + public static Matcher arrayContaining(Matcher... itemMatchers) { +- return arrayContaining(asList(itemMatchers)); ++ return arrayContaining((List) asList(itemMatchers)); + } + + /** +--- a/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/core/CombinableMatcher.java ++++ b/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/core/CombinableMatcher.java +@@ -57,7 +57,7 @@ + this.first = matcher; + } + public CombinableMatcher and(Matcher other) { +- return new CombinableMatcher<>(first).and(other); ++ return new CombinableMatcher<>(first).and((Matcher) other); + } + } + +@@ -76,7 +76,7 @@ + this.first = matcher; + } + public CombinableMatcher or(Matcher other) { +- return new CombinableMatcher<>(first).or(other); ++ return new CombinableMatcher<>(first).or((Matcher) other); + } + } + } +--- a/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInRelativeOrder.java ++++ b/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInRelativeOrder.java +@@ -99,7 +99,7 @@ + */ + @SafeVarargs + public static Matcher> containsInRelativeOrder(Matcher... itemMatchers) { +- return containsInRelativeOrder(asList(itemMatchers)); ++ return containsInRelativeOrder((List) asList(itemMatchers)); + } + + /** +--- a/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/collection/IsArrayContainingInAnyOrder.java ++++ b/libhamcrest-java/hamcrest/src/main/java/org/hamcrest/collection/IsArrayContainingInAnyOrder.java +@@ -59,7 +59,7 @@ + * a list of matchers, each of which must be satisfied by an entry in an examined array + */ + public static Matcher arrayContainingInAnyOrder(Matcher... itemMatchers) { +- return arrayContainingInAnyOrder(Arrays.asList(itemMatchers)); ++ return arrayContainingInAnyOrder((List) Arrays.asList(itemMatchers)); + } + + /** diff -Nru jtreg7-7.3.1+1/debian/patches/opentest4j-01-ignore-versioning-plugin.patch jtreg7-7.5.2+1+ds2/debian/patches/opentest4j-01-ignore-versioning-plugin.patch --- jtreg7-7.3.1+1/debian/patches/opentest4j-01-ignore-versioning-plugin.patch 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/patches/opentest4j-01-ignore-versioning-plugin.patch 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,21 @@ +Description: Disables the net.nemerosa.versioning plugin (not in Debian and irrelevant) +Author: Emmanuel Bourg +Forwarded: not-needed +--- a/opentest4j/build.gradle ++++ b/opentest4j/build.gradle +@@ -8,7 +8,6 @@ + id 'maven' + id 'signing' + id 'com.diffplug.gradle.spotless' version '3.23.0' +- id 'net.nemerosa.versioning' version '2.8.2' + id 'org.ajoberstar.github-pages' version '1.7.2' + } + +@@ -71,7 +70,6 @@ + 'Built-By': builtByValue, + 'Build-Date': buildDate, + 'Build-Time': buildTime, +- 'Build-Revision': versioning.info.commit, + 'Specification-Title': project.name, + 'Specification-Version': normalizeVersion(project.version), + 'Specification-Vendor': 'opentest4j.org', diff -Nru jtreg7-7.3.1+1/debian/patches/opentest4j-02-ignore-github-pages-plugin.patch jtreg7-7.5.2+1+ds2/debian/patches/opentest4j-02-ignore-github-pages-plugin.patch --- jtreg7-7.3.1+1/debian/patches/opentest4j-02-ignore-github-pages-plugin.patch 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/patches/opentest4j-02-ignore-github-pages-plugin.patch 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,58 @@ +Description: Disables the github-pages plugin +Author: Emmanuel Bourg +Forwarded: not-needed +--- a/opentest4j/build.gradle ++++ b/opentest4j/build.gradle +@@ -8,7 +8,6 @@ + id 'maven' + id 'signing' + id 'com.diffplug.gradle.spotless' version '3.23.0' +- id 'org.ajoberstar.github-pages' version '1.7.2' + } + + Date buildTimeAndDate = new Date() +@@ -219,20 +218,7 @@ + def docsVersion = project.version.contains('SNAPSHOT') ? 'snapshot' : project.version + def docsDir = new File(buildDir, 'ghpages-docs') + +-task prepareDocsForUploadToGhPages(dependsOn: [javadoc], type: Copy) { +- outputs.dir docsDir +- +- from("$buildDir/docs") { +- include 'javadoc/**' +- } +- into "${docsDir}/${docsVersion}" +- filesMatching('javadoc/**') { fileCopyDetails -> +- fileCopyDetails.path = fileCopyDetails.path.replace('javadoc/', 'api/') +- } +- includeEmptyDirs = false +-} +- +-task createCurrentDocsFolder(dependsOn: prepareDocsForUploadToGhPages, type: Copy) { ++task createCurrentDocsFolder(type: Copy) { + outputs.dir "${docsDir}/current" + + from "${docsDir}/${docsVersion}" +@@ -240,22 +226,3 @@ + } + + createCurrentDocsFolder.onlyIf { project.hasProperty('replaceCurrentDocs') } +- +-githubPages { +- repoUri = 'https://github.com/ota4j-team/opentest4j.git' +- +- credentials { +- username = project.hasProperty('githubToken') ? project.githubToken : '' +- password = '' +- } +- +- pages { +- from docsDir +- into "docs" +- } +- +- deleteExistingFiles = false +-} +- +-prepareGhPages.dependsOn(prepareDocsForUploadToGhPages) +-prepareGhPages.dependsOn(createCurrentDocsFolder) diff -Nru jtreg7-7.3.1+1/debian/patches/opentest4j-03-ignore-spotless-plugin.patch jtreg7-7.5.2+1+ds2/debian/patches/opentest4j-03-ignore-spotless-plugin.patch --- jtreg7-7.3.1+1/debian/patches/opentest4j-03-ignore-spotless-plugin.patch 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/patches/opentest4j-03-ignore-spotless-plugin.patch 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,50 @@ +Description: Disables the spotless plugin +Author: Emmanuel Bourg +Forwarded: not-needed +--- a/opentest4j/build.gradle ++++ b/opentest4j/build.gradle +@@ -7,7 +7,6 @@ + id 'idea' + id 'maven' + id 'signing' +- id 'com.diffplug.gradle.spotless' version '3.23.0' + } + + Date buildTimeAndDate = new Date() +@@ -107,17 +106,6 @@ + archives javadocJar + } + +-spotless { +- java { +- licenseHeaderFile rootProject.file('etc/spotless/apache-license-2.0.java') +- importOrder('java', 'javax', 'com', 'org') +- eclipse().configFile(rootProject.file('etc/eclipse/eclipse-formatter-settings.xml')) +- +- trimTrailingWhitespace() +- endWithNewline() +- } +-} +- + def signArtifacts = !project.version.contains('SNAPSHOT') + + if (signArtifacts) { +@@ -203,18 +191,6 @@ + } + } + +-spotless { +- format 'misc', { +- target project.fileTree(project.rootDir) { +- include '**/*.gradle', '**/*.md', '**/*.gitignore' +- exclude '.gradle/**/*.*' +- } +- indentWithTabs() +- trimTrailingWhitespace() +- endWithNewline() +- } +-} +- + def docsVersion = project.version.contains('SNAPSHOT') ? 'snapshot' : project.version + def docsDir = new File(buildDir, 'ghpages-docs') + diff -Nru jtreg7-7.3.1+1/debian/patches/opentest4j-04-reproducible-builds-timestamp.patch jtreg7-7.5.2+1+ds2/debian/patches/opentest4j-04-reproducible-builds-timestamp.patch --- jtreg7-7.3.1+1/debian/patches/opentest4j-04-reproducible-builds-timestamp.patch 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/patches/opentest4j-04-reproducible-builds-timestamp.patch 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,23 @@ +Add support for SOURCE_DATE_EPOCH to avoid embedding timestamp in .jar +file. + +https://reproducible-builds.org/docs/source-date-epoch/ + +--- a/opentest4j/build.gradle ++++ b/opentest4j/build.gradle +@@ -9,7 +9,14 @@ + id 'signing' + } + +-Date buildTimeAndDate = new Date() ++// https://reproducible-builds.org/docs/source-date-epoch/ ++String source_date_epoch = System.getenv("SOURCE_DATE_EPOCH"); ++if (source_date_epoch != null) { ++ TimeZone.setDefault(TimeZone.getTimeZone("UTC")) ++} ++Date buildTimeAndDate = source_date_epoch == null ? ++ new Date() : ++ new Date(1000 * Long.parseLong(source_date_epoch)) + ext { + buildDate = new SimpleDateFormat('yyyy-MM-dd').format(buildTimeAndDate) + buildTime = new SimpleDateFormat('HH:mm:ss.SSSZ').format(buildTimeAndDate) diff -Nru jtreg7-7.3.1+1/debian/patches/opentest4j-05-build-on-java-17.patch jtreg7-7.5.2+1+ds2/debian/patches/opentest4j-05-build-on-java-17.patch --- jtreg7-7.3.1+1/debian/patches/opentest4j-05-build-on-java-17.patch 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/patches/opentest4j-05-build-on-java-17.patch 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,26 @@ +Description: attempt build on Java versions >= 11 +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1011776 +Author: tony mancill + +--- a/opentest4j/settings.gradle ++++ b/opentest4j/settings.gradle +@@ -1,7 +1,7 @@ + rootProject.name = 'opentest4j' + + // Require Java 11 +-if (!JavaVersion.current().java11) { ++if (!JavaVersion.current().isJava11Compatible()) { + throw new GradleException('The OpenTest4J build requires Java 11. ' + + "Currently executing with Java ${JavaVersion.current()}.") + } +--- a/opentest4j/build.gradle ++++ b/opentest4j/build.gradle +@@ -31,7 +31,7 @@ + } + + compileJava { +- options.compilerArgs = ['--release', '6'] ++ options.compilerArgs = ['--release', '8'] + } + + task compileModule(type: JavaCompile) { diff -Nru jtreg7-7.3.1+1/debian/patches/opentest4j-reporting-01-gradle-compatibility.patch jtreg7-7.5.2+1+ds2/debian/patches/opentest4j-reporting-01-gradle-compatibility.patch --- jtreg7-7.3.1+1/debian/patches/opentest4j-reporting-01-gradle-compatibility.patch 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/patches/opentest4j-reporting-01-gradle-compatibility.patch 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,55 @@ +Description: Rewrite the build system without Kotlin until Gradle is upgraded to a recent version +Author: Emmanuel Bourg +Forwarded: not-needed +--- /dev/null ++++ b/opentest4j-reporting/build.gradle +@@ -0,0 +1,10 @@ ++plugins { ++ id 'java' ++} ++ ++allprojects { ++ apply plugin: 'java' ++} ++ ++sourceCompatibility = "1.8" ++targetCompatibility = "1.8" +--- /dev/null ++++ b/opentest4j-reporting/events/build.gradle +@@ -0,0 +1,16 @@ ++/* ++plugins { ++ `java-conventions` ++} ++*/ ++ ++sourceCompatibility = "1.8" ++targetCompatibility = "1.8" ++ ++dependencies { ++ compile(project(":schema")) ++// testImplementation(libs.archunit) ++// testImplementation(libs.assertj.core) ++// testImplementation(libs.junit.jupiter) ++// testImplementation(libs.xmlunit.assertj) ++} +--- /dev/null ++++ b/opentest4j-reporting/settings.gradle +@@ -0,0 +1,17 @@ ++rootProject.name = "open-test-reporting" ++/* ++dependencyResolutionManagement { ++ repositories { ++ mavenCentral() ++ } ++} ++*/ ++ ++//include("cli") ++//include("documentation") ++include("events") ++include("schema") ++//include("tooling") ++ ++//enableFeaturePreview("VERSION_CATALOGS") ++//enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") diff -Nru jtreg7-7.3.1+1/debian/patches/picocli-0001-Adjust-build-to-work-without-asciidoctor.patch jtreg7-7.5.2+1+ds2/debian/patches/picocli-0001-Adjust-build-to-work-without-asciidoctor.patch --- jtreg7-7.3.1+1/debian/patches/picocli-0001-Adjust-build-to-work-without-asciidoctor.patch 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/patches/picocli-0001-Adjust-build-to-work-without-asciidoctor.patch 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,391 @@ +From: Miroslav Kravec +Date: Sat, 26 Jan 2019 19:31:42 +0100 +Subject: Adjust build to work without the following plugins: + - asciidoctor + - bnd (so no OSGi metadata) + - org.beryx:badass-jar (so no multi-version JARs) + and with default java +Last-update: 2021-11-21 +Forwarded: not-needed + +--- a/picocli/build.gradle ++++ b/picocli/build.gradle +@@ -1,61 +1,8 @@ +-import aQute.bnd.gradle.Bundle +- + group 'info.picocli' + description 'Java command line parser with both an annotations API and a programmatic API. Usage help with ANSI styles and colors. Autocomplete. Nested subcommands. Easily included as source to avoid adding a dependency.' + version "$projectVersion" + ext.moduleName = 'info.picocli' + +-buildscript { +- repositories { +- maven { +- url "https://plugins.gradle.org/m2/" +- } +- mavenCentral() +- } +- +- dependencies { +- classpath "org.asciidoctor:asciidoctor-gradle-jvm:$asciidoctorGradlePluginVersion" +- classpath 'org.asciidoctor:asciidoctorj-pdf:1.5.4' +- classpath "gradle.plugin.org.beryx:badass-jar:1.1.3" +- classpath 'biz.aQute.bnd:biz.aQute.bnd.gradle:5.1.2' +- } +-} +- +-apply plugin: "org.beryx.jar" +- +-if (System.getenv('MAVEN_OSS_USER')) { // on home system +- apply plugin: 'biz.aQute.bnd.builder' +-} else { +- try { // otherwise, only apply if available +- Class.forName('aQute.bnd.gradle.BndPlugin') +- Class.forName('aQute.bnd.build.Project') +- apply plugin: 'biz.aQute.bnd.builder' +- } catch (Throwable ignored) {} +-} +-pluginManager.withPlugin('biz.aQute.bnd.builder') { // if plugin applied, execute this action +- configurations { +- bundleCompile +- baseline +- } +- dependencies { +- baseline('group': group, 'name': jar.archiveBaseName) { +- version { +- strictly "(,${jar.archiveVersion}[" +- } +- transitive = false +- } +- } +- sourceSets { +- bundle +- } +- task bundle(type: Bundle) { +- from sourceSets.bundle.output +- bndfile = 'bnd.bnd' +- sourceSet = sourceSets.bundle +- } +-} +- +- + allprojects { + apply plugin: 'java' + apply plugin: 'java-library' // to avoid https://github.com/gradle/gradle/issues/1118 +@@ -103,7 +50,7 @@ + } + } + +-sourceSets.main.java.srcDirs = ['src/main/java', 'src/main/java9'] ++sourceSets.main.java.srcDirs = ['src/main/java'] + compileJava { + inputs.property("moduleName", moduleName) + doFirst { +@@ -116,20 +63,6 @@ + } + } + +-jar { +- manifest { +- attributes 'Specification-Title' : 'picocli', +- 'Specification-Vendor' : 'Remko Popma', +- 'Specification-Version' : archiveVersion.get(), +- 'Implementation-Title' : 'picocli', +- 'Implementation-Vendor' : 'Remko Popma', +- 'Implementation-Version': archiveVersion.get(), +- 'Main-Class' : 'picocli.AutoComplete' +- } +- // copy module-info.class to META-INF/versions/9 +- multiRelease = true +-} +- + // jacoco 0.8.2 does not work with Java 13; gradle 4.x has no JavaVersion enum value for Java 12 + if (org.gradle.api.JavaVersion.current().isJava11Compatible()) { + project.logger.lifecycle("skipping jacoco test for Java version ${org.gradle.api.JavaVersion.current()}") +--- a/picocli/picocli-codegen/build.gradle ++++ b/picocli/picocli-codegen/build.gradle +@@ -29,24 +29,11 @@ + //generateGraalReflectionConfig.dependsOn(compileJava) + //jar.dependsOn(generateGraalReflectionConfig) + +-jar { +- manifest { +- attributes 'Specification-Title' : 'Picocli Code Generation', +- 'Specification-Vendor' : 'Remko Popma', +- 'Specification-Version' : archiveVersion.get(), +- 'Implementation-Title' : 'Picocli Code Generation', +- 'Implementation-Vendor' : 'Remko Popma', +- 'Implementation-Version': archiveVersion.get(), +- 'Automatic-Module-Name' : 'info.picocli.codegen' +- } +-} +- +- + task generateManpageAsciiDoc(type: JavaExec) { + dependsOn(classes) + group = "Documentation" + description = "Generate AsciiDoc manpage" +- classpath(configurations.compileClasspath, configurations.annotationProcessor, sourceSets.main.runtimeClasspath) ++ classpath(configurations.compileClasspath, sourceSets.main.runtimeClasspath) + main 'picocli.codegen.docgen.manpage.ManPageGenerator' + args 'picocli.codegen.docgen.manpage.ManPageGenerator$App', + 'picocli.codegen.aot.graalvm.DynamicProxyConfigGenerator$App', +@@ -62,18 +49,6 @@ + } + } + +-apply plugin: 'org.asciidoctor.jvm.convert' +-asciidoctor { +- dependsOn(generateManpageAsciiDoc) +- sourceDir = file("${project.buildDir}/picocli-generated-docs") +- outputDir = file("${project.buildDir}/docs") +- logDocuments = true +- outputOptions { +- backends = ['manpage', 'html5'] +- } +-} +-javadoc.dependsOn('asciidoctor') +- + ext { + PUBLISH_GROUP_ID = group + PUBLISH_ARTIFACT_ID = project.name +--- a/picocli/gradle/docs.gradle ++++ b/picocli/gradle/docs.gradle +@@ -1,13 +1,4 @@ + apply plugin: 'java' +-apply plugin: 'org.asciidoctor.jvm.convert' +-pluginManager.withPlugin('org.asciidoctor.jvm.convert') { // if plugin applied, execute this action +- configurations { +- tabbedCodeExt +- } +- dependencies { +- tabbedCodeExt "com.bmuschko:asciidoctorj-tabbed-code-extension:0.3" +- } +-} + + Map linkMap = org.gradle.api.JavaVersion.values().collectEntries { version -> + [(version) : 'https://docs.oracle.com/javase/8/docs/api/'] +@@ -41,19 +32,3 @@ + } + } + javadoc.dependsOn(jar) +-javadoc.dependsOn('asciidoctor') +-asciidoctorj { +- version = '2.4.3' +-} +-asciidoctor { +- sourceDir = file('docs') +- outputDir = file('build/docs') +- logDocuments = true +- configurations 'tabbedCodeExt' +- baseDirFollowsSourceDir() +-// backends 'pdf', 'html' +-// attributes 'sourcedir': file('docs') //project.sourceSets.main.java.srcDirs[0] +-//// attributes 'pdf-stylesdir': 'theme', +-//// 'pdf-style': 'custom', +-//// 'sourcedir': file('docs') //project.sourceSets.main.java.srcDirs[0] +-} +--- a/picocli/picocli-examples/generate-man-pages/example-gradle-project/build.gradle ++++ b/picocli/picocli-examples/generate-man-pages/example-gradle-project/build.gradle +@@ -1,22 +1,6 @@ +-buildscript { +- repositories { +- jcenter() +- maven { +- url "https://plugins.gradle.org/m2/" +- } +- mavenCentral() +- } +- +- dependencies { +- classpath "org.asciidoctor:asciidoctor-gradle-jvm:3.3.2" +- } +-} +- + plugins { + id 'java' + } +-apply plugin: 'org.asciidoctor.jvm.convert' +- + + group 'org.mycompany.myproject' + version '1.0-SNAPSHOT' +@@ -50,18 +34,6 @@ + args project.ext.mainClassName, "--outdir=${project.buildDir}/generated-picocli-docs", "-v", "--template-dir=src/docs/mantemplates" + } + +-apply plugin: 'org.asciidoctor.jvm.convert' +-asciidoctor { +- dependsOn(generateManpageAsciiDoc) +- sourceDir = file("${project.buildDir}/generated-picocli-docs") +- outputDir = file("${project.buildDir}/docs") +- logDocuments = true +- outputOptions { +- backends = ['manpage', 'html5'] +- } +-} +-assemble.dependsOn(asciidoctor) +- + // We can now use the Gradle `distribution` plugin to include + // the generated manpage files in the distribution archive: + apply plugin: "distribution" +--- a/picocli/picocli-annotation-processing-tests/build.gradle ++++ b/picocli/picocli-annotation-processing-tests/build.gradle +@@ -22,19 +22,7 @@ + } + } + tasks.withType(Test.class) { +- if (org.gradle.api.JavaVersion.current().isJava12Compatible()) { // only a problem from Java 16, but okay ++ //if (org.gradle.api.JavaVersion.current().isJava12Compatible()) { // only a problem from Java 16, but okay + it.jvmArgs '--add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED' // https://github.com/google/compile-testing/issues/222 +- } +-} +- +-jar { +- manifest { +- attributes 'Specification-Title': 'Picocli Annotation Processing Tests', +- 'Specification-Vendor' : 'Remko Popma', +- 'Specification-Version' : archiveVersion.get(), +- 'Implementation-Title' : 'Picocli Annotation Processing Tests', +- 'Implementation-Vendor' : 'Remko Popma', +- 'Implementation-Version': archiveVersion.get(), +- 'Automatic-Module-Name' : 'info.picocli.annotation.processing.tests' +- } ++ //} + } +--- a/picocli/picocli-groovy/build.gradle ++++ b/picocli/picocli-groovy/build.gradle +@@ -29,18 +29,6 @@ + ] + //javadoc.options.linksOffline 'http://docs.groovy-lang.org/2.4.9/html/gapi', 'gradle/javadocs/jdk/9/' + +-jar { +- manifest { +- attributes 'Specification-Title' : 'Picocli Groovy', +- 'Specification-Vendor' : 'Remko Popma', +- 'Specification-Version' : archiveVersion.get(), +- 'Implementation-Title' : 'Picocli Groovy', +- 'Implementation-Vendor' : 'Remko Popma', +- 'Implementation-Version': archiveVersion.get(), +- 'Automatic-Module-Name' : 'info.picocli.groovy' +- } +-} +- + ext { + PUBLISH_GROUP_ID = group + PUBLISH_ARTIFACT_ID = project.name +--- a/picocli/picocli-shell-jline2/build.gradle ++++ b/picocli/picocli-shell-jline2/build.gradle +@@ -12,18 +12,6 @@ + testImplementation "junit:junit:$junitVersion" + } + +-jar { +- manifest { +- attributes 'Specification-Title' : 'Picocli Shell JLine2', +- 'Specification-Vendor' : 'Remko Popma', +- 'Specification-Version' : archiveVersion.get(), +- 'Implementation-Title' : 'Picocli Shell JLine2', +- 'Implementation-Vendor' : 'Remko Popma', +- 'Implementation-Version': archiveVersion.get(), +- 'Automatic-Module-Name' : 'info.picocli.shell.jline2' +- } +-} +- + ext { + PUBLISH_GROUP_ID = group + PUBLISH_ARTIFACT_ID = project.name +--- a/picocli/picocli-shell-jline3/build.gradle ++++ b/picocli/picocli-shell-jline3/build.gradle +@@ -15,18 +15,6 @@ + testImplementation "junit:junit:$junitVersion" + } + +-jar { +- manifest { +- attributes 'Specification-Title' : 'Picocli Shell JLine3', +- 'Specification-Vendor' : 'Remko Popma', +- 'Specification-Version' : archiveVersion.get(), +- 'Implementation-Title' : 'Picocli Shell JLine3', +- 'Implementation-Vendor' : 'Remko Popma', +- 'Implementation-Version': archiveVersion.get(), +- 'Automatic-Module-Name' : 'info.picocli.shell.jline3' +- } +-} +- + ext { + PUBLISH_GROUP_ID = group + PUBLISH_ARTIFACT_ID = project.name +--- a/picocli/picocli-spring-boot-starter/build.gradle ++++ b/picocli/picocli-spring-boot-starter/build.gradle +@@ -11,19 +11,7 @@ + dependencies { + api rootProject + api "org.springframework.boot:spring-boot-starter:$springBootVersion" +- annotationProcessor "org.springframework.boot:spring-boot-configuration-processor:$springBootVersion" +-} +- +-jar { +- manifest { +- attributes 'Specification-Title' : 'Picocli Spring Boot Starter', +- 'Specification-Vendor' : 'Remko Popma', +- 'Specification-Version' : archiveVersion.get(), +- 'Implementation-Title' : 'Picocli Spring Boot Starter', +- 'Implementation-Vendor' : 'Remko Popma', +- 'Implementation-Version': archiveVersion.get(), +- 'Automatic-Module-Name' : 'info.picocli.spring' +- } ++ //annotationProcessor "org.springframework.boot:spring-boot-configuration-processor:$springBootVersion" + } + + ext { +--- a/picocli/gradle/publish-mavencentral.gradle ++++ b/picocli/gradle/publish-mavencentral.gradle +@@ -1,3 +1,4 @@ ++/* disabled for Debian packaging build + apply plugin: 'java' + apply plugin: 'distribution' + apply plugin: 'maven-publish' +@@ -130,3 +131,4 @@ + signing { + sign publishing.publications + } ++*/ +--- a/picocli/picocli-examples/build.gradle ++++ b/picocli/picocli-examples/build.gradle +@@ -5,13 +5,13 @@ + mavenCentral() + } + +- dependencies { +- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.31" +- } ++ //dependencies { ++ // classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.31" ++ //} + } + + apply plugin: 'groovy' +-apply plugin: 'kotlin' ++//apply plugin: 'kotlin' + apply plugin: 'scala' + apply plugin: 'java-library' + +@@ -24,7 +24,7 @@ + dependencies { + api rootProject + api project(':picocli-groovy') +- api "org.jetbrains.kotlin:kotlin-stdlib" ++ //api "org.jetbrains.kotlin:kotlin-stdlib" + api 'org.scala-lang:scala-library:2.13.3' + ivy "org.apache.ivy:ivy:$ivyVersion" // for Intelli/J + implementation "org.codehaus.groovy:groovy-all:$groovyVersion", +@@ -38,7 +38,7 @@ + "org.hibernate.validator:hibernate-validator-annotation-processor:6.1.2.Final", + "javax.el:javax.el-api:3.0.0", + "org.glassfish.web:javax.el:2.2.6" +- implementation "org.jetbrains.kotlin:kotlin-script-runtime:1.4.31" ++ //implementation "org.jetbrains.kotlin:kotlin-script-runtime:1.4.31" + } + tasks.withType(GroovyCompile) { + // this, and the `configurations {ivy}` section, are a workaround for the dreaded diff -Nru jtreg7-7.3.1+1/debian/patches/preview-test.patch jtreg7-7.5.2+1+ds2/debian/patches/preview-test.patch --- jtreg7-7.3.1+1/debian/patches/preview-test.patch 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/patches/preview-test.patch 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,31 @@ +Description: Enable preview feature tests for Java > 11 + openjdk-11 does not have preview features. Enable preview tests + for Java specification version > 11. + The patch is not needed upstream, as upstream is on 8.x. + jtreg 8.x requires minimum Java version 17. +Author: Vladimir Petko +Forwarded: not-needed +Last-Update: 2025-08-04 +--- a/test/previewLeaking/TestPreviewLeaking.gmk ++++ b/test/previewLeaking/TestPreviewLeaking.gmk +@@ -39,4 +39,8 @@ + $(TESTDIR)/previewLeaking/ + echo "test passed at `date`" > $@ + ++INCLUDE_PREVIEW_TEST := $(shell if [ ${JAVA_SPECIFICATION_VERSION} -gt 11 ]; then echo 1; else echo 0; fi) ++ ++ifeq ($(INCLUDE_PREVIEW_TEST),1) + TESTS.jtreg += $(BUILDTESTDIR)/PreviewLeakingTest.ok ++endif +--- a/test/preview/PreviewTest.gmk ++++ b/test/preview/PreviewTest.gmk +@@ -54,5 +54,9 @@ + $(GREP) -s 'Test results: failed: 3; error: 1' $(@:%.ok=%/jt.log) > /dev/null + echo "test passed at `date`" > $@ + ++INCLUDE_PREVIEW_TEST := $(shell if [ ${JAVA_SPECIFICATION_VERSION} -gt 11 ]; then echo 1; else echo 0; fi) ++ ++ifeq ($(INCLUDE_PREVIEW_TEST),1) + TESTS.jtreg += $(BUILDTESTDIR)/PreviewTest_good.ok + TESTS.jtreg += $(BUILDTESTDIR)/PreviewTest_bad.ok ++endif diff -Nru jtreg7-7.3.1+1/debian/patches/reproducible-build.patch jtreg7-7.5.2+1+ds2/debian/patches/reproducible-build.patch --- jtreg7-7.3.1+1/debian/patches/reproducible-build.patch 2023-06-25 20:54:10.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/patches/reproducible-build.patch 2026-01-11 23:06:11.000000000 +0000 @@ -3,12 +3,12 @@ Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1038957 Last-Update: 2023-06-22 ---- jtreg7-7.2+1.orig/make/Rules.gmk -+++ jtreg7-7.2+1/make/Rules.gmk -@@ -60,6 +60,13 @@ $(CLASSDIR) $(BUILDDIR) $(BUILDDIR)/test - # default copyright; override as necessary - JAR_COPYRIGHT = -C $(TOPDIR) COPYRIGHT - +--- a/make/Rules.gmk ++++ b/make/Rules.gmk +@@ -67,6 +67,13 @@ + BUILD_DATE ?= $(shell date "$(DATE_FMT)") + endif + +DATE_FMT = +%B %d, %Y +ifdef SOURCE_DATE_EPOCH + BUILD_DATE ?= $(shell LC_ALL=C date -u -d "@$(SOURCE_DATE_EPOCH)" "$(DATE_FMT)" 2>/dev/null || LC_ALL=C date -u -r "$(SOURCE_DATE_EPOCH)" "$(DATE_FMT)" 2>/dev/null || date -u "$(DATE_FMT)") @@ -18,13 +18,4 @@ + $(IMAGES_DIR)/%.jar: pkgsToFiles.sh $(RM) $@ $(@:$(IMAGES_DIR)/%.jar=$(BUILDDIR)/jarData/%) - $(MKDIR) -p $(@D) -@@ -73,7 +80,7 @@ $(IMAGES_DIR)/%.jar: pkgsToFiles.sh - echo "$(@F:%.jar=%)-Build: $(BUILD_NUMBER)" ; \ - echo "$(@F:%.jar=%)-BuildJavaVersion: `$(JDKJAVA) -fullversion 2>&1 | awk '{print $$NF}' | \ - sed -e 's|^"\(.*\)"$$|Java(TM) 2 SDK, Version \1|'`" ; \ -- echo "$(@F:%.jar=%)-BuildDate: `/bin/date +'%B %d, %Y'`" ; \ -+ echo "$(@F:%.jar=%)-BuildDate: $(BUILD_DATE)" ; \ - ) \ - > $(@:$(IMAGES_DIR)/%.jar=$(BUILDDIR)/jarData/%/manifest.txt) - sh pkgsToFiles.sh $(CLASSDIR) $($(@F:%.jar=PKGS.JAR.%)) > $(@:$(IMAGES_DIR)/%.jar=$(BUILDDIR)/jarData/%/includes.txt) + $(MKDIR) $(@D) diff -Nru jtreg7-7.3.1+1/debian/patches/series jtreg7-7.5.2+1+ds2/debian/patches/series --- jtreg7-7.3.1+1/debian/patches/series 2023-08-13 22:38:52.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/patches/series 2026-02-23 04:42:48.000000000 +0000 @@ -1,3 +1,36 @@ launchers.patch do-not-export-headless-display.patch reproducible-build.patch +apiguardian-01-build_gradle.patch +opentest4j-01-ignore-versioning-plugin.patch +opentest4j-02-ignore-github-pages-plugin.patch +opentest4j-03-ignore-spotless-plugin.patch +opentest4j-04-reproducible-builds-timestamp.patch +opentest4j-05-build-on-java-17.patch +opentest4j-reporting-01-gradle-compatibility.patch +hawt-jni-02-commons-lang-dependency.patch +jline3-01-ignore-warnings.patch +jline3-02-ignore-remote-modules.patch +jline3-03-java21-compatibility.patch +picocli-0001-Adjust-build-to-work-without-asciidoctor.patch +libhamcrest-java-04-gradle-build.patch +libhamcrest-java-05-backward-compatibility.patch +libhamcrest-java-06-type-inference-fix.patch +junit4-exclude-dependency-sources.patch +junit4-Version.patch +junit4-java17-compatibility.patch +junit4-hamcrest-compatibility.patch +junit5-15-deprecated.patch +junit5-16-maven-build.patch +junit5-17-backward-compatibility.patch +testng-build-with-gradle.patch +jtdiff-version.patch +java21-codetools-7903646.patch +preview-test.patch +codetools-7904101-proposed.patch +codetools-7904104-proposed.patch +codetools-7904105-proposed.patch +codetools-7904106-proposed.patch +codetools-7904107-proposed.patch +codetools-7904152.patch +codetools-7904157-proposed.patch diff -Nru jtreg7-7.3.1+1/debian/patches/testng-build-with-gradle.patch jtreg7-7.5.2+1+ds2/debian/patches/testng-build-with-gradle.patch --- jtreg7-7.3.1+1/debian/patches/testng-build-with-gradle.patch 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/patches/testng-build-with-gradle.patch 2026-02-23 04:42:48.000000000 +0000 @@ -0,0 +1,128 @@ +Description: Provide a Groovy gradle build for testng +Author: Vladimir Petko +Forwarded: not-needed + +--- /dev/null ++++ b/testng/build.gradle +@@ -0,0 +1,117 @@ ++plugins { ++ id 'java-library' ++ id 'maven-publish' ++} ++ ++repositories { ++ mavenLocal() ++} ++ ++apply plugin: 'java' ++apply plugin: 'java-library' ++apply plugin: 'maven-publish' ++ ++sourceCompatibility = 8 ++targetCompatibility = 8 ++ ++dependencies { ++ compile 'org.slf4j:slf4j-api:1.7.36' ++ compile 'com.beust:jcommander:1.82' ++ compile 'org.apache.ant:ant:1.10.12' ++ compile 'com.google.inject:guice:5.1.0' ++ compile 'junit:junit:4.13.2' ++ compile 'org.assertj:assertj-core:2.3.0' ++ compile 'com.google.code.findbugs:jsr305:debian' ++} ++ ++group = 'org.testng' ++version = System.env.TESTNG_VERSION ++description = 'testng' ++ ++sourceSets { ++ main { ++ java { ++ srcDirs 'testng-runner-api/src/main/java' ++ srcDirs 'testng-core/src/main/java' ++ srcDirs 'testng-asserts/src/main/java' ++ srcDirs 'testng-core-api/src/main/java' ++ srcDirs 'testng-test-kit/src/main/java' ++ srcDirs 'testng-reflection-utils/src/main/java' ++ srcDirs 'testng-collections/src/main/java' ++ } ++ resources { ++ srcDirs 'testng-core/src/main/resources' ++ } ++ } ++} ++ ++tasks { ++ jar { ++ manifest { ++ attributes( ++ "Specification-Title": rootProject.name, ++ "Specification-Version": version, ++ "Specification-Vendor" : rootProject.name, ++ "Implementation-Title" : rootProject.name, ++ "Implementation-Version": version, ++ "Implementation-Vendor" : rootProject.name, ++ "Implementation-Vendor-Id" : project.group, ++ "Implementation-Url": "https://testng.org", ++ "Automatic-Module-Name" : project.group, ++ "Bundle-ManifestVersion": "2", ++ "Bundle-Name": rootProject.name, ++ "Bundle-SymbolicName": project.group, ++ "Bundle-Vendor": rootProject.name, ++ "Bundle-License": "Apache-2.0", ++ "Bundle-Description": "Testing framework for Java", ++ "Bundle-Version": version, ++ "Import-Package" : """ ++ bsh.*;version="[2.0.03.0.0)";resolution:=optional, ++ com.beust.jcommander.*;version="[1.7.03.0.0)";resolution:=optional, ++ com.google.inject.*;version="[1.21.3)";resolution:=optional, ++ junit.framework;version="[3.8.1 5.0.0)";resolution:=optional, ++ org.junit.*;resolution:=optional, ++ org.apache.tools.ant.*;version="[1.7.0 2.0.0)";resolution:=optional, ++ org.yaml.*;version="[1.62.0)";resolution:=optional, ++ *;resolution:=optional ++ """.replace(" ", "").replace("\n", ""), ++ "Export-Package" : """ ++ org.testng, ++ org.testng.annotations, ++ org.testng.asserts, ++ org.testng.collections, ++ org.testng.internal, ++ org.testng.internal.annotations, ++ org.testng.internal.ant, ++ org.testng.internal.collections, ++ org.testng.internal.invokers, ++ org.testng.internal.invokers.objects, ++ org.testng.internal.junit, ++ org.testng.internal.objects, ++ org.testng.internal.objects.pojo, ++ org.testng.internal.reflect, ++ org.testng.internal.thread, ++ org.testng.internal.thread.graph, ++ org.testng.junit, ++ org.testng.log, ++ org.testng.log4testng, ++ org.testng.reporters, ++ org.testng.reporters.jq, ++ org.testng.reporters.util, ++ org.testng.thread, ++ org.testng.util, ++ org.testng.xml, ++ org.testng.xml.internal ++ """.replace(" ", "").replace("\n", " ") ++ ) ++ } ++ } ++} ++ ++publishing { ++ publications { ++ testng(MavenPublication) { ++ from(components.java) ++ } ++ } ++} +--- /dev/null ++++ b/testng/settings.gradle +@@ -0,0 +1 @@ ++rootProject.name = 'testng' diff -Nru jtreg7-7.3.1+1/debian/picocli/maven.ignoreRules jtreg7-7.5.2+1+ds2/debian/picocli/maven.ignoreRules --- jtreg7-7.3.1+1/debian/picocli/maven.ignoreRules 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/picocli/maven.ignoreRules 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1 @@ +org.springframework.boot:spring-boot-starter * * * * diff -Nru jtreg7-7.3.1+1/debian/picocli/maven.rules jtreg7-7.5.2+1+ds2/debian/picocli/maven.rules --- jtreg7-7.3.1+1/debian/picocli/maven.rules 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/picocli/maven.rules 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,3 @@ + +jline jline jar * * * +org.codehaus.groovy groovy-all * s/2.*/debian/ * * diff -Nru jtreg7-7.3.1+1/debian/picocli/poms jtreg7-7.5.2+1+ds2/debian/picocli/poms --- jtreg7-7.3.1+1/debian/picocli/poms 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/picocli/poms 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,3 @@ +build/debian/picocli.pom --artifact=build/libs/picocli*.jar --java-lib +picocli-codegen/build/debian/picocli-codegen.pom --artifact=picocli-shell-jline2/build/libs/picocli*.jar --java-lib +picocli-shell-jline2/build/debian/picocli-shell-jline2.pom --artifact=picocli-shell-jline2/build/libs/picocli*.jar --java-lib diff -Nru jtreg7-7.3.1+1/debian/picocli/rules jtreg7-7.5.2+1+ds2/debian/picocli/rules --- jtreg7-7.3.1+1/debian/picocli/rules 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/picocli/rules 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,19 @@ +#!/usr/bin/make -f + +%: + dh $@ --buildsystem=gradle --with maven-repo-helper + +override_dh_auto_build: + dh_auto_build -- jar \ + -x :picocli-annotation-processing-tests:jar \ + -x :picocli-examples:compileGroovy \ + -x :picocli-examples:jar \ + -x :picocli-shell-jline3:jar \ + -x :picocli-spring-boot-starter:jar + +# tests are disabled until we have com.github.stefanbirkner:system-rules:1.x +override_dh_auto_test: + +override_dh_auto_configure: + dh_auto_configure $@ + rsync -Lav ../debian/built-components/ debian/ || true \ No newline at end of file diff -Nru jtreg7-7.3.1+1/debian/rules jtreg7-7.5.2+1+ds2/debian/rules --- jtreg7-7.3.1+1/debian/rules 2023-06-25 20:54:10.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/rules 2026-01-11 23:06:11.000000000 +0000 @@ -7,6 +7,9 @@ BUILD_NUMBER := $(shell dpkg-parsechangelog --show-field Version | awk -F'[+~-]' '{ print $$2 }') DATE := $(shell dpkg-parsechangelog --show-field Date) JTREG_HOME := $(shell readlink -f build/images/jtreg) + +export TESTNG_VERSION=7.5 + export JTREG_HOME export HEADLESS=1 @@ -17,29 +20,44 @@ NJOBS = $(subst parallel=,,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS)))) endif +JAVA_VERSION=$(shell java -version 2>&1) +JAVA_SPECIFICATION_VERSION=$(shell echo "${JAVA_VERSION}" | \ + grep -e ^java -e ^openjdk | \ + head -n 1 | \ + sed -e 's/^[^0-9]*\(1\.\)*\([1-9][0-9]*\).*/\2/' ) + +components:=apiguardian hawt-jni jansi1 jline3 picocli univocity-parsers libhamcrest-java junit4 opentest4j opentest4j-reporting junit5 testng + %: - dh $@ --with javahelper + dh $@ + +override_dh_clean: + ./debian/component-scripts/clean-components.sh jtreg7 $(components) + dh_clean override_dh_auto_build: + ./debian/component-scripts/build-components.sh jtreg7 $(components) + echo "=== $(VERSION) - $(BUILD_NUMBER) ===" mkdir -p build/classes/com/sun/javatest/regtest/tool + mkdir -p build/test (cd make && make \ ASMTOOLS_JAR=/usr/share/java/asmtools.jar \ BUILD_DIR=../build \ - JUNIT_JARS=/usr/share/java/junit-platform-console-standalone.jar \ - TESTNG_JARS="/usr/share/java/testng.jar /usr/share/java/guice.jar /usr/share/java/jcommander.jar /usr/share/java/slf4j-simple.jar /usr/share/java/slf4j-api.jar" \ + JUNIT_JARS=../junit5/debian/jtreg7/usr/share/java/junit-platform-console-standalone.jar \ + TESTNG_JARS="../testng/debian/jtreg7/usr/share/java/testng.jar /usr/share/java/guice.jar /usr/share/java/jcommander.jar /usr/share/java/slf4j-simple.jar /usr/share/java/slf4j-api.jar" \ JAVATEST_JAR=/usr/share/java/javatest.jar \ BUILD_DATE='$(DATE)' \ BUILD_NUMBER=$(VERSION) \ BUILD_VERSION_STRING="$(VERSION)-src+$(BUILD_NUMBER)" \ BUILD_MILESTONE=src \ JDKHOME=$(JAVA_HOME) \ + JAVA_SPECIFICATION_VERSION=$(JAVA_SPECIFICATION_VERSION) \ BUILD_NUMBER=$(BUILD_NUMBER) -j$(NJOBS) all) - dh_auto_build # Generate the manpages - JT_HOME=./build/images/jtreg/lib/ help2man --no-discard-stderr --name="Regression Test Harness" --help-option="-help all" ./build/images/jtreg/bin/jtdiff > jtdiff.1 - JT_HOME=./build/images/jtreg/lib/ help2man --no-discard-stderr --name="Regression Test Harness" --help-option="-help all" ./build/images/jtreg/bin/jtreg > jtreg.1 + JT_HOME=build/images/jtreg help2man --name="Regression Test Harness" --help-option="-help all" --version-option="-version" build/images/jtreg/bin/jtdiff > jtdiff.1 + JT_HOME=build/images/jtreg help2man --name="Regression Test Harness" --help-option="-help all" --version-option="-version" build/images/jtreg/bin/jtreg > jtreg.1 # Make jtreg.jar writable so it is not ignored by strip-nondeterminism chmod +w build/images/jtreg/lib/jtreg.jar diff -Nru jtreg7-7.3.1+1/debian/source/lintian-overrides jtreg7-7.5.2+1+ds2/debian/source/lintian-overrides --- jtreg7-7.3.1+1/debian/source/lintian-overrides 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/source/lintian-overrides 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,16 @@ +# Package does not install component examples +jtreg7 source: package-does-not-install-examples + +# junit5 tests contain prebuilt java jars +jtreg7 source: source-contains-prebuilt-java-object + +# jtreg7 is used in backport, so it uses compat-file +jtreg7 source: uses-debhelper-compat-file +jtreg7 source: package-uses-old-debhelper-compat-version + +# libhamscrest-java packaging license d/copyright contains +# symlink. The license information copied verbatim. +jtreg7: copyright-refers-to-symlink-license + +# jtreg uses old style GPL license +jtreg7 source: old-fsf-address-in-copyright-file diff -Nru jtreg7-7.3.1+1/debian/testng/maven.ignoreRules jtreg7-7.5.2+1+ds2/debian/testng/maven.ignoreRules --- jtreg7-7.3.1+1/debian/testng/maven.ignoreRules 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/testng/maven.ignoreRules 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,7 @@ + +com.coderplus.maven.plugins copy-rename-maven-plugin * * * * +org.apache.maven.plugins maven-gpg-plugin * * * * +org.apache.maven.plugins maven-javadoc-plugin * * * * +org.apache.maven.plugins maven-release-plugin * * * * +org.apache.maven.plugins maven-source-plugin * * * * +org.apache.maven.plugins maven-surefire-plugin * * * * diff -Nru jtreg7-7.3.1+1/debian/testng/maven.rules jtreg7-7.5.2+1+ds2/debian/testng/maven.rules --- jtreg7-7.3.1+1/debian/testng/maven.rules 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/testng/maven.rules 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,7 @@ + +com.google.inject guice jar s/.*/debian/ s/no_aop// * +junit junit jar s/4\..*/4.x/ * * +org.yaml snakeyaml bundle s/1\..*/1.x/ * * +org.yaml snakeyaml s/jar/bundle/ s/1\..*/1.x/ * * +s/ant/org.apache.ant/ * * s/.*/debian/ * * +org.assertj assertj-core jar s/.*/debian/ * * diff -Nru jtreg7-7.3.1+1/debian/testng/poms jtreg7-7.5.2+1+ds2/debian/testng/poms --- jtreg7-7.3.1+1/debian/testng/poms 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/testng/poms 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1 @@ +build/debian/testng.pom --artifact=build/libs/testng-*.jar --java-lib --relocate=org.testng:testng:7.x diff -Nru jtreg7-7.3.1+1/debian/testng/rules jtreg7-7.5.2+1+ds2/debian/testng/rules --- jtreg7-7.3.1+1/debian/testng/rules 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/testng/rules 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,16 @@ +#!/usr/bin/make -f + +include /usr/share/dpkg/pkg-info.mk + +export DEB_VERSION_UPSTREAM + +%: + dh $@ --buildsystem=gradle --with maven-repo-helper + +override_dh_auto_build: + mkdir -p src/main/java + dh_auto_build + +override_dh_auto_configure: + dh_auto_configure $@ + rsync -Lav ../debian/built-components/ debian/ || true \ No newline at end of file diff -Nru jtreg7-7.3.1+1/debian/tests/self-test jtreg7-7.5.2+1+ds2/debian/tests/self-test --- jtreg7-7.3.1+1/debian/tests/self-test 2023-06-19 07:20:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/tests/self-test 2026-01-11 23:06:11.000000000 +0000 @@ -4,6 +4,12 @@ export JAVA_HOME="/usr/lib/jvm/default-java" mkdir -p "${AUTOPKGTEST_TMP}/build/classes/com/sun/javatest/regtest/tool" +JAVA_VERSION=`${JAVA_HOME}/bin/java -version 2>&1` +JAVA_SPECIFICATION_VERSION=`echo "${JAVA_VERSION}" | \ + grep -e ^java -e ^openjdk | \ + head -n 1 | \ + sed -e 's/^[^0-9]*\(1\.\)*\([1-9][0-9]*\).*/\2/'` + PARALLEL_TESTS=`nproc --all` # be safe for 32bit architectures if [ "$PARALLEL_TESTS" -gt 2 ]; then @@ -18,11 +24,12 @@ set -x make -j${PARALLEL_TESTS} -C make \ - ASMTOOLS_JAR=/usr/share/java/asmtools.jar \ + ASMTOOLS_JAR=${JTREG_HOME}/lib/asmtools.jar \ BUILD_DIR="${AUTOPKGTEST_TMP}/build" \ - JUNIT_JARS=/usr/share/java/junit-platform-console-standalone.jar \ - TESTNG_JARS="/usr/share/java/testng.jar /usr/share/java/guice.jar /usr/share/java/jcommander.jar /usr/share/java/slf4j-simple.jar /usr/share/java/slf4j-api.jar" \ - JAVATEST_JAR=/usr/share/java/javatest.jar \ + JUNIT_JARS=${JTREG_HOME}/lib/junit-platform-console-standalone.jar \ + TESTNG_JARS="${JTREG_HOME}/lib/testng.jar ${JTREG_HOME}/lib/guice.jar ${JTREG_HOME}/lib/jcommander.jar ${JTREG_HOME}/lib/slf4j-simple.jar ${JTREG_HOME}/lib/slf4j-api.jar" \ + JAVATEST_JAR=${JTREG_HOME}/lib/javatest.jar \ BUILD_MILESTONE=src \ JDKHOME="${JAVA_HOME}" \ + JAVA_SPECIFICATION_VERSION=${JAVA_SPECIFICATION_VERSION} \ test diff -Nru jtreg7-7.3.1+1/debian/univocity-parsers/maven.ignoreRules jtreg7-7.5.2+1+ds2/debian/univocity-parsers/maven.ignoreRules --- jtreg7-7.3.1+1/debian/univocity-parsers/maven.ignoreRules 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/univocity-parsers/maven.ignoreRules 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,9 @@ + +com.univocity univocity-output-tester +org.apache.maven.plugins maven-assembly-plugin +org.apache.maven.plugins maven-enforcer-plugin +org.apache.maven.plugins maven-javadoc-plugin +org.apache.maven.plugins maven-source-plugin +org.hsqldb hsqldb +org.sonatype.plugins nexus-staging-maven-plugin +org.testng testng diff -Nru jtreg7-7.3.1+1/debian/univocity-parsers/maven.rules jtreg7-7.5.2+1+ds2/debian/univocity-parsers/maven.rules --- jtreg7-7.3.1+1/debian/univocity-parsers/maven.rules 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/univocity-parsers/maven.rules 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,2 @@ + +com.univocity univocity-parsers jar s/.*/debian/ * * diff -Nru jtreg7-7.3.1+1/debian/univocity-parsers/poms jtreg7-7.5.2+1+ds2/debian/univocity-parsers/poms --- jtreg7-7.3.1+1/debian/univocity-parsers/poms 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/univocity-parsers/poms 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1 @@ +pom.xml --has-package-version diff -Nru jtreg7-7.3.1+1/debian/univocity-parsers/rules jtreg7-7.5.2+1+ds2/debian/univocity-parsers/rules --- jtreg7-7.3.1+1/debian/univocity-parsers/rules 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/univocity-parsers/rules 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,8 @@ +#!/usr/bin/make -f + +%: + dh $@ + +override_dh_auto_configure: + dh_auto_configure $@ + rsync -Lav ../debian/built-components/ debian/ || true \ No newline at end of file diff -Nru jtreg7-7.3.1+1/debian/watch jtreg7-7.5.2+1+ds2/debian/watch --- jtreg7-7.3.1+1/debian/watch 2023-05-23 02:28:12.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/watch 2026-02-23 04:42:48.000000000 +0000 @@ -1,7 +1,39 @@ version=4 -opts=\ -compression=gzip,\ -repack,\ -repacksuffix=~us1,\ -dversionmangle=s/\~us\d*$// \ -https://github.com/openjdk/jtreg/tags .*/jtreg-([\d\.]+(?:\+[0-9]+)?).tar.gz +opts="compression=gzip,repack,repacksuffix=+ds2,dversionmangle=s/\+(debian|dfsg|ds|deb)(\.?\d+)?$//" \ +https://github.com/openjdk/jtreg/tags .*/jtreg-(7.[\d\.]+(?:\+[0-9]+)?)\.tar\.gz + +opts="compression=gzip,component=jansi1,repack" \ +https://github.com/fusesource/jansi/tags?after=jansi-2.1.0 .*/jansi-project-(1.18)\.tar\.gz 1.18 + +opts="compression=gzip,component=jline3,repack" \ +https://github.com/jline/jline3/tags?after=jline-parent-3.5.2 .*/.*-(3.3.1)\.tar\.gz 3.3.1 + +opts="compression=gzip,component=junit4,repack" \ + https://github.com/junit-team/junit4/tags .*/r?(4.13.2)\.tar\.gz 4.13.2 + +opts="compression=gzip,component=junit5,repack" \ +https://github.com/junit-team/junit5/tags?after=r5.12.2 .*/r(5.11.4)\.tar\.gz 5.11.4 + +opts="compression=gzip,component=libhamcrest-java,repack" \ +https://github.com/hamcrest/JavaHamcrest/tags .*/(?:hamcrest-java-|v)(2.2)\.tar\.gz 2.2 + +opts="compression=gzip,component=opentest4j-reporting,repack" \ +https://github.com/ota4j-team/open-test-reporting/tags .*/r(0.1.0-M2)\.tar\.gz 0.1.0-M2 + +opts="compression=gzip,component=picocli,repack" \ +https://github.com/remkop/picocli/tags (?:.*?/)?v?(4.6.2)\.tar\.gz 4.6.2 + +opts="compression=gzip,component=testng,repack" \ +https://github.com/cbeust/testng/tags?after=7.8.0-rc2 .*/(7.5.1)\.tar\.gz 7.5.1 + +opts="compression=gzip,component=univocity-parsers,repack" \ +https://github.com/univocity/univocity-parsers/tags .*/(?:.*?)(2.9.1)\.tar\.gz 2.9.1 + +opts="compression=gzip,component=hawt-jni,repack" \ +https://github.com/fusesource/hawtjni/tags .*/hawtjni-project-(1.18).tar.gz 1.18 + +opts="compression=gzip,component=opentest4j,repack" \ +https://github.com/ota4j-team/opentest4j/tags .*/r(1.2.0)\.tar\.gz 1.2.0 + +opts="compression=gzip,component=apiguardian,repack" \ +https://github.com/apiguardian-team/apiguardian/tags .*/r(1.1.2)\.tar\.gz 1.1.2 diff -Nru jtreg7-7.3.1+1/doc/building.md jtreg7-7.5.2+1+ds2/doc/building.md --- jtreg7-7.3.1+1/doc/building.md 2023-08-15 15:26:56.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/doc/building.md 2025-10-28 19:26:35.000000000 +0000 @@ -1,6 +1,6 @@ # Building The Regression Test Harness for the OpenJDK platform: `jtreg` -(This information is also available at ) +(This information is also available at ) `jtreg` depends on a number of external components: JT Harness, TestNG, JUnit, AsmTools, and JCov. @@ -40,6 +40,12 @@ These are documented in _make/build.sh_ and are normally specified in _make/build-support/version-numbers_ and _make/build-support/*/version-numbers_ . +### Rebuilding faster with `build/make.sh` + +After you have run `make/build.sh` once, if you wish to rebuild after making some +changes, you can run `build/make.sh`. It skips the steps to download and build +the dependencies, and so should be significantly faster. + ## Building `jtreg` with GNU Make If you don't want to use `build.sh` to build `jtreg`, you can invoke the @@ -101,7 +107,15 @@ ## Running `jtreg` Self-Tests The tests can be invoked with individual make targets, or collectively via the -`test` target. +`test` target. Individual make targets for self-tests are explained +[here](../test/README.md#makefiles). For example, the +[ControlTest.gmk](../test/ctrl/ControlTest.gmk) makefile has a `$(BUILDTESTDIR)/ControlTest.ok` +target which runs one of the self-tests. In order to run that individual test, +use a command such as the following: + +```shell +bash build/make.sh $(pwd)/build/test/ControlTest.ok +``` Some tests depend on specific versions of JDK being available, specified by the following variables: `JDK8HOME`, `JDK9HOME`, `JDK14HOME`, `JDK18HOME`. @@ -133,3 +147,14 @@ complete. The logic for using VNC is encapsulated within the script _make/display.sh_. + +# Contribution guidelines + +Contributors are encouraged to follow code style conventions in [Java Style Guidelines](https://cr.openjdk.org/~alundblad/styleguide/index-v6.html) +where reasonable. Existing `jtreg` command-line options have a certain style due to their +age, but new options should strive to follow [JEP 293: Guidelines for JDK Command-Line Tool Options](https://openjdk.org/jeps/293). +For backwards compatibility, `jtreg` option names are case-insensitive. + +The `jtreg` codebase is very dependent on (jtharness)[https://github.com/openjdk/jtharness]. +The two repos should most often be viewed together. This also places constraints +on what changes can (easily) be made in jtreg. diff -Nru jtreg7-7.3.1+1/hawt-jni/.gitignore jtreg7-7.5.2+1+ds2/hawt-jni/.gitignore --- jtreg7-7.3.1+1/hawt-jni/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/.gitignore 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +.classpath +.project +.settings +*.iml +*.ipr +*.iws +.idea +webgen/out +webgen/webgen.cache +target +dependency-reduced-pom.xml diff -Nru jtreg7-7.3.1+1/hawt-jni/.travis.yml jtreg7-7.5.2+1+ds2/hawt-jni/.travis.yml --- jtreg7-7.3.1+1/hawt-jni/.travis.yml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/.travis.yml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +language: java +jobs: + include: + - arch: amd64 + - arch: ppc64le + before_install: + - mkdir -p /opt/maven + - curl https://downloads.apache.org/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz|tar -xz --strip 1 -C /opt/maven + - export MAVEN_HOME=/opt/maven + - export PATH=${MAVEN_HOME}/bin:${PATH} +after_failure: print_surefire_reports.sh diff -Nru jtreg7-7.3.1+1/hawt-jni/changelog.md jtreg7-7.5.2+1+ds2/hawt-jni/changelog.md --- jtreg7-7.3.1+1/hawt-jni/changelog.md 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/changelog.md 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,189 @@ +# ![HawtJNI](http://fusesource.github.io/hawtjni/images/project-logo.png) + +## HawtJNI 1.18, released 2020-10-21 + +* [`84606da`](https://github.com/fusesource/hawtjni/commit/84606dacef9bced4d21c2d47bb641b2737738ceb) Bump junit from 4.13 to 4.13.1 in /hawtjni-example +* [`de46737`](https://github.com/fusesource/hawtjni/commit/de4673789a0f0892516450f837c301f5e81246d0) Merge pull request #70 from Siddhesh-Ghadi/ci-power +* [`c06f662`](https://github.com/fusesource/hawtjni/commit/c06f662b9e7ef74dd98bf73f9458cae7a3f5fd86) Add ppc64le support on travis-ci +* [`2976527`](https://github.com/fusesource/hawtjni/commit/2976527a43ec256c98c383110d436bba7aff8c9c) Add doc to setup the native build environment macOS +* [`c00e2d2`](https://github.com/fusesource/hawtjni/commit/c00e2d22b4dfa105d31754bf044874845d7cacb5) Support for shared pointers, fixes #57 +* [`5b4e5ad`](https://github.com/fusesource/hawtjni/commit/5b4e5ad74e63f1c1c180b2169eedd20c9b64e716) Merge pull request #59 from voutilad/master +* [`8678713`](https://github.com/fusesource/hawtjni/commit/8678713caf00652f4f7d52e36b8b384cf611dde5) Merge pull request #61 from remkop/master +* [`d145a1d`](https://github.com/fusesource/hawtjni/commit/d145a1dea37bbd8f98c9f1e6f21d756f849d7979) Do not force JDK 11 but rather support it +* [`8ee5b21`](https://github.com/fusesource/hawtjni/commit/8ee5b2113069399c79610a1de6e01af7d5ae8c45) Updated to work with JDK11 +* [`d1f1492`](https://github.com/fusesource/hawtjni/commit/d1f14926156d103357e7761c4182085b27e7c663) Fix example on OSX +* [`b7277af`](https://github.com/fusesource/hawtjni/commit/b7277aff8f3b01c1c462ede437efb3a4a33973ff) prepare 1.17 release website +* [`56b5bd0`](https://github.com/fusesource/hawtjni/commit/56b5bd0dd3e9a3091905cf262dbe232b65447e07) use hawtjni-maven-plugin for Maven Central badge +* [`c14fec0`](https://github.com/fusesource/hawtjni/commit/c14fec00b9976ff6b84e62e483d678594a7d3832) Support for OSX Catalina +* [`2c64ed4`](https://github.com/fusesource/hawtjni/commit/2c64ed4134de9b3cefd9423382a59f60c8f3ad25) jansi/#162 fix issue where bitModel could not be retrieved on GraalVM +* [`e7806ff`](https://github.com/fusesource/hawtjni/commit/e7806ff89508fce6a61c300ea9a16992324c0ce1) support for OpenBSD + +## HawtJNI 1.17, released 2019-04-03 + +* [`1c4a17b`](https://github.com/fusesource/hawtjni/commit/1c4a17b31bf988f99df6da7085f86829b935c342) Remove shared_ptr support until it's working +* [`d3f9d0a`](https://github.com/fusesource/hawtjni/commit/d3f9d0ab71fd25d8d6f6eb9c3de6c6b47ddae92e) Keep (long*) for standard pointers +* [`906aa15`](https://github.com/fusesource/hawtjni/commit/906aa158c24d3603aca6f3766b7fa0da306d23d6) Merge branch 'calin-iorgulescu-master' +* [`c5130eb`](https://github.com/fusesource/hawtjni/commit/c5130eb900279531f67d4734ccf1ad2f2ad95a70) Fix typo +* [`9d38df2`](https://github.com/fusesource/hawtjni/commit/9d38df2f4a25ee55fbb0dc921fb2004b33c59541) Merge branch 'master' of https://github.com/calin-iorgulescu/hawtjni into calin-iorgulescu-master +* [`1c42406`](https://github.com/fusesource/hawtjni/commit/1c42406ec55ed1955d2fc573e3002e5fa557c984) Merge branch 'master' of https://github.com/batterseapower/hawtjni into batterseapower-master +* [`55afd36`](https://github.com/fusesource/hawtjni/commit/55afd361a8fe44d4d6126de30b279c5b941894ba) Add 10.14 in OSX SDK version list +* [`d094c95`](https://github.com/fusesource/hawtjni/commit/d094c95e7fd0fb879f896b49c796a92adee72369) Merge pull request #45 from wjsl/osx10.13 +* [`d028542`](https://github.com/fusesource/hawtjni/commit/d028542040a23e090633ab0b192ca9c08f7838e2) Merge pull request #48 from castortech/master +* [`c0cfb25`](https://github.com/fusesource/hawtjni/commit/c0cfb2558b8e11edd224f08fd7da6daa84876b34) Merge branch 'master' into master +* [`73e0b4f`](https://github.com/fusesource/hawtjni/commit/73e0b4f68d4597295bcb6d0196a1c030ff14589a) Merge pull request #55 from tdemande/hawtjni-issue-54 +* [`ec9cc6c`](https://github.com/fusesource/hawtjni/commit/ec9cc6c3ce72b7fcd99d356f1abbc0f36fbb9a29) Merge branch 'hawtjni_shared_pointer' of https://github.com/ossdev07/hawtjni into ossdev07-hawtjni_shared_pointer +* [`bd514b7`](https://github.com/fusesource/hawtjni/commit/bd514b71878415e7091b914420a291310de3ec30) Implement a different strategy with sha1 checksum for extracting libraries, fixes #56 +* [`40e0b2f`](https://github.com/fusesource/hawtjni/commit/40e0b2f27a2218b4d10ae3989a4ed74bcf40562d) Formatting +* [`bc3f187`](https://github.com/fusesource/hawtjni/commit/bc3f187087a043caa6737a78c10f982159bd8c2c) #54 Also search in base dir when finding/extracting native lib +* [`8f464d0`](https://github.com/fusesource/hawtjni/commit/8f464d07bc9a807acf33f0f2e355065471f15235) Implement new JNIField accessor model: allow support for separate getter/setter methods for individual fields. +* [`5f52fee`](https://github.com/fusesource/hawtjni/commit/5f52fee5720c5cbeeaae71cfaa90611bcba56e8d) StructsGenerator: Fix bug where a JniClass extending another class that has only ignored fields would generate calls to cache the fields. +* [`2b88a8f`](https://github.com/fusesource/hawtjni/commit/2b88a8f56fdbbf0e71b213f15b333a681e7dc72f) StructsGenerator: Fix bug where an empty field declaration would be created if only skipped fields are declared in a struct. +* [`235f0b9`](https://github.com/fusesource/hawtjni/commit/235f0b985acba4559cfda588a0312287f9420791) Change maven settings to allow building. +* [`839ddcf`](https://github.com/fusesource/hawtjni/commit/839ddcf2bff9e53020f162feeac7258ea6ac97db) added icon for hawtjni-runtime artifact in Central +* [`27af76b`](https://github.com/fusesource/hawtjni/commit/27af76b5f73af61ef592cc66ed65fb12438cc166) Update StructsGenerator.java +* [`f29f849`](https://github.com/fusesource/hawtjni/commit/f29f84960133e5a5740bcd6b6120b8bb7f172f0d) added Automatic-Module-Name to manifest for Java 9 auto-module name +* [`1c2d511`](https://github.com/fusesource/hawtjni/commit/1c2d511d970ad07924ebdbb1e8566fb56e2edf6c) Hawtjni: Shared_pointer support added in hawtjni +* [`7a6082f`](https://github.com/fusesource/hawtjni/commit/7a6082faed85ea73945065466e68ad6035cf724d) fixed typo +* [`35c061c`](https://github.com/fusesource/hawtjni/commit/35c061ca7ffedb11fa52a18c8c087a41bbb5cd88) added Runtime API as a feature +* [`6c1f140`](https://github.com/fusesource/hawtjni/commit/6c1f140970a59727a102b8ee2daef909eb991b78) Added customization for the Windows build. +* [`98b1531`](https://github.com/fusesource/hawtjni/commit/98b1531628f236aa9a68fd49b67ac09f1b547868) Added missing case of "no directory" as per method documentation. +* [`a103c50`](https://github.com/fusesource/hawtjni/commit/a103c50b1b1b357d6a5d932cac7ebc599bb0d16b) Added support to detect newer versions of Visual Studio as candidates for msbuild +* [`6f891af`](https://github.com/fusesource/hawtjni/commit/6f891af96768e77f5e800fd0f723712b87e30735) Updated documentation to clearly indicate the vcbuild is deprecated and that msbuild is supported. +* [`84aa381`](https://github.com/fusesource/hawtjni/commit/84aa381836dae2b784ea685b71c54c6eb6622646) update changelog.md for 1.16 release +* [`3fffa67`](https://github.com/fusesource/hawtjni/commit/3fffa67c2b23f92a1c57552e3779c58382795855) fixed and improved changelog.md formatting +* [`2c7134b`](https://github.com/fusesource/hawtjni/commit/2c7134b4ee612af788d8486181459580811ba1d6) Add 10.13 in OSX SDK version list + +## HawtJNI 1.16, released 2018-02-02 + +* [`2e99592`](https://github.com/fusesource/hawtjni/commit/2e99592f7be976a935beeed7d7395d4a5787e04e) fixed site build +* [`14f1d05`](https://github.com/fusesource/hawtjni/commit/14f1d0564d6e2c71c74288e537fcfa4acf7f4c18) renamed maven-hawtjni-plugin to hawtjni-maven-plugin +* [`743d57b`](https://github.com/fusesource/hawtjni/commit/743d57b25337dc1e0b5dcfc7dce63b15a4433f78) switched Maven plugin from javadoc annotations to Java5 annotations +* [`4a42ee6`](https://github.com/fusesource/hawtjni/commit/4a42ee611ad66c71a6d4b32d41b78ca02ca225e4) [#36](http://github.com/fusesource/hawtjni/issues/36) added info on loaded native library +* [`16c5d82`](https://github.com/fusesource/hawtjni/commit/16c5d820e84864fe437ce77a33011b50b2a6f66d) Merge pull request [#37](http://github.com/fusesource/hawtjni/issues/37) from ghost/patch-1 +* [`45e8a55`](https://github.com/fusesource/hawtjni/commit/45e8a557788a8dbf9fd134df6f8e99f456e3324f) [#43](http://github.com/fusesource/hawtjni/issues/43) mark HawtJNI annotations @Documented +* [`f0c3b54`](https://github.com/fusesource/hawtjni/commit/f0c3b547aeecd508498871583595ab7adff54ea3) s/your/you're/ + +## [HawtJNI 1.15](http://fusesource.github.io/hawtjni/blog/releases/release-1-15.html), released 2017-05-04 + +* [`7537b9d`](https://github.com/fusesource/hawtjni/commit/7537b9d19be9806b210674ccad4b96d90a11d50b) Update changelog +* [`906cedb`](https://github.com/fusesource/hawtjni/commit/906cedb80b9661d0ea08f524fb464243610653a9) Default to extract in the users' home folder in case the temp directory is not writable +* [`ed95784`](https://github.com/fusesource/hawtjni/commit/ed95784f9a4d3ed1afb0a14bd3dccc815d3e3cbe) search in library.$name.path like in META-INF/native resources +* [`477c8cc`](https://github.com/fusesource/hawtjni/commit/477c8ccac78c3695ebcf6299d8b201adb3394d34) Fix some other problems with platform, especially on windows when compiling for the non native platform +* [`58834e8`](https://github.com/fusesource/hawtjni/commit/58834e835c6f196f6188c6f35aa9c349db610d84) Upgrade some plugins +* [`992ee3f`](https://github.com/fusesource/hawtjni/commit/992ee3fa28f30823913fe95a790fe3a08d19bdf3) Fix bad naming for the extracted file when the version contains a dot +* [`6b58328`](https://github.com/fusesource/hawtjni/commit/6b58328635bd181c18048387aa7d83fda51d5be8) Do not include the extension in the windows project name, [#23](http://github.com/fusesource/hawtjni/issues/23) +* [`9165154`](https://github.com/fusesource/hawtjni/commit/916515413152d2b25268d0f813c1f0f411388b3a) Merge pull request [#30](http://github.com/fusesource/hawtjni/issues/30) from felixvf/fix_lib64_bug +* [`1cb6770`](https://github.com/fusesource/hawtjni/commit/1cb6770dc7348958d96b38d8d0b1f4b065f43da5) Merge pull request [#34](http://github.com/fusesource/hawtjni/issues/34) from hboutemy/master +* [`4c430c6`](https://github.com/fusesource/hawtjni/commit/4c430c6d4454b37e035c1fb7ae284b8d3ac99c03) Merge pull request [#20](http://github.com/fusesource/hawtjni/issues/20) from felixvf/fix_bug_18 +* [`f99972b`](https://github.com/fusesource/hawtjni/commit/f99972b7892fd621dca1442b8c8f3234edd4b02f) Better exception reporting when unable to load a library, fixes [#27](http://github.com/fusesource/hawtjni/issues/27) +* [`1c5b81f`](https://github.com/fusesource/hawtjni/commit/1c5b81fb386f74e47e776f3ba2775d15003f2ae9) Allow the windows project name to be specified, fixes [#23](http://github.com/fusesource/hawtjni/issues/23) +* [`ef3437c`](https://github.com/fusesource/hawtjni/commit/ef3437cde117c04793d773b25bd0627e5e260e66) Allow the -Dplatform=xxx setting to be used when doing the actual native build +* [`0072848`](https://github.com/fusesource/hawtjni/commit/0072848253e100c98745725bdf5224e63103fad7) Remove explicit array creation when using var args +* [`c6fb914`](https://github.com/fusesource/hawtjni/commit/c6fb9149b43292564bbc854d9942d4898a7f728d) Remove unused imports +* [`145f3ee`](https://github.com/fusesource/hawtjni/commit/145f3ee50204c8b8f8ae728cc91533dd19424d7d) Fix typos in method names +* [`81a35e1`](https://github.com/fusesource/hawtjni/commit/81a35e1a923bb1c7b0e6ffbdd66a08c83e119324) prepare gh-pages publication with scm-publish plugin +* [`b3982d5`](https://github.com/fusesource/hawtjni/commit/b3982d573b04878918aebe5435a5f64af6a4401f) Use latest version of maven javadoc plugin +* [`cb2ad85`](https://github.com/fusesource/hawtjni/commit/cb2ad85bc551e1628be25181acd6f9e97e04afab) Merge branch 'hboutemy-hawtjni-31' +* [`cd20329`](https://github.com/fusesource/hawtjni/commit/cd20329a801e5d904d7a43c46d3cb150b4767b66) [#31](http://github.com/fusesource/hawtjni/issues/31) fixed API doc generation and misc other Maven-related conf +* [`784a50f`](https://github.com/fusesource/hawtjni/commit/784a50f22d0abd1d4fa05f1fb720e70623092e63) Fix libdir to "/lib". Prevent any variation such as "/lib64". +* [`401ce1c`](https://github.com/fusesource/hawtjni/commit/401ce1cc6f053fccae386977b695ae7a5948ef4d) Update readme.md +* [`a73fc16`](https://github.com/fusesource/hawtjni/commit/a73fc165306a139e8cbb82f9dc28002c05d6d206) Merge pull request [#11](http://github.com/fusesource/hawtjni/issues/11) from OhmData/travis +* [`098c501`](https://github.com/fusesource/hawtjni/commit/098c501c90feb20749105840eaca1f51fbae2559) Simplify the fallback case a bit +* [`40f9f23`](https://github.com/fusesource/hawtjni/commit/40f9f23b4839941e217a8415eb9799aa539e0e36) Merge pull request [#22](http://github.com/fusesource/hawtjni/issues/22) from slaunay/use-java7-chmod-with-unix-chmod-fallback + +## [HawtJNI 1.14](http://fusesource.github.io/hawtjni/blog/releases/release-1.14.html), released 2016-06-20 + +* [`e2522b0`](https://github.com/fusesource/hawtjni/commit/e2522b0ddd9f8975dc3a1cc99534ea458b807ddd) Merge pull request [#26](http://github.com/fusesource/hawtjni/issues/26) from michael-o/freebsd +* [`6dc93fe`](https://github.com/fusesource/hawtjni/commit/6dc93fe4c3b67e68d9805b6f0cc7f2b7c36d5b06) Improve FreeBSD support +* [`2d49307`](https://github.com/fusesource/hawtjni/commit/2d493076d264f6d8e2ac81ada4da4fcd78b2dabf) Deploy to sonatype. + +## [HawtJNI 1.12](http://fusesource.github.io/hawtjni/blog/releases/release-1.12.html), released 2016-04-26 + +* [`70f24ba`](https://github.com/fusesource/hawtjni/commit/70f24ba7438a698d8e1e0de599b304774e01f5d4) Don't build the website by default. +* [`ef93152`](https://github.com/fusesource/hawtjni/commit/ef931527b4ca915a53c59eb6f6ef0222f8cf3c12) Better JDK detection on OS X. +* [`61ac652`](https://github.com/fusesource/hawtjni/commit/61ac6525a42117f0ea8820417d00616ef7f27452) Use Files.setPosixFilePermissions for chmod +* [`57e5b32`](https://github.com/fusesource/hawtjni/commit/57e5b3262a86ac0541585f3b3a40bf3b8933561b) Define JNI64 not only in case of \_\_x86\_64\_\_ but in general for any \_LP64 platform. + +## [HawtJNI 1.11](http://fusesource.github.io/hawtjni/blog/releases/release-1.11.html), released 2015-04-21 + +* [`e1da91a`](https://github.com/fusesource/hawtjni/commit/e1da91aec68eda9f40350b062c4fed4e75fb4cb1) Update xbean version used. +* [`354e277`](https://github.com/fusesource/hawtjni/commit/354e2773cfb60008fd7500eef52ea7de8e9bb74a) Disable deployment of website since web host is not there anymore. +* [`08cfdd0`](https://github.com/fusesource/hawtjni/commit/08cfdd0995bb298d88e87d559d2ce39018e6b509) Update parent pom. +* [`86e97d1`](https://github.com/fusesource/hawtjni/commit/86e97d161d956009bbc92f2913dd570ece2ec3da) Merge pull request [#19](http://github.com/fusesource/hawtjni/issues/19) from jerrydlamme/master +* [`1e2ee63`](https://github.com/fusesource/hawtjni/commit/1e2ee6330f6832a374e29b78a1fff2df62d4a52c) Added architecture specific native library loading path +* [`d10c4b0`](https://github.com/fusesource/hawtjni/commit/d10c4b0914301810297f0f917ce3dba3e8868ff1) Merge pull request [#16](http://github.com/fusesource/hawtjni/issues/16) from NJAldwin/use-absolute-path +* [`3d3aa0b`](https://github.com/fusesource/hawtjni/commit/3d3aa0be17cc8d35e251ea3594b1e684ce919d0d) Ensure absolute path is used for library +* [`8c28532`](https://github.com/fusesource/hawtjni/commit/8c2853238e31b6e92f61fbdeda84314e5a529254) Merge pull request [#13](http://github.com/fusesource/hawtjni/issues/13) from batterseapower/master +* [`c10adf5`](https://github.com/fusesource/hawtjni/commit/c10adf5139969f1bfa6cb6e8dd6af204d64280a9) Version bumps and markup fixes necessary for building on JDK8 +* [`aed6cbd`](https://github.com/fusesource/hawtjni/commit/aed6cbd06b4579170617dae7146ec9c61b70d82c) Build a stock travis +* [`efa684c`](https://github.com/fusesource/hawtjni/commit/efa684c0a87136f16b0bca67bc518ee9bf698f85) Ignore IDEA project files. +* [`18cb7e5`](https://github.com/fusesource/hawtjni/commit/18cb7e5d98e0edf687ba2d02c724c36d631e9f65) prepare for next development iteration +* [`f3bd38e`](https://github.com/fusesource/hawtjni/commit/f3bd38e1d83a5563c63b1bbebadf0c77c1fb54b8) Upgrade parent pom version. +* [`175faf0`](https://github.com/fusesource/hawtjni/commit/175faf07fbc2ec1c42582d0b935bb05fd46fc33f) Merge pull request [#8](http://github.com/fusesource/hawtjni/issues/8) from normanmaurer/netty\_needs +* [`b3f8609`](https://github.com/fusesource/hawtjni/commit/b3f8609c6682bda6d6c112c2e19c0c6cdc6dcfc6) Allow to also use generate mojo with existing native src files +* [`c27b5a0`](https://github.com/fusesource/hawtjni/commit/c27b5a0c4640bce9437488275b0d8c360c45c1e6) Avoid warning. +* [`c1980ef`](https://github.com/fusesource/hawtjni/commit/c1980ef32387547b0a5bba408abb00cbceaf6705) Add support for building against the Oracle JDK on OS X. + +## [HawtJNI 1.10](http://fusesource.github.io/hawtjni/blog/releases/release-1.10.html), released 2014-02-12 + +* `efa684c` Ignore IDEA project files. +* `18cb7e5` prepare for next development iteration +* `f3bd38e` Upgrade parent pom version. +* `175faf0` Merge pull request [#8](http://github.com/fusesource/hawtjni/issues/8) from normanmaurer/netty\_needs +* `b3f8609` Allow to also use generate mojo with existing native src files +* `c27b5a0` Avoid warning. +* `c1980ef` Add support for building against the Oracle JDK on OS X. + +## [HawtJNI 1.9](http://fusesource.github.io/hawtjni/blog/releases/release-1-9.html), released 2013-09-09 + +* [`1d27b2f`](https://github.com/fusesource/hawtjni/commit/1d27b2f1396920be7fce0be8b1995ac0459c69ef) Improve the generated build settings. +* [`d9cd0ab`](https://github.com/fusesource/hawtjni/commit/d9cd0ab660ac5acbdc5f84c806ba14b77e197385) Should fix issue [#7](http://github.com/fusesource/hawtjni/issues/7). We now do a write barrier before setting the 'cached' field to 1 so that reader don't see this get re-ordered before all the fields are readable. + +## [HawtJNI 1.8](http://fusesource.github.io/hawtjni/blog/releases/release-1-8.html), released 2013-05-13 + +* [`92c2661`](https://github.com/fusesource/hawtjni/commit/92c266170ce98edc200c656bd034a237098b8aa5) Simplify shared lib extraction. + +## [HawtJNI 1.7](http://fusesource.github.io/hawtjni/blog/releases/release-1-7.html), released 2013-03-20 + +* [`3567b1d`](https://github.com/fusesource/hawtjni/commit/3567b1d89d458bddb651df252f3bb275c9076e1a) Support explicitly configuring which build tool to use on windows. +* [`d566bf7`](https://github.com/fusesource/hawtjni/commit/d566bf7de5d6a67fa7c7b3e04352ca2630fb55fe) Fix for automake 1.11 + +## [HawtJNI 1.6](http://fusesource.github.io/hawtjni/blog/releases/release-1-6.html), released 2012-08-09 + +* [`11df668`](https://github.com/fusesource/hawtjni/commit/11df668cb0d1269c0f98d9c09d80c56cf0770421) Updating hawtjni generate projects so that they work on OS X Lion. +* [`f0e3ace`](https://github.com/fusesource/hawtjni/commit/f0e3ace6422e5c5413445229ac79d27f68b1485b) Fixes [#2](http://github.com/fusesource/hawtjni/issues/2) : Support passing the JNIEnv pointer to native methods. + +## [HawtJNI 1.5](http://fusesource.github.io/hawtjni/blog/releases/release-1-5.html), released 2011-09-21 + +* [`15d5b1a`](https://github.com/fusesource/hawtjni/commit/15d5b1a4c928fb8c39eee0705316478af30704b5) Only include config.h if it's available. + +## [HawtJNI 1.4](http://fusesource.github.io/hawtjni/blog/releases/release-1-4.html), released 2011-08-18 + +* Add more options to the maven hawtjni plugin so that you can build jars containing + native libs in a different module from the one which generates the native package for + the jar. + +## [HawtJNI 1.3](http://fusesource.github.io/hawtjni/blog/releases/release-1-3.html), released 2011-08-08 + +* Add hawtjni_attach_thread and hawtjni_dettach_thread helper methods +* Fully support binding against C++ source code / classes. +* Support using private fields in struct bound classes. +* Avoid "jump to label from here crosses initialization" compiler error message. +* Provide better error messages when a user does not properly setup a C++ method binding. +* Support mapping a class to a differently named structure name. +* Support picking the OS X SDK version via a configure option. +* Added pointer math support class to be able to do pointer math in java land without going into a JNI layer. + +## [HawtJNI 1.2](http://fusesource.github.io/hawtjni/blog/releases/release-1-2.html), released 2011-06-11 + +* Adding bit model to the name of the extracted library to support hosts running both 32 and 64 bits JVM. +* Converted website to a scalate based static website + +## [HawtJNI 1.1](http://fusesource.github.io/hawtjni/blog/releases/release-1-1.html), released 2010-11-04 +---- +* Generate a .vcxproj for for compatibility with the new Windows 7.1 SDK +* Fixed callback failures on 32 bit platforms + +## [HawtJNI 1.0](http://fusesource.github.io/hawtjni/blog/releases/2010/04/release-1-0.html), released 2010-02-24 + +* Initial release diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-example/pom.xml jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-example/pom.xml --- jtreg7-7.3.1+1/hawt-jni/hawtjni-example/pom.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-example/pom.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,148 @@ + + + + 4.0.0 + + + org.fusesource.hawtjni + hawtjni-project + 1.18 + + + hawtjni-example + HawtJNI Example + + + + org.fusesource.hawtjni + hawtjni-runtime + ${project.version} + + + junit + junit + 4.13.1 + test + + + log4j + log4j + 1.2.17 + test + + + + + + + org.fusesource.hawtjni + hawtjni-maven-plugin + ${project.version} + + + + generate + build + package-jar + package-source + + + + + + + + + + + + org.apache.maven.plugins + maven-shade-plugin + 3.2.3 + + + package + + shade + + + + + junit:junit + + + + + *:* + + META-INF/MANIFEST.MF + + + + + + + + + + + + + + + mac + + + mac + + + + + + org.fusesource.hawtjni + hawtjni-maven-plugin + + + osname=MacOS;processor=x86-64 + osname=MacOS;processor=x86 + * + + + --with-universal + + osx + + + + + + + + + diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-example/src/main/java/test/Example.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-example/src/main/java/test/Example.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-example/src/main/java/test/Example.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-example/src/main/java/test/Example.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,351 @@ +/******************************************************************************* + * Copyright (C) 2009-2011 FuseSource Corp. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + *******************************************************************************/ +package test; + +import java.util.Arrays; + +import org.fusesource.hawtjni.runtime.*; + +import static org.fusesource.hawtjni.runtime.ArgFlag.*; +import static org.fusesource.hawtjni.runtime.FieldFlag.*; +import static org.fusesource.hawtjni.runtime.MethodFlag.*; + +/** + * + * @author Hiram Chirino + */ +@JniClass +public class Example { + + private static final Library LIBRARY = new Library("hawtjni-example", Example.class); + static { + LIBRARY.load(); + init(); + } + + public static final void main(String args[]) { + + System.out.println("Checking Operating System Constants:"); + System.out.println(" O_RDONLY: "+O_RDONLY); + System.out.println(" O_WRONLY: "+O_WRONLY); + System.out.println(" O_RDWR: "+O_RDWR); + System.out.println(""); + + System.out.println("Allocating c structures on the heap..."); + int COUNT = 10; + // We track memory pointers with longs. + long []ptrArray = new long[COUNT]; + long last=0; + for( int i=0; i < COUNT; i++ ) { + // Allocate heap space of the structure.. + ptrArray[i] = malloc(bar.SIZEOF); + + // Configure some data for a structure... + bar f = new bar(); + f.a = i; + f.b = 1; + + byte[] src = "hello world".getBytes(); + System.arraycopy(src, 0, f.c, 0, src.length); + + f.c5 = 0; + f.prev = last; + + // Copy the data values into the allocated space. + memmove(ptrArray[i], f, bar.SIZEOF); + + last = ptrArray[i]; + } + + // Display a couple of structures... + System.out.println("Dump of the first 2 structures:"); + print_foo(ptrArray[0]); + print_foo(ptrArray[1]); + + System.out.println("Passing a pointer array to a c function..."); + long rc = foowork(ptrArray, COUNT); + System.out.println("Function result (expecting 55): "+rc); + + System.out.println("freein up allocated memory."); + for( int i=0; i < COUNT; i++ ) { + free(ptrArray[i]); + } + } + + // Example of how to load constants. + @JniMethod(flags={CONSTANT_INITIALIZER}) + private static final native void init(); + + @JniField(flags={CONSTANT}) + public static int O_RDONLY; + @JniField(flags={CONSTANT}) + public static int O_WRONLY; + @JniField(flags={CONSTANT}) + public static int O_RDWR; + + + @JniMethod(cast="void *") + public static final native long malloc( + @JniArg(cast="size_t") long size); + + public static final native void free( + @JniArg(cast="void *") long ptr); + + + public static final native void memmove ( + @JniArg(cast="void *") long dest, + @JniArg(cast="const void *") long src, + @JniArg(cast="size_t") long size); + + public static final native void memmove ( + @JniArg(cast="void *") long dest, + @JniArg(cast="const void *", flags={NO_OUT, CRITICAL}) byte[] src, + @JniArg(cast="size_t") long size); + + public static final native void memmove ( + @JniArg(cast="void *") long dest, + @JniArg(cast="const void *", flags={NO_OUT, CRITICAL}) char[] src, + @JniArg(cast="size_t") long size); + + public static final native void memmove ( + @JniArg(cast="void *") long dest, + @JniArg(cast="const void *", flags={NO_OUT, CRITICAL}) short[] src, + @JniArg(cast="size_t") long size); + + public static final native void memmove ( + @JniArg(cast="void *") long dest, + @JniArg(cast="const void *", flags={NO_OUT, CRITICAL}) int[] src, + @JniArg(cast="size_t") long size); + + public static final native void memmove ( + @JniArg(cast="void *") long dest, + @JniArg(cast="const void *", flags={NO_OUT, CRITICAL}) long[] src, + @JniArg(cast="size_t") long size); + + public static final native void memmove ( + @JniArg(cast="void *") long dest, + @JniArg(cast="const void *", flags={NO_OUT, CRITICAL}) float[] src, + @JniArg(cast="size_t") long size); + + public static final native void memmove ( + @JniArg(cast="void *") long dest, + @JniArg(cast="const void *", flags={NO_OUT, CRITICAL}) double[] src, + @JniArg(cast="size_t") long size); + + + + public static final native void memmove ( + @JniArg(cast="void *", flags={NO_IN, CRITICAL}) byte[] dest, + @JniArg(cast="const void *") long src, + @JniArg(cast="size_t") long size); + + public static final native void memmove ( + @JniArg(cast="void *", flags={NO_IN, CRITICAL}) char[] dest, + @JniArg(cast="const void *") long src, + @JniArg(cast="size_t") long size); + + public static final native void memmove ( + @JniArg(cast="void *", flags={NO_IN, CRITICAL}) short[] dest, + @JniArg(cast="const void *") long src, + @JniArg(cast="size_t") long size); + + public static final native void memmove ( + @JniArg(cast="void *", flags={NO_IN, CRITICAL}) int[] dest, + @JniArg(cast="const void *") long src, + @JniArg(cast="size_t") long size); + + public static final native void memmove ( + @JniArg(cast="void *", flags={NO_IN, CRITICAL}) long[] dest, + @JniArg(cast="const void *") long src, + @JniArg(cast="size_t") long size); + + public static final native void memmove ( + @JniArg(cast="void *", flags={NO_IN, CRITICAL}) float[] dest, + @JniArg(cast="const void *") long src, + @JniArg(cast="size_t") long size); + + public static final native void memmove ( + @JniArg(cast="void *", flags={NO_IN, CRITICAL}) double[] dest, + @JniArg(cast="const void *") long src, + @JniArg(cast="size_t") long size); + + public static final native void memmove ( + @JniArg(cast="void *", flags={NO_IN, CRITICAL}) byte[] dest, + @JniArg(cast="const void *", flags={NO_OUT, CRITICAL}) char[] src, + @JniArg(cast="size_t") long size); + + public static final native void memmove ( + @JniArg(cast="void *", flags={NO_IN, CRITICAL}) int[] dest, + @JniArg(cast="const void *", flags={NO_OUT, CRITICAL}) byte[] src, + @JniArg(cast="size_t") long size); + + @JniMethod(cast="void *") + public static final native long memset ( + @JniArg(cast="void *") long buffer, + int c, + @JniArg(cast="size_t") long num); + + public static final native int strlen( + @JniArg(cast="char *")long s); + + @JniClass(name="foo", flags={ClassFlag.STRUCT}) + static public class bar { + + static { + LIBRARY.load(); + init(); + } + + @JniMethod(flags={CONSTANT_INITIALIZER}) + private static final native void init(); + +// public static final native int foo_sizeof (); + + @JniField(flags={CONSTANT}, accessor="sizeof(struct foo)") + public static int SIZEOF; + + public int a; + + @JniField(cast="size_t") + public long b; + + public byte c[] = new byte[20]; + + @JniField(accessor="c[5]") + public byte c5; + + @JniField(cast="struct foo *") + public long prev; + + @JniField(getter = "get_d()", setter = "set_d()", flags = { GETTER_NONMEMBER, SETTER_NONMEMBER }) + private float d; + + @JniField(getter = "get_sp()", setter = "set_sp()", flags={ SHARED_PTR, GETTER_NONMEMBER, SETTER_NONMEMBER }) + private long CheckStr; + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + a; + result = prime * result + (int) (b ^ (b >>> 32)); + result = prime * result + Arrays.hashCode(c); + result = prime * result + c5; + result = prime * result + (int) (prev ^ (prev >>> 32)); + result = prime * result + Float.valueOf(d).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; + bar other = (bar) obj; + if (a != other.a) + return false; + if (b != other.b) + return false; + if (!Arrays.equals(c, other.c)) + return false; + if (c5 != other.c5) + return false; + if (prev != other.prev) + return false; + if (d != other.d) { + return false; + } + return true; + } + + @Override + public String toString() { + return "foo [a=" + a + ", b=" + b + ", c=" + Arrays.toString(c) + ", c5=" + c5 + ", prev=" + prev + ", d=" + d + "]"; + } + + } + + public static final native void memmove ( + @JniArg(cast="void *") long dest, + @JniArg(cast="const void *", flags={NO_OUT, CRITICAL}) bar src, + @JniArg(cast="size_t") long size); + + public static final native void memmove ( + @JniArg(cast="void *", flags={NO_IN, CRITICAL}) bar dest, + @JniArg(cast="const void *") long src, + @JniArg(cast="size_t") long size); + + public static final native void print_foo(@JniArg(cast="struct foo *")long ptr); + public static final native long foowork (@JniArg(cast="struct foo **") long[] foos, int count); + + @JniMethod(cast = "struct foo *") + public static final native long foo_add(@JniArg(cast="struct foo *")long ptr, int count); + + @JniMethod(cast = "char *") + public static final native long char_add(@JniArg(cast="char *")long ptr, int count); + + @JniClass(flags={ClassFlag.STRUCT, ClassFlag.TYPEDEF}) + static public class point { + static { + LIBRARY.load(); + init(); + } + + @JniMethod(flags={CONSTANT_INITIALIZER}) + private static final native void init(); + + @JniField(flags={CONSTANT}, accessor="sizeof(point)") + public static int SIZEOF; + + public int x; + public int y; + } + + public static final native void callmeback( + @JniArg(cast="void (*)(int)", flags = ArgFlag.POINTER_ARG) + long ptr); + + @JniClass(flags={ClassFlag.STRUCT, ClassFlag.CPP}) + static class Range { + static { + LIBRARY.load(); + } + + @JniMethod(flags={MethodFlag.CPP_NEW}) + public static final native long Range(); + + @JniMethod(flags={MethodFlag.CPP_NEW}) + public static final native long Range(int start, int end); + + @JniMethod(flags={MethodFlag.CPP_DELETE}) + public static final native void delete(long ptr); + + @JniMethod(flags={MethodFlag.CPP_METHOD}) + public static final native void dump(long ptr); + + + } + + public static final native void passingtheenv (String msg, JNIEnv env); + + @JniClass(flags={ClassFlag.STRUCT}) + static class ClassWithAccessors { + static { + LIBRARY.load(); + } + + @JniField(getter = "get_e()", setter = "set_e()") + private float e; + + + } +} diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-example/src/main/java/test/ObjectiveCExample.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-example/src/main/java/test/ObjectiveCExample.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-example/src/main/java/test/ObjectiveCExample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-example/src/main/java/test/ObjectiveCExample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,73 @@ +/******************************************************************************* + * Copyright (C) 2009-2011 FuseSource Corp. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + *******************************************************************************/ +package test; + +import org.fusesource.hawtjni.runtime.JniArg; +import org.fusesource.hawtjni.runtime.JniClass; +import org.fusesource.hawtjni.runtime.JniMethod; +import org.fusesource.hawtjni.runtime.Library; + +import static org.fusesource.hawtjni.runtime.ArgFlag.*; +import static org.fusesource.hawtjni.runtime.MethodFlag.*; + +/** + * + * @author Hiram Chirino + */ +@JniClass(conditional="defined(__APPLE__)") +public class ObjectiveCExample { + + private static final Library LIBRARY = new Library("hawtjni-example", Example.class); + static { + LIBRARY.load(); + } + + public static final void main(String args[]) { + + // Memory pool... + long NSAutoreleasePool = objc_getClass("NSAutoreleasePool"); + long pool = $($(NSAutoreleasePool, alloc), init); + + // Allocate and use a simple Objective C object + long NSString = objc_getClass("NSString"); + long id = $(NSString, stringWithUTF8String, "Hello"); + long value = $(id, length); + System.out.println("The length was: "+value); + + // Release the pool to release the allocations.. + $(pool, release); + } + + + + public static final long stringWithUTF8String = sel_registerName("stringWithUTF8String:"); + public static final long release = sel_registerName("release"); + public static final long alloc = sel_registerName("alloc"); + public static final long init = sel_registerName("init"); + public static final long length = sel_registerName("length"); + + @JniMethod(cast="SEL", flags={POINTER_RETURN}) + public static final native long sel_registerName(String selectorName); + + @JniMethod(cast="id", flags={POINTER_RETURN}) + public static final native long objc_getClass(String className); + + @JniMethod(cast="id", flags={POINTER_RETURN}, accessor="reinterpret_cast (objc_msgSend)") + public static final native long $( + @JniArg(cast="id", flags={POINTER_ARG})long id, + @JniArg(cast="SEL", flags={POINTER_ARG})long sel + ); + + @JniMethod(cast="id", flags={POINTER_RETURN}, accessor="reinterpret_cast (objc_msgSend)") + public static final native long $( + @JniArg(cast="id", flags={POINTER_ARG})long id, + @JniArg(cast="SEL", flags={POINTER_ARG})long sel, + String arg0); + +} diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-example/src/main/native-package/src/foo.cpp jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-example/src/main/native-package/src/foo.cpp --- jtreg7-7.3.1+1/hawt-jni/hawtjni-example/src/main/native-package/src/foo.cpp 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-example/src/main/native-package/src/foo.cpp 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,53 @@ +/******************************************************************************* + * Copyright (C) 2009-2011 FuseSource Corp. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + *******************************************************************************/ +#include "foo.h" +#include + +float get_d(struct foo *arg) { + return 0.0f; +} +void set_d(struct foo *arg, float d) { +} + +std::shared_ptr get_sp(long CheckStr) { + return std::make_shared (CheckStr); +} +void set_sp(struct foo *arg, std::shared_ptr ptr) { +} + +void print_foo(struct foo *arg) { + printf("foo@%p: { a: %d, b: %d, c: \"%s\", prev: @%p, d: %f, Checkstr: %p}\n", arg, arg->a, (int)arg->b, arg->c, arg->prev, get_d(arg), get_sp(arg->CheckStr).get()); +} + +long foowork(struct foo **arg, int count) { + long rc=0; + int i=0; + for( i=0; i < count; i++ ) { + rc = rc + (*arg)->a; + rc = rc + (*arg)->b; + arg++; + } + return rc; +} + +void callmeback(void (*thecallback)(int number)) { + thecallback(69); +} + +struct foo * foo_add(struct foo *arg, int count) { + return arg+count; +} + +char * char_add(char *arg, int count) { + return arg+count; +} + +void passingtheenv (const char *who, JNIEnv *env) { + printf("%s, the JNIEnv is at: %p\n", who, env); +} diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-example/src/main/native-package/src/foo.h jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-example/src/main/native-package/src/foo.h --- jtreg7-7.3.1+1/hawt-jni/hawtjni-example/src/main/native-package/src/foo.h 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-example/src/main/native-package/src/foo.h 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,63 @@ +/******************************************************************************* + * Copyright (C) 2009-2011 FuseSource Corp. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + *******************************************************************************/ +#ifndef INCLUDED_FOO_H +#define INCLUDED_FOO_H + +#include +#include +#include "jni.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct foo { + int a; + size_t b; + char c[20]; + struct foo *prev; + long CheckStr; +}; + +typedef struct _point { + int x; + int y; +} point; + +struct ClassWithAccessors { + float e; + + float (*get_e)(); + void (*set_e)(float e); +}; + +float get_d(struct foo *arg); +void set_d(struct foo *arg, float d); + +float ClassWithAccessors_get_e(struct foo *arg); +void ClassWithAccessors_set_e(struct foo *arg, float e); + +struct foo * foo_add(struct foo *arg, int count); +char * char_add(char *arg, int count); + +void print_foo(struct foo *arg); +long foowork(struct foo **arg, int count); + +void callmeback(void (*thecallback)(int number)); + +void passingtheenv (const char *who, JNIEnv *env); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +std::shared_ptr get_sp(long CheckStr); +void set_sp(struct foo *arg, std::shared_ptr); + +#endif /* INCLUDED_FOO_H */ diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-example/src/main/native-package/src/hawtjni-example.h jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-example/src/main/native-package/src/hawtjni-example.h --- jtreg7-7.3.1+1/hawt-jni/hawtjni-example/src/main/native-package/src/hawtjni-example.h 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-example/src/main/native-package/src/hawtjni-example.h 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,64 @@ +/******************************************************************************* + * Copyright (C) 2009-2011 FuseSource Corp. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + *******************************************************************************/ +#ifndef INCLUDED_PLATFORM_H +#define INCLUDED_PLATFORM_H + +#ifdef HAVE_CONFIG_H + /* configure based build.. we will use what it discovered about the platform */ + #include "config.h" +#else + #ifdef WIN32 + /* Windows based build */ + #define HAVE_STDLIB_H 1 + #define HAVE_STRINGS_H 1 + #endif +#endif +#include +#ifdef __APPLE__ +#import +#endif + +#ifdef HAVE_UNISTD_H + #include +#endif + +#ifdef HAVE_STDLIB_H + #include +#endif + +#ifdef HAVE_STRINGS_H + #include +#endif + +#include +#include "foo.h" + +#include "stdio.h" + +class Range { +public: + + int start; + int end; + + Range() { + start = 0; + end = 0; + } + Range(const int s, const int e) { + start = s; + end = e; + } + + void dump() { + printf("range: %d-%d\n", start, end); + } +}; + +#endif /* INCLUDED_PLATFORM_H */ diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-example/src/test/java/test/ExampleTest.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-example/src/test/java/test/ExampleTest.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-example/src/test/java/test/ExampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-example/src/test/java/test/ExampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,88 @@ +package test; + +import static org.junit.Assert.*; +import static test.Example.*; + +import org.fusesource.hawtjni.runtime.Callback; +import org.fusesource.hawtjni.runtime.JNIEnv; +import org.junit.Test; +import static org.fusesource.hawtjni.runtime.PointerMath.*; + +import test.Example.bar; + +public class ExampleTest { + + static private int staticCallbackResult; + private int instanceCallbackResult; + + @Test + public void testPointerMath() { + long values[] = new long[]{ + 0, Long.MAX_VALUE, Long.MIN_VALUE, Integer.MAX_VALUE, Integer.MIN_VALUE, + 0+1, Long.MAX_VALUE+1, Long.MIN_VALUE+1, Integer.MAX_VALUE+1, Integer.MIN_VALUE+1, + 0-1, Long.MAX_VALUE-1, Long.MIN_VALUE-1, Integer.MAX_VALUE-1, Integer.MIN_VALUE-1}; + for( long i: values ) { + assertEquals(char_add(i, 1), add(i, 1) ); + assertEquals(char_add(i, -1), add(i, -1) ); + } + } + + @Test + public void test() { + // Allocate and initialize some memory on the heap. + long ptr = malloc(bar.SIZEOF); + memset(ptr, 0, bar.SIZEOF); + + // Configure an object that can be mapped to a C structure. + bar expected = new bar(); + expected.a = 35; + expected.b = Integer.MAX_VALUE; + + System.arraycopy("Hello World!".getBytes(), 0, expected.c, 0, 5); + + // Marshal the object to the allocated heap memory + memmove(ptr, expected, bar.SIZEOF); + + // Unmarshal the object from the allocated heap memory. + bar acutal = new bar(); + memmove(acutal, ptr, bar.SIZEOF); + + assertEquals(expected, acutal); + + Callback callback = new Callback(this, "instanceCallback", 1); + callmeback(callback.getAddress()); + assertEquals(69, instanceCallbackResult); + callback.dispose(); + + long r1 = Range.Range(); + Range.dump(r1); + + long r2 = Range.Range(10,100); + Range.dump(r2); + + Range.delete(r1); + Range.delete(r2); + + + callback = new Callback(ExampleTest.class, "staticCallback", 1); + callmeback(callback.getAddress()); + assertEquals(69, staticCallbackResult); + callback.dispose(); + + // Heap memory is not GCed, we must manually free it. + free(ptr); + + passingtheenv("Hiram", null); + } + + public long instanceCallback(long value) { + this.instanceCallbackResult = (int) value; + return 0; + } + + static public long staticCallback(long value) { + staticCallbackResult = (int) value; + return 0; + } + +} diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/pom.xml jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/pom.xml --- jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/pom.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/pom.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,111 @@ + + + + 4.0.0 + + + org.fusesource.hawtjni + hawtjni-project + 1.18 + + + hawtjni-generator + + HawtJNI Generator + This module contains the JNI code generation tools. + + + + org.fusesource.hawtjni + hawtjni-runtime + ${project.version} + + + xbean-finder + org.apache.xbean + 4.16 + + + org.ow2.asm + asm + 8.0.1 + + + org.ow2.asm + asm-commons + 8.0.1 + + + + commons-cli + commons-cli + 1.0 + + + + + + + + org.apache.maven.plugins + maven-shade-plugin + 3.2.3 + + + package + + shade + + + + + junit:junit + + + + + *:* + + META-INF/DEPENDENCIES + META-INF/LICENSE* + META-INF/NOTICE + META-INF/MANIFEST.MF + module-info.class + + + + org.apache.xbean:xbean-finder + + org/apache/xbean/asm7/original/commons/AsmConstants.class + org/apache/xbean/asm7/original/commons/EmptyVisitor* + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/CleanupClass.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/CleanupClass.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/CleanupClass.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/CleanupClass.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,139 @@ +/******************************************************************************* + * Copyright (C) 2009-2011 FuseSource Corp. + * Copyright (c) 2004, 2008 IBM Corporation and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + *******************************************************************************/ +package org.fusesource.hawtjni.generator; + +import java.io.*; +import java.util.*; + +import org.fusesource.hawtjni.generator.model.JNIClass; +import org.fusesource.hawtjni.generator.model.JNIMethod; + +/** + * + * @author Hiram Chirino + */ +public abstract class CleanupClass extends JNIGenerator { + + String classSourcePath; + String[] sourcePath; + String classSource; + HashMap files; + + int usedCount, unusedCount; + + String[] getArgNames(JNIMethod method) { + int n_args = method.getParameters().size(); + if (n_args == 0) + return new String[0]; + String name = method.getName(); + String params = ""; + int index = 0; + while (true) { + index = classSource.indexOf(name, index + 1); + if (!Character.isWhitespace(classSource.charAt(index - 1))) + continue; + if (index == -1) + return null; + int parantesesStart = classSource.indexOf("(", index); + if (classSource.substring(index + name.length(), parantesesStart).trim().length() == 0) { + int parantesesEnd = classSource.indexOf(")", parantesesStart); + params = classSource.substring(parantesesStart + 1, parantesesEnd); + break; + } + } + String[] names = new String[n_args]; + StringTokenizer tk = new StringTokenizer(params, ","); + for (int i = 0; i < names.length; i++) { + String s = tk.nextToken().trim(); + StringTokenizer tk1 = new StringTokenizer(s, " "); + String s1 = null; + while (tk1.hasMoreTokens()) { + s1 = tk1.nextToken(); + } + names[i] = s1.trim(); + } + return names; + } + + void loadClassSource() { + if (classSourcePath == null) + return; + File f = new File(classSourcePath); + classSource = loadFile(f); + } + + void loadFiles() { + // BAD - holds on to a lot of memory + if (sourcePath == null) + return; + files = new HashMap(); + for (int i = 0; i < sourcePath.length; i++) { + File file = new File(sourcePath[i]); + if (file.exists()) { + if (!file.isDirectory()) { + if (file.getAbsolutePath().endsWith(".java")) { + files.put(file, loadFile(file)); + } + } else { + loadDirectory(file); + } + } + } + } + + String loadFile(File file) { + try { + FileReader fr = new FileReader(file); + BufferedReader br = new BufferedReader(fr); + StringBuffer str = new StringBuffer(); + char[] buffer = new char[1024]; + int read; + while ((read = br.read(buffer)) != -1) { + str.append(buffer, 0, read); + } + fr.close(); + return str.toString(); + } catch (IOException e) { + e.printStackTrace(System.out); + } + return ""; + } + + void loadDirectory(File file) { + String[] entries = file.list(); + for (int i = 0; i < entries.length; i++) { + String entry = entries[i]; + File f = new File(file, entry); + if (!f.isDirectory()) { + if (f.getAbsolutePath().endsWith(".java")) { + files.put(f, loadFile(f)); + } + } else { + loadDirectory(f); + } + } + } + + public void generate(JNIClass clazz) { + loadFiles(); + loadClassSource(); + } + + public void setSourcePath(String[] sourcePath) { + this.sourcePath = sourcePath; + files = null; + } + + public void setClassSourcePath(String classSourcePath) { + this.classSourcePath = classSourcePath; + } + +} diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/CleanupConstants.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/CleanupConstants.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/CleanupConstants.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/CleanupConstants.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,105 @@ +/******************************************************************************* + * Copyright (C) 2009-2011 FuseSource Corp. + * Copyright (c) 2004, 2007 IBM Corporation and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + *******************************************************************************/ +package org.fusesource.hawtjni.generator; + +import java.lang.reflect.Modifier; +import java.util.Collection; +import java.util.List; + +import org.fusesource.hawtjni.generator.model.JNIClass; +import org.fusesource.hawtjni.generator.model.JNIField; +import org.fusesource.hawtjni.generator.model.ReflectClass; + +/** + * + * @author Hiram Chirino + */ +public class CleanupConstants extends CleanupClass { + + String getFieldValue(JNIField field) { + String name = field.getName(); + int index = 0; + while (true) { + index = classSource.indexOf(name, index + 1); + if (index == -1) + return null; + int equalsIndex = classSource.indexOf("=", index); + if (classSource.substring(index + name.length(), equalsIndex).trim().length() == 0) { + int semiIndex = classSource.indexOf(";", equalsIndex); + return classSource.substring(equalsIndex + 1, semiIndex).trim(); + } + } + } + + public void generate(JNIClass clazz) { + unusedCount = usedCount = 0; + super.generate(clazz); + List fields = clazz.getDeclaredFields(); + generate(fields); + output("used=" + usedCount + " unused=" + unusedCount + " total=" + (unusedCount + usedCount)); + } + + public void generate(List fields) { + sortFields(fields); + for (JNIField field : fields) { + if ((field.getModifiers() & Modifier.FINAL) == 0) + continue; + generate(field); + } + } + + public void generate(JNIField field) { + String name = field.getName(); + Collection values = files.values(); + for (String str : values) { + if (str.indexOf(name) != -1) { + int modifiers = field.getModifiers(); + String modifiersStr = Modifier.toString(modifiers); + output("\t"); + output(modifiersStr); + if (modifiersStr.length() > 0) + output(" "); + output(field.getType().getTypeSignature3(false)); + output(" "); + output(field.getName()); + output(" = "); + output(getFieldValue(field)); + outputln(";"); + usedCount++; + return; + } + } + unusedCount++; + // output("NOT USED=" + field.toString() + " \n"); + } + + public static void main(String[] args) { + if (args.length < 3) { + System.out.println("Usage: java CleanupConstants "); + return; + } + try { + CleanupConstants gen = new CleanupConstants(); + String clazzName = args[0]; + String classSource = args[1]; + String[] sourcePath = new String[args.length - 2]; + System.arraycopy(args, 2, sourcePath, 0, sourcePath.length); + Class clazz = Class.forName(clazzName); + gen.setSourcePath(sourcePath); + gen.setClassSourcePath(classSource); + gen.generate(new ReflectClass(clazz)); + } catch (Exception e) { + System.out.println("Problem"); + e.printStackTrace(System.out); + } + } + +} diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/CleanupNatives.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/CleanupNatives.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/CleanupNatives.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/CleanupNatives.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,104 @@ +/******************************************************************************* + * Copyright (C) 2009-2011 FuseSource Corp. + * Copyright (c) 2004, 2007 IBM Corporation and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + *******************************************************************************/ +package org.fusesource.hawtjni.generator; + +import java.util.*; +import java.io.File; +import java.lang.reflect.*; + +import org.fusesource.hawtjni.generator.model.JNIClass; +import org.fusesource.hawtjni.generator.model.JNIMethod; +import org.fusesource.hawtjni.generator.model.ReflectClass; + +/** + * + * @author Hiram Chirino + */ +public class CleanupNatives extends CleanupClass { + + public CleanupNatives() { + } + + public void generate(JNIClass clazz) { + unusedCount = usedCount = 0; + super.generate(clazz); + List methods = clazz.getDeclaredMethods(); + generate(methods); + output("used=" + usedCount + " unused=" + unusedCount + " total=" + (unusedCount + usedCount)); + } + + public void generate(List methods) { + sortMethods(methods); + for (JNIMethod method : methods) { + if ((method.getModifiers() & Modifier.NATIVE) == 0) + continue; + generate(method); + } + } + + public void generate(JNIMethod method) { + String name = method.getName(); + Set keys = files.keySet(); + for (File key : keys) { + String str = (String) files.get(key); + if (str.indexOf(name) != -1) { + // int modifiers = method.getModifiers(); + // Class clazz = method.getDeclaringClass(); + // String modifiersStr = Modifier.toString(modifiers); + // output(modifiersStr); + // if (modifiersStr.length() > 0) output(" "); + // output(getTypeSignature3(method.getReturnType())); + // output(" " ); + // output(method.getName()); + // output("("); + // Class[] paramTypes = method.getParameterTypes(); + // String[] paramNames = getArgNames(method); + // for (int i = 0; i < paramTypes.length; i++) { + // Class paramType = paramTypes[i]; + // if (i != 0) output(", "); + // String sig = getTypeSignature3(paramType); + // if (clazz.getPackage().equals(paramType.getPackage())) sig = + // getClassName(paramType); + // output(sig); + // output(" "); + // output(paramNames[i]); + // } + // outputln(");"); + usedCount++; + return; + } + } + unusedCount++; + output("NOT USED=" + method.toString() + "\n"); + } + + public static void main(String[] args) { + if (args.length < 2) { + System.out.println("Usage: java CleanupNatives "); + return; + } + try { + CleanupNatives gen = new CleanupNatives(); + String clazzName = args[0]; + String classSource = args[1]; + String[] sourcePath = new String[args.length - 2]; + System.arraycopy(args, 2, sourcePath, 0, sourcePath.length); + Class clazz = Class.forName(clazzName); + gen.setSourcePath(sourcePath); + gen.setClassSourcePath(classSource); + gen.generate(new ReflectClass(clazz)); + } catch (Exception e) { + System.out.println("Problem"); + e.printStackTrace(System.out); + } + } + +} diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/ConstantsGenerator.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/ConstantsGenerator.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/ConstantsGenerator.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/ConstantsGenerator.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,76 @@ +/******************************************************************************* + * Copyright (C) 2009-2011 FuseSource Corp. + * Copyright (c) 2004 IBM Corporation and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + *******************************************************************************/ +package org.fusesource.hawtjni.generator; + +import java.lang.reflect.Modifier; +import java.util.List; + +import org.fusesource.hawtjni.generator.model.JNIClass; +import org.fusesource.hawtjni.generator.model.JNIField; +import org.fusesource.hawtjni.generator.model.JNIType; +import org.fusesource.hawtjni.generator.model.ReflectClass; + +/** + * + * @author Hiram Chirino + */ +public class ConstantsGenerator extends JNIGenerator { + + public void generate(JNIClass clazz) { + List fields = clazz.getDeclaredFields(); + generate(fields); + } + + public void generate(List fields) { + sortFields(fields); + outputln("int main() {"); + for (JNIField field : fields) { + if ((field.getModifiers() & Modifier.FINAL) == 0) + continue; + generate(field); + } + outputln("}"); + } + + public void generate(JNIField field) { + JNIType type = field.getType(); + output("\tprintf(\"public static final "); + output(field.getType().getTypeSignature3(false)); + output(" "); + output(field.getName()); + output(" = "); + if (type.isType("java.lang.String") || type.isType("[B")) + output("\"%s\""); + else + output("0x%x"); + output(";\\n\", "); + output(field.getName()); + outputln(");"); + } + + public static void main(String[] args) { + if (args.length < 1) { + System.out.println("Usage: java ConstantsGenerator "); + return; + } + try { + ConstantsGenerator gen = new ConstantsGenerator(); + for (String clazzName : args) { + Class clazz = Class.forName(clazzName); + gen.generate(new ReflectClass(clazz)); + } + } catch (Exception e) { + System.out.println("Problem"); + e.printStackTrace(System.out); + } + } + +} diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/DOMWriter.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/DOMWriter.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/DOMWriter.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/DOMWriter.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1 @@ +/******************************************************************************* * Copyright (C) 2009-2011 FuseSource Corp. * Copyright (c) 2008 IBM Corporation and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * *******************************************************************************/ package org.fusesource.hawtjni.generator; import java.io.PrintStream; import java.util.Arrays; import java.util.Comparator; import org.w3c.dom.Attr; import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; import org.w3c.dom.NodeList; /** * * @author Hiram Chirino */ public class DOMWriter { static String ENCONDING = "UTF8"; PrintStream out; String[] attributeFilter; String nodeFilter; public DOMWriter(PrintStream out) { this.out = new PrintStream(out); } String nodeName(Node node) { // TODO use getLocalName()? return node.getNodeName(); } boolean filter(Attr attr) { if (attributeFilter == null) return false; String name = attr.getNodeName(); for (int i = 0; i < attributeFilter.length; i++) { if (name.matches(attributeFilter[i])) return false; } return true; } void print(String str) { out.print(str); } void println() { out.println(); } public void print(Node node) { print(node, 0); } public void print(Node node, int level) { if (node == null) return; int type = node.getNodeType(); switch (type) { case Node.DOCUMENT_NODE: { print(""); println(); print(((Document) node).getDocumentElement()); break; } case Node.ELEMENT_NODE: { Attr attrs[] = sort(node.getAttributes()); String name = nodeName(node); boolean gen = name.equals("arg") || name.equals("retval"); for (int i = 0; i < attrs.length && !gen; i++) { Attr attr = attrs[i]; if (nodeName(attr).startsWith(nodeFilter)) gen = true; } if (!gen) break; for (int i = 0; i < level; i++) print("\t"); print("<"); print(name); for (int i = 0; i < attrs.length; i++) { Attr attr = attrs[i]; if (filter(attr)) continue; print(" "); print(nodeName(attr)); print("=\""); print(normalize(attr.getNodeValue())); print("\""); } print(">"); NodeList children = node.getChildNodes(); int count = 0; if (children != null) { int len = children.getLength(); for (int i = 0; i < len; i++) { if (children.item(i).getNodeType() == Node.ELEMENT_NODE) count++; } if (count > 0) println(); for (int i = 0; i < len; i++) { print(children.item(i), level + 1); } if (count > 0) { for (int i = 0; i < level; i++) print("\t"); } } print(""); println(); break; } } out.flush(); } Attr[] sort(NamedNodeMap attrs) { if (attrs == null) return new Attr[0]; Attr result[] = new Attr[attrs.getLength()]; for (int i = 0; i < result.length; i++) { result[i] = (Attr) attrs.item(i); } Arrays.sort(result, new Comparator() { public int compare(Node arg0, Node arg1) { return nodeName(arg0).compareTo(nodeName(arg1)); } }); return result; } String normalize(String s) { if (s == null) return ""; StringBuffer str = new StringBuffer(); for (int i = 0, length = s.length(); i < length; i++) { char ch = s.charAt(i); switch (ch) { case '"': str.append("\""); break; case '\r': case '\n': // FALL THROUGH default: str.append(ch); } } return str.toString(); } public void setNodeFilter(String filter) { nodeFilter = filter; } public void setAttributeFilter(String[] filter) { attributeFilter = filter; } } \ No newline at end of file diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/HawtJNI.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/HawtJNI.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/HawtJNI.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/HawtJNI.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,495 @@ +/******************************************************************************* + * Copyright (C) 2009-2011 FuseSource Corp. + * Copyright (c) 2004, 2007 IBM Corporation and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + *******************************************************************************/ +package org.fusesource.hawtjni.generator; + +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.PrintStream; +import java.io.PrintWriter; +import java.lang.reflect.Array; +import java.net.URL; +import java.net.URLClassLoader; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Calendar; +import java.util.HashSet; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; +import java.util.regex.Pattern; + +import org.apache.commons.cli.CommandLine; +import org.apache.commons.cli.HelpFormatter; +import org.apache.commons.cli.Options; +import org.apache.commons.cli.ParseException; +import org.apache.commons.cli.PosixParser; +import org.apache.xbean.finder.ClassFinder; +import org.apache.xbean.finder.UrlSet; +import org.fusesource.hawtjni.generator.model.JNIClass; +import org.fusesource.hawtjni.generator.model.ReflectClass; +import org.fusesource.hawtjni.generator.util.FileSupport; +import org.fusesource.hawtjni.runtime.ClassFlag; +import org.fusesource.hawtjni.runtime.JniClass; + +import static org.fusesource.hawtjni.generator.util.OptionBuilder.*; + +/** + * + * @author Hiram Chirino + */ +public class HawtJNI { + public static final String END_YEAR_TAG = "%END_YEAR%"; + + private ProgressMonitor progress; + private File nativeOutput = new File("."); +// private File javaOutputDir = new File("."); + private List classpaths = new ArrayList(); + private List packages = new ArrayList(); + private String name = "hawtjni_native"; + private String copyright = ""; + private boolean callbacks = true; + + /////////////////////////////////////////////////////////////////// + // Command line entry point + /////////////////////////////////////////////////////////////////// + public static void main(String[] args) { + String jv = System.getProperty("java.version").substring(0, 3); + if (jv.compareTo("1.5") < 0) { + System.err.println("This application requires jdk 1.5 or higher to run, the current java version is " + System.getProperty("java.version")); + System.exit(-1); + return; + } + + HawtJNI app = new HawtJNI(); + System.exit(app.execute(args)); + } + + /////////////////////////////////////////////////////////////////// + // Entry point for an embedded users who want to call us with + // via command line arguments. + /////////////////////////////////////////////////////////////////// + public int execute(String[] args) { + CommandLine cli = null; + try { + cli = new PosixParser().parse(createOptions(), args, true); + } catch (ParseException e) { + System.err.println( "Unable to parse command line options: " + e.getMessage() ); + displayHelp(); + return 1; + } + + if( cli.hasOption("h") ) { + displayHelp(); + return 0; + } + + if( cli.hasOption("v") ) { + progress = new ProgressMonitor() { + public void step() { + } + public void setTotal(int total) { + } + public void setMessage(String message) { + System.out.println(message); + } + }; + } + + name = cli.getOptionValue("n", "hawtjni_native"); + nativeOutput = new File(cli.getOptionValue("o", ".")); +// javaOutputDir = new File(cli.getOptionValue("j", ".")); + String[] values = cli.getOptionValues("p"); + if( values!=null ) { + packages = Arrays.asList(values); + } + + values = cli.getArgs(); + if( values!=null ) { + classpaths = Arrays.asList(values); + } + + try { + if( classpaths.isEmpty() ) { + throw new UsageException("No classpath supplied."); + } + generate(); + } catch (UsageException e) { + System.err.println("Invalid usage: "+e.getMessage()); + displayHelp(); + return 1; + } catch (Throwable e) { + System.out.flush(); + System.err.println("Unexpected failure:"); + e.printStackTrace(); + Set exceptions = new HashSet(); + exceptions.add(e); + for (int i = 0; i < 10; i++) { + e = e.getCause(); + if (e != null && exceptions.add(e)) { + System.err.println("Reason: " + e); + e.printStackTrace(); + } else { + break; + } + } + return 2; + } + return 0; + } + + + /////////////////////////////////////////////////////////////////// + // Entry point for an embedded users who want use us like a pojo + /////////////////////////////////////////////////////////////////// + public ProgressMonitor getProgress() { + return progress; + } + + public void setProgress(ProgressMonitor progress) { + this.progress = progress; + } + + public File getNativeOutput() { + return nativeOutput; + } + + public void setNativeOutput(File nativeOutput) { + this.nativeOutput = nativeOutput; + } + + public List getClasspaths() { + return classpaths; + } + + public void setClasspaths(List classpaths) { + this.classpaths = classpaths; + } + + public List getPackages() { + return packages; + } + + public void setPackages(List packages) { + this.packages = packages; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public void setCopyright(String copyright) { + this.copyright = copyright; + } + + public boolean isCallbacks() { + return callbacks; + } + + public void setCallbacks(boolean enableCallbacks) { + this.callbacks = enableCallbacks; + } + + public void generate() throws UsageException, IOException { + progress("Analyzing classes..."); + + ArrayList natives = new ArrayList(); + ArrayList structs = new ArrayList(); + findClasses(natives, structs); + + if( natives.isEmpty() && structs.isEmpty() ) { + throw new RuntimeException("No @JniClass or @JniStruct annotated classes found."); + } + + + if (progress != null) { + int nativeCount = 0; + for (JNIClass clazz : natives) { + nativeCount += clazz.getNativeMethods().size(); + } + int total = nativeCount * 4; + total += natives.size() * (3); + total += structs.size() * 2; + progress.setTotal(total); + } + + File file; + nativeOutput.mkdirs(); + + progress("Generating..."); + file = nativeFile(".c"); + generate(new NativesGenerator(), natives, file); + + file = nativeFile("_stats.h"); + generate(new StatsGenerator(true), natives, file); + + file = nativeFile("_stats.c"); + generate(new StatsGenerator(false), natives, file); + + file = nativeFile("_structs.h"); + generate(new StructsGenerator(true), structs, file); + + file = nativeFile("_structs.c"); + generate(new StructsGenerator(false), structs, file); + + file = new File(nativeOutput, "hawtjni.h"); + generateFromResource("hawtjni.h", file); + + file = new File(nativeOutput, "hawtjni.c"); + generateFromResource("hawtjni.c", file); + + file = new File(nativeOutput, "hawtjni-callback.c"); + if( callbacks ) { + generateFromResource("hawtjni-callback.c", file); + } else { + file.delete(); + } + + file = new File(nativeOutput, "windows"); + file.mkdirs(); + file = new File(file, "stdint.h"); + generateFromResource("windows/stdint.h", file); + + progress("Done."); + } + + /////////////////////////////////////////////////////////////////// + // Helper methods + /////////////////////////////////////////////////////////////////// + + private void findClasses(ArrayList jni, ArrayList structs) throws UsageException { + + ArrayList urls = new ArrayList(); + for (String classpath : classpaths) { + String[] fileNames = classpath.replace(';', ':').split(":"); + for (String fileName : fileNames) { + try { + File file = new File(fileName); + if( file.isDirectory() ) { + urls.add(new URL(url(file)+"/")); + } else { + urls.add(new URL(url(file))); + } + } catch (Exception e) { + throw new UsageException("Invalid class path. Not a valid file: "+fileName); + } + } + } + LinkedHashSet> jniClasses = new LinkedHashSet>(); + try { + URLClassLoader classLoader = new URLClassLoader(array(URL.class, urls), JniClass.class.getClassLoader()); + UrlSet urlSet = new UrlSet(classLoader); + urlSet = urlSet.excludeJavaHome(); + ClassFinder finder = new ClassFinder(classLoader, urlSet.getUrls()); + collectMatchingClasses(finder, JniClass.class, jniClasses); + } catch (Exception e) { + throw new RuntimeException(e); + } + + for (Class clazz : jniClasses) { + ReflectClass rc = new ReflectClass(clazz); + if( rc.getFlag(ClassFlag.STRUCT) ) { + structs.add(rc); + } + if( !rc.getNativeMethods().isEmpty() ) { + jni.add(rc); + } + } + } + + + static private Options createOptions() { + Options options = new Options(); + options.addOption("h", "help", false, "Display help information"); + options.addOption("v", "verbose", false, "Verbose generation"); + + options.addOption("o", "offline", false, "Work offline"); + options.addOption(ob() + .id("n") + .name("name") + .arg("value") + .description("The base name of the library, used to determine generated file names. Defaults to 'hawtjni_native'.").op()); + + options.addOption(ob() + .id("o") + .name("native-output") + .arg("dir") + .description("Directory where generated native source code will be stored. Defaults to the current directory.").op()); + +// options.addOption(ob() +// .id("j") +// .name("java-output") +// .arg("dir") +// .description("Directory where generated native source code will be stored. Defaults to the current directory.").op()); + + options.addOption(ob() + .id("p") + .name("package") + .arg("package") + .description("Restrict looking for JNI classes to the specified package.").op()); + + return options; + } + + + private void displayHelp() { + System.err.flush(); + String app = System.getProperty("hawtjni.application"); + if( app == null ) { + try { + URL location = getClass().getProtectionDomain().getCodeSource().getLocation(); + String[] split = location.toString().split("/"); + if( split[split.length-1].endsWith(".jar") ) { + app = split[split.length-1]; + } + } catch (Throwable e) { + } + if( app == null ) { + app = getClass().getSimpleName(); + } + } + + // The commented out line is 80 chars long. We have it here as a visual reference +// p(" "); + p(); + p("Usage: "+ app +" [options] "); + p(); + p("Description:"); + p(); + pw(" "+app+" is a code generator that produces the JNI code needed to implement java native methods.", 2); + p(); + + p("Options:"); + p(); + PrintWriter out = new PrintWriter(System.out); + HelpFormatter formatter = new HelpFormatter(); + formatter.printOptions(out, 78, createOptions(), 2, 2); + out.flush(); + p(); + p("Examples:"); + p(); + pw(" "+app+" -o build foo.jar bar.jar ", 2); + pw(" "+app+" -o build foo.jar:bar.jar ", 2); + pw(" "+app+" -o build -p org.mypackage foo.jar;bar.jar ", 2); + p(); + } + + private void p() { + System.out.println(); + } + private void p(String s) { + System.out.println(s); + } + private void pw(String message, int indent) { + PrintWriter out = new PrintWriter(System.out); + HelpFormatter formatter = new HelpFormatter(); + formatter.printWrapped(out, 78, indent, message); + out.flush(); + } + + @SuppressWarnings("unchecked") + private void collectMatchingClasses(ClassFinder finder, Class annotation, LinkedHashSet> collector) { + List> annotated = finder.findAnnotatedClasses(annotation); + for (Class clazz : annotated) { + if( packages.isEmpty() ) { + collector.add(clazz); + } else { + if( packages.contains(clazz.getPackage().getName()) ) { + collector.add(clazz); + } + } + } + } + + private void progress(String message) { + if (progress != null) { + progress.setMessage(message); + } + } + + private void generate(JNIGenerator gen, ArrayList classes, File target) throws IOException { + gen.setOutputName(name); + gen.setClasses(classes); + gen.setCopyright(getCopyright()); + gen.setProgressMonitor(progress); + ByteArrayOutputStream out = new ByteArrayOutputStream(); + gen.setOutput(new PrintStream(out)); + gen.generate(); + if (out.size() > 0) { + if( target.getName().endsWith(".c") && gen.isCPP ) { + target = new File(target.getParentFile(), target.getName()+"pp"); + } + if( FileSupport.write(out.toByteArray(), target) ) { + progress("Wrote: "+target); + } + } + } + + private void generateFromResource(String resource, File target) throws IOException { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + InputStream is = getClass().getClassLoader().getResourceAsStream(resource); + FileSupport.copy(is, out); + String content = new String(out.toByteArray(), "UTF-8"); + String[] parts = content.split(Pattern.quote("/* == HEADER-SNIP-LOCATION == */")); + if( parts.length==2 ) { + content = parts[1]; + } + out.reset(); + PrintStream ps = new PrintStream(out); + ps.print(JNIGenerator.fixDelimiter(getCopyright())); + ps.print(JNIGenerator.fixDelimiter(content)); + ps.close(); + if( FileSupport.write(out.toByteArray(), target) ) { + progress("Wrote: "+target); + } + } + + @SuppressWarnings("unchecked") + private T[] array(Class type, ArrayList urls) { + return urls.toArray((T[])Array.newInstance(type, urls.size())); + } + + private String url(File file) throws IOException { + return "file:"+(file.getCanonicalPath().replace(" ", "%20")); + } + + @SuppressWarnings("serial") + public static class UsageException extends Exception { + public UsageException(String message) { + super(message); + } + } + + private File nativeFile(String suffix) { + return new File(nativeOutput, name+suffix); + } + + public String getCopyright() { + if (copyright == null) + return ""; + + int index = copyright.indexOf(END_YEAR_TAG); + if (index != -1) { + String temp = copyright.substring(0, index); + temp += Calendar.getInstance().get(Calendar.YEAR); + temp += copyright.substring(index + END_YEAR_TAG.length()); + copyright = temp; + } + + return copyright; + } + +} diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/JNIGenerator.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/JNIGenerator.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/JNIGenerator.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/JNIGenerator.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,239 @@ +/******************************************************************************* + * Copyright (C) 2009-2011 FuseSource Corp. + * Copyright (c) 2004, 2006 IBM Corporation and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + *******************************************************************************/ +package org.fusesource.hawtjni.generator; + +import java.io.BufferedReader; +import java.io.FileReader; +import java.io.IOException; +import java.io.PrintStream; +import java.lang.reflect.Modifier; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; + +import org.fusesource.hawtjni.generator.model.JNIClass; +import org.fusesource.hawtjni.generator.model.JNIField; +import org.fusesource.hawtjni.generator.model.JNIMethod; +import org.fusesource.hawtjni.generator.model.JNIType; +import org.fusesource.hawtjni.runtime.ClassFlag; + +/** + * + * @author Hiram Chirino + */ +public abstract class JNIGenerator { + + static final String delimiter = System.getProperty("line.separator"); + static final String JNI64 = "JNI64"; + + ArrayList classes; + String copyright = ""; + boolean isCPP; + PrintStream output = System.out; + ProgressMonitor progress; + private String outputName; + + static String fixDelimiter(String str) { + if (delimiter.equals("\n")) { + return str; + } + return str.replaceAll("\n", delimiter); + } + + static String getFunctionName(JNIMethod method) { + return getFunctionName(method, method.getParameterTypes()); + } + + static String getFunctionName(JNIMethod method, List paramTypes) { + if ((method.getModifiers() & Modifier.NATIVE) == 0) + return method.getName(); + String function = toC(method.getName()); + if (!method.isNativeUnique()) { + StringBuffer buffer = new StringBuffer(); + buffer.append(function); + buffer.append("__"); + for (JNIType paramType : paramTypes) { + buffer.append(toC(paramType.getTypeSignature(false))); + } + return buffer.toString(); + } + return function; + } + + static String loadFile(String file) { + try { + FileReader fr = new FileReader(file); + BufferedReader br = new BufferedReader(fr); + StringBuffer str = new StringBuffer(); + char[] buffer = new char[1024]; + int read; + while ((read = br.read(buffer)) != -1) { + str.append(buffer, 0, read); + } + fr.close(); + return str.toString(); + } catch (IOException e) { + throw new RuntimeException("File not found:" + file, e); + } + } + + public static void sortMethods(List methods) { + Collections.sort(methods, new Comparator() { + public int compare(JNIMethod mth1, JNIMethod mth2) { + int result = mth1.getName().compareTo(mth2.getName()); + return result != 0 ? result : getFunctionName(mth1).compareTo(getFunctionName(mth2)); + } + }); + } + + static void sortFields(List fields) { + Collections.sort(fields, new Comparator() { + public int compare(JNIField a, JNIField b) { + return a.getName().compareTo(b.getName()); + } + }); + } + + static void sortClasses(ArrayList classes) { + Collections.sort(classes, new Comparator() { + public int compare(JNIClass a, JNIClass b) { + return a.getName().compareTo(b.getName()); + } + }); + } + + static String toC(String str) { + int length = str.length(); + StringBuffer buffer = new StringBuffer(length * 2); + for (int i = 0; i < length; i++) { + char c = str.charAt(i); + switch (c) { + case '_': + buffer.append("_1"); + break; + case ';': + buffer.append("_2"); + break; + case '[': + buffer.append("_3"); + break; + case '.': + buffer.append("_"); + break; + case '/': + buffer.append("_"); + break; + default: + if( + ('a' <= c && c <= 'z') + || ('A' <= c && c <= 'Z') + || ('0' <= c && c <= '9') + ) { + buffer.append(c); + } else { + buffer.append(String.format("_0%04x",(int)c)); + } + } + } + return buffer.toString(); + } + + public abstract void generate(JNIClass clazz); + + public void generateCopyright() { + } + + public void generateIncludes() { + } + + public void generate() { + if (classes == null) + return; + generateCopyright(); + generateIncludes(); + sortClasses(classes); + for (JNIClass clazz : classes) { + if (clazz.getFlag(ClassFlag.CPP)) { + isCPP = true; + break; + } + } + generate(classes); + output.flush(); + } + + protected void generate(ArrayList classes) { + for (JNIClass clazz : classes) { + if (clazz.getGenerate()) + generate(clazz); + if (progress != null) + progress.step(); + } + } + + public boolean getCPP() { + return isCPP; + } + + public String getDelimiter() { + return delimiter; + } + + public PrintStream getOutput() { + return output; + } + + public String getOutputName() { + return outputName; + } + + public void setOutputName(String outputName) { + this.outputName = outputName; + } + + public ProgressMonitor getProgressMonitor() { + return progress; + } + + public void output(String str) { + output.print(str); + } + + public void outputln() { + output(getDelimiter()); + } + + public void outputln(String str) { + output(str); + output(getDelimiter()); + } + + public void setClasses(ArrayList classes) { + this.classes = classes; + } + + public void setOutput(PrintStream output) { + this.output = output; + } + + public void setProgressMonitor(ProgressMonitor progress) { + this.progress = progress; + } + public String getCopyright() { + return copyright; + } + + public void setCopyright(String copyright) { + this.copyright = copyright; + } + +} diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/LockGenerator.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/LockGenerator.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/LockGenerator.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/LockGenerator.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,160 @@ +/******************************************************************************* + * Copyright (C) 2009-2011 FuseSource Corp. + * Copyright (c) 2004, 2007 IBM Corporation and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + *******************************************************************************/ +package org.fusesource.hawtjni.generator; + +import java.lang.reflect.Modifier; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.fusesource.hawtjni.generator.model.JNIClass; +import org.fusesource.hawtjni.generator.model.JNIMethod; +import org.fusesource.hawtjni.generator.model.JNIType; +import org.fusesource.hawtjni.generator.model.ReflectClass; +import org.fusesource.hawtjni.generator.model.ReflectType; + +/** + * + * @author Hiram Chirino + */ +public class LockGenerator extends CleanupClass { + + public LockGenerator() { + } + + String getParams(JNIMethod method) { + int n_args = method.getParameters().size(); + if (n_args == 0) + return ""; + String name = method.getName(); + String params = ""; + int index = 0; + while (true) { + index = classSource.indexOf(name, index + 1); + if (!Character.isWhitespace(classSource.charAt(index - 1))) + continue; + if (index == -1) + return null; + int parantesesStart = classSource.indexOf("(", index); + if (classSource.substring(index + name.length(), parantesesStart).trim().length() == 0) { + int parantesesEnd = classSource.indexOf(")", parantesesStart); + params = classSource.substring(parantesesStart + 1, parantesesEnd); + break; + } + } + return params; + } + + String getReturn(JNIMethod method) { + JNIType returnType = method.getReturnType32(); + if (!returnType.isType("int")) + return returnType.getTypeSignature3(false); + String modifierStr = Modifier.toString(method.getModifiers()); + String name = method.getName(); + Pattern p = Pattern.compile(modifierStr + ".*" + name + ".*(.*)"); + Matcher m = p.matcher(classSource); + if (m.find()) { + String methodStr = classSource.substring(m.start(), m.end()); + int index = methodStr.indexOf("/*long*/"); + if (index != -1 && index < methodStr.indexOf(name)) { + return new ReflectType(Integer.TYPE).getTypeSignature3(false) + " /*long*/"; + } + } + return new ReflectType(Integer.TYPE).getTypeSignature3(false); + } + + public void generate(JNIClass clazz) { + super.generate(clazz); + generate(clazz.getDeclaredMethods()); + } + + public void generate(List methods) { + sortMethods(methods); + for (JNIMethod method : methods) { + if ((method.getModifiers() & Modifier.NATIVE) == 0) + continue; + generate(method); + } + } + + public void generate(JNIMethod method) { + int modifiers = method.getModifiers(); + boolean lock = (modifiers & Modifier.SYNCHRONIZED) != 0; + String returnStr = getReturn(method); + String paramsStr = getParams(method); + if (lock) { + String modifiersStr = Modifier.toString(modifiers & ~Modifier.SYNCHRONIZED); + output(modifiersStr); + if (modifiersStr.length() > 0) + output(" "); + output(returnStr); + output(" _"); + output(method.getName()); + output("("); + output(paramsStr); + outputln(");"); + } + String modifiersStr = Modifier.toString(modifiers & ~(Modifier.SYNCHRONIZED | (lock ? Modifier.NATIVE : 0))); + output(modifiersStr); + if (modifiersStr.length() > 0) + output(" "); + output(returnStr); + output(" "); + output(method.getName()); + output("("); + output(paramsStr); + output(")"); + if (lock) { + outputln(" {"); + outputln("\tlock.lock();"); + outputln("\ttry {"); + output("\t\t"); + if (!method.getReturnType32().isType("void")) { + output("return "); + } + output("_"); + output(method.getName()); + output("("); + String[] paramNames = getArgNames(method); + for (int i = 0; i < paramNames.length; i++) { + if (i != 0) + output(", "); + output(paramNames[i]); + } + outputln(");"); + outputln("\t} finally {"); + outputln("\t\tlock.unlock();"); + outputln("\t}"); + outputln("}"); + } else { + outputln(";"); + } + } + + public static void main(String[] args) { + if (args.length < 2) { + System.out.println("Usage: java LockGenerator "); + return; + } + try { + LockGenerator gen = new LockGenerator(); + String clazzName = args[0]; + String classSource = args[1]; + Class clazz = Class.forName(clazzName); + gen.setClassSourcePath(classSource); + gen.generate(new ReflectClass(clazz)); + } catch (Exception e) { + System.out.println("Problem"); + e.printStackTrace(System.out); + } + } + +} diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/MacGenerator.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/MacGenerator.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/MacGenerator.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/MacGenerator.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,1828 @@ +/******************************************************************************* + * Copyright (C) 2009-2011 FuseSource Corp. + * Copyright (c) 2008 IBM Corporation and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + *******************************************************************************/ +package org.fusesource.hawtjni.generator; + +import java.io.BufferedInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.PrintStream; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; +import java.util.StringTokenizer; +import java.util.TreeMap; +import java.util.TreeSet; + +import javax.xml.parsers.DocumentBuilderFactory; + +import org.fusesource.hawtjni.generator.HawtJNI.UsageException; +import org.fusesource.hawtjni.generator.util.FileSupport; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.InputSource; + +/** + * + * @author Hiram Chirino + */ +public class MacGenerator { + String[] xmls; + Document[] documents; + String outputDir, mainClassName; + String delimiter = System.getProperty("line.separator"); + PrintStream out; + + public MacGenerator() { + } + + static void list(File path, ArrayList list) { + if (path == null) + return; + File[] frameworks = path.listFiles(); + if (frameworks == null) + return; + for (int i = 0; i < frameworks.length; i++) { + File file = frameworks[i]; + String name = file.getName(); + int index = name.lastIndexOf("."); + if (index != -1) { + String xml = file.getAbsolutePath() + "/Resources/BridgeSupport/" + name.substring(0, index) + "Full.bridgesupport"; + if (new File(xml).exists()) { + list.add(xml); + } + } + } + } + + int getLevel(Node node) { + int level = 0; + while (node != null) { + level++; + node = node.getParentNode(); + } + return level; + } + + void merge(Document document, Document extraDocument) { + if (extraDocument == null) + return; + + /* Build a lookup table for extraDocument */ + HashMap extras = new HashMap(); + buildLookup(extraDocument, extras); + + /* + * Merge attributes on existing elements building a lookup table for + * document + */ + HashMap lookup = new HashMap(); + merge(document, extras, lookup); + + /* + * Merge new elements. Extras at this point contains only elements that + * were not found in the document. + */ + ArrayList sortedNodes = Collections.list(Collections.enumeration(extras.values())); + Collections.sort(sortedNodes, new Comparator() { + public int compare(Node arg0, Node arg1) { + int compare = getLevel(arg0) - getLevel(arg1); + if (compare == 0) { + return (arg0).getNodeName().compareTo((arg1).getNodeName()); + } + return compare; + } + }); + String delimiter = System.getProperty("line.separator"); + for (Iterator iterator = sortedNodes.iterator(); iterator.hasNext();) { + Node node = iterator.next(); + String name = node.getNodeName(); + if ("arg".equals(name) || "retval".equals(name)) { + if (!sortedNodes.contains(node.getParentNode())) + continue; + } + Node parent = lookup.get(getKey(node.getParentNode())); + Element element = document.createElement(node.getNodeName()); + String text = parent.getChildNodes().getLength() == 0 ? delimiter : ""; + for (int i = 0, level = getLevel(parent) - 1; i < level; i++) { + text += " "; + } + parent.appendChild(document.createTextNode(text)); + parent.appendChild(element); + parent.appendChild(document.createTextNode(delimiter)); + NamedNodeMap attributes = node.getAttributes(); + for (int j = 0, length = attributes.getLength(); j < length; j++) { + Node attr = (Node) attributes.item(j); + element.setAttribute(attr.getNodeName(), attr.getNodeValue()); + } + lookup.put(getKey(element), element); + } + } + + public void generate(ProgressMonitor progress) throws UsageException { + if (progress != null) { + progress.setTotal(3); + progress.setMessage("extra attributes..."); + } + generateExtraAttributes(); + if (progress != null) { + progress.step(); + progress.setMessage(mainClassName); + } + generateMainClass(); + if (progress != null) { + progress.step(); + progress.setMessage("classes..."); + } + generateClasses(); + if (progress != null) { + progress.step(); + progress.setMessage("Done."); + } + } + + + String fixDelimiter(String str) { + if (delimiter.equals("\n")) + return str; + int index = 0, length = str.length(); + StringBuffer buffer = new StringBuffer(); + while (index != -1) { + int start = index; + index = str.indexOf('\n', start); + if (index == -1) { + buffer.append(str.substring(start, length)); + } else { + buffer.append(str.substring(start, index)); + buffer.append(delimiter); + index++; + } + } + return buffer.toString(); + } + + void generateMethods(String className, ArrayList methods) { + for (Node method : methods) { + NamedNodeMap mthAttributes = method.getAttributes(); + String sel = mthAttributes.getNamedItem("selector").getNodeValue(); + out("public "); + boolean isStatic = isStatic(method); + if (isStatic) + out("static "); + Node returnNode = getReturnNode(method.getChildNodes()); + if (getType(returnNode).equals("void")) + returnNode = null; + String returnType = "", returnType64 = ""; + if (returnNode != null) { + String type = returnType = getJavaType(returnNode), type64 = returnType64 = getJavaType64(returnNode); + out(type); + if (!type.equals(type64)) { + out(" /*"); + out(type64); + out("*/"); + } + out(" "); + } else { + out("void "); + } + String methodName = sel; + if (isUnique(method, methods)) { + int index = methodName.indexOf(":"); + if (index != -1) + methodName = methodName.substring(0, index); + } else { + // TODO improve this selector + methodName = methodName.replaceAll(":", "_"); + if (isStatic) + methodName = "static_" + methodName; + } + out(methodName); + out("("); + NodeList params = method.getChildNodes(); + boolean first = true; + for (int k = 0; k < params.getLength(); k++) { + Node param = params.item(k); + if ("arg".equals(param.getNodeName())) { + NamedNodeMap paramAttributes = param.getAttributes(); + if (!first) + out(", "); + String type = getJavaType(param), type64 = getJavaType64(param); + out(type); + if (!type.equals(type64)) { + out(" /*"); + out(type64); + out("*/"); + } + first = false; + out(" "); + String paramName = paramAttributes.getNamedItem("name").getNodeValue(); + if (paramName.length() == 0) + paramName = "arg" + paramAttributes.getNamedItem("index").getNodeValue(); + if (paramName.equals("boolean")) + paramName = "b"; + out(paramName); + } + } + out(") {"); + outln(); + if (returnNode != null && isStruct(returnNode)) { + out("\t"); + out(returnType); + out(" result = new "); + out(returnType); + out("();"); + outln(); + out("\tOS.objc_msgSend_stret(result, "); + } else if (returnNode != null && isBoolean(returnNode)) { + out("\treturn "); + out("OS.objc_msgSend_bool("); + } else if (returnNode != null && isFloatingPoint(returnNode)) { + out("\treturn "); + if (returnType.equals("float")) + out("(float)"); + out("OS.objc_msgSend_fpret("); + } else if (returnNode != null && isObject(returnNode)) { + out("\tint /*long*/ result = OS.objc_msgSend("); + } else { + if (returnNode != null) { + out("\treturn "); + if ((returnType.equals("int") && returnType64.equals("int")) || !returnType.equals("int")) { + out("("); + out(returnType); + out(")"); + } + if (returnType.equals("int") && returnType64.equals("int")) { + out("/*64*/"); + } + } else { + out("\t"); + } + out("OS.objc_msgSend("); + } + if (isStatic) { + out("OS.class_"); + out(className); + } else { + out("this.id"); + } + out(", OS."); + out(getSelConst(sel)); + first = false; + for (int k = 0; k < params.getLength(); k++) { + Node param = params.item(k); + if ("arg".equals(param.getNodeName())) { + NamedNodeMap paramAttributes = param.getAttributes(); + if (!first) + out(", "); + first = false; + String paramName = paramAttributes.getNamedItem("name").getNodeValue(); + if (paramName.length() == 0) + paramName = "arg" + paramAttributes.getNamedItem("index").getNodeValue(); + if (paramName.equals("boolean")) + paramName = "b"; + if (isObject(param)) { + out(paramName); + out(" != null ? "); + out(paramName); + out(".id : 0"); + } else { + out(paramName); + } + } + } + out(")"); + out(";"); + outln(); + if (returnNode != null && isObject(returnNode)) { + if (!isStatic && returnType.equals(className)) { + out("\treturn result == this.id ? this : (result != 0 ? new "); + out(returnType); + out("(result) : null);"); + } else { + out("\treturn result != 0 ? new "); + NamedNodeMap attributes = returnNode.getAttributes(); + Node hawtjni_alloc = attributes.getNamedItem("hawtjni_alloc"); + if (hawtjni_alloc != null && hawtjni_alloc.getNodeValue().equals("true")) { + out(className); + } else { + out(returnType); + } + out("(result) : null;"); + } + outln(); + } else if (returnNode != null && isStruct(returnNode)) { + out("\treturn result;"); + outln(); + } + out("}"); + outln(); + outln(); + } + } + + void generateExtraMethods(String className) { + /* Empty constructor */ + out("public "); + out(className); + out("() {"); + outln(); + out("\tsuper();"); + outln(); + out("}"); + outln(); + outln(); + /* pointer constructor */ + out("public "); + out(className); + out("(int /*long*/ id) {"); + outln(); + out("\tsuper(id);"); + outln(); + out("}"); + outln(); + outln(); + /* object constructor */ + out("public "); + out(className); + out("(id id) {"); + outln(); + out("\tsuper(id);"); + outln(); + out("}"); + outln(); + outln(); + /* NSObject helpers */ + if (className.equals("NSObject")) { + out("public NSObject alloc() {"); + outln(); + out("\tthis.id = OS.objc_msgSend(objc_getClass(), OS.sel_alloc);"); + outln(); + out("\treturn this;"); + outln(); + out("}"); + outln(); + outln(); + } + /* NSString helpers */ + if (className.equals("NSString")) { + /* Get java string */ + out("public String getString() {"); + outln(); + out("\tchar[] buffer = new char[(int)/*64*/length()];"); + outln(); + out("\tgetCharacters(buffer);"); + outln(); + out("\treturn new String(buffer);"); + outln(); + out("}"); + outln(); + outln(); + /* create NSString */ + out("public NSString initWithString(String str) {"); + outln(); + out("\tchar[] buffer = new char[str.length()];"); + outln(); + out("\tstr.getChars(0, buffer.length, buffer, 0);"); + outln(); + out("\treturn initWithCharacters(buffer, buffer.length);"); + outln(); + out("}"); + outln(); + outln(); + out("public static NSString stringWith(String str) {"); + outln(); + out("\tchar[] buffer = new char[str.length()];"); + outln(); + out("\tstr.getChars(0, buffer.length, buffer, 0);"); + outln(); + out("\treturn stringWithCharacters(buffer, buffer.length);"); + outln(); + out("}"); + outln(); + outln(); + } + } + + static class NodeEntry { + private final Node parent; + private final ArrayList children; + + public NodeEntry(Node parent, ArrayList children) { + this.parent = parent; + this.children = children; + } + } + + TreeMap getGeneratedClasses() { + TreeMap classes = new TreeMap(); + for (int x = 0; x < xmls.length; x++) { + Document document = documents[x]; + if (document == null) + continue; + NodeList list = document.getDocumentElement().getChildNodes(); + for (int i = 0; i < list.getLength(); i++) { + Node node = list.item(i); + if ("class".equals(node.getNodeName()) && getGen(node)) { + ArrayList methods; + String name = node.getAttributes().getNamedItem("name").getNodeValue(); + NodeEntry clazz = classes.get(name); + if (clazz == null) { + methods = new ArrayList(); + classes.put(name, new NodeEntry(node, methods)); + } else { + methods = clazz.children; + } + NodeList methodList = node.getChildNodes(); + for (int j = 0; j < methodList.getLength(); j++) { + Node method = methodList.item(j); + if ("method".equals(method.getNodeName()) && getGen(method)) { + methods.add(method); + } + } + } + } + } + return classes; + } + + void copyClassMethodsDown(final Map classes) { + ArrayList sortedClasses = Collections.list(Collections.enumeration(classes.values())); + Collections.sort(sortedClasses, new Comparator() { + int getHierarchyLevel(Node node) { + String superclass = getSuperclassName(node); + int level = 0; + while (!superclass.equals("id")) { + level++; + superclass = getSuperclassName(classes.get(superclass).parent); + } + return level; + } + + public int compare(NodeEntry arg0, NodeEntry arg1) { + return getHierarchyLevel(arg0.parent) - getHierarchyLevel(arg1.parent); + } + }); + for (NodeEntry clazz : sortedClasses) { + Node node = (Node) clazz.parent; + ArrayList methods = (ArrayList) clazz.children; + NodeEntry superclass = classes.get(getSuperclassName(node)); + if (superclass != null) { + for (Node method : superclass.children) { + if (isStatic(method)) { + methods.add(method); + } + } + } + } + } + + String getSuperclassName(Node node) { + NamedNodeMap attributes = node.getAttributes(); + Node superclass = attributes.getNamedItem("hawtjni_superclass"); + if (superclass != null) { + return superclass.getNodeValue(); + } else { + Node name = attributes.getNamedItem("name"); + if (name.getNodeValue().equals("NSObject")) { + return "id"; + } else { + return "NSObject"; + } + } + } + + void generateClasses() { + TreeMap classes = getGeneratedClasses(); + copyClassMethodsDown(classes); + + Set classNames = classes.keySet(); + for (Iterator iterator = classNames.iterator(); iterator.hasNext();) { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + this.out = new PrintStream(out); + +// out(fixDelimiter(metaData.getCopyright())); + + String className = iterator.next(); + NodeEntry clazz = classes.get(className); + Node node = clazz.parent; + ArrayList methods = clazz.children; + out("package "); + String packageName = getPackageName(mainClassName); + out(packageName); + out(";"); + outln(); + outln(); + out("public class "); + out(className); + out(" extends "); + out(getSuperclassName(node)); + out(" {"); + outln(); + outln(); + generateExtraMethods(className); + generateMethods(className, methods); + out("}"); + outln(); + + String fileName = outputDir + packageName.replace('.', '/') + "/" + className + ".java"; + try { + out.flush(); + if (out.size() > 0) { + FileSupport.write(out.toByteArray(), new File(fileName)); + } + } catch (Exception e) { + System.out.println("Problem"); + e.printStackTrace(System.out); + } + out = null; + } + } + + void generateExtraAttributes() { + Document[] documents = getDocuments(); + for (int x = 0; x < xmls.length; x++) { + Document document = documents[x]; + if (document == null || !getGen(document.getDocumentElement())) + continue; + saveExtraAttributes(xmls[x], document); + } + } + + void generateMainClass() { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + this.out = new PrintStream(out); + + String header = "", footer = ""; + String fileName = outputDir + mainClassName.replace('.', '/') + ".java"; + FileInputStream is = null; + try { + InputStreamReader input = new InputStreamReader(new BufferedInputStream(is = new FileInputStream(fileName))); + StringBuffer str = new StringBuffer(); + char[] buffer = new char[4096]; + int read; + while ((read = input.read(buffer)) != -1) { + str.append(buffer, 0, read); + } + String section = "/** This section is auto generated */"; + int start = str.indexOf(section) + section.length(); + int end = str.indexOf(section, start); + header = str.substring(0, start); + footer = str.substring(end); + } catch (IOException e) { + } finally { + try { + if (is != null) + is.close(); + } catch (IOException e) { + } + } + + out(header); + outln(); + outln(); + + out("/** Custom callbacks */"); + outln(); + generateCustomCallbacks(); + outln(); + out("/** Classes */"); + outln(); + generateClassesConst(); + outln(); + out("/** Protocols */"); + outln(); + generateProtocolsConst(); + outln(); + out("/** Selectors */"); + outln(); + generateSelectorsConst(); + outln(); + out("/** Constants */"); + outln(); + generateEnums(); + outln(); + out("/** Globals */"); + outln(); + generateConstants(); + outln(); + out("/** Functions */"); + outln(); + outln(); + generateFunctions(); + outln(); + out("/** Super Sends */"); + outln(); + generateSends(true); + outln(); + out("/** Sends */"); + outln(); + generateSends(false); + outln(); + generateStructNatives(); + + outln(); + out(footer); + try { + out.flush(); + if (out.size() > 0) { + FileSupport.write(out.toByteArray(), new File(fileName)); + + } + } catch (Exception e) { + System.out.println("Problem"); + e.printStackTrace(System.out); + } + } + + public Document[] getDocuments() { + if (documents == null) { + String[] xmls = getXmls(); + documents = new Document[xmls.length]; + for (int i = 0; i < xmls.length; i++) { + String xmlPath = xmls[i]; + Document document = documents[i] = getDocument(xmlPath); + if (document == null) + continue; + if (mainClassName != null && outputDir != null) { + String packageName = getPackageName(mainClassName); + String extrasPath = outputDir + packageName.replace('.', '/') + "/" + getFileName(xmlPath) + ".extras"; + merge(document, getDocument(extrasPath)); + } + } + } + return documents; + } + + public String[] getXmls() { + if (xmls == null || xmls.length == 0) { + ArrayList array = new ArrayList(); + list(new File("/System/Library/Frameworks"), array); + list(new File("/System/Library/Frameworks/CoreServices.framework/Frameworks"), array); + list(new File("/System/Library/Frameworks/ApplicationServices.framework/Frameworks"), array); + Collections.sort(array, new Comparator() { + public int compare(String o1, String o2) { + return new File(o1).getName().compareTo(new File(o2).getName()); + } + }); + xmls = array.toArray(new String[array.size()]); + } + return xmls; + } + + void saveExtraAttributes(String xmlPath, Document document) { + try { + String packageName = getPackageName(mainClassName); + String fileName = outputDir + packageName.replace('.', '/') + "/" + getFileName(xmlPath) + ".extras"; + ByteArrayOutputStream out = new ByteArrayOutputStream(); + DOMWriter writer = new DOMWriter(new PrintStream(out)); + String[] names = getIDAttributeNames(); + String[] filter = new String[names.length + 2]; + filter[0] = "class_method"; + filter[1] = "hawtjni_.*"; + System.arraycopy(names, 0, filter, 2, names.length); + writer.setAttributeFilter(filter); + writer.setNodeFilter("hawtjni_"); + writer.print(document); + if (out.size() > 0) { + FileSupport.write(out.toByteArray(), new File(fileName)); + } + } catch (Exception e) { + System.out.println("Problem"); + e.printStackTrace(System.out); + } + } + + public void setOutputDir(String dir) { + if (dir != null) { + if (!dir.endsWith("\\") && !dir.endsWith("/")) { + dir += "/"; + } + } + this.outputDir = dir; + } + + public void setXmls(String[] xmls) { + this.xmls = xmls; + this.documents = null; + } + + public void setMainClass(String mainClassName) { + this.mainClassName = mainClassName; + } + + Document getDocument(String xmlPath) { + try { + InputStream is = null; + if (xmlPath.indexOf(File.separatorChar) == -1) + is = getClass().getResourceAsStream(xmlPath); + if (is == null) + is = new BufferedInputStream(new FileInputStream(xmlPath)); + if (is != null) + return DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(is)); + } catch (Exception e) { + // e.printStackTrace(); + } + return null; + } + + public String[] getExtraAttributeNames(Node node) { + String name = node.getNodeName(); + if (name.equals("method")) { + return new String[] { "hawtjni_gen_super_msgSend", "hawtjni_gen_custom_callback" }; + } else if (name.equals("function")) { + NamedNodeMap attribs = node.getAttributes(); + if (attribs != null && attribs.getNamedItem("variadic") != null) { + return new String[] { "hawtjni_variadic_count", "hawtjni_variadic_java_types" }; + } + } else if (name.equals("class")) { + return new String[] { "hawtjni_superclass" }; + } else if (name.equals("retval")) { + return new String[] { "hawtjni_java_type", "hawtjni_java_type64", "hawtjni_alloc" }; + } else if (name.equals("arg")) { + return new String[] { "hawtjni_java_type", "hawtjni_java_type64" }; + } + return new String[0]; + } + + public String getFileName(String xmlPath) { + File file = new File(xmlPath); + return file.getName(); + } + + String getKey(Node node) { + StringBuffer buffer = new StringBuffer(); + while (node != null) { + if (buffer.length() > 0) + buffer.append("_"); + String name = node.getNodeName(); + StringBuffer key = new StringBuffer(name); + Node nameAttrib = getIDAttribute(node); + if (nameAttrib != null) { + key.append("-"); + key.append(nameAttrib.getNodeValue()); + } + NamedNodeMap attributes = node.getAttributes(); + if (attributes != null) { + boolean isStatic = attributes.getNamedItem("class_method") != null; + if (isStatic) + key.append("-static"); + } + buffer.append(key.reverse()); + node = node.getParentNode(); + } + buffer.reverse(); + return buffer.toString(); + } + + public Node getIDAttribute(Node node) { + NamedNodeMap attributes = node.getAttributes(); + if (attributes == null) + return null; + String[] names = getIDAttributeNames(); + for (int i = 0; i < names.length; i++) { + Node nameAttrib = attributes.getNamedItem(names[i]); + if (nameAttrib != null) + return nameAttrib; + } + return null; + } + + public String[] getIDAttributeNames() { + return new String[] { "name", "selector", "path", }; + } + + void merge(Node node, HashMap extras, HashMap docLookup) { + NodeList list = node.getChildNodes(); + for (int i = 0; i < list.getLength(); i++) { + Node childNode = list.item(i); + if (childNode.getNodeType() == Node.ELEMENT_NODE) { + String key = getKey(childNode); + if (docLookup != null && docLookup.get(key) == null) { + docLookup.put(key, childNode); + } + Node extra = extras.remove(key); + if (extra != null) { + NamedNodeMap attributes = extra.getAttributes(); + for (int j = 0, length = attributes.getLength(); j < length; j++) { + Node attr = (Node) attributes.item(j); + String name = attr.getNodeName(); + if (name.startsWith("hawtjni_")) { + ((Element) childNode).setAttribute(name, attr.getNodeValue()); + } + } + } + } + merge(childNode, extras, docLookup); + } + } + + void out(String str) { + PrintStream out = this.out; + if (out == null) + out = System.out; + out.print(str); + } + + void outln() { + PrintStream out = this.out; + if (out == null) + out = System.out; + out.println(); + } + + void generateConstants() { + for (int x = 0; x < xmls.length; x++) { + Document document = documents[x]; + if (document == null) + continue; + NodeList list = document.getDocumentElement().getChildNodes(); + for (int i = 0; i < list.getLength(); i++) { + Node node = list.item(i); + if ("constant".equals(node.getNodeName())) { + if (getGen(node)) { + NamedNodeMap attributes = node.getAttributes(); + String constName = attributes.getNamedItem("name").getNodeValue(); + out("/** @method flags=const */"); + outln(); + out("public static final native "); + String type = getType(node), type64 = getType64(node); + out(type); + if (!type.equals(type64)) { + out(" /*"); + out(type64); + out("*/"); + } + out(" "); + out(constName); + out("();"); + outln(); + if (attributes.getNamedItem("declared_type").getNodeValue().equals("NSString*")) { + out("public static final NSString "); + out(constName); + out(" = new NSString("); + out(constName); + out("());"); + outln(); + } + } + } + } + } + } + + void generateEnums() { + for (int x = 0; x < xmls.length; x++) { + Document document = documents[x]; + if (document == null) + continue; + NodeList list = document.getDocumentElement().getChildNodes(); + for (int i = 0; i < list.getLength(); i++) { + Node node = list.item(i); + if ("enum".equals(node.getNodeName())) { + if (getGen(node)) { + NamedNodeMap attributes = node.getAttributes(); + Node valueNode = attributes.getNamedItem("value"); + if (valueNode != null) { + String value = valueNode.getNodeValue(); + out("public static final "); + boolean isLong = false; + if (value.indexOf('.') != -1) { + out("double "); + } else { + try { + Integer.parseInt(value); + out("int "); + } catch (NumberFormatException e) { + isLong = true; + out("long "); + } + } + out(attributes.getNamedItem("name").getNodeValue()); + out(" = "); + out(value); + if (isLong && !value.endsWith("L")) + out("L"); + out(";"); + outln(); + } + } + } + } + } + } + + boolean getGen(Node node) { + NamedNodeMap attributes = node.getAttributes(); + if (attributes == null) + return false; + Node gen = attributes.getNamedItem("hawtjni_gen"); + return gen != null && !gen.getNodeValue().equals("false"); + } + + boolean getGenSuper(Node node) { + NamedNodeMap attributes = node.getAttributes(); + if (attributes == null) + return false; + Node gen = attributes.getNamedItem("hawtjni_gen_super_msgSend"); + return gen != null && !gen.getNodeValue().equals("false"); + } + + boolean getGenCallback(Node node) { + NamedNodeMap attributes = node.getAttributes(); + if (attributes == null) + return false; + Node gen = attributes.getNamedItem("hawtjni_gen_custom_callback"); + return gen != null && !gen.getNodeValue().equals("false"); + } + + boolean isStatic(Node node) { + NamedNodeMap attributes = node.getAttributes(); + Node isStatic = attributes.getNamedItem("class_method"); + return isStatic != null && isStatic.getNodeValue().equals("true"); + } + + boolean isStruct(Node node) { + NamedNodeMap attributes = node.getAttributes(); + String code = attributes.getNamedItem("type").getNodeValue(); + return code.startsWith("{"); + } + + boolean isFloatingPoint(Node node) { + NamedNodeMap attributes = node.getAttributes(); + String code = attributes.getNamedItem("type").getNodeValue(); + return code.equals("f") || code.equals("d"); + } + + boolean isObject(Node node) { + NamedNodeMap attributes = node.getAttributes(); + String code = attributes.getNamedItem("type").getNodeValue(); + return code.equals("@"); + } + + boolean isBoolean(Node node) { + NamedNodeMap attributes = node.getAttributes(); + String code = attributes.getNamedItem("type").getNodeValue(); + return code.equals("B"); + } + + void buildLookup(Node node, HashMap table) { + NodeList list = node.getChildNodes(); + for (int i = 0; i < list.getLength(); i++) { + Node childNode = list.item(i); + if (childNode.getNodeType() == Node.ELEMENT_NODE) { + String key = getKey(childNode); + if (table.get(key) == null) + table.put(key, childNode); + buildLookup(childNode, table); + } + } + } + + boolean isUnique(Node method, ArrayList methods) { + String methodName = method.getAttributes().getNamedItem("selector").getNodeValue(); + String signature = ""; + NodeList params = method.getChildNodes(); + for (int k = 0; k < params.getLength(); k++) { + Node param = params.item(k); + if ("arg".equals(param.getNodeName())) { + signature += getJavaType(param); + } + } + int index = methodName.indexOf(":"); + if (index != -1) + methodName = methodName.substring(0, index); + for (Node node : methods) { + NamedNodeMap attributes = node.getAttributes(); + Node otherSel = null; + if (attributes != null) + otherSel = attributes.getNamedItem("selector"); + if (node != method && otherSel != null) { + String otherName = otherSel.getNodeValue(); + index = otherName.indexOf(":"); + if (index != -1) + otherName = otherName.substring(0, index); + if (methodName.equals(otherName)) { + NodeList otherParams = node.getChildNodes(); + String otherSignature = ""; + for (int k = 0; k < otherParams.getLength(); k++) { + Node param = otherParams.item(k); + if ("arg".equals(param.getNodeName())) { + otherSignature += getJavaType(param); + } + } + if (signature.equals(otherSignature)) { + return false; + } + } + } + } + return true; + } + + void generateSelectorsConst() { + TreeSet set = new TreeSet(); + for (int x = 0; x < xmls.length; x++) { + Document document = documents[x]; + if (document == null) + continue; + NodeList list = document.getDocumentElement().getChildNodes(); + for (int i = 0; i < list.getLength(); i++) { + Node node = list.item(i); + if ("class".equals(node.getNodeName()) || "informal_protocol".equals(node.getNodeName())) { + if (getGen(node)) { + NodeList methods = node.getChildNodes(); + for (int j = 0; j < methods.getLength(); j++) { + Node method = methods.item(j); + if (getGen(method)) { + NamedNodeMap mthAttributes = method.getAttributes(); + String sel = mthAttributes.getNamedItem("selector").getNodeValue(); + set.add(sel); + } + } + } + } + } + } + set.add("alloc"); + for (Iterator iterator = set.iterator(); iterator.hasNext();) { + String sel = iterator.next(); + String selConst = getSelConst(sel); + out("public static final int /*long*/ "); + out(selConst); + out(" = "); + out("sel_registerName(\""); + out(sel); + out("\");"); + outln(); + } + } + + void generateStructNatives() { + TreeSet set = new TreeSet(); + for (int x = 0; x < xmls.length; x++) { + Document document = documents[x]; + if (document == null) + continue; + NodeList list = document.getDocumentElement().getChildNodes(); + for (int i = 0; i < list.getLength(); i++) { + Node node = list.item(i); + if ("struct".equals(node.getNodeName()) && getGen(node)) { + set.add(getIDAttribute(node).getNodeValue()); + } + } + } + out("/** Sizeof natives */"); + outln(); + for (Iterator iterator = set.iterator(); iterator.hasNext();) { + String struct = iterator.next(); + out("public static final native int "); + out(struct); + out("_sizeof();"); + outln(); + } + outln(); + out("/** Memmove natives */"); + outln(); + outln(); + for (Iterator iterator = set.iterator(); iterator.hasNext();) { + String struct = iterator.next(); + out("/**"); + outln(); + out(" * @param dest cast=(void *),flags=no_in critical"); + outln(); + out(" * @param src cast=(void *),flags=critical"); + // out(" * @param src cast=(void *),flags=no_out critical"); + outln(); + out(" */"); + outln(); + out("public static final native void memmove("); + out("int /*long*/ dest, "); + out(struct); + out(" src, int /*long*/ size);"); + outln(); + out("/**"); + outln(); + out(" * @param dest cast=(void *),flags=no_in critical"); + outln(); + out(" * @param src cast=(void *),flags=critical"); + // out(" * @param src cast=(void *),flags=no_out critical"); + outln(); + out(" */"); + outln(); + out("public static final native void memmove("); + out(struct); + out(" dest, int /*long*/ src, int /*long*/ size);"); + outln(); + } + } + + String buildSend(Node method, boolean tags, boolean only64, boolean superCall) { + Node returnNode = getReturnNode(method.getChildNodes()); + StringBuffer buffer = new StringBuffer(); + buffer.append("public static final native "); + if (returnNode != null && isStruct(returnNode)) { + buffer.append("void "); + buffer.append(superCall ? "objc_msgSendSuper_stret" : "objc_msgSend_stret"); + buffer.append("("); + buffer.append(getJavaType(returnNode)); + buffer.append(" result, "); + } else if (returnNode != null && isFloatingPoint(returnNode)) { + buffer.append("double "); + buffer.append(superCall ? "objc_msgSendSuper_fpret" : "objc_msgSend_fpret"); + buffer.append("("); + } else if (returnNode != null && isBoolean(returnNode)) { + buffer.append("boolean "); + buffer.append(superCall ? "objc_msgSendSuper_bool" : "objc_msgSend_bool"); + buffer.append("("); + } else { + if (only64) { + buffer.append("long"); + } else { + if (tags) { + buffer.append("int /*long*/"); + } else { + buffer.append("int"); + } + } + buffer.append(" "); + buffer.append(superCall ? "objc_msgSendSuper" : "objc_msgSend"); + buffer.append("("); + } + if (superCall) { + if (only64) { + buffer.append("objc_super superId, long sel"); + } else { + if (tags) { + buffer.append("objc_super superId, int /*long*/ sel"); + } else { + buffer.append("objc_super superId, int sel"); + } + } + } else { + if (only64) { + buffer.append("long id, long sel"); + } else { + if (tags) { + buffer.append("int /*long*/ id, int /*long*/ sel"); + } else { + buffer.append("int id, int sel"); + } + } + } + NodeList params = method.getChildNodes(); + boolean first = false; + int count = 0; + for (int k = 0; k < params.getLength(); k++) { + Node param = params.item(k); + if ("arg".equals(param.getNodeName())) { + if (!first) + buffer.append(", "); + if (isStruct(param)) { + buffer.append(getJavaType(param)); + } else { + String type = getType(param), type64 = getType64(param); + buffer.append(only64 ? type64 : type); + if (!only64 && tags && !type.equals(type64)) { + buffer.append(" /*"); + buffer.append(type64); + buffer.append("*/"); + } + } + first = false; + buffer.append(" arg"); + buffer.append(String.valueOf(count++)); + } + } + buffer.append(");"); + return buffer.toString(); + } + + String getCType(Node node) { + NamedNodeMap attributes = node.getAttributes(); + return attributes.getNamedItem("declared_type").getNodeValue(); + } + + Node findNSObjectMethod(Node method) { + NamedNodeMap methodAttributes = method.getAttributes(); + String selector = methodAttributes.getNamedItem("selector").getNodeValue(); + NodeList list = method.getParentNode().getParentNode().getChildNodes(); + for (int i = 0; i < list.getLength(); i++) { + Node cls = list.item(i); + if ("class".equals(cls.getNodeName())) { + NamedNodeMap classAttributes = cls.getAttributes(); + if ("NSObject".equals(classAttributes.getNamedItem("name").getNodeValue())) { + NodeList methods = cls.getChildNodes(); + for (int j = 0; j < methods.getLength(); j++) { + Node mth = methods.item(j); + if ("method".equals(mth.getNodeName())) { + NamedNodeMap mthAttributes = mth.getAttributes(); + if (selector.equals(mthAttributes.getNamedItem("selector").getNodeValue())) { + return mth; + } + } + } + } + } + } + return null; + } + + void generateCustomCallbacks() { + TreeMap set = new TreeMap(); + for (int x = 0; x < xmls.length; x++) { + Document document = documents[x]; + if (document == null) + continue; + NodeList list = document.getDocumentElement().getChildNodes(); + for (int i = 0; i < list.getLength(); i++) { + Node node = list.item(i); + if (("class".equals(node.getNodeName()) || "informal_protocol".equals(node.getNodeName())) && getGen(node)) { + NodeList methods = node.getChildNodes(); + for (int j = 0; j < methods.getLength(); j++) { + Node method = methods.item(j); + if ("method".equals(method.getNodeName()) && getGen(method) && getGenCallback(method)) { + NamedNodeMap mthAttributes = method.getAttributes(); + String sel = mthAttributes.getNamedItem("selector").getNodeValue(); + set.put(sel, method); + } + } + } + } + } + for (Iterator iterator = set.keySet().iterator(); iterator.hasNext();) { + String key = iterator.next(); + Node method = set.get(key); + if ("informal_protocol".equals(method.getParentNode().getNodeName())) { + method = findNSObjectMethod(method); + if (method == null) + continue; + } + String nativeMth = key.replaceAll(":", "_"); + out("/** @method callback_types="); + Node returnNode = getReturnNode(method.getChildNodes()); + out(returnNode == null ? "void" : getCType(returnNode)); + out(";id;SEL;"); + NodeList params = method.getChildNodes(); + for (int k = 0; k < params.getLength(); k++) { + Node param = params.item(k); + if ("arg".equals(param.getNodeName())) { + out(getCType(param)); + out(";"); + } + } + out(",callback_flags="); + out(returnNode != null && isStruct(returnNode) ? "struct" : "none"); + out(";none;none;"); + for (int k = 0; k < params.getLength(); k++) { + Node param = params.item(k); + if ("arg".equals(param.getNodeName())) { + out(isStruct(param) ? "struct" : "none"); + out(";"); + } + } + out(" */"); + outln(); + out("public static final native int /*long*/ CALLBACK_"); + out(nativeMth); + out("(int /*long*/ func);"); + outln(); + } + } + + void generateSends(boolean superCall) { + TreeMap set = new TreeMap(); + TreeMap set64 = new TreeMap(); + for (int x = 0; x < xmls.length; x++) { + Document document = documents[x]; + if (document == null) + continue; + NodeList list = document.getDocumentElement().getChildNodes(); + for (int i = 0; i < list.getLength(); i++) { + Node node = list.item(i); + if ("class".equals(node.getNodeName()) && getGen(node)) { + NodeList methods = node.getChildNodes(); + for (int j = 0; j < methods.getLength(); j++) { + Node method = methods.item(j); + if ("method".equals(method.getNodeName()) && getGen(method) && (!superCall || getGenSuper(method))) { + String code = buildSend(method, false, false, superCall); + String code64 = buildSend(method, false, true, superCall); + if (set.get(code) == null) { + set.put(code, method); + } + if (set64.get(code64) == null) { + set64.put(code64, method); + } + } + } + } + } + } + outln(); + TreeMap tagsSet = new TreeMap(); + for (Iterator iterator = set.keySet().iterator(); iterator.hasNext();) { + String key = iterator.next(); + Node method = set.get(key); + String tagCode = buildSend(method, false, true, superCall); + if (set64.get(tagCode) != null) { + tagsSet.put(key, method); + iterator.remove(); + set64.remove(tagCode); + } + } + TreeMap all = new TreeMap(); + for (Iterator iterator = tagsSet.keySet().iterator(); iterator.hasNext();) { + String key = iterator.next(); + Node method = tagsSet.get(key); + all.put(buildSend(method, true, false, superCall), method); + } + for (Iterator iterator = set.keySet().iterator(); iterator.hasNext();) { + String key = iterator.next(); + all.put(key, set.get(key)); + } + for (Iterator iterator = set64.keySet().iterator(); iterator.hasNext();) { + String key = iterator.next(); + all.put(key, set64.get(key)); + } + for (Iterator iterator = all.keySet().iterator(); iterator.hasNext();) { + String key = iterator.next(); + Node method = all.get(key); + NodeList params = method.getChildNodes(); + ArrayList tags = new ArrayList(); + int count = 0; + for (int k = 0; k < params.getLength(); k++) { + Node param = params.item(k); + if ("arg".equals(param.getNodeName())) { + if (isStruct(param)) { + tags.add(" * @param arg" + count + " flags=struct"); + } + count++; + } + } + out("/**"); + if (tags.size() > 0) { + outln(); + out(" *"); + } + out(" @method flags=cast"); + if (tags.size() > 0) + outln(); + for (String tag : tags) { + out(tag); + outln(); + } + out(" */"); + outln(); + out(key.toString()); + outln(); + } + } + + String getSelConst(String sel) { + return "sel_" + sel.replaceAll(":", "_"); + } + + void generateClassesConst() { + TreeSet set = new TreeSet(); + for (int x = 0; x < xmls.length; x++) { + Document document = documents[x]; + if (document == null) + continue; + NodeList list = document.getDocumentElement().getChildNodes(); + for (int i = 0; i < list.getLength(); i++) { + Node node = list.item(i); + if ("class".equals(node.getNodeName())) { + if (getGen(node)) { + NamedNodeMap attributes = node.getAttributes(); + String name = attributes.getNamedItem("name").getNodeValue(); + set.add(name); + } + } + } + } + for (Iterator iterator = set.iterator(); iterator.hasNext();) { + String cls = iterator.next(); + String clsConst = "class_" + cls; + out("public static final int /*long*/ "); + out(clsConst); + out(" = "); + out("objc_getClass(\""); + out(cls); + out("\");"); + outln(); + } + } + + void generateProtocolsConst() { + TreeSet set = new TreeSet(); + for (int x = 0; x < xmls.length; x++) { + Document document = documents[x]; + if (document == null) + continue; + NodeList list = document.getDocumentElement().getChildNodes(); + for (int i = 0; i < list.getLength(); i++) { + Node node = list.item(i); + if ("informal_protocol".equals(node.getNodeName())) { + if (getGen(node)) { + NamedNodeMap attributes = node.getAttributes(); + String name = attributes.getNamedItem("name").getNodeValue(); + set.add(name); + } + } + } + } + for (Iterator iterator = set.iterator(); iterator.hasNext();) { + String cls = iterator.next(); + String clsConst = "protocol_" + cls; + out("public static final int /*long*/ "); + out(clsConst); + out(" = "); + out("objc_getProtocol(\""); + out(cls); + out("\");"); + outln(); + } + } + + String getPackageName(String className) { + int dot = mainClassName.lastIndexOf('.'); + if (dot == -1) + return ""; + return mainClassName.substring(0, dot); + } + + String getClassName(String className) { + int dot = mainClassName.lastIndexOf('.'); + if (dot == -1) + return mainClassName; + return mainClassName.substring(dot + 1); + } + + Node getReturnNode(NodeList list) { + for (int j = 0; j < list.getLength(); j++) { + Node node = list.item(j); + if ("retval".equals(node.getNodeName())) { + return node; + } + } + return null; + } + + String getType(Node node) { + NamedNodeMap attributes = node.getAttributes(); + Node javaType = attributes.getNamedItem("hawtjni_java_type"); + if (javaType != null) + return javaType.getNodeValue(); + String code = attributes.getNamedItem("type").getNodeValue(); + return getType(code, attributes, false); + } + + String getType64(Node node) { + NamedNodeMap attributes = node.getAttributes(); + Node javaType = attributes.getNamedItem("hawtjni_java_type"); + if (javaType != null) { + Node javaType64 = attributes.getNamedItem("hawtjni_java_type64"); + return javaType64 != null ? javaType64.getNodeValue() : javaType.getNodeValue(); + } + Node attrib = attributes.getNamedItem("type"); + String code = attrib.getNodeValue(); + Node attrib64 = attributes.getNamedItem("type64"); + if (attrib64 != null) + code = attrib64.getNodeValue(); + return getType(code, attributes, true); + } + + String getType(String code, NamedNodeMap attributes, boolean is64) { + if (code.equals("c")) + return "byte"; + if (code.equals("i")) + return "int"; + if (code.equals("s")) + return "short"; + if (code.equals("l")) + return "int"; + if (code.equals("q")) + return "long"; + if (code.equals("C")) + return "byte"; + if (code.equals("I")) + return "int"; + if (code.equals("S")) + return "short"; + if (code.equals("L")) + return "int"; + if (code.equals("Q")) + return "long"; + if (code.equals("f")) + return "float"; + if (code.equals("d")) + return "double"; + if (code.equals("B")) + return "boolean"; + if (code.equals("v")) + return "void"; + if (code.equals("*")) + return is64 ? "long" : "int"; + if (code.equals("@")) + return is64 ? "long" : "int"; + if (code.equals("#")) + return is64 ? "long" : "int"; + if (code.equals(":")) + return is64 ? "long" : "int"; + if (code.startsWith("^")) + return is64 ? "long" : "int"; + if (code.startsWith("{")) { + return attributes.getNamedItem("declared_type").getNodeValue(); + } + return "BAD " + code; + } + + String getJNIType(Node node) { + NamedNodeMap attributes = node.getAttributes(); + String code = attributes.getNamedItem("type").getNodeValue(); + if (code.equals("c")) + return "B"; + if (code.equals("i")) + return "I"; + if (code.equals("s")) + return "S"; + if (code.equals("l")) + return "I"; + if (code.equals("q")) + return "J"; + if (code.equals("C")) + return "B"; + if (code.equals("I")) + return "I"; + if (code.equals("S")) + return "S"; + if (code.equals("L")) + return "I"; + if (code.equals("Q")) + return "J"; + if (code.equals("f")) + return "F"; + if (code.equals("d")) + return "D"; + if (code.equals("B")) + return "Z"; + if (code.equals("v")) + return "V"; + if (code.equals("*")) + return "I"; + if (code.equals("@")) + return "I"; + if (code.equals("#")) + return "I"; + if (code.equals(":")) + return "I"; + if (code.startsWith("^")) + return "I"; + if (code.startsWith("[")) + return "BAD " + code; + if (code.startsWith("{")) { + return "BAD " + code; + } + if (code.startsWith("(")) + return "BAD " + code; + return "BAD " + code; + } + + String getJavaType(Node node) { + NamedNodeMap attributes = node.getAttributes(); + Node javaType = attributes.getNamedItem("hawtjni_java_type"); + if (javaType != null) + return javaType.getNodeValue().trim(); + String code = attributes.getNamedItem("type").getNodeValue(); + return getJavaType(code, attributes, false); + } + + String getJavaType64(Node node) { + NamedNodeMap attributes = node.getAttributes(); + Node javaType = attributes.getNamedItem("hawtjni_java_type"); + if (javaType != null) { + Node javaType64 = attributes.getNamedItem("hawtjni_java_type64"); + return javaType64 != null ? javaType64.getNodeValue() : javaType.getNodeValue(); + } + Node attrib = attributes.getNamedItem("type"); + String code = attrib.getNodeValue(); + Node attrib64 = attributes.getNamedItem("type64"); + if (attrib64 != null) + code = attrib64.getNodeValue(); + return getJavaType(code, attributes, true); + } + + String getJavaType(String code, NamedNodeMap attributes, boolean is64) { + if (code.equals("c")) + return "byte"; + if (code.equals("i")) + return "int"; + if (code.equals("s")) + return "short"; + if (code.equals("l")) + return "int"; + if (code.equals("q")) + return "long"; + if (code.equals("C")) + return "byte"; + if (code.equals("I")) + return "int"; + if (code.equals("S")) + return "short"; + if (code.equals("L")) + return "int"; + if (code.equals("Q")) + return "long"; + if (code.equals("f")) + return "float"; + if (code.equals("d")) + return "double"; + if (code.equals("B")) + return "boolean"; + if (code.equals("v")) + return "void"; + if (code.equals("*")) + return is64 ? "long" : "int"; + if (code.equals("#")) + return is64 ? "long" : "int"; + if (code.equals(":")) + return is64 ? "long" : "int"; + if (code.startsWith("^")) + return is64 ? "long" : "int"; + if (code.equals("@")) { + String type = attributes.getNamedItem("declared_type").getNodeValue(); + int index = type.indexOf('*'); + if (index != -1) + type = type.substring(0, index); + index = type.indexOf('<'); + if (index != -1) + type = type.substring(0, index); + return type.trim(); + } + if (code.startsWith("{")) { + return attributes.getNamedItem("declared_type").getNodeValue().trim(); + } + return "BAD " + code; + } + + static String[] split(String str, String separator) { + StringTokenizer tk = new StringTokenizer(str, separator); + ArrayList result = new ArrayList(); + while (tk.hasMoreElements()) { + result.add(tk.nextElement()); + } + return result.toArray(new String[result.size()]); + } + + void generateFunctions() { + for (int x = 0; x < xmls.length; x++) { + Document document = documents[x]; + if (document == null) + continue; + NodeList list = document.getDocumentElement().getChildNodes(); + for (int i = 0; i < list.getLength(); i++) { + Node node = list.item(i); + if ("function".equals(node.getNodeName())) { + if (getGen(node)) { + NamedNodeMap attributes = node.getAttributes(); + String name = attributes.getNamedItem("name").getNodeValue(); + NodeList params = node.getChildNodes(); + int count = 0; + for (int j = 0; j < params.getLength(); j++) { + Node param = params.item(j); + if ("arg".equals(param.getNodeName())) { + count++; + } + } + if (count > 0) { + out("/**"); + outln(); + } + for (int j = 0; j < params.getLength(); j++) { + Node param = params.item(j); + if ("arg".equals(param.getNodeName())) { + NamedNodeMap paramAttributes = param.getAttributes(); + out(" * @param "); + out(paramAttributes.getNamedItem("name").getNodeValue()); + if (isStruct(param)) { + out(" flags=struct"); + } else { + out(" cast="); + Node declaredType = paramAttributes.getNamedItem("declared_type"); + String cast = declaredType.getNodeValue(); + if (!cast.startsWith("(")) + out("("); + out(cast); + if (!cast.endsWith(")")) + out(")"); + } + outln(); + } + } + if (count > 0) { + out(" */"); + outln(); + } + out("public static final native "); + Node returnNode = getReturnNode(node.getChildNodes()); + if (returnNode != null) { + String type = getType(returnNode), type64 = getType64(returnNode); + out(type); + if (!type.equals(type64)) { + out(" /*"); + out(type64); + out("*/"); + } + out(" "); + } else { + out("void "); + } + out(name); + out("("); + params = node.getChildNodes(); + boolean first = true; + for (int j = 0; j < params.getLength(); j++) { + Node param = params.item(j); + if ("arg".equals(param.getNodeName())) { + NamedNodeMap paramAttributes = param.getAttributes(); + if (!first) + out(", "); + first = false; + String type = getType(param), type64 = getType64(param); + out(type); + if (!type.equals(type64)) { + out(" /*"); + out(type64); + out("*/"); + } + out(" "); + out(paramAttributes.getNamedItem("name").getNodeValue()); + } + } + generateVariadics(node); + out(");"); + outln(); + } + } + } + } + } + + void generateVariadics(Node node) { + NamedNodeMap attributes = node.getAttributes(); + Node variadicCount = attributes.getNamedItem("hawtjni_variadic_count"); + if (variadicCount != null) { + Node variadicTypes = attributes.getNamedItem("hawtjni_variadic_java_types"); + String[] types = null; + if (variadicTypes != null) { + types = split(variadicTypes.getNodeValue(), ","); + } + int varCount = 0; + try { + varCount = Integer.parseInt(variadicCount.getNodeValue()); + } catch (NumberFormatException e) { + } + for (int j = 0; j < varCount; j++) { + out(", "); + if (types != null && types.length > j && !types[j].equals("*")) { + out(types[j]); + } else if (types != null && types[types.length - 1].equals("*")) { + out(types[types.length - 2]); + } else { + out("int /*long*/"); + } + out(" varArg"); + out("" + j); + } + } + } + + public static void main(String[] args) { + try { + MacGenerator gen = new MacGenerator(); + gen.setXmls(args); + gen.setOutputDir("../org.eclipse.hawtjni/Eclipse SWT PI/cocoa/"); + gen.setMainClass("org.eclipse.hawtjni.internal.cocoa.OS"); + gen.generate(null); + } catch (Throwable e) { + e.printStackTrace(); + } + } +} diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/MozillaGenerator.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/MozillaGenerator.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/MozillaGenerator.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/MozillaGenerator.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,631 @@ +/******************************************************************************* + * Copyright (C) 2009-2011 FuseSource Corp. + * Copyright (c) 2003, 2006 IBM Corporation and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + *******************************************************************************/ +package org.fusesource.hawtjni.generator; + +import java.io.*; +import java.util.*; + +/** + * Produces the java classes mapping to XPCOM Mozilla objects. + * + * @author Hiram Chirino + */ +public class MozillaGenerator { + + static boolean DEBUG = false; + + FileReader r = null; + FileWriter w = null; + int maxLines = 1000; + int cntLines = 0; + int n = 0; + String[] b = null; + String body = null; + int nMethods = 0; + String uuidName; + String uuidValue; + String className; + String parentName; + String[] constantNames; + String[] constantValues; + String[] methodNames; + String[][] argTypes; + String[][] argNames; + String bodyOrder; + TreeMap> vtbls = new TreeMap>(); + + + // Contains the characters found before a method name + // Useful to extract the method name. e.g. + // NS_IMETHOD QueryInterface(const nsIID & uuid, void * *result) = 0; + // NS_IMETHOD_(nsrefcnt) AddRef(void) = 0; + // method name follows: QueryInterface, AddRef etc. + static String[] BEFORE_METHOD_NAME = { " NS_IMETHOD ", " NS_IMETHOD_(nsrefcnt) ", " NS_IMETHOD_(void *) ", " NS_IMETHOD_(void) ", " NS_IMETHOD_(nsresult) ", + " NS_SCRIPTABLE NS_IMETHOD ", " NS_SCRIPTABLE NS_IMETHOD_(nsrefcnt) ", " NS_SCRIPTABLE NS_IMETHOD_(void *) ", " NS_SCRIPTABLE NS_IMETHOD_(void) ", + " NS_SCRIPTABLE NS_IMETHOD_(nsresult) ", }; + + static String NO_SUPER_CLASS = "SWT_NO_SUPER_CLASS"; + + static String[][] TYPES_C2JAVA = { { "PRBool *", "int[]" }, + { "nsIID &", "nsID" }, + { "nsCID &", "nsID" }, + { "nsCID * *", "int /*long*/" }, // nsID[] not supported by jnigen + { "* *", "int /*long*/[]" }, { "**", "int /*long*/[]" }, { "* &", "int /*long*/[]" }, { "PRUint32 *", "int[]" }, { "PRInt32 *", "int[]" }, { "PRInt64 *", "long[]" }, + { "PRUnichar *", "char[]" }, { "char *", "byte[]" }, { "float *", "float[]" }, { "PRUint16 *", "short[]" }, { "nativeWindow *", "int /*long*/[]" }, + { "nsWriteSegmentFun", "int /*long*/" }, { "nativeWindow", "int /*long*/" }, + + { "*", "int /*long*/" }, // c type containing one or more * (and any + // other character, and did not match + // previous patterns) is a simple pointer + { "&", "int /*long*/" }, + + { "PRUint32", "int" }, { "PRInt32", "int" }, { "PRInt64", "long" }, { "nsresult", "int" }, { "PRBool", "int" }, { "float", "float" }, { "PRUint16", "short" }, + { "size_t", "int" }, }; + + static String GECKO = "/bluebird/teamhawtjni/hawtjni-builddir/mozilla/1.4/linux_gtk2/mozilla/dist/include/"; + + static String TARGET_FOLDER = "/bluebird/teamhawtjni/chrisx/amd64/workspace/org.eclipse.hawtjni/Eclipse SWT Mozilla/common/org/eclipse/hawtjni/internal/mozilla/"; + + static String[] XPCOM_HEADERS = { "profile/nsIProfile.h", "widget/nsIAppShell.h", "widget/nsIBaseWindow.h", "xpcom/nsIComponentManager.h", "xpcom/nsIComponentRegistrar.h", + "webbrwsr/nsIContextMenuListener.h", "docshell/nsIDocShell.h", "dom/nsIDOMEvent.h", "dom/nsIDOMMouseEvent.h", "dom/nsIDOMUIEvent.h", "dom/nsIDOMWindow.h", + "uriloader/nsIDownload.h", + "webbrwsr/nsIEmbeddingSiteWindow.h", + "xpcom/nsIFactory.h", + "xpcom/nsIFile.h", + "helperAppDlg/nsIHelperAppLauncherDialog.h", + "exthandler/nsIExternalHelperAppService.h", // contains + // nsIHelperAppLauncher + "xpcom/nsIInputStream.h", "xpcom/nsIInterfaceRequestor.h", "necko/nsIIOService.h", "xpcom/nsILocalFile.h", "xpcom/nsIMemory.h", "progressDlg/nsIProgressDialog.h", + "windowwatcher/nsIPromptService.h", "xpcom/nsIServiceManager.h", "xpcom/nsISupports.h", "webbrwsr/nsITooltipListener.h", "necko/nsIURI.h", + "uriloader/nsIURIContentListener.h", "xpcom/nsIWeakReference.h", "webbrwsr/nsIWebBrowser.h", "webbrwsr/nsIWebBrowserChrome.h", "webbrwsr/nsIWebBrowserChromeFocus.h", + "webbrwsr/nsIWebBrowserFocus.h", "docshell/nsIWebNavigation.h", "uriloader/nsIWebProgress.h", "uriloader/nsIWebProgressListener.h", "embed_base/nsIWindowCreator.h", + "windowwatcher/nsIWindowWatcher.h" }; + + public static void main(String[] args) { + MozillaGenerator x = new MozillaGenerator(); + for (int i = 0; i < XPCOM_HEADERS.length; i++) + x.parse(GECKO + XPCOM_HEADERS[i], TARGET_FOLDER); + x.outputVtblCall(); + System.out.println("done"); + } + + + /** Write callbacks */ + public void write(String data) { + if (DEBUG) { + System.out.print(data); + return; + } + try { + w.write(data); + } catch (IOException e) { + e.printStackTrace(); + } + } + + public void writeLine() { + if (DEBUG) { + System.out.println(); + return; + } + write("\r\n"); + } + + public void writeLine(String data) { + if (DEBUG) { + System.out.println(data); + return; + } + write(data + "\r\n"); + } + + public void writeCopyrights() { + writeLine(COPYRIGHTS); + } + + public void writePackageDeclaration() { + writeLine(PACKAGE_DECLARATION); + } + + public void writeClassDeclaration(String className, String parentName) { + String line = "public class " + className; + if (!parentName.equals(NO_SUPER_CLASS)) + line += " extends " + parentName; + line += " {"; + writeLine(line); + } + + public void writeLastMethodId(String parentName, int nMethods) { + String line = "\tstatic final int LAST_METHOD_ID = "; + if (!parentName.equals(NO_SUPER_CLASS)) + line += parentName + ".LAST_METHOD_ID + " + nMethods + ";"; + else + line += "" + (nMethods - 1) + ";"; // zero indexed + writeLine(line); + } + + public void writeIID(String uuidName, String uuidValue) { + writeLine("\tpublic static final String " + uuidName + " ="); + writeLine("\t\t\"" + uuidValue + "\";"); + writeLine(); + String iid = uuidName.substring(0, uuidName.indexOf("_STR")); + writeLine("\tpublic static final nsID " + iid + " ="); + writeLine("\t\tnew nsID(" + uuidName + ");"); + } + + public void writeAddressField() { + writeLine("\tint /*long*/ address;"); + } + + public void writeConstructor(String className, String parentName) { + writeLine("\tpublic " + className + "(int /*long*/ address) {"); + if (!parentName.equals(NO_SUPER_CLASS)) { + writeLine("\t\tsuper(address);"); + } else { + writeLine("\t\tthis.address = address;"); + } + writeLine("\t}"); + } + + public void writeAddressGetter() { + writeLine("\tpublic int /*long*/ getAddress() {"); + writeLine("\t\treturn this.address;"); + writeLine("\t}"); + } + + public void writeConstant(String name, String value) { + writeLine("\tpublic static final int " + name + " = " + value + ";"); + } + + public void writeMethod(String name, String parentName, int methodIndex, String[] argTypes, String[] argNames) { + write("\tpublic int " + name + "("); + for (int i = 0; i < argTypes.length; i++) { + write(argTypes[i] + " " + argNames[i]); + if (i < argTypes.length - 1) + write(", "); + } + write(") {"); + writeLine(); + String line = "\t\treturn XPCOM.VtblCall("; + if (!parentName.equals(NO_SUPER_CLASS)) + line += parentName + ".LAST_METHOD_ID + " + (methodIndex + 1) + ", getAddress()"; + else + line += methodIndex + ", getAddress()"; // zero indexed + write(line); + if (argTypes.length > 0) + write(", "); + for (int i = 0; i < argTypes.length; i++) { + write(argNames[i]); + if (i < argTypes.length - 1) + write(", "); + } + writeLine(");"); + writeLine("\t}"); + } + + public void writeClassEnd() { + write("}"); + } + + public void logVtblCall(String[] argTypes) { + String vtbl = "static final native int VtblCall(int fnNumber, int /*long*/ ppVtbl"; + if (argTypes.length > 0) + vtbl += ", "; + for (int i = 0; i < argTypes.length; i++) { + vtbl += argTypes[i] + " arg" + i; + if (i < argTypes.length - 1) + vtbl += ", "; + } + vtbl += ");"; + Integer key = new Integer(argTypes.length); + TreeSet list = vtbls.get(key); + if (list == null) { + list = new TreeSet(); + vtbls.put(key, list); + } + boolean duplicate = false; + + for (String s : list) { + if (vtbl.equals(s)) { + duplicate = true; + break; + } + } + if (!duplicate) + list.add(vtbl); + } + + public void outputVtblCall() { + Collection> values = vtbls.values(); + for (TreeSet elts : values) { + for (String elt : elts) { + System.out.println(elt); + } + } + } + + /** Parsing invoking write callbacks */ + + /* + * Convert a C header file into a Java source file matching SWT Mozilla + * binding. + */ + public void parse(String src, String destPath) { + if (DEBUG) + writeLine("*** PARSING <" + src + "> to folder " + destPath); + b = new String[maxLines]; + cntLines = 0; + try { + r = new FileReader(src); + BufferedReader br = new BufferedReader(r); + while ((b[cntLines] = br.readLine()) != null) { + cntLines++; + } + br.close(); + } catch (IOException e) { + e.printStackTrace(); + return; + } + n = 0; + boolean lookForClasses = true; + while (lookForClasses) { + /* parsing */ + lookForClasses = parse(); + + String destFile = destPath + className + ".java"; + try { + w = new FileWriter(destFile); + if (DEBUG) + writeLine("** CREATED JAVA FILE <" + destFile + ">"); + } catch (IOException e) { + e.printStackTrace(); + return; + } + + /* writing */ + writeCopyrights(); + writePackageDeclaration(); + writeLine(); + writeClassDeclaration(className, parentName); + writeLine(); + writeLastMethodId(parentName, nMethods); + writeLine(); + writeIID(uuidName, uuidValue); + writeLine(); + if (parentName.equals(NO_SUPER_CLASS)) { + writeAddressField(); + writeLine(); + } + writeConstructor(className, parentName); + writeLine(); + + if (parentName.equals(NO_SUPER_CLASS)) { + writeAddressGetter(); + writeLine(); + } + + int constantIndex = 0, methodIndex = 0; + for (int i = 0; i < bodyOrder.length(); i++) { + if (bodyOrder.charAt(i) == 'C') { + writeConstant(constantNames[constantIndex], constantValues[constantIndex]); + if (i < bodyOrder.length() - 1) + writeLine(); + constantIndex++; + } else if (bodyOrder.charAt(i) == 'M') { + writeMethod(methodNames[methodIndex], parentName, methodIndex, argTypes[methodIndex], argNames[methodIndex]); + if (i < bodyOrder.length() - 1) + writeLine(); + methodIndex++; + } + } + + writeClassEnd(); + + try { + w.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + public String getPackages() { + return "package org.eclipse.hawtjni.internal.mozilla;"; + } + + public boolean parse() { + if (!jumpToUuidDeclaration()) + return false; + uuidName = getUuidName(b[n]); + if (DEBUG) + System.out.println("UUID name: <" + uuidName + ">"); + uuidValue = getUuidValue(b[n]); + if (DEBUG) + System.out.println("UUID value: <" + uuidValue + ">"); + jumpToInterfaceDeclaration(); + className = getClassName(b[n]); + if (DEBUG) + System.out.println("Interface name: <" + className + ">"); + parentName = getParentName(b[n]); + if (DEBUG) + System.out.println("parentName: <" + parentName + ">"); + parseBody(); + return true; + } + + boolean jumpToUuidDeclaration() { + // jump to line matching: + // "#define NS_IWEBBROWSERCHROME_IID_STR "ba434c60-9d52-11d3-afb0-00a024ffc08c"" + while (!(b[n].startsWith("#define ") && b[n].indexOf("_IID_STR \"") != -1)) { + n++; + if (n >= cntLines) + return false; + } + return true; + } + + // assume a declaration matching: + // "#define NS_IWEBBROWSERCHROME_IID_STR "ba434c60-9d52-11d3-afb0-00a024ffc08c"" + // returns NS_IWEBBROWSERCHROME_IID_STR + String getUuidName(String declaration) { + return declaration.substring(declaration.indexOf("#define ") + "#define ".length(), declaration.indexOf(" \"")); + } + + // assume a declaration matching: + // "#define NS_IWEBBROWSERCHROME_IID_STR "ba434c60-9d52-11d3-afb0-00a024ffc08c"" + // returns ba434c60-9d52-11d3-afb0-00a024ffc08c + String getUuidValue(String declaration) { + return declaration.substring(declaration.indexOf("_IID_STR \"") + "_IID_STR \"".length(), declaration.lastIndexOf('"')); + } + + void jumpToInterfaceDeclaration() { + // jump to line matching: + // "class NS_NO_VTABLE nsIWebBrowserChrome : public nsISupports {" + while (!(b[n].startsWith("class NS_NO_VTABLE "))) { + n++; + } + } + + // Assume a declaration matching: + // "class NS_NO_VTABLE nsIWebBrowserChrome : public nsISupports {" + // or + // "class NS_NO_VTABLE NS_SCRIPTABLE nsIWebBrowserChrome : public nsISupports {" + // returns nsIWebBrowserChrome. + // Special case for nsISupports that has no super class: class NS_NO_VTABLE + // nsISupports { + String getClassName(String declaration) { + int endIndex = declaration.indexOf(" :"); + // nsISupports special case (no super class) + if (endIndex == -1) + endIndex = declaration.indexOf(" {"); + String searchString = "class NS_NO_VTABLE NS_SCRIPTABLE"; + int startIndex = declaration.indexOf(searchString); + if (startIndex == -1) { + searchString = "class NS_NO_VTABLE "; + startIndex = declaration.indexOf(searchString); + } + return declaration.substring(startIndex + searchString.length(), endIndex); + } + + // assume a declaration matching: + // "class NS_NO_VTABLE nsIWebBrowserChrome : public nsISupports {" + // returns nsISupports + // special case for nsISupports that has no super class: class NS_NO_VTABLE + // nsISupports { + String getParentName(String declaration) { + if (declaration.indexOf(" :") == -1) + return NO_SUPER_CLASS; + return declaration.substring(declaration.indexOf(": public ") + ": public ".length(), declaration.indexOf(" {")); + } + + // parse methods and constants declarations starting at the current index + // out: + // .String body - contains the corresponding java content + // .n - set to the end of the interface body declaration ( line with the + // enclosing "};" ) + // .nMethods - set to the number of methods parsed + void parseBody() { + body = ""; + bodyOrder = ""; + int nConstants = 0; + nMethods = 0; + + int tmp_n = n; + while (true) { + int type = jumpToNextConstantOrMethod(); + if (type == CONSTANT) + nConstants++; + if (type == METHOD) + nMethods++; + if (type == END_BODY) + break; + n++; + } + n = tmp_n; + constantNames = new String[nConstants]; + constantValues = new String[nConstants]; + methodNames = new String[nMethods]; + argTypes = new String[nMethods][]; + argNames = new String[nMethods][]; + int constantIndex = 0, methodIndex = 0; + while (true) { + int type = jumpToNextConstantOrMethod(); + if (type == CONSTANT) { + parseConstant(b[n], constantIndex); + bodyOrder += "C"; + constantIndex++; + } + if (type == METHOD) { + parseMethod(b[n], methodIndex); + logVtblCall(argTypes[methodIndex]); + bodyOrder += "M"; + methodIndex++; + } + if (type == END_BODY) + return; + n++; + } + } + + static int CONSTANT = 0; + + static int METHOD = 1; + + static int END_BODY = 2; + + boolean isEndOfInterfaceBody() { + return b[n].startsWith("};"); + } + + int jumpToNextConstantOrMethod() { + while (!isEndOfInterfaceBody()) { + if (b[n].startsWith(" enum { ")) { + return CONSTANT; + } + if (methodNameStartIndexOf(b[n]) != -1) { + return METHOD; + } + n++; + } + return END_BODY; + } + + void parseConstant(String constant, int constantIndex) { + String constantName = constant.substring(constant.indexOf(" enum { ") + " enum { ".length(), constant.indexOf(" =")); + if (DEBUG) + writeLine("constantName <" + constantName + ">"); + constantNames[constantIndex] = constantName; + + // most constants values have a trailing U + // enum { APP_TYPE_UNKNOWN = 0U }; + int endIndex = constant.indexOf("U };"); + // a few others don't + // enum { ENUMERATE_FORWARDS = 0 }; + if (endIndex == -1) + endIndex = constant.indexOf(" };"); + String constantValue = constant.substring(constant.indexOf(" = ") + " = ".length(), endIndex); + if (DEBUG) + writeLine("constantValue <" + constantValue + ">"); + constantValues[constantIndex] = constantValue; + } + + // NS_IMETHOD SetStatus(PRUint32 statusType, const PRUnichar *status) = 0; + // identify: + // method name: + // Nbr of arguments: 2 + // Type of argument 0: PRUint32 + // Name of argument 0: statusType + // Type of argument 1: const PRUnichar * + // Name of argument 1: status + void parseMethod(String line, int methodIndex) { + int start = methodNameStartIndexOf(line); + int end = methodNameEndIndexOf(line); + String methodName = line.substring(start, end); + if (DEBUG) + writeLine("method name: <" + methodName + ">"); + methodNames[methodIndex] = methodName; + int argStart = end + "(".length(); + int argEnd = line.indexOf(")", argStart); + parseArgs(line.substring(argStart, argEnd), methodIndex); + } + + // Given a line, returns the start of the method name or -1 + // if the line does not contain a method declaration. + int methodNameStartIndexOf(String line) { + for (int i = 0; i < BEFORE_METHOD_NAME.length; i++) { + int index = line.indexOf(BEFORE_METHOD_NAME[i]); + if (index != -1) + return index + BEFORE_METHOD_NAME[i].length(); + } + return -1; + } + + int methodNameEndIndexOf(String line) { + int startIndex = methodNameStartIndexOf(line); + return line.indexOf("(", startIndex); + } + + void parseArgs(String args, int methodIndex) { + int nArgs = -1; + // methods with no args look like: () or (void) + String[] noArgs = new String[] { "", "void" }; + for (int i = 0; i < noArgs.length; i++) { + if (args.equals(noArgs[i])) { + nArgs = 0; + break; + } + } + if (nArgs == -1) + nArgs = count(args, ", ") + 1; + String[] argTypes = new String[nArgs]; + this.argTypes[methodIndex] = argTypes; + String[] argNames = new String[nArgs]; + this.argNames[methodIndex] = argNames; + int typeStart = 0; + + // name is separated from its type by either of the following (sorted by + // decreasing size to find the most complete pattern */ + String[] typeNameSep = new String[] { " * *", " **", " * & ", " * ", " *", " & ", " " }; + for (int i = 0; i < nArgs; i++) { + /* get the type */ + int nextTypeStart = i < nArgs - 1 ? args.indexOf(", ", typeStart) + ", ".length() : args.length(); + int typeNameSepIndex = 0; + int separatorIndex = 0; + for (; typeNameSepIndex < typeNameSep.length; typeNameSepIndex++) { + separatorIndex = args.indexOf(typeNameSep[typeNameSepIndex], typeStart); + if (separatorIndex != -1 && separatorIndex < nextTypeStart) + break; + } + String separator = typeNameSep[typeNameSepIndex]; + argTypes[i] = getC2JavaType(args.substring(typeStart, separatorIndex + separator.length())); + if (DEBUG) + writeLine("arg type" + i + ": <" + argTypes[i] + ">"); + /* get the name */ + int nameStart = separatorIndex + separator.length(); + int nameEnd = i < nArgs - 1 ? args.indexOf(", ", nameStart) : args.length(); + argNames[i] = args.substring(nameStart, nameEnd); + if (DEBUG) + writeLine("arg name" + i + ": <" + argNames[i] + ">"); + + typeStart = nextTypeStart; + } + } + + String getC2JavaType(String cType) { + for (int i = 0; i < TYPES_C2JAVA.length; i++) { + if (cType.indexOf(TYPES_C2JAVA[i][0]) != -1) + return TYPES_C2JAVA[i][1]; + } + return "!ERROR UNKNOWN C TYPE <" + cType + ">!"; + } + + // how many times part can be found in s + static int count(String s, String part) { + int index = -1, cnt = 0; + while ((index = s.indexOf(part, index + 1)) != -1) + cnt++; + return cnt; + } + + static String COPYRIGHTS = "/* ***** BEGIN LICENSE BLOCK *****\r\n" + " * Version: MPL 1.1\r\n" + " *\r\n" + + " * The contents of this file are subject to the Mozilla Public License Version\r\n" + + " * 1.1 (the \"License\"); you may not use this file except in compliance with\r\n" + " * the License. You may obtain a copy of the License at\r\n" + + " * http://www.mozilla.org/MPL/\r\n" + " *\r\n" + " * Software distributed under the License is distributed on an \"AS IS\" basis,\r\n" + + " * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\r\n" + " * for the specific language governing rights and limitations under the\r\n" + + " * License.\r\n" + " *\r\n" + " * The Original Code is Mozilla Communicator client code, released March 31, 1998.\r\n" + " *\r\n" + + " * The Initial Developer of the Original Code is\r\n" + " * Netscape Communications Corporation.\r\n" + + " * Portions created by Netscape are Copyright (C) 1998-1999\r\n" + " * Netscape Communications Corporation. All Rights Reserved.\r\n" + " *\r\n" + + " * Contributor(s):\r\n" + " *\r\n" + " * IBM\r\n" + " * - Binding to permit interfacing between Mozilla and SWT\r\n" + + " * - Copyright (C) 2003, 2009 IBM Corp. All Rights Reserved.\r\n" + " *\r\n" + " * ***** END LICENSE BLOCK ***** */"; + + static String PACKAGE_DECLARATION = "package org.eclipse.hawtjni.internal.mozilla;"; + +} diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/NativesGenerator.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/NativesGenerator.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/NativesGenerator.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/NativesGenerator.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,1227 @@ +/******************************************************************************* + * Copyright (C) 2009-2011 FuseSource Corp. + * Copyright (c) 2004, 2007 IBM Corporation and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + *******************************************************************************/ +package org.fusesource.hawtjni.generator; + +import java.lang.reflect.Modifier; +import java.util.ArrayList; +import java.util.List; + +import org.fusesource.hawtjni.generator.model.JNIClass; +import org.fusesource.hawtjni.generator.model.JNIField; +import org.fusesource.hawtjni.generator.model.JNIFieldAccessor; +import org.fusesource.hawtjni.generator.model.JNIMethod; +import org.fusesource.hawtjni.generator.model.JNIParameter; +import org.fusesource.hawtjni.generator.model.JNIType; +import org.fusesource.hawtjni.runtime.ArgFlag; +import org.fusesource.hawtjni.runtime.ClassFlag; +import org.fusesource.hawtjni.runtime.FieldFlag; +import org.fusesource.hawtjni.runtime.MethodFlag; + +import static org.fusesource.hawtjni.runtime.MethodFlag.*; + +/** + * + * @author Hiram Chirino + */ +public class NativesGenerator extends JNIGenerator { + + boolean enterExitMacro; + + public NativesGenerator() { + enterExitMacro = true; + } + + public void generateCopyright() { + outputln(fixDelimiter(getCopyright())); + } + + public void generateIncludes() { + String outputName = getOutputName(); + outputln("#include \"" + outputName + ".h\""); + outputln("#include \"hawtjni.h\""); + outputln("#include \"" + outputName + "_structs.h\""); + outputln("#include \"" + outputName + "_stats.h\""); + outputln(); + } + + public void generate(JNIClass clazz) { + List methods = clazz.getNativeMethods(); + if( methods.isEmpty() ) { + return; + } + sortMethods(methods); + generateNativeMacro(clazz); + generate(methods); + } + + public void generate(List methods) { + sortMethods(methods); + for (JNIMethod method : methods) { + if ((method.getModifiers() & Modifier.NATIVE) == 0) + continue; + generate(method); + if (progress != null) + progress.step(); + } + } + + boolean isStruct(ArgFlag flags[]) { + for (ArgFlag flag : flags) { + if (flag.equals(ArgFlag.BY_VALUE)) + return true; + } + return false; + } + + void generateCallback(JNIMethod method, String function, List params, JNIType returnType) { + output("static jintLong "); + output(function); + outputln(";"); + output("static "); + String[] types = method.getCallbackTypes(); + ArgFlag[][] flags = method.getCallbackFlags(); + output(types[0]); + output(" "); + output("proc_"); + output(function); + output("("); + boolean first = true; + for (int i = 1; i < types.length; i++) { + if (!first) + output(", "); + output(types[i]); + output(" "); + output("arg"); + output(String.valueOf(i - 1)); + first = false; + } + outputln(") {"); + + output("\t"); + if (isStruct(flags[0])) { + output(types[0]); + output("* lprc = "); + } else if (!types[0].equals("void")) { + output("return "); + } + output("(("); + output(types[0]); + if (isStruct(flags[0])) + output("*"); + output(" (*)("); + first = true; + for (int i = 1; i < types.length; i++) { + if (!first) + output(", "); + first = false; + output(types[i]); + if (isStruct(flags[i])) + output("*"); + } + output("))"); + output(function); + output(")("); + first = true; + for (int i = 1; i < types.length; i++) { + if (!first) + output(", "); + first = false; + if (isStruct(flags[i])) + output("&"); + output("arg"); + output(String.valueOf(i - 1)); + } + outputln(");"); + if (isStruct(flags[0])) { + output("\t"); + output(types[0]); + outputln(" rc;"); + outputln("\tif (lprc) {"); + outputln("\t\trc = *lprc;"); + outputln("\t\tfree(lprc);"); + outputln("\t} else {"); + output("\t\tmemset(&rc, 0, sizeof("); + output(types[0]); + outputln("));"); + outputln("\t}"); + outputln("\treturn rc;"); + } + outputln("}"); + + output("static jintLong "); + output(method.getName()); + outputln("(jintLong func) {"); + output("\t"); + output(function); + outputln(" = func;"); + output("\treturn (jintLong)proc_"); + output(function); + outputln(";"); + outputln("}"); + } + + private void generateConstantsInitializer(JNIMethod method) { + JNIClass clazz = method.getDeclaringClass(); + ArrayList constants = getConstantFields(clazz); + if( constants.isEmpty() ) { + return; + } + + if (isCPP) { + output("extern \"C\" "); + } + outputln("JNIEXPORT void JNICALL "+clazz.getSimpleName()+"_NATIVE("+toC(method.getName())+")(JNIEnv *env, jclass that)"); + outputln("{"); + for (JNIField field : constants) { + + String conditional = field.getConditional(); + if (conditional!=null) { + outputln("#if "+conditional); + } + JNIType type = field.getType(), type64 = field.getType64(); + boolean allowConversion = !type.equals(type64); + + String simpleName = type.getSimpleName(); + JNIFieldAccessor accessor = field.getAccessor(); + + String fieldId = "(*env)->GetStaticFieldID(env, that, \""+field.getName()+"\", \""+type.getTypeSignature(allowConversion)+"\")"; + if (isCPP) { + fieldId = "env->GetStaticFieldID(that, \""+field.getName()+"\", \""+type.getTypeSignature(allowConversion)+"\")"; + } + + if (type.isPrimitive()) { + if (isCPP) { + output("\tenv->SetStatic"+type.getTypeSignature1(allowConversion)+"Field(that, "+fieldId +", "); + } else { + output("\t(*env)->SetStatic"+type.getTypeSignature1(allowConversion)+"Field(env, that, "+fieldId +", "); + } + output("("+type.getTypeSignature2(allowConversion)+")"); + if( field.isPointer() ) { + output("(intptr_t)"); + } + output(accessor.getter()); + output(");"); + + } else if (type.isArray()) { + JNIType componentType = type.getComponentType(), componentType64 = type64.getComponentType(); + if (componentType.isPrimitive()) { + outputln("\t{"); + output("\t"); + output(type.getTypeSignature2(allowConversion)); + output(" lpObject1 = ("); + output(type.getTypeSignature2(allowConversion)); + if (isCPP) { + output(")env->GetStaticObjectField(that, "); + } else { + output(")(*env)->GetStaticObjectField(env, that, "); + } + output(field.getDeclaringClass().getSimpleName()); + output(fieldId); + outputln(");"); + if (isCPP) { + output("\tenv->Set"); + } else { + output("\t(*env)->Set"); + } + output(componentType.getTypeSignature1(!componentType.equals(componentType64))); + if (isCPP) { + output("ArrayRegion(lpObject1, 0, sizeof("); + } else { + output("ArrayRegion(env, lpObject1, 0, sizeof("); + } + output(accessor.getter()); + output(")"); + if (!componentType.isType("byte")) { + output(" / sizeof("); + output(componentType.getTypeSignature2(!componentType.equals(componentType64))); + output(")"); + } + output(", ("); + output(type.getTypeSignature4(allowConversion, false)); + output(")"); + output(accessor.getter()); + outputln(");"); + output("\t}"); + } else { + throw new Error("not done"); + } + } else { + outputln("\t{"); + if (isCPP) { + output("\tjobject lpObject1 = env->GetStaticObjectField(that, "); + } else { + output("\tjobject lpObject1 = (*env)->GetStaticObjectField(env, that, "); + } + output(field.getDeclaringClass().getSimpleName()); + output("Fc."); + output(field.getName()); + outputln(");"); + output("\tif (lpObject1 != NULL) set"); + output(simpleName); + output("Fields(env, lpObject1, &lpStruct->"); + output(accessor.getter()); + outputln(");"); + output("\t}"); + } + outputln(); + if (conditional!=null) { + outputln("#endif"); + } + } + outputln(" return;"); + outputln("}"); + + } + + private ArrayList getConstantFields(JNIClass clazz) { + ArrayList rc = new ArrayList(); + List fields = clazz.getDeclaredFields(); + for (JNIField field : fields) { + int mods = field.getModifiers(); + if ( (mods & Modifier.STATIC) != 0 && field.getFlag(FieldFlag.CONSTANT)) { + rc.add(field); + } + } + return rc; + } + + public void generate(JNIMethod method) { + if (method.getFlag(MethodFlag.METHOD_SKIP)) + return; + + JNIType returnType = method.getReturnType32(), returnType64 = method.getReturnType64(); + + if( method.getFlag(CONSTANT_INITIALIZER)) { + if( returnType.isType("void") && method.getParameters().isEmpty() ) { + generateConstantsInitializer(method); + } else { + output("#error Warning: invalid CONSTANT_INITIALIZER tagged method. It must be void and take no arguments: "); + outputln(method.toString()); + } + return; + } + + if (!(returnType.isType("void") || returnType.isPrimitive() || isSystemClass(returnType) || returnType.isType("java.lang.String"))) { + output("#error Warning: bad return type. :"); + outputln(method.toString()); + return; + } + + String conditional = method.getConditional(); + if (conditional!=null) { + outputln("#if "+conditional); + } + + List params = method.getParameters(); + String function = getFunctionName(method), function64 = getFunctionName(method, method.getParameterTypes64()); + boolean sameFunction = function.equals(function64); + if (!sameFunction) { + output("#ifndef "); + output(JNI64); + outputln(); + } + if (isCPP) { + output("extern \"C\" "); + generateFunctionPrototype(method, function, params, returnType, returnType64, true); + outputln(";"); + } + if (function.startsWith("CALLBACK_")) { + generateCallback(method, function, params, returnType); + } + generateFunctionPrototype(method, function, params, returnType, returnType64, !sameFunction); + if (!function.equals(function64)) { + outputln(); + outputln("#else"); + if (isCPP) { + output("extern \"C\" "); + generateFunctionPrototype(method, function64, params, returnType, returnType64, true); + outputln(";"); + } + generateFunctionPrototype(method, function64, params, returnType, returnType64, !sameFunction); + outputln(); + outputln("#endif"); + } + generateFunctionBody(method, function, function64, params, returnType, returnType64); + if (conditional!=null) { + outputln("#endif"); + } + outputln(); + } + + public void setEnterExitMacro(boolean enterExitMacro) { + this.enterExitMacro = enterExitMacro; + } + + void generateNativeMacro(JNIClass clazz) { + output("#define "); + output(clazz.getSimpleName()); + output("_NATIVE(func) Java_"); + output(toC(clazz.getName())); + outputln("_##func"); + outputln(); + } + + boolean generateGetParameter(JNIMethod method, JNIParameter param, boolean critical, int indent) { + JNIType paramType = param.getType32(), paramType64 = param.getType64(); + if (paramType.isPrimitive() || isSystemClass(paramType)) + return false; + String iStr = String.valueOf(param.getParameter()); + for (int j = 0; j < indent; j++) + output("\t"); + output("if (arg"); + output(iStr); + output(") if ((lparg"); + output(iStr); + output(" = "); + if (paramType.isArray()) { + JNIType componentType = paramType.getComponentType(); + if (componentType.isPrimitive()) { + if( "long".equals( componentType.getName() ) && param.isPointer() ) { + // This case is special as we may need to do pointer conversions.. + // if your on a 32 bit system but are keeping track of the pointers in a 64 bit long + output("hawtjni_malloc_pointer_array(env, arg"); + output(iStr); + output(")"); + } else if (critical) { + if (isCPP) { + output("("); + output(componentType.getTypeSignature2(!paramType.equals(paramType64))); + output("*)"); + output("env->GetPrimitiveArrayCritical(arg"); + } else { + output("(*env)->GetPrimitiveArrayCritical(env, arg"); + } + output(iStr); + output(", NULL)"); + } else { + if (isCPP) { + output("env->Get"); + } else { + output("(*env)->Get"); + } + output(componentType.getTypeSignature1(!paramType.equals(paramType64))); + if (isCPP) { + output("ArrayElements(arg"); + } else { + output("ArrayElements(env, arg"); + } + output(iStr); + output(", NULL)"); + } + } else { + throw new Error("not done"); + } + } else if (paramType.isType("java.lang.String")) { + if (param.getFlag(ArgFlag.UNICODE)) { + if (isCPP) { + output("env->GetStringChars(arg"); + } else { + output("(*env)->GetStringChars(env, arg"); + } + output(iStr); + output(", NULL)"); + } else { + if (isCPP) { + output("env->GetStringUTFChars(arg"); + } else { + output("(*env)->GetStringUTFChars(env, arg"); + } + output(iStr); + output(", NULL)"); + } + } else { + if (param.getFlag(ArgFlag.NO_IN)) { + output("&_arg"); + output(iStr); + } else { + output("get"); + output(paramType.getSimpleName()); + output("Fields(env, arg"); + output(iStr); + output(", &_arg"); + output(iStr); + output(")"); + } + } + outputln(") == NULL) goto fail;"); + return true; + } + + void generateSetParameter(JNIParameter param, boolean critical) { + JNIType paramType = param.getType32(), paramType64 = param.getType64(); + if (paramType.isPrimitive() || isSystemClass(paramType)) + return; + String iStr = String.valueOf(param.getParameter()); + if (paramType.isArray()) { + output("\tif (arg"); + output(iStr); + output(" && lparg"); + output(iStr); + output(") "); + JNIType componentType = paramType.getComponentType(); + if (componentType.isPrimitive()) { + if( "long".equals( componentType.getName() ) && param.isPointer() ) { + // This case is special as we may need to do pointer conversions.. + // if your on a 32 bit system but are keeping track of the pointers in a 64 bit long + output("hawtjni_free_pointer_array(env, arg"); + output(iStr); + } else if (critical) { + if (isCPP) { + output("env->ReleasePrimitiveArrayCritical(arg"); + } else { + output("(*env)->ReleasePrimitiveArrayCritical(env, arg"); + } + output(iStr); + } else { + if (isCPP) { + output("env->Release"); + } else { + output("(*env)->Release"); + } + output(componentType.getTypeSignature1(!paramType.equals(paramType64))); + if (isCPP) { + output("ArrayElements(arg"); + } else { + output("ArrayElements(env, arg"); + } + output(iStr); + } + output(", lparg"); + output(iStr); + output(", "); + if (param.getFlag(ArgFlag.NO_OUT)) { + output("JNI_ABORT"); + } else { + output("0"); + } + output(");"); + } else { + throw new Error("not done"); + } + outputln(); + } else if (paramType.isType("java.lang.String")) { + output("\tif (arg"); + output(iStr); + output(" && lparg"); + output(iStr); + output(") "); + if (param.getFlag(ArgFlag.UNICODE)) { + if (isCPP) { + output("env->ReleaseStringChars(arg"); + } else { + output("(*env)->ReleaseStringChars(env, arg"); + } + } else { + if (isCPP) { + output("env->ReleaseStringUTFChars(arg"); + } else { + output("(*env)->ReleaseStringUTFChars(env, arg"); + } + } + output(iStr); + output(", lparg"); + output(iStr); + outputln(");"); + } else { + if (!param.getFlag(ArgFlag.NO_OUT)) { + output("\tif (arg"); + output(iStr); + output(" && lparg"); + output(iStr); + output(") "); + output("set"); + output(paramType.getSimpleName()); + output("Fields(env, arg"); + output(iStr); + output(", lparg"); + output(iStr); + outputln(");"); + } + } + } + + void generateEnterExitMacro(JNIMethod method, String function, String function64, boolean enter) { + if (!enterExitMacro) + return; + if (!function.equals(function64)) { + output("#ifndef "); + output(JNI64); + outputln(); + } + output("\t"); + output(method.getDeclaringClass().getSimpleName()); + output("_NATIVE_"); + output(enter ? "ENTER" : "EXIT"); + output("(env, that, "); + output(method.getDeclaringClass().getSimpleName()+"_"+function); + outputln("_FUNC);"); + if (!function.equals(function64)) { + outputln("#else"); + output("\t"); + output(method.getDeclaringClass().getSimpleName()); + output("_NATIVE_"); + output(enter ? "ENTER" : "EXIT"); + output("(env, that, "); + output(method.getDeclaringClass().getSimpleName()+"_"+function64); + outputln("_FUNC);"); + outputln("#endif"); + } + } + + boolean generateLocalVars(JNIMethod method, List params, JNIType returnType, JNIType returnType64) { + boolean needsReturn = enterExitMacro; + for (int i = 0; i < params.size(); i++) { + JNIParameter param = params.get(i); + JNIType paramType = param.getType32(), paramType64 = param.getType64(); + if (paramType.isPrimitive() || isSystemClass(paramType)) + continue; + output("\t"); + if (paramType.isArray()) { + JNIType componentType = paramType.getComponentType(); + if( "long".equals( componentType.getName() ) && param.isPointer() ) { + output("void **lparg" + i+"=NULL;"); + } else if (componentType.isPrimitive()) { + output(componentType.getTypeSignature2(!paramType.equals(paramType64))); + output(" *lparg" + i); + output("=NULL;"); + } else { + throw new Error("not done"); + } + } else if (paramType.isType("org.fusesource.hawtjni.runtime.JNIEnv")) { + // no need to generate a local for this one.. + } else if (paramType.isType("java.lang.String")) { + if (param.getFlag(ArgFlag.UNICODE)) { + output("const jchar *lparg" + i); + } else { + output("const char *lparg" + i); + } + output("= NULL;"); + } else { + if (param.getTypeClass().getFlag(ClassFlag.STRUCT) && !param.getTypeClass().getFlag(ClassFlag.TYPEDEF)) { + output("struct "); + } + output(paramType.getNativeName()); + output(" _arg" + i); + if (param.getFlag(ArgFlag.INIT)) + output("={0}"); + output(", *lparg" + i); + output("=NULL;"); + } + outputln(); + needsReturn = true; + } + if (needsReturn) { + if (!returnType.isType("void")) { + output("\t"); + output(returnType.getTypeSignature2(!returnType.equals(returnType64))); + outputln(" rc = 0;"); + } + } + return needsReturn; + } + + boolean generateGetters(JNIMethod method, List params) { + boolean genFailTag = false; + int criticalCount = 0; + for (JNIParameter param : params) { + if( !"org.fusesource.hawtjni.runtime.JNIEnv".equals(param.getTypeClass().getName()) ) { + if (!isCritical(param)) { + genFailTag |= generateGetParameter(method, param, false, 1); + } else { + criticalCount++; + } + } + } + if (criticalCount != 0) { + outputln("#ifdef JNI_VERSION_1_2"); + outputln("\tif (IS_JNI_1_2) {"); + for (JNIParameter param : params) { + if( !"org.fusesource.hawtjni.runtime.JNIEnv".equals(param.getTypeClass().getName()) ) { + if (isCritical(param)) { + genFailTag |= generateGetParameter(method, param, true, 2); + } + } + } + outputln("\t} else"); + outputln("#endif"); + outputln("\t{"); + for (JNIParameter param : params) { + if( !"org.fusesource.hawtjni.runtime.JNIEnv".equals(param.getTypeClass().getName()) ) { + if (isCritical(param)) { + genFailTag |= generateGetParameter(method, param, false, 2); + } + } + } + outputln("\t}"); + } + return genFailTag; + } + + void generateSetters(JNIMethod method, List params) { + int criticalCount = 0; + for (int i = params.size() - 1; i >= 0; i--) { + JNIParameter param = params.get(i); + if( !"org.fusesource.hawtjni.runtime.JNIEnv".equals(param.getTypeClass().getName()) ) { + if (isCritical(param)) { + criticalCount++; + } + } + } + if (criticalCount != 0) { + outputln("#ifdef JNI_VERSION_1_2"); + outputln("\tif (IS_JNI_1_2) {"); + for (int i = params.size() - 1; i >= 0; i--) { + JNIParameter param = params.get(i); + if( !"org.fusesource.hawtjni.runtime.JNIEnv".equals(param.getTypeClass().getName()) ) { + if (isCritical(param)) { + output("\t"); + generateSetParameter(param, true); + } + } + } + outputln("\t} else"); + outputln("#endif"); + outputln("\t{"); + for (int i = params.size() - 1; i >= 0; i--) { + JNIParameter param = params.get(i); + if( !"org.fusesource.hawtjni.runtime.JNIEnv".equals(param.getTypeClass().getName()) ) { + if (isCritical(param)) { + output("\t"); + generateSetParameter(param, false); + } + } + } + outputln("\t}"); + } + for (int i = params.size() - 1; i >= 0; i--) { + JNIParameter param = params.get(i); + if( !"org.fusesource.hawtjni.runtime.JNIEnv".equals(param.getTypeClass().getName()) ) { + if (!isCritical(param)) { + generateSetParameter(param, false); + } + } + } + } + + void generateDynamicFunctionCall(JNIMethod method, List params, JNIType returnType, JNIType returnType64, boolean needsReturn) { + outputln("/*"); + generateFunctionCall(method, params, returnType, returnType64, needsReturn); + outputln("*/"); + outputln("\t{"); + + String name = method.getName(); + if (name.startsWith("_")) + name = name.substring(1); + output("\t\tLOAD_FUNCTION(fp, "); + output(name); + outputln(")"); + outputln("\t\tif (fp) {"); + output("\t\t"); + generateFunctionCallLeftSide(method, returnType, returnType64, needsReturn); + output("(("); + output(returnType.getTypeSignature2(!returnType.equals(returnType64))); + output(" (CALLING_CONVENTION*)("); + for (int i = 0; i < params.size(); i++) { + if (i != 0) + output(", "); + JNIParameter param = params.get(i); + String cast = param.getCast(); + if( param.isPointer() ) { + output("(intptr_t)"); + } + boolean isStruct = param.getFlag(ArgFlag.BY_VALUE); + if (cast.length() > 2) { + cast = cast.substring(1, cast.length() - 1); + if (isStruct) { + int index = cast.lastIndexOf('*'); + if (index != -1) + cast = cast.substring(0, index).trim(); + } + output(cast); + } else { + JNIType paramType = param.getType32(), paramType64 = param.getType64(); + output(paramType.getTypeSignature4(!paramType.equals(paramType64), isStruct)); + } + } + output("))"); + output("fp"); + output(")"); + generateFunctionCallRightSide(method, params, 0); + output(";"); + outputln(); + outputln("\t\t}"); + outputln("\t}"); + } + + void generateFunctionCallLeftSide(JNIMethod method, JNIType returnType, JNIType returnType64, boolean needsReturn) { + output("\t"); + if (!returnType.isType("void")) { + if (needsReturn) { + output("rc = "); + } else { + output("return "); + } + + String cast = method.getCast(); + if (cast.length() != 0 && !cast.equals("()")) { + if( method.isPointer() ) { + output("(intptr_t)"); + } + output(cast); + } else { + if( method.getFlag(CPP_NEW)) { + String[] parts = getNativeNameParts(method); + String className = parts[0]; + output("(intptr_t)("+className+" *)"); + } else { + output("("); + output(returnType.getTypeSignature2(!returnType.equals(returnType64))); + output(")"); + } + } + } + if (method.getFlag(MethodFlag.ADDRESS)) { + output("&"); + } + if (method.getFlag(MethodFlag.JNI)) { + output(isCPP ? "env->" : "(*env)->"); + } + } + + void generateFunctionCallRightSide(JNIMethod method, List params, int paramStart) { + if (!method.getFlag(MethodFlag.CONSTANT_GETTER)) { + output("("); + if (method.getFlag(MethodFlag.JNI)) { + if (!isCPP) + output("env, "); + } + for (int i = paramStart; i < params.size(); i++) { + JNIParameter param = params.get(i); + if (i != paramStart) + output(", "); + if (param.getFlag(ArgFlag.BY_VALUE)) + output("*"); + output(param.getCast()); + if( param.isPointer() ) { + output("(intptr_t)"); + } + if (param.getFlag(ArgFlag.CS_OBJECT)) + output("TO_OBJECT("); + if (i == params.size() - 1 && param.getFlag(ArgFlag.SENTINEL)) { + output("NULL"); + } else { + if( "org.fusesource.hawtjni.runtime.JNIEnv".equals(param.getTypeClass().getName()) ) { + output("env"); + } else { + JNIType paramType = param.getType32(); + if (!paramType.isPrimitive() && !isSystemClass(paramType)) + output("lp"); + output("arg" + i); + } + } + if (param.getFlag(ArgFlag.CS_OBJECT)) + output(")"); + } + output(")"); + } + } + + static String[] getNativeNameParts(JNIMethod method) { + String className = null; + String methodName = null; + + JNIClass dc = method.getDeclaringClass(); + if( dc.getFlag(ClassFlag.CPP) || dc.getFlag(ClassFlag.STRUCT) ) { + className = method.getDeclaringClass().getNativeName(); + } + + if( method.getAccessor().length() != 0 ) { + methodName = method.getAccessor(); + int pos = methodName.lastIndexOf("::"); + if( pos >= 0 ) { + className = methodName.substring(0, pos); + methodName = methodName.substring(pos+2); + } + } else { + methodName = method.getName(); + if( className==null ) { + int pos = methodName.indexOf("_"); + if( pos > 0 ) { + className = methodName.substring(0, pos); + methodName = methodName.substring(pos+1); + } + } + } + if( className==null ) { + throw new Error(String.format("Could not determine object type name of method '%s'", method.getDeclaringClass().getSimpleName()+"."+method.getName())); + } + return new String[]{className, methodName}; + } + + void generateFunctionCall(JNIMethod method, List params, JNIType returnType, JNIType returnType64, boolean needsReturn) { + String name = method.getName(); + String copy = method.getCopy(); + boolean makeCopy = copy.length() != 0 && isCPP && !returnType.isType("void"); + if (makeCopy) { + output("\t{"); + output("\t\t"); + output(copy); + output(" temp = "); + } else { + generateFunctionCallLeftSide(method, returnType, returnType64, needsReturn); + } + int paramStart = 0; + if (name.startsWith("_")) + name = name.substring(1); + + boolean objc_struct = false; + if (name.equals("objc_msgSend_stret") || name.equals("objc_msgSendSuper_stret")) + objc_struct = true; + if (objc_struct) { + outputln("if (sizeof(_arg0) > STRUCT_SIZE_LIMIT) {"); + generate_objc_msgSend_stret(method, params, name); + paramStart = 1; + } else if (name.equalsIgnoreCase("call")) { + output("("); + JNIParameter param = params.get(0); + String cast = param.getCast(); + if (cast.length() != 0 && !cast.equals("()")) { + output(cast); + if( param.isPointer() ) { + output("(intptr_t)"); + } + } else { + output("("); + output(returnType.getTypeSignature2(!returnType.equals(returnType64))); + output(" (*)())"); + } + output("arg0)"); + paramStart = 1; + } else if (name.startsWith("VtblCall") || name.startsWith("_VtblCall")) { + output("(("); + output(returnType.getTypeSignature2(!returnType.equals(returnType64))); + output(" (STDMETHODCALLTYPE *)("); + for (int i = 1; i < params.size(); i++) { + if (i != 1) + output(", "); + JNIParameter param = params.get(i); + JNIType paramType = param.getType32(), paramType64 = param.getType64(); + output(paramType.getTypeSignature4(!paramType.equals(paramType64), false)); + } + output("))(*("); + JNIType paramType = params.get(1).getType32(), paramType64 = params.get(1).getType64(); + output(paramType.getTypeSignature4(!paramType.equals(paramType64), false)); + output(" **)arg1)[arg0])"); + paramStart = 1; + } else if (method.getFlag(MethodFlag.CPP_METHOD) || method.getFlag(MethodFlag.SETTER) || method.getFlag(MethodFlag.GETTER) || method.getFlag(MethodFlag.ADDER)) { + + String[] parts = getNativeNameParts(method); + String className = parts[0]; + String methodName = parts[1]; + + if (method.getFlag(MethodFlag.CS_OBJECT)) { + output("TO_HANDLE("); + } + output("("); + if( params.isEmpty() ) { + throw new Error(String.format("C++ bound method '%s' missing the 'this' parameter", method.getDeclaringClass().getSimpleName()+"."+method.getName())); + } + JNIParameter param = params.get(0); + if (param.getFlag(ArgFlag.BY_VALUE)) + output("*"); + String cast = param.getCast(); + if (cast.length() != 0 && !cast.equals("()")) { + output(cast); + if( param.isPointer() ) { + output("(intptr_t)"); + } + } else { + output("("+className+" *)(intptr_t)"); + } + if (param.getFlag(ArgFlag.CS_OBJECT)) { + output("TO_OBJECT("); + } + output("arg0"); + if (param.getFlag(ArgFlag.CS_OBJECT)) { + output(")"); + } + output(")->"); + output(methodName); + paramStart = 1; + } else if (method.getFlag(MethodFlag.CS_NEW)) { + output("TO_HANDLE(gcnew "); + String accessor = method.getAccessor(); + if (accessor.length() != 0) { + output(accessor); + } else { + JNIClass dc = method.getDeclaringClass(); + if( dc.getFlag(ClassFlag.CPP) || dc.getFlag(ClassFlag.STRUCT) ) { + output(dc.getNativeName()); + } else { + int index = -1; + if ((index = name.indexOf('_')) != -1) { + output(name.substring(index + 1)); + } else { + output(name); + } + } + } + } else if (method.getFlag(MethodFlag.CPP_NEW)) { + if (method.getFlag(MethodFlag.CS_OBJECT)) { + output("TO_HANDLE("); + } + output("new "); + String accessor = method.getAccessor(); + if (accessor.length() != 0) { + output(accessor); + } else { + + JNIClass dc = method.getDeclaringClass(); + if( dc.getFlag(ClassFlag.CPP) ) { + output(method.getDeclaringClass().getNativeName()); + } else { + int index = -1; + if ((index = name.indexOf('_')) != -1) { + output(name.substring(index+1)); + } else { + output(name); + } + } + + } + } else if (method.getFlag(MethodFlag.CPP_DELETE)) { + String[] parts = getNativeNameParts(method); + String className = parts[0]; + + output("delete "); + JNIParameter param = params.get(0); + String cast = param.getCast(); + if (cast.length() != 0 && !cast.equals("()")) { + output(cast); + if( param.isPointer() ) { + output("(intptr_t)"); + } + } else { + output("("+className+" *)(intptr_t)"); + } + outputln("arg0;"); + return; + } else { + if (method.getFlag(MethodFlag.CS_OBJECT)) { + output("TO_HANDLE("); + } + if (method.getFlag(MethodFlag.CAST)) { + output("(("); + String returnCast = returnType.getTypeSignature2(!returnType.equals(returnType64)); + if (name.equals("objc_msgSend_bool") && returnCast.equals("jboolean")) { + returnCast = "BOOL"; + } + output(returnCast); + output(" (*)("); + for (int i = 0; i < params.size(); i++) { + if (i != 0) + output(", "); + JNIParameter param = params.get(i); + String cast = param.getCast(); + if (cast.length() != 0 && !cast.equals("()") ) { + if (cast.startsWith("(")) + cast = cast.substring(1); + if (cast.endsWith(")")) + cast = cast.substring(0, cast.length() - 1); + output(cast); + } else { + JNIType paramType = param.getType32(), paramType64 = param.getType64(); + if (!(paramType.isPrimitive() || paramType.isArray())) { + if (param.getTypeClass().getFlag(ClassFlag.STRUCT) && !param.getTypeClass().getFlag(ClassFlag.TYPEDEF)) { + output("struct "); + } + } + output(paramType.getTypeSignature4(!paramType.equals(paramType64), param.getFlag(ArgFlag.BY_VALUE))); + } + } + output("))"); + } + String accessor = method.getAccessor(); + if (accessor.length() != 0) { + output(accessor); + } else { + output(name); + } + if (method.getFlag(MethodFlag.CAST)) { + output(")"); + } + } + if ((method.getFlag(MethodFlag.SETTER) && params.size() == 3) || (method.getFlag(MethodFlag.GETTER) && params.size() == 2)) { + output("[arg1]"); + paramStart++; + } + if (method.getFlag(MethodFlag.SETTER)) + output(" = "); + if (method.getFlag(MethodFlag.ADDER)) + output(" += "); + if (!method.getFlag(MethodFlag.GETTER)) { + generateFunctionCallRightSide(method, params, paramStart); + } + if (method.getFlag(MethodFlag.CS_NEW) || method.getFlag(MethodFlag.CS_OBJECT)) { + output(")"); + } + output(";"); + outputln(); + if (makeCopy) { + outputln("\t\t{"); + output("\t\t\t"); + output(copy); + output("* copy = new "); + output(copy); + outputln("();"); + outputln("\t\t\t*copy = temp;"); + output("\t\t\trc = "); + output("("); + output(returnType.getTypeSignature2(!returnType.equals(returnType64))); + output(")"); + outputln("copy;"); + outputln("\t\t}"); + outputln("\t}"); + } + if (objc_struct) { + outputln("\t} else {"); + generate_objc_msgSend_stret(method, params, name.substring(0, name.length() - "_stret".length())); + generateFunctionCallRightSide(method, params, 1); + outputln(";"); + outputln("\t}"); + } + } + + void generate_objc_msgSend_stret(JNIMethod method, List params, String func) { + output("\t\t*lparg0 = (*("); + JNIType paramType = params.get(0).getType32(), paramType64 = params.get(0).getType64(); + output(paramType.getTypeSignature4(!paramType.equals(paramType64), true)); + output(" (*)("); + for (int i = 1; i < params.size(); i++) { + if (i != 1) + output(", "); + JNIParameter param = params.get(i); + String cast = param.getCast(); + if( param.isPointer() ) { + output("(intptr_t)"); + } + if (cast.length() != 0 && !cast.equals("()")) { + if (cast.startsWith("(")) + cast = cast.substring(1); + if (cast.endsWith(")")) + cast = cast.substring(0, cast.length() - 1); + output(cast); + } else { + paramType = param.getType32(); + paramType64 = param.getType64(); + if (!(paramType.isPrimitive() || paramType.isArray())) { + if (param.getTypeClass().getFlag(ClassFlag.STRUCT) && !param.getTypeClass().getFlag(ClassFlag.TYPEDEF)) { + output("struct "); + } + } + output(paramType.getTypeSignature4(!paramType.equals(paramType64), param.getFlag(ArgFlag.BY_VALUE))); + } + } + output("))"); + output(func); + output(")"); + } + + void generateReturn(JNIMethod method, JNIType returnType, boolean needsReturn) { + if (needsReturn && !returnType.isType("void")) { + outputln("\treturn rc;"); + } + } + + void generateMemmove(JNIMethod method, String function, String function64, List params) { + generateEnterExitMacro(method, function, function64, true); + output("\t"); + boolean get = params.get(0).getType32().isPrimitive(); + String className = params.get(get ? 1 : 0).getType32().getSimpleName(); + output(get ? "if (arg1) get" : "if (arg0) set"); + output(className); + output(get ? "Fields(env, arg1, (" : "Fields(env, arg0, ("); + output(className); + output(get ? " *)arg0)" : " *)arg1)"); + outputln(";"); + generateEnterExitMacro(method, function, function64, false); + } + + void generateFunctionBody(JNIMethod method, String function, String function64, List params, JNIType returnType, JNIType returnType64) { + outputln("{"); + + /* Custom GTK memmoves. */ + String name = method.getName(); + if (name.startsWith("_")) + name = name.substring(1); + boolean isMemove = (name.equals("memmove") || name.equals("MoveMemory")) && params.size() == 2 && returnType.isType("void"); + if (isMemove) { + generateMemmove(method, function, function64, params); + } else { + boolean needsReturn = generateLocalVars(method, params, returnType, returnType64); + generateEnterExitMacro(method, function, function64, true); + boolean genFailTag = generateGetters(method, params); + if (method.getFlag(MethodFlag.DYNAMIC)) { + generateDynamicFunctionCall(method, params, returnType, returnType64, needsReturn); + } else { + generateFunctionCall(method, params, returnType, returnType64, needsReturn); + } + if (genFailTag) + outputln("fail:"); + generateSetters(method, params); + generateEnterExitMacro(method, function, function64, false); + generateReturn(method, returnType, needsReturn); + } + + outputln("}"); + } + + void generateFunctionPrototype(JNIMethod method, String function, List params, JNIType returnType, JNIType returnType64, boolean singleLine) { + output("JNIEXPORT "); + output(returnType.getTypeSignature2(!returnType.equals(returnType64))); + output(" JNICALL "); + output(method.getDeclaringClass().getSimpleName()); + output("_NATIVE("); + output(function); + if (singleLine) { + output(")"); + output("(JNIEnv *env, "); + } else { + outputln(")"); + output("\t(JNIEnv *env, "); + } + if ((method.getModifiers() & Modifier.STATIC) != 0) { + output("jclass"); + } else { + output("jobject"); + } + output(" that"); + for (int i = 0; i < params.size(); i++) { + output(", "); + JNIType paramType = params.get(i).getType32(), paramType64 = params.get(i).getType64(); + output(paramType.getTypeSignature2(!paramType.equals(paramType64))); + output(" arg" + i); + } + output(")"); + if (!singleLine) + outputln(); + } + + boolean isCritical(JNIParameter param) { + JNIType paramType = param.getType32(); + return paramType.isArray() && paramType.getComponentType().isPrimitive() && param.getFlag(ArgFlag.CRITICAL); + } + + boolean isSystemClass(JNIType type) { + return type.isType("java.lang.Object") || type.isType("java.lang.Class"); + } + +} diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/ProgressMonitor.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/ProgressMonitor.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/ProgressMonitor.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/ProgressMonitor.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,22 @@ +/******************************************************************************* + * Copyright (c) 2005 IBM Corporation and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + *******************************************************************************/ +package org.fusesource.hawtjni.generator; + +/** + * + * @author Hiram Chirino + */ +public interface ProgressMonitor { + + public void setTotal(int total); + public void setMessage(String message); + public void step(); + +} diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/SizeofGenerator.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/SizeofGenerator.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/SizeofGenerator.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/SizeofGenerator.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,76 @@ +/******************************************************************************* + * Copyright (C) 2009-2011 FuseSource Corp. + * Copyright (c) 2004 IBM Corporation and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + *******************************************************************************/ +package org.fusesource.hawtjni.generator; + +import java.lang.reflect.Modifier; +import java.util.List; + +import org.fusesource.hawtjni.generator.model.JNIClass; +import org.fusesource.hawtjni.generator.model.JNIField; +import org.fusesource.hawtjni.generator.model.ReflectClass; + +/** + * + * @author Hiram Chirino + */ +public class SizeofGenerator extends JNIGenerator { + + public void generate(JNIClass clazz) { + String className = clazz.getSimpleName(); + output("\tprintf(\""); + output(className); + output("=%d\\n\", sizeof("); + output(className); + outputln("));"); + } + + public void generate() { + outputln("int main() {"); + super.generate(); + outputln("}"); + } + + public void generate(List fields) { + sortFields(fields); + for (JNIField field : fields) { + if ((field.getModifiers() & Modifier.FINAL) == 0) + continue; + generate(field); + } + } + + public void generate(JNIField field) { + output("\tprintf(\""); + output(field.getName()); + output("=%d\\n\", sizeof("); + output(field.getName()); + outputln("));"); + } + + public static void main(String[] args) { + if (args.length < 1) { + System.out.println("Usage: java SizeofGenerator "); + return; + } + try { + SizeofGenerator gen = new SizeofGenerator(); + for (int i = 0; i < args.length; i++) { + String clazzName = args[i]; + Class clazz = Class.forName(clazzName); + gen.generate(new ReflectClass(clazz)); + } + } catch (Exception e) { + System.out.println("Problem"); + e.printStackTrace(System.out); + } + } + +} diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/StatsGenerator.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/StatsGenerator.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/StatsGenerator.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/StatsGenerator.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,225 @@ +/******************************************************************************* + * Copyright (C) 2009-2011 FuseSource Corp. + * Copyright (c) 2004, 2007 IBM Corporation and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + *******************************************************************************/ +package org.fusesource.hawtjni.generator; + +import java.lang.reflect.Modifier; +import java.util.List; + +import org.fusesource.hawtjni.generator.model.JNIClass; +import org.fusesource.hawtjni.generator.model.JNIMethod; + +/** + * + * @author Hiram Chirino + */ +public class StatsGenerator extends JNIGenerator { + + boolean header; + + public StatsGenerator(boolean header) { + this.header = header; + } + + public void generateCopyright() { + outputln(fixDelimiter(getCopyright())); + } + + public void generateIncludes() { + if (!header) { + outputln("#include \"hawtjni.h\""); + outputln("#include \""+getOutputName()+"_stats.h\""); + outputln(); + } + } + + public void generate(JNIClass clazz) { + if (header) { + generateHeaderFile(clazz); + } else { + generateSourceFile(clazz); + } + } + + void generateHeaderFile(JNIClass clazz) { + generateNATIVEMacros(clazz); + List methods = clazz.getDeclaredMethods(); + sortMethods(methods); + generateFunctionEnum(methods); + } + + void generateNATIVEMacros(JNIClass clazz) { + String className = clazz.getSimpleName(); + outputln("#ifdef NATIVE_STATS"); + output("extern int "); + output(className); + outputln("_nativeFunctionCount;"); + output("extern int "); + output(className); + outputln("_nativeFunctionCallCount[];"); + output("extern char* "); + output(className); + outputln("_nativeFunctionNames[];"); + output("#define "); + output(className); + output("_NATIVE_ENTER(env, that, func) "); + output(className); + outputln("_nativeFunctionCallCount[func]++;"); + output("#define "); + output(className); + outputln("_NATIVE_EXIT(env, that, func) "); + outputln("#else"); + output("#ifndef "); + output(className); + outputln("_NATIVE_ENTER"); + output("#define "); + output(className); + outputln("_NATIVE_ENTER(env, that, func) "); + outputln("#endif"); + output("#ifndef "); + output(className); + outputln("_NATIVE_EXIT"); + output("#define "); + output(className); + outputln("_NATIVE_EXIT(env, that, func) "); + outputln("#endif"); + outputln("#endif"); + outputln(); + } + + void generateSourceFile(JNIClass clazz) { + outputln("#ifdef NATIVE_STATS"); + outputln(); + List methods = clazz.getDeclaredMethods(); + int methodCount = 0; + for (JNIMethod method : methods) { + if ((method.getModifiers() & Modifier.NATIVE) == 0) + continue; + methodCount++; + } + String className = clazz.getSimpleName(); + output("int "); + output(className); + output("_nativeFunctionCount = "); + output(String.valueOf(methodCount)); + outputln(";"); + output("int "); + output(className); + output("_nativeFunctionCallCount["); + output(String.valueOf(methodCount)); + outputln("];"); + output("char * "); + output(className); + outputln("_nativeFunctionNames[] = {"); + sortMethods(methods); + for (JNIMethod method : methods) { + if ((method.getModifiers() & Modifier.NATIVE) == 0) + continue; + String function = getFunctionName(method), function64 = getFunctionName(method, method.getParameterTypes64()); + if (!function.equals(function64)) { + output("#ifndef "); + output(JNI64); + outputln(); + } + output("\t\""); + output(function); + outputln("\","); + if (!function.equals(function64)) { + outputln("#else"); + output("\t\""); + output(function64); + outputln("\","); + outputln("#endif"); + } + if (progress != null) + progress.step(); + } + outputln("};"); + outputln(); + generateStatsNatives(className); + outputln(); + outputln("#endif"); + } + + void generateStatsNatives(String className) { + outputln("#define STATS_NATIVE(func) Java_org_fusesource_hawtjni_runtime_NativeStats_##func"); + outputln(); + + output("JNIEXPORT jint JNICALL STATS_NATIVE("); + output(toC(className + "_GetFunctionCount")); + outputln(")"); + outputln("\t(JNIEnv *env, jclass that)"); + outputln("{"); + output("\treturn "); + output(className); + outputln("_nativeFunctionCount;"); + outputln("}"); + outputln(); + + output("JNIEXPORT jstring JNICALL STATS_NATIVE("); + output(toC(className + "_GetFunctionName")); + outputln(")"); + outputln("\t(JNIEnv *env, jclass that, jint index)"); + outputln("{"); + output("\treturn "); + if (isCPP) { + output("env->NewStringUTF("); + } else { + output("(*env)->NewStringUTF(env, "); + } + output(className); + outputln("_nativeFunctionNames[index]);"); + outputln("}"); + outputln(); + + output("JNIEXPORT jint JNICALL STATS_NATIVE("); + output(toC(className + "_GetFunctionCallCount")); + outputln(")"); + outputln("\t(JNIEnv *env, jclass that, jint index)"); + outputln("{"); + output("\treturn "); + output(className); + outputln("_nativeFunctionCallCount[index];"); + outputln("}"); + } + + void generateFunctionEnum(List methods) { + if (methods.isEmpty()) + return; + outputln("typedef enum {"); + for (JNIMethod method : methods) { + if ((method.getModifiers() & Modifier.NATIVE) == 0) + continue; + String function = getFunctionName(method), function64 = getFunctionName(method, method.getParameterTypes64()); + if (!function.equals(function64)) { + output("#ifndef "); + output(JNI64); + outputln(); + } + output("\t"); + output(method.getDeclaringClass().getSimpleName()+"_"+function); + outputln("_FUNC,"); + if (!function.equals(function64)) { + outputln("#else"); + output("\t"); + output(method.getDeclaringClass().getSimpleName()+"_"+function64); + outputln("_FUNC,"); + outputln("#endif"); + } + if (progress != null) + progress.step(); + } + JNIClass clazz = methods.get(0).getDeclaringClass(); + output("} "); + output(clazz.getSimpleName()); + outputln("_FUNCS;"); + } + +} diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/StructsGenerator.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/StructsGenerator.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/StructsGenerator.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/StructsGenerator.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,631 @@ +/******************************************************************************* + * Copyright (C) 2009-2011 FuseSource Corp. + * Copyright (c) 2004, 2007 IBM Corporation and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + *******************************************************************************/ +package org.fusesource.hawtjni.generator; + +import java.lang.reflect.Modifier; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +import org.fusesource.hawtjni.generator.model.JNIClass; +import org.fusesource.hawtjni.generator.model.JNIField; +import org.fusesource.hawtjni.generator.model.JNIFieldAccessor; +import org.fusesource.hawtjni.generator.model.JNIType; +import org.fusesource.hawtjni.runtime.ClassFlag; + +/** + * + * @author Hiram Chirino + */ +public class StructsGenerator extends JNIGenerator { + + boolean header; + + static final boolean GLOBAL_REF = false; + + private HashMap> structFields = new HashMap>(); + + public StructsGenerator(boolean header) { + this.header = header; + } + + public void generateCopyright() { + outputln(fixDelimiter(getCopyright())); + } + + public void generateIncludes() { + if (header) { + outputln("#include \"" + getOutputName() + ".h\""); + } else { + outputln("#include \"" + getOutputName() + ".h\""); + outputln("#include \"hawtjni.h\""); + outputln("#include \"" + getOutputName() + "_structs.h\""); + } + outputln(); + } + + public void generate(JNIClass clazz) { + ArrayList fields = getStructFields(clazz); + if (fields.isEmpty()) + return; + if (header) { + generateHeaderFile(clazz); + } else { + generateSourceFile(clazz); + } + } + + private ArrayList getStructFields(JNIClass clazz) { + if (!structFields.containsKey(clazz)) { + ArrayList rc = new ArrayList(); + List fields = clazz.getDeclaredFields(); + for (JNIField field : fields) { + int mods = field.getModifiers(); + if ((mods & Modifier.STATIC) == 0 && (mods & Modifier.TRANSIENT) == 0) { + rc.add(field); + } + } + + structFields.put(clazz, rc); + } + return structFields.get(clazz); + } + + void generateHeaderFile(JNIClass clazz) { + generateSourceStart(clazz); + generatePrototypes(clazz); + generateBlankMacros(clazz); + generateSourceEnd(clazz); + outputln(); + } + + void generateSourceFile(JNIClass clazz) { + generateSourceStart(clazz); + generateFIDsStructure(clazz); + outputln(); + generateGlobalVar(clazz); + outputln(); + generateFunctions(clazz); + generateSourceEnd(clazz); + outputln(); + } + + void generateSourceStart(JNIClass clazz) { + String conditional = clazz.getConditional(); + if (conditional != null) { + outputln("#if " + conditional); + } + } + + void generateSourceEnd(JNIClass clazz) { + if (clazz.getConditional() != null) { + outputln("#endif"); + } + } + + void generateGlobalVar(JNIClass clazz) { + String simpleName = clazz.getSimpleName(); + output(simpleName); + output("_FID_CACHE "); + output(simpleName); + outputln("Fc;"); + } + + void generateBlankMacros(JNIClass clazz) { + + if (clazz.getConditional() == null) { + return; + } + + String simpleName = clazz.getSimpleName(); + outputln("#else"); + output("#define cache"); + output(simpleName); + outputln("Fields(a,b)"); + output("#define get"); + output(simpleName); + outputln("Fields(a,b,c) NULL"); + output("#define set"); + output(simpleName); + outputln("Fields(a,b,c)"); + } + + void generatePrototypes(JNIClass clazz) { + String clazzName = clazz.getNativeName(); + String simpleName = clazz.getSimpleName(); + output("void cache"); + output(simpleName); + outputln("Fields(JNIEnv *env, jobject lpObject);"); + if (clazz.getFlag(ClassFlag.STRUCT) && !clazz.getFlag(ClassFlag.TYPEDEF)) { + output("struct "); + } + output(clazzName); + output(" *get"); + output(simpleName); + output("Fields(JNIEnv *env, jobject lpObject, "); + if (clazz.getFlag(ClassFlag.STRUCT) && !clazz.getFlag(ClassFlag.TYPEDEF)) { + output("struct "); + } + output(clazzName); + outputln(" *lpStruct);"); + output("void set"); + output(simpleName); + output("Fields(JNIEnv *env, jobject lpObject, "); + if (clazz.getFlag(ClassFlag.STRUCT) && !clazz.getFlag(ClassFlag.TYPEDEF)) { + output("struct "); + } + output(clazzName); + outputln(" *lpStruct);"); + } + + void generateFIDsStructure(JNIClass clazz) { + String simpleName = clazz.getSimpleName(); + output("typedef struct "); + output(simpleName); + outputln("_FID_CACHE {"); + outputln("\tint cached;"); + outputln("\tjclass clazz;"); + List fields = clazz.getDeclaredFields(); + boolean first = true; + for (JNIField field : fields) { + if (ignoreField(field)) + continue; + if (first) + output("\tjfieldID "); + else + output(", "); + output(field.getName()); + first = false; + } + outputln(";"); + output("} "); + output(simpleName); + outputln("_FID_CACHE;"); + } + + void generateCacheFunction(JNIClass clazz) { + String simpleName = clazz.getSimpleName(); + String clazzName = clazz.getNativeName(); + output("void cache"); + output(simpleName); + outputln("Fields(JNIEnv *env, jobject lpObject)"); + outputln("{"); + output("\tif ("); + output(simpleName); + outputln("Fc.cached) return;"); + JNIClass superclazz = clazz.getSuperclass(); + if (!superclazz.getName().equals("java.lang.Object") && hasNonIgnoredFields(superclazz)) { + String superName = superclazz.getSimpleName(); + output("\tcache"); + output(superName); + outputln("Fields(env, lpObject);"); + } + output("\t"); + output(simpleName); + if (isCPP) { + if (GLOBAL_REF) { + output("Fc.clazz = (jclass)env->NewGlobalRef(env->GetObjectClass(lpObject));"); + } else { + output("Fc.clazz = env->GetObjectClass(lpObject);"); + } + } else { + if (GLOBAL_REF) { + output("Fc.clazz = (*env)->NewGlobalRef(env, (*env)->GetObjectClass(env, lpObject));"); + } else { + output("Fc.clazz = (*env)->GetObjectClass(env, lpObject);"); + } + } + outputln(); + List fields = clazz.getDeclaredFields(); + for (JNIField field : fields) { + if (ignoreField(field)) + continue; + output("\t"); + output(simpleName); + output("Fc."); + output(field.getName()); + if (isCPP) { + output(" = env->GetFieldID("); + } else { + output(" = (*env)->GetFieldID(env, "); + } + output(simpleName); + output("Fc.clazz, \""); + output(field.getName()); + JNIType type = field.getType(), type64 = field.getType64(); + output("\", "); + if (type.equals(type64)) + output("\""); + output(type.getTypeSignature(!type.equals(type64))); + if (type.equals(type64)) + output("\""); + outputln(");"); + } + // Makes sure compiler/cpu does not reorder the following write before the previous updates are done. + outputln("\thawtjni_w_barrier();"); + output("\t"); + output(simpleName); + outputln("Fc.cached = 1;"); + outputln("}"); + } + + void generateGetFields(JNIClass clazz) { + JNIClass superclazz = clazz.getSuperclass(); + String clazzName = clazz.getNativeName(); + String superName = superclazz.getNativeName(); + String methodname; + if (!superclazz.getName().equals("java.lang.Object") && hasNonIgnoredFields(superclazz)) { + /* + * Windows exception - cannot call get/set function of super class + * in this case + */ + if (!(clazzName.equals(superName + "A") || clazzName.equals(superName + "W"))) { + output("\tget"); + output(superName); + output("Fields(env, lpObject, ("); + output(superName); + outputln(" *)lpStruct);"); + } else { + generateGetFields(superclazz); + } + } + List fields = clazz.getDeclaredFields(); + int sharePtrIndex = 0; + for (JNIField field : fields) { + if (ignoreField(field)) + continue; + String conditional = field.getConditional(); + if (conditional != null) { + outputln("#if " + conditional); + } + JNIType type = field.getType(), type64 = field.getType64(); + String simpleName = type.getSimpleName(); + JNIFieldAccessor accessor = field.getAccessor(); + boolean allowConversion = !type.equals(type64); + output("\t"); + if (type.isPrimitive()) { + if (!accessor.isNonMemberSetter()) + output("lpStruct->"); + if (accessor.isMethodSetter()) { + String setterStart = accessor.setter().split("\\(")[0]; + output(setterStart + "("); + if (accessor.isNonMemberSetter()) + output("lpStruct, "); + } else { + output(accessor.setter()); + output(" = "); + } + if (field.isSharedPointer()) + output("std::make_shared<" + type.getTypeSignature2(allowConversion) + ">("); + else + output(field.getCast()); + + if (field.isPointer()) { + output("(intptr_t)"); + } + if (isCPP) { + output("env->Get"); + } else { + output("(*env)->Get"); + } + output(type.getTypeSignature1(!type.equals(type64))); + if (isCPP) { + output("Field(lpObject, "); + } else { + output("Field(env, lpObject, "); + } + output(field.getDeclaringClass().getSimpleName()); + output("Fc."); + output(field.getName()); + if (field.isSharedPointer()) + output(")"); + if (accessor.isMethodSetter()) + output(")"); + output(");"); + } else if (type.isArray()) { + JNIType componentType = type.getComponentType(), componentType64 = type64.getComponentType(); + if (componentType.isPrimitive()) { + if (field.isSharedPointer()) { + output("(&"); + output("lpStruct->" + accessor); + output("));"); + } + outputln("{"); + output("\t"); + output(type.getTypeSignature2(!type.equals(type64))); + output(" lpObject1 = ("); + output(type.getTypeSignature2(!type.equals(type64))); + if (isCPP) { + output(")env->GetObjectField(lpObject, "); + } else { + output(")(*env)->GetObjectField(env, lpObject, "); + } + output(field.getDeclaringClass().getSimpleName()); + output("Fc."); + output(field.getName()); + outputln(");"); + if (isCPP) { + output("\tenv->Get"); + } else { + output("\t(*env)->Get"); + } + output(componentType.getTypeSignature1(!componentType.equals(componentType64))); + if (isCPP) { + output("ArrayRegion(lpObject1, 0, sizeof("); + } else { + output("ArrayRegion(env, lpObject1, 0, sizeof("); + } + if (!accessor.isNonMemberGetter()) + output("lpStruct->"); + output(accessor.getter()); + output(")"); + if (!componentType.isType("byte")) { + output(" / sizeof("); + output(componentType.getTypeSignature2(!componentType.equals(componentType64))); + output(")"); + } + output(", ("); + output(type.getTypeSignature4(!type.equals(type64), false)); + output(")"); + if (!accessor.isNonMemberGetter()) + output("lpStruct->"); + output(accessor.getter()); + outputln(");"); + output("\t}"); + } else { + throw new Error("not done"); + } + } else { + outputln("\t{"); + if (isCPP) { + output("\tjobject lpObject1 = env->GetObjectField(lpObject, "); + } else { + output("\tjobject lpObject1 = (*env)->GetObjectField(env, lpObject, "); + } + output(field.getDeclaringClass().getSimpleName()); + output("Fc."); + output(field.getName()); + outputln(");"); + output("\tif (lpObject1 != NULL) get"); + output(simpleName); + output("Fields(env, lpObject1, &lpStruct->"); + output(accessor.getter()); + outputln(");"); + output("\t}"); + } + outputln(); + if (conditional != null) { + outputln("#endif"); + } + } + } + + void generateGetFunction(JNIClass clazz) { + String clazzName = clazz.getNativeName(); + String simpleName = clazz.getSimpleName(); + if (clazz.getFlag(ClassFlag.STRUCT) && !clazz.getFlag(ClassFlag.TYPEDEF)) { + output("struct "); + } + output(clazzName); + output(" *get"); + output(simpleName); + output("Fields(JNIEnv *env, jobject lpObject, "); + if (clazz.getFlag(ClassFlag.STRUCT) && !clazz.getFlag(ClassFlag.TYPEDEF)) { + output("struct "); + } + output(clazzName); + outputln(" *lpStruct)"); + outputln("{"); + output("\tif (!"); + output(simpleName); + output("Fc.cached) cache"); + output(simpleName); + outputln("Fields(env, lpObject);"); + if (clazz.getFlag(ClassFlag.ZERO_OUT)) { + outputln("memset(lpStruct, 0, sizeof(struct " + clazzName + "));"); + } + generateGetFields(clazz); + outputln("\treturn lpStruct;"); + outputln("}"); + } + + void generateSetFields(JNIClass clazz) { + JNIClass superclazz = clazz.getSuperclass(); + String clazzName = clazz.getNativeName(); + String superName = superclazz.getNativeName(); + if (!superclazz.getName().equals("java.lang.Object") && hasNonIgnoredFields(superclazz)) { + /* + * Windows exception - cannot call get/set function of super class + * in this case + */ + if (!(clazzName.equals(superName + "A") || clazzName.equals(superName + "W"))) { + output("\tset"); + output(superName); + output("Fields(env, lpObject, ("); + output(superName); + outputln(" *)lpStruct);"); + } else { + generateSetFields(superclazz); + } + } + List fields = clazz.getDeclaredFields(); + for (JNIField field : fields) { + if (ignoreField(field)) + continue; + String conditional = field.getConditional(); + if (conditional != null) { + outputln("#if " + conditional); + } + JNIType type = field.getType(), type64 = field.getType64(); + boolean allowConversion = !type.equals(type64); + + String simpleName = type.getSimpleName(); + JNIFieldAccessor accessor = field.getAccessor(); + if (type.isPrimitive()) { + if (isCPP) { + output("\tenv->Set"); + } else { + output("\t(*env)->Set"); + } + output(type.getTypeSignature1(allowConversion)); + if (isCPP) { + output("Field(lpObject, "); + } else { + output("Field(env, lpObject, "); + } + output(field.getDeclaringClass().getSimpleName()); + output("Fc."); + output(field.getName()); + output(", "); + output("(" + type.getTypeSignature2(allowConversion) + ")"); + if (field.isPointer()) { + output("(intptr_t)"); + } + if (!accessor.isNonMemberGetter()) + output("lpStruct->"); + if (accessor.isMethodGetter()) { + String getterStart = accessor.getter().split("\\(")[0]; + output(getterStart + "("); + if (accessor.isNonMemberGetter()) + output("lpStruct"); + if (field.isSharedPointer()) + output("->" + field.getName()); + output(")"); + } else { + output(accessor.getter()); + } + if (field.isSharedPointer()) { + output(".get()"); + } + output(");"); + } else if (type.isArray()) { + JNIType componentType = type.getComponentType(), componentType64 = type64.getComponentType(); + if (componentType.isPrimitive()) { + outputln("\t{"); + output("\t"); + output(type.getTypeSignature2(allowConversion)); + output(" lpObject1 = ("); + output(type.getTypeSignature2(allowConversion)); + if (isCPP) { + output(")env->GetObjectField(lpObject, "); + } else { + output(")(*env)->GetObjectField(env, lpObject, "); + } + output(field.getDeclaringClass().getSimpleName()); + output("Fc."); + output(field.getName()); + outputln(");"); + if (isCPP) { + output("\tenv->Set"); + } else { + output("\t(*env)->Set"); + } + output(componentType.getTypeSignature1(!componentType.equals(componentType64))); + if (isCPP) { + output("ArrayRegion(lpObject1, 0, sizeof("); + } else { + output("ArrayRegion(env, lpObject1, 0, sizeof("); + } + if (!accessor.isNonMemberGetter()) + output("lpStruct->"); + if (accessor.isMethodGetter()) { + String getterStart = accessor.getter().split("\\(")[0]; + output(getterStart + "("); + if (accessor.isNonMemberGetter()) + output("lpStruct"); + output(")"); + } else { + output(accessor.getter()); + } + output(")"); + if (!componentType.isType("byte")) { + output(" / sizeof("); + output(componentType.getTypeSignature2(!componentType.equals(componentType64))); + output(")"); + } + output(", ("); + output(type.getTypeSignature4(allowConversion, false)); + output(")"); + if (!accessor.isNonMemberGetter()) + output("lpStruct->"); + output(accessor.getter()); + outputln(");"); + output("\t}"); + } else { + throw new Error("not done"); + } + } else { + outputln("\t{"); + if (isCPP) { + output("\tjobject lpObject1 = env->GetObjectField(lpObject, "); + } else { + output("\tjobject lpObject1 = (*env)->GetObjectField(env, lpObject, "); + } + output(field.getDeclaringClass().getSimpleName()); + output("Fc."); + output(field.getName()); + outputln(");"); + output("\tif (lpObject1 != NULL) set"); + output(simpleName); + output("Fields(env, lpObject1, &lpStruct->"); + output(accessor.getter()); + outputln(");"); + output("\t}"); + } + outputln(); + if (conditional != null) { + outputln("#endif"); + } + } + } + + void generateSetFunction(JNIClass clazz) { + String clazzName = clazz.getNativeName(); + String simpleName = clazz.getSimpleName(); + output("void set"); + output(simpleName); + output("Fields(JNIEnv *env, jobject lpObject, "); + if (clazz.getFlag(ClassFlag.STRUCT) && !clazz.getFlag(ClassFlag.TYPEDEF)) { + output("struct "); + } + output(clazzName); + outputln(" *lpStruct)"); + outputln("{"); + output("\tif (!"); + output(simpleName); + output("Fc.cached) cache"); + output(simpleName); + outputln("Fields(env, lpObject);"); + generateSetFields(clazz); + outputln("}"); + } + + void generateFunctions(JNIClass clazz) { + generateCacheFunction(clazz); + outputln(); + generateGetFunction(clazz); + outputln(); + generateSetFunction(clazz); + } + + boolean ignoreField(JNIField field) { + int mods = field.getModifiers(); + return field.ignore() || ((mods & Modifier.FINAL) != 0) || ((mods & Modifier.STATIC) != 0); + } + + boolean hasNonIgnoredFields(JNIClass clazz) { + for (JNIField field : getStructFields(clazz)) + if (!ignoreField(field)) return true; + return false; + } + +} + diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/JNIClass.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/JNIClass.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/JNIClass.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/JNIClass.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,37 @@ +/******************************************************************************* + * Copyright (C) 2009-2011 FuseSource Corp. + * Copyright (c) 2004, 2008 IBM Corporation and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + *******************************************************************************/ +package org.fusesource.hawtjni.generator.model; + +import java.util.List; + +import org.fusesource.hawtjni.runtime.ClassFlag; + +/** + * + * @author Hiram Chirino + */ +public interface JNIClass { + + public boolean getFlag(ClassFlag flag); + + public String getName(); + public String getSimpleName(); + public String getNativeName(); + + public JNIClass getSuperclass(); + public List getDeclaredFields(); + public List getDeclaredMethods(); + public List getNativeMethods(); + + + public boolean getGenerate(); + public String getConditional(); +} diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/JNIField.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/JNIField.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/JNIField.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/JNIField.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,37 @@ +/******************************************************************************* + * Copyright (C) 2009-2011 FuseSource Corp. + * Copyright (c) 2004, 2008 IBM Corporation and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + *******************************************************************************/ +package org.fusesource.hawtjni.generator.model; + +import org.fusesource.hawtjni.runtime.FieldFlag; + +/** + * + * @author Hiram Chirino + */ +public interface JNIField { + + public boolean getFlag(FieldFlag flag); + + public String getName(); + public int getModifiers(); + + public JNIType getType(); + public JNIType getType64(); + + public JNIClass getDeclaringClass(); + public JNIFieldAccessor getAccessor(); + public String getCast(); + public String getConditional(); + public boolean ignore(); + + public boolean isSharedPointer(); + public boolean isPointer(); +} diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/JNIFieldAccessor.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/JNIFieldAccessor.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/JNIFieldAccessor.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/JNIFieldAccessor.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package org.fusesource.hawtjni.generator.model; + +/** + * @author Calin Iorgulescu + */ +public interface JNIFieldAccessor { + public String getter(); + + public String setter(); + + public boolean isNonMemberGetter(); + + public boolean isNonMemberSetter(); + + public boolean isMethodGetter(); + + public boolean isMethodSetter(); + +} diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/JNIMethod.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/JNIMethod.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/JNIMethod.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/JNIMethod.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,56 @@ +/******************************************************************************* + * Copyright (C) 2009-2011 FuseSource Corp. + * Copyright (c) 2004, 2008 IBM Corporation and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + *******************************************************************************/ +package org.fusesource.hawtjni.generator.model; + +import java.util.List; + +import org.fusesource.hawtjni.runtime.ArgFlag; +import org.fusesource.hawtjni.runtime.MethodFlag; + +/** + * + * @author Hiram Chirino + */ +public interface JNIMethod { + + public boolean getFlag(MethodFlag flag); + + public String getName(); + + public int getModifiers(); + + public boolean isNativeUnique(); + + public JNIType getReturnType32(); + + public JNIType getReturnType64(); + + public List getParameters(); + + public List getParameterTypes(); + + public List getParameterTypes64(); + + public JNIClass getDeclaringClass(); + + public String getAccessor(); + + public String getConditional(); + + public String getCopy(); + + public String[] getCallbackTypes(); + public ArgFlag[][] getCallbackFlags(); + + public String getCast(); + + public boolean isPointer(); +} diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/JNIParameter.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/JNIParameter.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/JNIParameter.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/JNIParameter.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,31 @@ +/******************************************************************************* + * Copyright (C) 2009-2011 FuseSource Corp. + * Copyright (c) 2004, 2008 IBM Corporation and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + *******************************************************************************/ +package org.fusesource.hawtjni.generator.model; + +import org.fusesource.hawtjni.runtime.ArgFlag; + +/** + * + * @author Hiram Chirino + */ +public interface JNIParameter { + + public boolean getFlag(ArgFlag flag); + public String getCast(); + public boolean isPointer(); + + public JNIMethod getMethod(); + public int getParameter(); + public JNIClass getTypeClass(); + public JNIType getType32(); + public JNIType getType64(); + +} diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/JNIType.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/JNIType.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/JNIType.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/JNIType.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,32 @@ +/******************************************************************************* + * Copyright (C) 2009-2011 FuseSource Corp. + * Copyright (c) 2004, 2008 IBM Corporation and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + *******************************************************************************/ +package org.fusesource.hawtjni.generator.model; + +/** + * + * @author Hiram Chirino + */ +public interface JNIType { + + public boolean isPrimitive(); + public boolean isArray(); + public JNIType getComponentType(); + public boolean isType(String type); + public String getName(); + public String getSimpleName(); + public String getNativeName(); + public String getTypeSignature(boolean define); + public String getTypeSignature1(boolean define); + public String getTypeSignature2(boolean define); + public String getTypeSignature3(boolean define); + public String getTypeSignature4(boolean define, boolean struct); + +} diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/ReflectClass.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/ReflectClass.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/ReflectClass.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/ReflectClass.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,151 @@ +/******************************************************************************* + * Copyright (C) 2009-2011 FuseSource Corp. + * Copyright (c) 2004, 2008 IBM Corporation and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + *******************************************************************************/ +package org.fusesource.hawtjni.generator.model; + +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; + +import org.fusesource.hawtjni.runtime.ClassFlag; +import org.fusesource.hawtjni.runtime.JniClass; + +/** + * + * @author Hiram Chirino + */ +public class ReflectClass implements JNIClass { + + private Class clazz; + private ArrayList fields; + private ArrayList methods; + private JniClass annotation; + private HashSet flags; + private String nativeName; + + public ReflectClass(Class clazz) { + this.clazz = clazz; + } + + public String toString() { + return clazz.toString(); + } + public int hashCode() { + return clazz.hashCode(); + } + public boolean equals(Object obj) { + if (!(obj instanceof ReflectClass)) + return false; + return ((ReflectClass) obj).clazz.equals(clazz); + } + + public Class getWrapedClass() { + return clazz; + } + + /////////////////////////////////////////////////////////////////// + // JNIClass interface methods + /////////////////////////////////////////////////////////////////// + + public String getName() { + return clazz.getName(); + } + + public JNIClass getSuperclass() { + return new ReflectClass(clazz.getSuperclass()); + } + + public String getSimpleName() { + return clazz.getSimpleName(); + } + + public String getNativeName() { + lazyLoad(); + if( nativeName!=null ) + return nativeName; + else + return getSimpleName(); + } + + public List getDeclaredFields() { + lazyLoad(); + return new ArrayList(fields); + } + + public List getDeclaredMethods() { + lazyLoad(); + return new ArrayList(methods); + } + + public List getNativeMethods() { + ArrayList rc = new ArrayList(); + for (JNIMethod method : getDeclaredMethods()) { + if ((method.getModifiers() & Modifier.NATIVE) == 0) + continue; + rc.add(method); + } + return rc; + } + + public String getConditional() { + lazyLoad(); + return annotation == null ? null : emptyFilter(annotation.conditional()); + } + + public boolean getGenerate() { + return !getFlag(ClassFlag.CLASS_SKIP); + } + + public boolean getFlag(ClassFlag flag) { + lazyLoad(); + return flags.contains(flag); + } + + /////////////////////////////////////////////////////////////////// + // Helper methods + /////////////////////////////////////////////////////////////////// + static public String emptyFilter(String value) { + if( value==null || value.length()==0 ) + return null; + return value; + } + + private void lazyLoad() { + if (fields != null) + return; + + this.annotation = this.clazz.getAnnotation(JniClass.class); + this.flags = new HashSet(); + if( this.annotation!=null ) { + this.flags.addAll(Arrays.asList(this.annotation.flags())); + if( this.annotation.name().trim().length() > 0 ) { + this.nativeName = this.annotation.name().trim(); + } + } + + + Field[] fields = clazz.getDeclaredFields(); + this.fields = new ArrayList(fields.length); + for (Field field : fields) { + this.fields.add(new ReflectField(this, field)); + } + + Method[] methods = clazz.getDeclaredMethods(); + this.methods = new ArrayList(methods.length); + for (Method method : methods) { + this.methods.add(new ReflectMethod(this, method)); + } + } + +} diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/ReflectField.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/ReflectField.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/ReflectField.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/ReflectField.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,157 @@ +/******************************************************************************* + * Copyright (C) 2009-2011 FuseSource Corp. + * Copyright (c) 2004, 2008 IBM Corporation and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + *******************************************************************************/ +package org.fusesource.hawtjni.generator.model; + +import java.lang.reflect.Field; +import java.util.Arrays; +import java.util.HashSet; +import org.apache.commons.lang.StringUtils; +import org.fusesource.hawtjni.runtime.FieldFlag; +import org.fusesource.hawtjni.runtime.JniField; +import org.fusesource.hawtjni.runtime.T32; + +import static org.fusesource.hawtjni.generator.util.TextSupport.*; +import static org.fusesource.hawtjni.runtime.FieldFlag.*; + +/** + * + * @author Hiram Chirino + */ +public class ReflectField implements JNIField { + + private ReflectClass parent; + private Field field; + private ReflectType type; + private JniField annotation; + private HashSet flags; + private boolean allowConversion; + private ReflectFieldAccessor accessor; + + public ReflectField(ReflectClass parent, Field field) { + this.parent = parent; + this.field = field; + lazyLoad(); + } + + public int hashCode() { + return field.hashCode(); + } + + public boolean equals(Object obj) { + if (!(obj instanceof ReflectField)) + return false; + return ((ReflectField) obj).field.equals(field); + } + + public String toString() { + return field.toString(); + } + + /////////////////////////////////////////////////////////////////// + // JNIField interface methods + /////////////////////////////////////////////////////////////////// + + public JNIClass getDeclaringClass() { + return parent; + } + + public int getModifiers() { + return field.getModifiers(); + } + + public String getName() { + return field.getName(); + } + + public JNIType getType() { + return type.asType32(allowConversion); + } + + public JNIType getType64() { + return type.asType64(allowConversion); + } + + public JNIFieldAccessor getAccessor() { + return accessor; + } + + public String getCast() { + String rc = annotation == null ? "" : annotation.cast().trim(); + return cast(rc); + } + + public boolean ignore() { + return getFlag(FieldFlag.FIELD_SKIP); + } + + public boolean isPointer() { + if( annotation == null ) { + return false; + } + return getFlag(POINTER_FIELD) || ( type.getWrappedClass() == Long.TYPE && getCast().endsWith("*") ); + } + + public boolean isSharedPointer() { + if (annotation == null) { + return false; + } + return getFlag(SHARED_PTR); + } + + public String getConditional() { + String parentConditional = getDeclaringClass().getConditional(); + String myConditional = annotation == null ? null : emptyFilter(annotation.conditional()); + if( parentConditional!=null ) { + if( myConditional!=null ) { + return parentConditional+" && "+myConditional; + } else { + return parentConditional; + } + } + return myConditional; + } + + public boolean getFlag(FieldFlag flag) { + return flags.contains(flag); + } + + /////////////////////////////////////////////////////////////////// + // Helper methods + /////////////////////////////////////////////////////////////////// + static public String emptyFilter(String value) { + if( value==null || value.length()==0 ) + return null; + return value; + } + + private void lazyLoad() { + this.type = new ReflectType(field.getType()); + this.annotation = this.field.getAnnotation(JniField.class); + this.flags = new HashSet(); + this.accessor = new ReflectFieldAccessor(this.field.getName()); + if( this.annotation!=null ) { + this.flags.addAll(Arrays.asList(this.annotation.flags())); + if (!StringUtils.isEmpty(this.annotation.accessor())) { + this.accessor = new ReflectFieldAccessor(this.annotation.accessor()); + } else if (!StringUtils.isEmpty(this.annotation.getter()) && + !StringUtils.isEmpty(this.annotation.setter())) { + this.accessor = new ReflectFieldAccessor( + this.annotation.getter(), + this.flags.contains(GETTER_NONMEMBER), + this.annotation.setter(), + this.flags.contains(SETTER_NONMEMBER)); + } + } + + allowConversion = this.field.getAnnotation(T32.class)!=null; + } + +} diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/ReflectFieldAccessor.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/ReflectFieldAccessor.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/ReflectFieldAccessor.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/ReflectFieldAccessor.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,48 @@ +package org.fusesource.hawtjni.generator.model; + +/** + * @author Calin Iorgulescu + */ +public class ReflectFieldAccessor implements JNIFieldAccessor { + + private String getter; + private String setter; + private boolean nonMemberGetter; + private boolean nonMemberSetter; + + public ReflectFieldAccessor(String value) { + this.getter = this.setter = value; + this.nonMemberGetter = this.nonMemberSetter = false; + } + + public ReflectFieldAccessor(String getter, boolean nonMemberGetter, String setter, boolean nonMemberSetter) { + this.getter = getter; + this.nonMemberGetter = nonMemberGetter; + this.setter = setter; + this.nonMemberSetter = nonMemberSetter; + } + + public String getter() { + return getter; + } + + public String setter() { + return setter; + } + + public boolean isNonMemberGetter() { + return nonMemberGetter; + } + + public boolean isNonMemberSetter() { + return nonMemberSetter; + } + + public boolean isMethodGetter() { + return getter.contains("("); + } + + public boolean isMethodSetter() { + return setter.contains("("); + } +} diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/ReflectMethod.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/ReflectMethod.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/ReflectMethod.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/ReflectMethod.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,242 @@ +/******************************************************************************* + * Copyright (C) 2009-2011 FuseSource Corp. + * Copyright (c) 2004, 2008 IBM Corporation and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + *******************************************************************************/ +package org.fusesource.hawtjni.generator.model; + +import java.lang.annotation.Annotation; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; + +import org.fusesource.hawtjni.runtime.ArgFlag; +import org.fusesource.hawtjni.runtime.JniArg; +import org.fusesource.hawtjni.runtime.JniMethod; +import org.fusesource.hawtjni.runtime.MethodFlag; +import org.fusesource.hawtjni.runtime.T32; + +import static org.fusesource.hawtjni.generator.util.TextSupport.*; +import static org.fusesource.hawtjni.runtime.MethodFlag.*; + +/** + * + * @author Hiram Chirino + */ +public class ReflectMethod implements JNIMethod { + + private ReflectClass declaringClass; + private Method method; + + private List paramTypes32; + private List paramTypes64; + private List parameters; + private boolean unique; + private JniMethod annotation; + + private boolean allowConversion; + private ReflectType returnType; + + private HashSet flags; + + public ReflectMethod(ReflectClass declaringClass, Method method) { + this.declaringClass = declaringClass; + this.method = method; + lazyLoad(); + } + + public int hashCode() { + return method.hashCode(); + } + + public boolean equals(Object obj) { + if (!(obj instanceof ReflectMethod)) + return false; + return ((ReflectMethod) obj).method.equals(method); + } + + public String toString() { + return method.toString(); + } + + public Method getWrapedMethod() { + return method; + } + + /////////////////////////////////////////////////////////////////// + // JNIMethod interface methods + /////////////////////////////////////////////////////////////////// + + public JNIClass getDeclaringClass() { + return declaringClass; + } + + public int getModifiers() { + return method.getModifiers(); + } + + public String getName() { + return method.getName(); + } + + public List getParameters() { + lazyLoad(); + return parameters; + } + + public List getParameterTypes() { + lazyLoad(); + return paramTypes32; + } + + public List getParameterTypes64() { + lazyLoad(); + return paramTypes64; + } + + public JNIType getReturnType32() { + lazyLoad(); + return returnType.asType32(allowConversion); + } + + public JNIType getReturnType64() { + lazyLoad(); + return returnType.asType64(allowConversion); + } + + public boolean getFlag(MethodFlag flag) { + lazyLoad(); + return flags.contains(flag); + } + + public String getCast() { + lazyLoad(); + String rc = annotation == null ? "" : annotation.cast(); + return cast(rc); + } + + public boolean isPointer() { + lazyLoad(); + if( annotation == null ) { + return false; + } + return getFlag(POINTER_RETURN) || ( returnType.getWrappedClass() == Long.TYPE && getCast().endsWith("*)") ); + } + + public String getCopy() { + lazyLoad(); + return annotation == null ? "" : annotation.copy(); + } + + public String getAccessor() { + lazyLoad(); + return annotation == null ? "" : annotation.accessor(); + } + + public String getConditional() { + lazyLoad(); + + String parentConditional = getDeclaringClass().getConditional(); + String myConditional = annotation == null ? null : emptyFilter(annotation.conditional()); + if( parentConditional!=null ) { + if( myConditional!=null ) { + return parentConditional+" && "+myConditional; + } else { + return parentConditional; + } + } + return myConditional; + } + + public boolean isNativeUnique() { + lazyLoad(); + return unique; + } + + public String[] getCallbackTypes() { + lazyLoad(); + if( annotation==null ) { + return new String[0]; + } + + JniArg[] callbackArgs = annotation.callbackArgs(); + String[] rc = new String[callbackArgs.length]; + for (int i = 0; i < rc.length; i++) { + rc[i] = callbackArgs[i].cast(); + } + + return rc; + } + + public ArgFlag[][] getCallbackFlags() { + lazyLoad(); + if( annotation==null ) { + return new ArgFlag[0][]; + } + + JniArg[] callbackArgs = annotation.callbackArgs(); + ArgFlag[][] rc = new ArgFlag[callbackArgs.length][]; + for (int i = 0; i < rc.length; i++) { + rc[i] = callbackArgs[i].flags(); + } + return rc; + } + + + /////////////////////////////////////////////////////////////////// + // Helper methods + /////////////////////////////////////////////////////////////////// + static public String emptyFilter(String value) { + if( value==null || value.length()==0 ) + return null; + return value; + } + + private void lazyLoad() { + if( flags!=null ) { + return; + } + + this.annotation = this.method.getAnnotation(JniMethod.class); + this.allowConversion = method.getAnnotation(T32.class)!=null; + this.flags = new HashSet(); + if( this.annotation!=null ) { + this.flags.addAll(Arrays.asList(this.annotation.flags())); + } + + Class returnType = method.getReturnType(); + Class[] paramTypes = method.getParameterTypes(); + + this.paramTypes32 = new ArrayList(paramTypes.length); + this.paramTypes64 = new ArrayList(paramTypes.length); + this.parameters = new ArrayList(paramTypes.length); + this.returnType = new ReflectType(returnType); + + Annotation[][] parameterAnnotations = method.getParameterAnnotations(); + for (int i = 0; i < paramTypes.length; i++) { + ReflectParameter parameter = new ReflectParameter(this, i, parameterAnnotations[i]); + this.parameters.add(parameter); + this.paramTypes32.add( parameter.getType32() ); + this.paramTypes64.add( parameter.getType64() ); + } + + unique = true; + Class parent = ((ReflectClass)declaringClass).getWrapedClass(); + String name = method.getName(); + for (Method mth : parent.getDeclaredMethods() ) { + if ( (mth.getModifiers()&Modifier.NATIVE) != 0 && method!=mth && !method.equals(mth) && name.equals(mth.getName())) { + unique = false; + break; + } + } + + } +} diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/ReflectParameter.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/ReflectParameter.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/ReflectParameter.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/ReflectParameter.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,92 @@ +/******************************************************************************* + * Copyright (C) 2009-2011 FuseSource Corp. + * Copyright (c) 2004, 2008 IBM Corporation and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + *******************************************************************************/ +package org.fusesource.hawtjni.generator.model; + +import java.lang.annotation.Annotation; +import java.util.Arrays; +import java.util.HashSet; + +import org.fusesource.hawtjni.runtime.ArgFlag; +import org.fusesource.hawtjni.runtime.JniArg; +import org.fusesource.hawtjni.runtime.T32; + +import static org.fusesource.hawtjni.generator.util.TextSupport.*; +import static org.fusesource.hawtjni.runtime.ArgFlag.*; + +/** + * + * @author Hiram Chirino + */ +public class ReflectParameter implements JNIParameter { + + private ReflectMethod method; + private ReflectType type; + private int parameter; + + private JniArg annotation; + private boolean allowConversion; + private HashSet flags; + + public ReflectParameter(ReflectMethod method, int parameter, Annotation[] annotations) { + this.method = method; + this.parameter = parameter; + this.type = new ReflectType(method.getWrapedMethod().getParameterTypes()[parameter]); + this.flags = new HashSet(); + if( annotations!=null ) { + for (Annotation annotation : annotations) { + if( annotation instanceof JniArg ) { + this.annotation = (JniArg) annotation; + this.flags.addAll(Arrays.asList(this.annotation.flags())); + } else if( annotation instanceof T32 ) { + this.allowConversion = true; + } + } + } + } + + public String getCast() { + String rc = annotation == null ? "" : annotation.cast(); + return cast(rc); + } + + public boolean isPointer() { + if( annotation == null ) { + return false; + } + return getFlag(POINTER_ARG) || ( type.getWrappedClass() == Long.TYPE && getCast().endsWith("*)") ); + } + + public JNIMethod getMethod() { + return method; + } + + public boolean getFlag(ArgFlag flag) { + return flags.contains(flag); + } + + public JNIType getType32() { + return type.asType32(allowConversion); + } + + public JNIType getType64() { + return type.asType64(allowConversion); + } + + public JNIClass getTypeClass() { + ReflectType type = (ReflectType) getType32(); + return new ReflectClass(type.getWrappedClass()); + } + + public int getParameter() { + return parameter; + } + +} diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/ReflectType.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/ReflectType.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/ReflectType.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/ReflectType.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,247 @@ +/******************************************************************************* + * Copyright (C) 2009-2011 FuseSource Corp. + * Copyright (c) 2004, 2008 IBM Corporation and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + *******************************************************************************/ +package org.fusesource.hawtjni.generator.model; + +import org.fusesource.hawtjni.runtime.JniClass; + +/** + * + * @author Hiram Chirino + */ +public class ReflectType implements JNIType { + + private Class clazz; + + public ReflectType(Class clazz) { + this.clazz = clazz; + } + + public int hashCode() { + return clazz.hashCode(); + } + + public boolean equals(Object obj) { + if (obj == this) + return true; + if (!(obj instanceof ReflectType)) + return false; + return ((ReflectType) obj).clazz == clazz; + } + + public Class getWrappedClass() { + return clazz; + } + + public ReflectType asType32(boolean allowConversion) { + if (allowConversion) { + if (clazz == long.class) + return new ReflectType(int.class); + else if (clazz == long[].class) + return new ReflectType(int[].class); + else if (clazz == double.class) + return new ReflectType(float.class); + else if (clazz == double[].class) + return new ReflectType(float[].class); + } + return this; + } + + public ReflectType asType64(boolean allowConversion) { + if (allowConversion) { + if (clazz == int.class) + return new ReflectType(long.class); + else if (clazz == int[].class) + return new ReflectType(long[].class); + else if (clazz == float.class) + return new ReflectType(double.class); + else if (clazz == float[].class) + return new ReflectType(double[].class); + } + return this; + } + + public JNIType getComponentType() { + return new ReflectType(clazz.getComponentType()); + } + + public String getName() { + return clazz.getName(); + } + + public String getSimpleName() { + return clazz.getSimpleName(); + } + + public String getNativeName() { + JniClass annotation = clazz.getAnnotation(JniClass.class); + if( annotation==null ) { + return getSimpleName(); + } else { + String name = annotation.name().trim(); + if( name.length()==0 ) { + return getSimpleName(); + } else { + return name; + } + } + } + + public String getTypeSignature(boolean define) { + if (clazz == Void.TYPE) + return "V"; + if (clazz == Integer.TYPE) + return define ? "I_J" : "I"; + if (clazz == Boolean.TYPE) + return "Z"; + if (clazz == Long.TYPE) + return define ? "J_J" : "J"; + if (clazz == Short.TYPE) + return "S"; + if (clazz == Character.TYPE) + return "C"; + if (clazz == Byte.TYPE) + return "B"; + if (clazz == Float.TYPE) + return define ? "F_D" : "F"; + if (clazz == Double.TYPE) + return define ? "F_D" : "D"; + if (clazz == String.class) + return "Ljava/lang/String;"; + if (clazz.isArray()) { + if (define) + return getComponentType().getTypeSignature(define) + "Array"; + return "[" + getComponentType().getTypeSignature(define); + } + return "L" + clazz.getName().replace('.', '/') + ";"; + } + + public String getTypeSignature1(boolean define) { + if (clazz == Void.TYPE) + return "Void"; + if (clazz == Integer.TYPE) + return define ? "IntLong" : "Int"; + if (clazz == Boolean.TYPE) + return "Boolean"; + if (clazz == Long.TYPE) + return define ? "IntLong" : "Long"; + if (clazz == Short.TYPE) + return "Short"; + if (clazz == Character.TYPE) + return "Char"; + if (clazz == Byte.TYPE) + return "Byte"; + if (clazz == Float.TYPE) + return define ? "FloatDouble" : "Float"; + if (clazz == Double.TYPE) + return define ? "FloatDouble" : "Double"; + if (clazz == String.class) + return "String"; + return "Object"; + } + + public String getTypeSignature2(boolean define) { + if (clazz == Void.TYPE) + return "void"; + if (clazz == Integer.TYPE) + return define ? "jintLong" : "jint"; + if (clazz == Boolean.TYPE) + return "jboolean"; + if (clazz == Long.TYPE) + return define ? "jintLong" : "jlong"; + if (clazz == Short.TYPE) + return "jshort"; + if (clazz == Character.TYPE) + return "jchar"; + if (clazz == Byte.TYPE) + return "jbyte"; + if (clazz == Float.TYPE) + return define ? "jfloatDouble" : "jfloat"; + if (clazz == Double.TYPE) + return define ? "jfloatDouble" : "jdouble"; + if (clazz == String.class) + return "jstring"; + if (clazz == Class.class) + return "jclass"; + if (clazz.isArray()) { + return getComponentType().getTypeSignature2(define) + "Array"; + } + return "jobject"; + } + + public String getTypeSignature3(boolean define) { + if (clazz == Void.TYPE) + return "void"; + if (clazz == Integer.TYPE) + return "int"; + if (clazz == Boolean.TYPE) + return "boolean"; + if (clazz == Long.TYPE) + return "long"; + if (clazz == Short.TYPE) + return "short"; + if (clazz == Character.TYPE) + return "char"; + if (clazz == Byte.TYPE) + return "byte"; + if (clazz == Float.TYPE) + return "float"; + if (clazz == Double.TYPE) + return "double"; + if (clazz == String.class) + return "String"; + if (clazz.isArray()) { + return getComponentType().getTypeSignature3(define) + "[]"; + } + return clazz.getName(); + } + + public String getTypeSignature4(boolean define, boolean struct) { + if (clazz == Void.TYPE) + return "void"; + if (clazz == Integer.TYPE) + return define ? "jintLong" : "jint"; + if (clazz == Boolean.TYPE) + return "jboolean"; + if (clazz == Long.TYPE) + return define ? "jintLong" : "jlong"; + if (clazz == Short.TYPE) + return "jshort"; + if (clazz == Character.TYPE) + return "jchar"; + if (clazz == Byte.TYPE) + return "jbyte"; + if (clazz == Float.TYPE) + return define ? "jfloatDouble" : "jfloat"; + if (clazz == Double.TYPE) + return define ? "jfloatDouble" : "jdouble"; + if (clazz == String.class) + return "jstring"; + if (clazz.isArray()) { + String sig = getComponentType().getTypeSignature4(define, struct); + return struct ? sig : sig + " *"; + } + String sig = getNativeName(); + return struct ? sig : sig + " *"; + } + + public boolean isArray() { + return clazz.isArray(); + } + + public boolean isPrimitive() { + return clazz.isPrimitive(); + } + + public boolean isType(String type) { + return clazz.getName().equals(type); + } + +} diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/util/FileSupport.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/util/FileSupport.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/util/FileSupport.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/util/FileSupport.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,97 @@ +/******************************************************************************* + * Copyright (C) 2009-2011 FuseSource Corp. + * Copyright (c) 2004, 2008 IBM Corporation and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + *******************************************************************************/ +package org.fusesource.hawtjni.generator.util; + +import java.io.BufferedInputStream; +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; + +/** + * + * @author Hiram Chirino + */ +public class FileSupport { + + public static boolean write(byte[] bytes, File file) throws IOException { + if( !equals(bytes, file) ) { + FileOutputStream out = new FileOutputStream(file); + try { + out.write(bytes); + } finally { + out.close(); + } + return true; + } + return false; + } + + public static void copy(InputStream is, OutputStream os) throws IOException { + try { + byte data[] = new byte[1024*4]; + int count; + while( (count=is.read(data, 0, data.length))>=0 ) { + os.write(data, 0, count); + } + } finally { + close(is); + close(os); + } + } + + public static boolean equals(byte[] bytes, File file) throws IOException { + FileInputStream is = null; + try { + is = new FileInputStream(file); + return equals(new ByteArrayInputStream(bytes), new BufferedInputStream(is)); + } catch (FileNotFoundException e) { + return false; + } finally { + close(is); + } + } + + public static void close(InputStream is) { + try { + if (is != null) + is.close(); + } catch (Throwable e) { + } + } + + public static void close(OutputStream ioss) { + try { + if (ioss != null) + ioss.close(); + } catch (Throwable e) { + } + } + + public static boolean equals(InputStream is1, InputStream is2) throws IOException { + while (true) { + int c1 = is1.read(); + int c2 = is2.read(); + if (c1 != c2) + return false; + if (c1 == -1) + break; + } + return true; + } + + + +} diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/util/OptionBuilder.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/util/OptionBuilder.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/util/OptionBuilder.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/util/OptionBuilder.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,95 @@ +/******************************************************************************* + * Copyright (C) 2009-2011 FuseSource Corp. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + *******************************************************************************/ +package org.fusesource.hawtjni.generator.util; + +import org.apache.commons.cli.Option; + +/** + * a better version of org.apache.commons.cli.OptionBuilder + * IDE provides nicer auto complete and less compiler warnings. + * + * @author Hiram Chirino + */ +public class OptionBuilder { + + private String id; + private String name; + private String description; + private boolean required; + private boolean optional; + private int args =-1; + private String arg; + private Object type; + private char sperator; + + public static OptionBuilder ob() { + return new OptionBuilder(); + } + + public Option op() { + Option option = new Option( id!=null ? id : " ", description ); + option.setLongOpt(name); + option.setRequired( required ); + option.setOptionalArg(optional); + option.setType( type ); + option.setValueSeparator(sperator); + if( arg !=null && args==-1 ) { + args=1; + } + option.setArgs(args); + option.setArgName(arg); + return option; + } + + public OptionBuilder arg(String argName) { + this.arg = argName; + return this; + } + + public OptionBuilder args(int args) { + this.args = args; + return this; + } + + public OptionBuilder description(String description) { + this.description = description; + return this; + } + + public OptionBuilder name(String lname) { + this.name = lname; + return this; + } + + public OptionBuilder id(String name) { + this.id = name; + return this; + } + + public OptionBuilder optional(boolean optional) { + this.optional = optional; + return this; + } + + public OptionBuilder required(boolean required) { + this.required = required; + return this; + } + + public OptionBuilder sperator(char sperator) { + this.sperator = sperator; + return this; + } + + public OptionBuilder type(Object type) { + this.type = type; + return this; + } +} \ No newline at end of file diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/util/TextSupport.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/util/TextSupport.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/util/TextSupport.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/util/TextSupport.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright (C) 2009-2011 FuseSource Corp. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + *******************************************************************************/ +package org.fusesource.hawtjni.generator.util; + +/** + * + * @author Hiram Chirino + */ +public class TextSupport { + + static public String cast(String cast) { + cast = cast.trim(); + if (cast.length() > 0) { + if (!cast.startsWith("(") || !cast.endsWith(")")) + cast = "(" + cast + ")"; + } + return cast; + } + +} diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/resources/hawtjni-callback.c jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/resources/hawtjni-callback.c --- jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/resources/hawtjni-callback.c 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/resources/hawtjni-callback.c 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,793 @@ +/******************************************************************************* + * Copyright (c) 2000, 2005 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +/* == HEADER-SNIP-LOCATION == */ +#include "hawtjni.h" +#include +#include + +/* define this to print out debug statements */ +/* #define DEBUG_CALL_PRINTS */ + +/* --------------- callback globals ----------------- */ +#if defined (_WIN32) || defined (_WIN32_WCE) +#include "windows.h" +#define RETURN_TYPE LRESULT CALLBACK +#define RETURN_CAST (LRESULT) +#endif + +#ifndef RETURN_TYPE +#define RETURN_TYPE jintLong +#endif + +#ifndef RETURN_CAST +#define RETURN_CAST +#endif + +/* +* Note that only x86 assembler is supported +*/ +#if !(defined(__i386__) || defined(_M_IX86) || defined(_X86_)) +#undef USE_ASSEMBLER +#endif + +#ifdef REDUCED_CALLBACKS +#define MAX_CALLBACKS 16 +#else +#ifdef USE_ASSEMBLER +#define MAX_CALLBACKS 256 +#else +#define MAX_CALLBACKS 128 +#endif +#endif /* REDUCED_CALLBACKS */ + +#define MAX_ARGS 12 + +typedef struct CALLBACK_DATA { + jobject callback; + jmethodID methodID; + jobject object; + jboolean isStatic; + jboolean isArrayBased; + jint argCount; + jlong errorResult; +} CALLBACK_DATA; + +static JavaVM *jvm = NULL; +static CALLBACK_DATA callbackData[MAX_CALLBACKS]; +static int callbackEnabled = 1; +static int callbackEntryCount = 0; +static int initialized = 0; +static jint JNI_VERSION = 0; + +#ifdef DEBUG_CALL_PRINTS +static int counter = 0; +#endif + +#ifdef ATOMIC +#include +#define ATOMIC_INC(value) OSAtomicIncrement32(&value); +#define ATOMIC_DEC(value) OSAtomicDecrement32(&value); +#else +#define ATOMIC_INC(value) value++; +#define ATOMIC_DEC(value) value--; +#endif + +jintLong callback(int index, ...); + +#ifdef USE_ASSEMBLER + +#if !(defined (_WIN32) || defined (_WIN32_WCE)) +#include +#endif + +static unsigned char *callbackCode = NULL; +#define CALLBACK_THUNK_SIZE 64 + +#else + +/* ------------- Start: class Callback impl --------------- */ + + +/* Function name from index and number of arguments */ +#define FN(index, args) fn##index##_##args + +/** + * Functions templates + * + * NOTE: If the maximum number of arguments changes (MAX_ARGS), the number + * of function templates has to change accordingly. + */ + +/* Function template with no arguments */ +#define FN_0(index) RETURN_TYPE FN(index, 0)() { return RETURN_CAST callback(index); } + +/* Function template with 1 argument */ +#define FN_1(index) RETURN_TYPE FN(index, 1)(jintLong p1) { return RETURN_CAST callback(index, p1); } + +/* Function template with 2 arguments */ +#define FN_2(index) RETURN_TYPE FN(index, 2)(jintLong p1, jintLong p2) { return RETURN_CAST callback(index, p1, p2); } + +/* Function template with 3 arguments */ +#define FN_3(index) RETURN_TYPE FN(index, 3)(jintLong p1, jintLong p2, jintLong p3) { return RETURN_CAST callback(index, p1, p2, p3); } + +/* Function template with 4 arguments */ +#define FN_4(index) RETURN_TYPE FN(index, 4)(jintLong p1, jintLong p2, jintLong p3, jintLong p4) { return RETURN_CAST callback(index, p1, p2, p3, p4); } + +/* Function template with 5 arguments */ +#define FN_5(index) RETURN_TYPE FN(index, 5)(jintLong p1, jintLong p2, jintLong p3, jintLong p4, jintLong p5) { return RETURN_CAST callback(index, p1, p2, p3, p4, p5); } + +/* Function template with 6 arguments */ +#define FN_6(index) RETURN_TYPE FN(index, 6)(jintLong p1, jintLong p2, jintLong p3, jintLong p4, jintLong p5, jintLong p6) { return RETURN_CAST callback(index, p1, p2, p3, p4, p5, p6); } + +/* Function template with 7 arguments */ +#define FN_7(index) RETURN_TYPE FN(index, 7)(jintLong p1, jintLong p2, jintLong p3, jintLong p4, jintLong p5, jintLong p6, jintLong p7) { return RETURN_CAST callback(index, p1, p2, p3, p4, p5, p6, p7); } + +/* Function template with 8 arguments */ +#define FN_8(index) RETURN_TYPE FN(index, 8)(jintLong p1, jintLong p2, jintLong p3, jintLong p4, jintLong p5, jintLong p6, jintLong p7, jintLong p8) { return RETURN_CAST callback(index, p1, p2, p3, p4, p5, p6, p7, p8); } + +/* Function template with 9 arguments */ +#define FN_9(index) RETURN_TYPE FN(index, 9)(jintLong p1, jintLong p2, jintLong p3, jintLong p4, jintLong p5, jintLong p6, jintLong p7, jintLong p8, jintLong p9) { return RETURN_CAST callback(index, p1, p2, p3, p4, p5, p6, p7, p8, p9); } + +/* Function template with 10 arguments */ +#define FN_10(index) RETURN_TYPE FN(index, 10) (jintLong p1, jintLong p2, jintLong p3, jintLong p4, jintLong p5, jintLong p6, jintLong p7, jintLong p8, jintLong p9, jintLong p10) { return RETURN_CAST callback(index, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10); } + +/* Function template with 11 arguments */ +#define FN_11(index) RETURN_TYPE FN(index, 11) (jintLong p1, jintLong p2, jintLong p3, jintLong p4, jintLong p5, jintLong p6, jintLong p7, jintLong p8, jintLong p9, jintLong p10, jintLong p11) { return RETURN_CAST callback(index, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11); } + +/* Function template with 12 arguments */ +#define FN_12(index) RETURN_TYPE FN(index, 12) (jintLong p1, jintLong p2, jintLong p3, jintLong p4, jintLong p5, jintLong p6, jintLong p7, jintLong p8, jintLong p9, jintLong p10, jintLong p11, jintLong p12) { return RETURN_CAST callback(index, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12); } + +/** + * Define all functions with the specified number of arguments. + * + * NOTE: If the maximum number of callbacks changes (MAX_CALLBACKS), + * this macro has to be updated. + */ +#if MAX_CALLBACKS == 16 +#define FN_BLOCK(args) \ + FN_##args(0) \ + FN_##args(1) \ + FN_##args(2) \ + FN_##args(3) \ + FN_##args(4) \ + FN_##args(5) \ + FN_##args(6) \ + FN_##args(7) \ + FN_##args(8) \ + FN_##args(9) \ + FN_##args(10) \ + FN_##args(11) \ + FN_##args(12) \ + FN_##args(13) \ + FN_##args(14) \ + FN_##args(15) +#elif MAX_CALLBACKS == 128 +#define FN_BLOCK(args) \ + FN_##args(0) \ + FN_##args(1) \ + FN_##args(2) \ + FN_##args(3) \ + FN_##args(4) \ + FN_##args(5) \ + FN_##args(6) \ + FN_##args(7) \ + FN_##args(8) \ + FN_##args(9) \ + FN_##args(10) \ + FN_##args(11) \ + FN_##args(12) \ + FN_##args(13) \ + FN_##args(14) \ + FN_##args(15) \ + FN_##args(16) \ + FN_##args(17) \ + FN_##args(18) \ + FN_##args(19) \ + FN_##args(20) \ + FN_##args(21) \ + FN_##args(22) \ + FN_##args(23) \ + FN_##args(24) \ + FN_##args(25) \ + FN_##args(26) \ + FN_##args(27) \ + FN_##args(28) \ + FN_##args(29) \ + FN_##args(30) \ + FN_##args(31) \ + FN_##args(32) \ + FN_##args(33) \ + FN_##args(34) \ + FN_##args(35) \ + FN_##args(36) \ + FN_##args(37) \ + FN_##args(38) \ + FN_##args(39) \ + FN_##args(40) \ + FN_##args(41) \ + FN_##args(42) \ + FN_##args(43) \ + FN_##args(44) \ + FN_##args(45) \ + FN_##args(46) \ + FN_##args(47) \ + FN_##args(48) \ + FN_##args(49) \ + FN_##args(50) \ + FN_##args(51) \ + FN_##args(52) \ + FN_##args(53) \ + FN_##args(54) \ + FN_##args(55) \ + FN_##args(56) \ + FN_##args(57) \ + FN_##args(58) \ + FN_##args(59) \ + FN_##args(60) \ + FN_##args(61) \ + FN_##args(62) \ + FN_##args(63) \ + FN_##args(64) \ + FN_##args(65) \ + FN_##args(66) \ + FN_##args(67) \ + FN_##args(68) \ + FN_##args(69) \ + FN_##args(70) \ + FN_##args(71) \ + FN_##args(72) \ + FN_##args(73) \ + FN_##args(74) \ + FN_##args(75) \ + FN_##args(76) \ + FN_##args(77) \ + FN_##args(78) \ + FN_##args(79) \ + FN_##args(80) \ + FN_##args(81) \ + FN_##args(82) \ + FN_##args(83) \ + FN_##args(84) \ + FN_##args(85) \ + FN_##args(86) \ + FN_##args(87) \ + FN_##args(88) \ + FN_##args(89) \ + FN_##args(90) \ + FN_##args(91) \ + FN_##args(92) \ + FN_##args(93) \ + FN_##args(94) \ + FN_##args(95) \ + FN_##args(96) \ + FN_##args(97) \ + FN_##args(98) \ + FN_##args(99) \ + FN_##args(100) \ + FN_##args(101) \ + FN_##args(102) \ + FN_##args(103) \ + FN_##args(104) \ + FN_##args(105) \ + FN_##args(106) \ + FN_##args(107) \ + FN_##args(108) \ + FN_##args(109) \ + FN_##args(110) \ + FN_##args(111) \ + FN_##args(112) \ + FN_##args(113) \ + FN_##args(114) \ + FN_##args(115) \ + FN_##args(116) \ + FN_##args(117) \ + FN_##args(118) \ + FN_##args(119) \ + FN_##args(120) \ + FN_##args(121) \ + FN_##args(122) \ + FN_##args(123) \ + FN_##args(124) \ + FN_##args(125) \ + FN_##args(126) \ + FN_##args(127) +#else +#error Invalid MAX_CALLBACKS +#endif /* MAX_CALLBACKS == 16 */ + +/** + * Define all callback functions. + * + * NOTE: If the maximum number of arguments changes (MAX_ARGS), the following + * has to change accordinglly. + */ +FN_BLOCK(0) +FN_BLOCK(1) +FN_BLOCK(2) +FN_BLOCK(3) +FN_BLOCK(4) +FN_BLOCK(5) +FN_BLOCK(6) +FN_BLOCK(7) +FN_BLOCK(8) +FN_BLOCK(9) +FN_BLOCK(10) +FN_BLOCK(11) +FN_BLOCK(12) + +/** + * Initialize the function pointers for the callback routines. + * + * NOTE: If MAX_ARGS or MAX_CALLBACKS changes, the following has to be updated. + */ +#if MAX_CALLBACKS == 16 +#define FN_A_BLOCK(args) { \ + (jintLong)FN(0, args), \ + (jintLong)FN(1, args), \ + (jintLong)FN(2, args), \ + (jintLong)FN(3, args), \ + (jintLong)FN(4, args), \ + (jintLong)FN(5, args), \ + (jintLong)FN(6, args), \ + (jintLong)FN(7, args), \ + (jintLong)FN(8, args), \ + (jintLong)FN(9, args), \ + (jintLong)FN(10, args), \ + (jintLong)FN(11, args), \ + (jintLong)FN(12, args), \ + (jintLong)FN(13, args), \ + (jintLong)FN(14, args), \ + (jintLong)FN(15, args), \ +}, +#elif MAX_CALLBACKS == 128 +#define FN_A_BLOCK(args) { \ + (jintLong)FN(0, args), \ + (jintLong)FN(1, args), \ + (jintLong)FN(2, args), \ + (jintLong)FN(3, args), \ + (jintLong)FN(4, args), \ + (jintLong)FN(5, args), \ + (jintLong)FN(6, args), \ + (jintLong)FN(7, args), \ + (jintLong)FN(8, args), \ + (jintLong)FN(9, args), \ + (jintLong)FN(10, args), \ + (jintLong)FN(11, args), \ + (jintLong)FN(12, args), \ + (jintLong)FN(13, args), \ + (jintLong)FN(14, args), \ + (jintLong)FN(15, args), \ + (jintLong)FN(16, args), \ + (jintLong)FN(17, args), \ + (jintLong)FN(18, args), \ + (jintLong)FN(19, args), \ + (jintLong)FN(20, args), \ + (jintLong)FN(21, args), \ + (jintLong)FN(22, args), \ + (jintLong)FN(23, args), \ + (jintLong)FN(24, args), \ + (jintLong)FN(25, args), \ + (jintLong)FN(26, args), \ + (jintLong)FN(27, args), \ + (jintLong)FN(28, args), \ + (jintLong)FN(29, args), \ + (jintLong)FN(30, args), \ + (jintLong)FN(31, args), \ + (jintLong)FN(32, args), \ + (jintLong)FN(33, args), \ + (jintLong)FN(34, args), \ + (jintLong)FN(35, args), \ + (jintLong)FN(36, args), \ + (jintLong)FN(37, args), \ + (jintLong)FN(38, args), \ + (jintLong)FN(39, args), \ + (jintLong)FN(40, args), \ + (jintLong)FN(41, args), \ + (jintLong)FN(42, args), \ + (jintLong)FN(43, args), \ + (jintLong)FN(44, args), \ + (jintLong)FN(45, args), \ + (jintLong)FN(46, args), \ + (jintLong)FN(47, args), \ + (jintLong)FN(48, args), \ + (jintLong)FN(49, args), \ + (jintLong)FN(50, args), \ + (jintLong)FN(51, args), \ + (jintLong)FN(52, args), \ + (jintLong)FN(53, args), \ + (jintLong)FN(54, args), \ + (jintLong)FN(55, args), \ + (jintLong)FN(56, args), \ + (jintLong)FN(57, args), \ + (jintLong)FN(58, args), \ + (jintLong)FN(59, args), \ + (jintLong)FN(60, args), \ + (jintLong)FN(61, args), \ + (jintLong)FN(62, args), \ + (jintLong)FN(63, args), \ + (jintLong)FN(64, args), \ + (jintLong)FN(65, args), \ + (jintLong)FN(66, args), \ + (jintLong)FN(67, args), \ + (jintLong)FN(68, args), \ + (jintLong)FN(69, args), \ + (jintLong)FN(70, args), \ + (jintLong)FN(71, args), \ + (jintLong)FN(72, args), \ + (jintLong)FN(73, args), \ + (jintLong)FN(74, args), \ + (jintLong)FN(75, args), \ + (jintLong)FN(76, args), \ + (jintLong)FN(77, args), \ + (jintLong)FN(78, args), \ + (jintLong)FN(79, args), \ + (jintLong)FN(80, args), \ + (jintLong)FN(81, args), \ + (jintLong)FN(82, args), \ + (jintLong)FN(83, args), \ + (jintLong)FN(84, args), \ + (jintLong)FN(85, args), \ + (jintLong)FN(86, args), \ + (jintLong)FN(87, args), \ + (jintLong)FN(88, args), \ + (jintLong)FN(89, args), \ + (jintLong)FN(90, args), \ + (jintLong)FN(91, args), \ + (jintLong)FN(92, args), \ + (jintLong)FN(93, args), \ + (jintLong)FN(94, args), \ + (jintLong)FN(95, args), \ + (jintLong)FN(96, args), \ + (jintLong)FN(97, args), \ + (jintLong)FN(98, args), \ + (jintLong)FN(99, args), \ + (jintLong)FN(100, args), \ + (jintLong)FN(101, args), \ + (jintLong)FN(102, args), \ + (jintLong)FN(103, args), \ + (jintLong)FN(104, args), \ + (jintLong)FN(105, args), \ + (jintLong)FN(106, args), \ + (jintLong)FN(107, args), \ + (jintLong)FN(108, args), \ + (jintLong)FN(109, args), \ + (jintLong)FN(110, args), \ + (jintLong)FN(111, args), \ + (jintLong)FN(112, args), \ + (jintLong)FN(113, args), \ + (jintLong)FN(114, args), \ + (jintLong)FN(115, args), \ + (jintLong)FN(116, args), \ + (jintLong)FN(117, args), \ + (jintLong)FN(118, args), \ + (jintLong)FN(119, args), \ + (jintLong)FN(120, args), \ + (jintLong)FN(121, args), \ + (jintLong)FN(122, args), \ + (jintLong)FN(123, args), \ + (jintLong)FN(124, args), \ + (jintLong)FN(125, args), \ + (jintLong)FN(126, args), \ + (jintLong)FN(127, args), \ +}, +#else +#error Invalid MAX_CALLBACKS +#endif /* MAX_CALLBACKS == 16 */ + +jintLong fnx_array[MAX_ARGS+1][MAX_CALLBACKS] = { + FN_A_BLOCK(0) + FN_A_BLOCK(1) + FN_A_BLOCK(2) + FN_A_BLOCK(3) + FN_A_BLOCK(4) + FN_A_BLOCK(5) + FN_A_BLOCK(6) + FN_A_BLOCK(7) + FN_A_BLOCK(8) + FN_A_BLOCK(9) + FN_A_BLOCK(10) + FN_A_BLOCK(11) + FN_A_BLOCK(12) +}; + +#endif /* USE_ASSEMBLER */ + +/* --------------- class Callback Native Methods --------------- */ + +JNIEXPORT jlong JNICALL Java_org_fusesource_hawtjni_runtime_Callback_bind + (JNIEnv *env, jclass that, jobject callbackObject, jobject object, jstring method, jstring signature, jint argCount, jboolean isStatic, jboolean isArrayBased, jlong errorResult) +{ + int i; + jmethodID mid = NULL; + jclass javaClass = that; + const char *methodString = NULL, *sigString = NULL; + if (jvm == NULL) (*env)->GetJavaVM(env, &jvm); + if (JNI_VERSION == 0) JNI_VERSION = (*env)->GetVersion(env); + if (!initialized) { + memset(&callbackData, 0, sizeof(callbackData)); + initialized = 1; + } + if (method) methodString = (const char *) (*env)->GetStringUTFChars(env, method, NULL); + if (signature) sigString = (const char *) (*env)->GetStringUTFChars(env, signature, NULL); + if (object && methodString && sigString) { + if (isStatic) { + mid = (*env)->GetStaticMethodID(env, object, methodString, sigString); + } else { + javaClass = (*env)->GetObjectClass(env, object); + mid = (*env)->GetMethodID(env, javaClass, methodString, sigString); + } + } + if (method && methodString) (*env)->ReleaseStringUTFChars(env, method, methodString); + if (signature && sigString) (*env)->ReleaseStringUTFChars(env, signature, sigString); + if (mid == 0) goto fail; + for (i=0; iNewGlobalRef(env, callbackObject)) == NULL) goto fail; + if ((callbackData[i].object = (*env)->NewGlobalRef(env, object)) == NULL) goto fail; + callbackData[i].isStatic = isStatic; + callbackData[i].isArrayBased = isArrayBased; + callbackData[i].argCount = argCount; + callbackData[i].errorResult = errorResult; + callbackData[i].methodID = mid; +#ifndef USE_ASSEMBLER + return (jintLong) fnx_array[argCount][i]; +#else + { + int j = 0, k; + unsigned char* code; +#ifdef __APPLE__ + int pad = 0; +#endif + if (callbackCode == NULL) { +#if defined (_WIN32) || defined (_WIN32_WCE) + callbackCode = VirtualAlloc(NULL, CALLBACK_THUNK_SIZE * MAX_CALLBACKS, MEM_COMMIT, PAGE_EXECUTE_READWRITE); + if (callbackCode == NULL) return 0; +#else + callbackCode = mmap(NULL, CALLBACK_THUNK_SIZE * MAX_CALLBACKS, PROT_EXEC | PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0); + if (callbackCode == MAP_FAILED) return 0; +#endif + } + code = (unsigned char *)(callbackCode + (i * CALLBACK_THUNK_SIZE)); + + //PUSH EBP - 1 byte + code[j++] = 0x55; + + //MOV EBP,ESP - 2 bytes + code[j++] = 0x8b; + code[j++] = 0xec; + +#ifdef __APPLE__ + /* darwin calling conventions require that the stack be aligned on a 16-byte boundary. */ + k = (argCount+3)*sizeof(jintLong); + pad = ((k + 15) & ~15) - k; + if (pad > 0) { + //SUB ESP,pad - 3 bytes + code[j++] = 0x83; + code[j++] = 0xec; + code[j++] = pad; + } +#endif + + // 3*argCount bytes + for (k=(argCount + 1) * sizeof(jintLong); k >= sizeof(jintLong)*2; k -= sizeof(jintLong)) { + //PUSH SS:[EBP+k] + code[j++] = 0xff; + code[j++] = 0x75; + code[j++] = k; + } + + if (i > 127) { + //PUSH i - 5 bytes + code[j++] = 0x68; + code[j++] = ((i >> 0) & 0xFF); + code[j++] = ((i >> 8) & 0xFF); + code[j++] = ((i >> 16) & 0xFF); + code[j++] = ((i >> 24) & 0xFF); + } else { + //PUSH i - 2 bytes + code[j++] = 0x6a; + code[j++] = i; + } + + //MOV EAX callback - 1 + sizeof(jintLong) bytes + code[j++] = 0xb8; + ((jintLong *)&code[j])[0] = (jintLong)&callback; + j += sizeof(jintLong); + + //CALL EAX - 2 bytes + code[j++] = 0xff; + code[j++] = 0xd0; + + //ADD ESP,(argCount + 1) * sizeof(jintLong) - 3 bytes + code[j++] = 0x83; + code[j++] = 0xc4; +#ifdef __APPLE__ + code[j++] = (unsigned char)(pad + ((argCount + 1) * sizeof(jintLong))); +#else + code[j++] = (unsigned char)((argCount + 1) * sizeof(jintLong)); +#endif + + //POP EBP - 1 byte + code[j++] = 0x5d; + +#if defined (_WIN32) || defined (_WIN32_WCE) + //RETN argCount * sizeof(jintLong) - 3 bytes + code[j++] = 0xc2; + code[j++] = (unsigned char)(argCount * sizeof(jintLong)); + code[j++] = 0x00; +#else + //RETN - 1 byte + code[j++] = 0xc3; +#endif + + if (j > CALLBACK_THUNK_SIZE) { + jclass errorClass = (*env)->FindClass(env, "java/lang/Error"); + (*env)->ThrowNew(env, errorClass, "Callback thunk overflow"); + } + + return (jintLong)code; + } +#endif /* USE_ASSEMBLER */ + } + } +fail: + return 0; +} + +JNIEXPORT void JNICALL Java_org_fusesource_hawtjni_runtime_Callback_unbind + (JNIEnv *env, jclass that, jobject callback) +{ + int i; + for (i=0; iIsSameObject(env, callback, callbackData[i].callback)) { + if (callbackData[i].callback != NULL) (*env)->DeleteGlobalRef(env, callbackData[i].callback); + if (callbackData[i].object != NULL) (*env)->DeleteGlobalRef(env, callbackData[i].object); + memset(&callbackData[i], 0, sizeof(CALLBACK_DATA)); + } + } +} + +JNIEXPORT jboolean JNICALL Java_org_eclipse_swt_internal_Callback_getEnabled + (JNIEnv *env, jclass that) +{ + return (jboolean)callbackEnabled; +} + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_Callback_getEntryCount + (JNIEnv *env, jclass that) +{ + return (jint)callbackEntryCount; +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_Callback_setEnabled + (JNIEnv *env, jclass that, jboolean enable) +{ + callbackEnabled = enable; +} + +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_Callback_reset + (JNIEnv *env, jclass that) +{ + memset((void *)&callbackData, 0, sizeof(callbackData)); +} + +jintLong callback(int index, ...) +{ + if (!callbackEnabled) return 0; + + { + JNIEnv *env = NULL; + jmethodID mid = callbackData[index].methodID; + jobject object = callbackData[index].object; + jboolean isStatic = callbackData[index].isStatic; + jboolean isArrayBased = callbackData[index].isArrayBased; + jint argCount = callbackData[index].argCount; + jlong result = callbackData[index].errorResult; + int detach = 0; + va_list vl; + +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "* callback starting %d\n", counter++); +#endif + +#ifdef JNI_VERSION_1_2 + if (IS_JNI_1_2) { + (*jvm)->GetEnv(jvm, (void **)&env, JNI_VERSION_1_2); + } +#endif + +#ifdef JNI_VERSION_1_4 + if (env == NULL) { + if (JNI_VERSION >= JNI_VERSION_1_4) { + (*jvm)->AttachCurrentThreadAsDaemon(jvm, (void **)&env, NULL); + } + } +#endif + + if (env == NULL) { + (*jvm)->AttachCurrentThread(jvm, (void **)&env, NULL); + if (IS_JNI_1_2) detach = 1; + } + + /* If the current thread is not attached to the VM, it is not possible to call into the VM */ + if (env == NULL) { +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "* could not get env\n"); +#endif + goto noEnv; + } + + /* If an exception has occurred in previous callbacks do not call into the VM. */ + if ((*env)->ExceptionOccurred(env)) { + goto done; + } + + /* Call into the VM. */ + ATOMIC_INC(callbackEntryCount); + va_start(vl, index); + if (isArrayBased) { + int i; + jintLongArray argsArray = (*env)->NewIntLongArray(env, argCount); + if (argsArray != NULL) { + jintLong *elements = (*env)->GetIntLongArrayElements(env, argsArray, NULL); + if (elements != NULL) { + for (i=0; iReleaseIntLongArrayElements(env, argsArray, elements, 0); + if (isStatic) { + result = (*env)->CallStaticIntLongMethod(env, object, mid, argsArray); + } else { + result = (*env)->CallIntLongMethod(env, object, mid, argsArray); + } + } + /* + * This function may be called many times before returning to Java, + * explicitly delete local references to avoid GP's in certain VMs. + */ + (*env)->DeleteLocalRef(env, argsArray); + } + } else { + if (isStatic) { + result = (*env)->CallStaticIntLongMethodV(env, object, mid, vl); + } else { + result = (*env)->CallIntLongMethodV(env, object, mid, vl); + } + } + va_end(vl); + ATOMIC_DEC(callbackEntryCount); + +done: + /* If an exception has occurred in Java, return the error result. */ + if ((*env)->ExceptionOccurred(env)) { +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "* java exception occurred\n"); + (*env)->ExceptionDescribe(env); +#endif + result = callbackData[index].errorResult; + } + + if (detach) { + (*jvm)->DetachCurrentThread(jvm); + env = NULL; + } + +noEnv: + +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "* callback exiting %d\n", --counter); +#endif + + return result; + } +} + +/* ------------- END: class Callback impl --------------- */ diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/resources/hawtjni.c jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/resources/hawtjni.c --- jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/resources/hawtjni.c 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/resources/hawtjni.c 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,175 @@ +/******************************************************************************* + * Copyright (c) 2000, 2005 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +/* == HEADER-SNIP-LOCATION == */ +#include "hawtjni.h" +#include +#include +#include + +int IS_JNI_1_2 = 0; + +#ifdef HAVE_PTHREAD_H + #include +#endif + +#ifdef HAVE_UNISTD_H + #include +#endif + +#ifdef JNI_VERSION_1_2 +JavaVM *JVM; + +#ifdef HAVE_PTHREAD_H +pthread_key_t JNI_ATTACH_THREAD_LOCAL_KEY; +#endif + +jint hawtjni_attach_thread(JNIEnv **env, const char *thread_name) { + JavaVMAttachArgs args; + args.version = JNI_VERSION_1_2; + args.name = (char *)thread_name; + args.group = 0; + #ifdef HAVE_PTHREAD_H + if( JNI_ATTACH_THREAD_LOCAL_KEY ) { + *env = pthread_getspecific(JNI_ATTACH_THREAD_LOCAL_KEY); + if( ! *env ) { + if( (*JVM)->AttachCurrentThread(JVM, (void**)env, &args)==0 ) { + pthread_setspecific(JNI_ATTACH_THREAD_LOCAL_KEY, *env); + } else { + return -1; + } + } + return 0; + } else { + return (*JVM)->AttachCurrentThread(JVM, (void**)env, &args); + } + #else + return (*JVM)->AttachCurrentThread(JVM, (void**)env, &args); + #endif +} + +jint hawtjni_detach_thread() { + #ifdef HAVE_PTHREAD_H + if( JNI_ATTACH_THREAD_LOCAL_KEY ) { + // Don't actually detach.. that will automatically + // happen when the the thread dies. + return 0; + } else { + return (*JVM)->DetachCurrentThread(JVM); + } + #else + return (*JVM)->DetachCurrentThread(JVM); + #endif +} + +#ifdef HAVE_PTHREAD_H + void hawtjni_thread_cleanup(void *data) { + if( data ) { + (*JVM)->DetachCurrentThread(JVM); + pthread_setspecific(JNI_ATTACH_THREAD_LOCAL_KEY, 0); + } + } +#endif + +JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) { + IS_JNI_1_2 = 1; + JVM = vm; + #ifdef HAVE_PTHREAD_H + if( pthread_key_create(&JNI_ATTACH_THREAD_LOCAL_KEY, hawtjni_thread_cleanup) ) { + JNI_ATTACH_THREAD_LOCAL_KEY = 0; + } + #endif + return JNI_VERSION_1_2; +} +#endif + +void throwOutOfMemory(JNIEnv *env) { + jclass clazz = (*env)->FindClass(env, "java/lang/OutOfMemoryError"); + if (clazz != NULL) { + (*env)->ThrowNew(env, clazz, ""); + } +} + +#ifndef JNI64 + +void **hawtjni_malloc_pointer_array(JNIEnv *env, jlongArray array) { + int i, size; + jlong *elems; + void **rc; + + if( array==NULL ) { + return NULL; + } +#ifdef JNI_VERSION_1_2 + if (IS_JNI_1_2) { + elems = (*env)->GetPrimitiveArrayCritical(env, array, NULL); + } else +#endif + { + elems = (*env)->GetLongArrayElements(env, array, NULL); + } + if( elems == NULL) { + return NULL; + } + + size = (*env)->GetArrayLength(env, array); + rc=malloc(sizeof(void *)*(size+1)); + if( rc!= NULL ) { + for( i=0; i < size; i++ ) { + rc[i]=(void *)(intptr_t)(elems[i]); + } + rc[size]=NULL; + } +#ifdef JNI_VERSION_1_2 + if (IS_JNI_1_2) { + (*env)->ReleasePrimitiveArrayCritical(env, array, elems, JNI_ABORT); + } else +#endif + { + (*env)->ReleaseLongArrayElements(env, array, elems, JNI_ABORT); + } + return rc; +} + +void hawtjni_free_pointer_array(JNIEnv *env, jlongArray array, void **elems, jint mode) { + + // do we need to copy back the data?? + if( mode != JNI_ABORT) { + int i, size; + jlong *tmp; + + size = (*env)->GetArrayLength(env, array); +#ifdef JNI_VERSION_1_2 + if (IS_JNI_1_2) { + tmp = (*env)->GetPrimitiveArrayCritical(env, array, NULL); + } else +#endif + { + tmp = (*env)->GetLongArrayElements(env, array, NULL); + } + if( tmp != NULL) { + for( i=0; i < size; i++ ) { + tmp[i]=(intptr_t)elems[i]; + } +#ifdef JNI_VERSION_1_2 + if (IS_JNI_1_2) { + (*env)->ReleasePrimitiveArrayCritical(env, array, tmp, 0); + } else +#endif + { + (*env)->ReleaseLongArrayElements(env, array, tmp, 0); + } + } + } /* mode != JNI_ABORTmode */ + + free(elems); +} + +#endif /* JNI64 */ diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/resources/hawtjni.h jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/resources/hawtjni.h --- jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/resources/hawtjni.h 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/resources/hawtjni.h 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,194 @@ +/******************************************************************************* + * Copyright (c) 2000, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +/* == HEADER-SNIP-LOCATION == */ +/** + * hawtjni.h + * + * This file contains the global macro declarations for a hawtjni based + * library. + * + */ +#ifndef INC_HAWTJNI_H +#define INC_HAWTJNI_H +#define _MULTI_THREADED + +#ifdef HAVE_CONFIG_H + #include "config.h" +#endif + +#include "jni.h" +#include + + +#ifdef __cplusplus +extern "C" { +#endif + +extern int IS_JNI_1_2; + +#ifndef JNI64 +#if defined(_LP64) +#define JNI64 +#endif +#endif + +/* 64 bit support */ +#ifndef JNI64 + +/* int/long defines */ +#define GetIntLongField GetIntField +#define SetIntLongField SetIntField +#define GetIntLongArrayElements GetIntArrayElements +#define ReleaseIntLongArrayElements ReleaseIntArrayElements +#define GetIntLongArrayRegion GetIntArrayRegion +#define SetIntLongArrayRegion SetIntArrayRegion +#define NewIntLongArray NewIntArray +#define CallStaticIntLongMethod CallStaticIntMethod +#define CallIntLongMethod CallIntMethod +#define CallStaticIntLongMethodV CallStaticIntMethodV +#define CallIntLongMethodV CallIntMethodV +#define jintLongArray jintArray +#define jintLong jint +#define I_J "I" +#define I_JArray "[I" + +/* float/double defines */ +#define GetFloatDoubleField GetFloatField +#define SetFloatDoubleField SetFloatField +#define GetFloatDoubleArrayElements GetFloatArrayElements +#define ReleaseFloatDoubleArrayElements ReleaseFloatArrayElements +#define GetFloatDoubleArrayRegion GetFloatArrayRegion +#define jfloatDoubleArray jfloatArray +#define jfloatDouble jfloat +#define F_D "F" +#define F_DArray "[F" + +#else + +/* int/long defines */ +#define GetIntLongField GetLongField +#define SetIntLongField SetLongField +#define GetIntLongArrayElements GetLongArrayElements +#define ReleaseIntLongArrayElements ReleaseLongArrayElements +#define GetIntLongArrayRegion GetLongArrayRegion +#define SetIntLongArrayRegion SetLongArrayRegion +#define NewIntLongArray NewLongArray +#define CallStaticIntLongMethod CallStaticLongMethod +#define CallIntLongMethod CallLongMethod +#define CallStaticIntLongMethodV CallStaticLongMethodV +#define CallIntLongMethodV CallLongMethodV +#define jintLongArray jlongArray +#define jintLong jlong +#define I_J "J" +#define I_JArray "[J" + +/* float/double defines */ +#define GetFloatDoubleField GetDoubleField +#define SetFloatDoubleField SetDoubleField +#define GetFloatDoubleArrayElements GetDoubleArrayElements +#define ReleaseFloatDoubleArrayElements ReleaseDoubleArrayElements +#define GetFloatDoubleArrayRegion GetDoubleArrayRegion +#define jfloatDoubleArray jdoubleArray +#define jfloatDouble jdouble +#define F_D "D" +#define F_DArray "[D" + +#endif + +#ifdef __APPLE__ +#define CALLING_CONVENTION +#define LOAD_FUNCTION(var, name) \ + static int initialized = 0; \ + static void *var = NULL; \ + if (!initialized) { \ + CFBundleRef bundle = CFBundleGetBundleWithIdentifier(CFSTR(name##_LIB)); \ + if (bundle) var = CFBundleGetFunctionPointerForName(bundle, CFSTR(#name)); \ + initialized = 1; \ + } +#elif defined (_WIN32) || defined (_WIN32_WCE) +#define CALLING_CONVENTION CALLBACK +#define LOAD_FUNCTION(var, name) \ + static int initialized = 0; \ + static FARPROC var = NULL; \ + if (!initialized) { \ + HMODULE hm = LoadLibrary(name##_LIB); \ + if (hm) var = GetProcAddress(hm, #name); \ + initialized = 1; \ + } +#else +#define CALLING_CONVENTION +#define LOAD_FUNCTION(var, name) \ + static int initialized = 0; \ + static void *var = NULL; \ + if (!initialized) { \ + void* handle = dlopen(name##_LIB, RTLD_LAZY); \ + if (handle) var = dlsym(handle, #name); \ + initialized = 1; \ + } +#endif + +#ifdef JNI_VERSION_1_2 +extern JavaVM *JVM; +jint hawtjni_attach_thread(JNIEnv **env, const char *thread_name); +jint hawtjni_detach_thread(); +#endif + +void throwOutOfMemory(JNIEnv *env); + +#define CHECK_NULL_VOID(ptr) \ + if ((ptr) == NULL) { \ + throwOutOfMemory(env); \ + return; \ + } + +#define CHECK_NULL(ptr) \ + if ((ptr) == NULL) { \ + throwOutOfMemory(env); \ + return 0; \ + } + +#ifndef JNI64 + void ** hawtjni_malloc_pointer_array(JNIEnv *env, jlongArray array); + void hawtjni_free_pointer_array(JNIEnv *env, jlongArray array, void **elems, jint mode); +#else + #ifdef __cplusplus + #define hawtjni_malloc_pointer_array(env, array) ( (void **)(intptr_t)env->GetLongArrayElements(array, NULL) ) + #define hawtjni_free_pointer_array(env, array, elems, mode) ( env->ReleaseLongArrayElements(array, (jlong*)elems, mode) ) + #else + #define hawtjni_malloc_pointer_array(env, source) ( (void **)(intptr_t)(*env)->GetLongArrayElements(env, source, NULL) ) + #define hawtjni_free_pointer_array(env, array, elems, mode) ( (*env)->ReleaseLongArrayElements(env, array, (jlong*)elems, mode) ) + #endif +#endif /* JNI64 */ + +#ifdef __GNUC__ + #define hawtjni_w_barrier() __sync_synchronize() +#elif defined(SOLARIS2) && SOLARIS2 >= 10 + #include + #define hawtjni_w_barrier() __machine_w_barrier() +#elif defined(__APPLE__) + #include + #define hawtjni_w_barrier() OSMemoryBarrier() +#elif defined(_WIN32) || defined(_WIN64) + #include + #define hawtjni_w_barrier() _mm_sfence(); _WriteBarrier() +#else + #pragma message ( "Don't know how to do a memory barrier on this platform" ) + #define hawtjni_w_barrier() +#endif + +void hawtjni_atomic_set(jlong *target, jlong value); +jlong hawtjni_atomic_get(jlong *target); + +#ifdef __cplusplus +} +#endif + +#endif /* ifndef INC_HAWTJNI_H */ diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/resources/windows/stdint.h jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/resources/windows/stdint.h --- jtreg7-7.3.1+1/hawt-jni/hawtjni-generator/src/main/resources/windows/stdint.h 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-generator/src/main/resources/windows/stdint.h 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,247 @@ +// ISO C9x compliant stdint.h for Microsoft Visual Studio +// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 +// +// Copyright (c) 2006-2008 Alexander Chemeris +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. The name of the author may be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _MSC_VER // [ +#error "Use this header only with Microsoft Visual C++ compilers!" +#endif // _MSC_VER ] + +#ifndef _MSC_STDINT_H_ // [ +#define _MSC_STDINT_H_ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#include + +// For Visual Studio 6 in C++ mode and for many Visual Studio versions when +// compiling for ARM we should wrap include with 'extern "C++" {}' +// or compiler give many errors like this: +// error C2733: second C linkage of overloaded function 'wmemchr' not allowed +#ifdef __cplusplus +extern "C" { +#endif +# include +#ifdef __cplusplus +} +#endif + +// Define _W64 macros to mark types changing their size, like intptr_t. +#ifndef _W64 +# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 +# define _W64 __w64 +# else +# define _W64 +# endif +#endif + + +// 7.18.1 Integer types + +// 7.18.1.1 Exact-width integer types + +// Visual Studio 6 and Embedded Visual C++ 4 doesn't +// realize that, e.g. char has the same size as __int8 +// so we give up on __intX for them. +#if (_MSC_VER < 1300) + typedef signed char int8_t; + typedef signed short int16_t; + typedef signed int int32_t; + typedef unsigned char uint8_t; + typedef unsigned short uint16_t; + typedef unsigned int uint32_t; +#else + typedef signed __int8 int8_t; + typedef signed __int16 int16_t; + typedef signed __int32 int32_t; + typedef unsigned __int8 uint8_t; + typedef unsigned __int16 uint16_t; + typedef unsigned __int32 uint32_t; +#endif +typedef signed __int64 int64_t; +typedef unsigned __int64 uint64_t; + + +// 7.18.1.2 Minimum-width integer types +typedef int8_t int_least8_t; +typedef int16_t int_least16_t; +typedef int32_t int_least32_t; +typedef int64_t int_least64_t; +typedef uint8_t uint_least8_t; +typedef uint16_t uint_least16_t; +typedef uint32_t uint_least32_t; +typedef uint64_t uint_least64_t; + +// 7.18.1.3 Fastest minimum-width integer types +typedef int8_t int_fast8_t; +typedef int16_t int_fast16_t; +typedef int32_t int_fast32_t; +typedef int64_t int_fast64_t; +typedef uint8_t uint_fast8_t; +typedef uint16_t uint_fast16_t; +typedef uint32_t uint_fast32_t; +typedef uint64_t uint_fast64_t; + +// 7.18.1.4 Integer types capable of holding object pointers +#ifdef _WIN64 // [ + typedef signed __int64 intptr_t; + typedef unsigned __int64 uintptr_t; +#else // _WIN64 ][ + typedef _W64 signed int intptr_t; + typedef _W64 unsigned int uintptr_t; +#endif // _WIN64 ] + +// 7.18.1.5 Greatest-width integer types +typedef int64_t intmax_t; +typedef uint64_t uintmax_t; + + +// 7.18.2 Limits of specified-width integer types + +#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259 + +// 7.18.2.1 Limits of exact-width integer types +#define INT8_MIN ((int8_t)_I8_MIN) +#define INT8_MAX _I8_MAX +#define INT16_MIN ((int16_t)_I16_MIN) +#define INT16_MAX _I16_MAX +#define INT32_MIN ((int32_t)_I32_MIN) +#define INT32_MAX _I32_MAX +#define INT64_MIN ((int64_t)_I64_MIN) +#define INT64_MAX _I64_MAX +#define UINT8_MAX _UI8_MAX +#define UINT16_MAX _UI16_MAX +#define UINT32_MAX _UI32_MAX +#define UINT64_MAX _UI64_MAX + +// 7.18.2.2 Limits of minimum-width integer types +#define INT_LEAST8_MIN INT8_MIN +#define INT_LEAST8_MAX INT8_MAX +#define INT_LEAST16_MIN INT16_MIN +#define INT_LEAST16_MAX INT16_MAX +#define INT_LEAST32_MIN INT32_MIN +#define INT_LEAST32_MAX INT32_MAX +#define INT_LEAST64_MIN INT64_MIN +#define INT_LEAST64_MAX INT64_MAX +#define UINT_LEAST8_MAX UINT8_MAX +#define UINT_LEAST16_MAX UINT16_MAX +#define UINT_LEAST32_MAX UINT32_MAX +#define UINT_LEAST64_MAX UINT64_MAX + +// 7.18.2.3 Limits of fastest minimum-width integer types +#define INT_FAST8_MIN INT8_MIN +#define INT_FAST8_MAX INT8_MAX +#define INT_FAST16_MIN INT16_MIN +#define INT_FAST16_MAX INT16_MAX +#define INT_FAST32_MIN INT32_MIN +#define INT_FAST32_MAX INT32_MAX +#define INT_FAST64_MIN INT64_MIN +#define INT_FAST64_MAX INT64_MAX +#define UINT_FAST8_MAX UINT8_MAX +#define UINT_FAST16_MAX UINT16_MAX +#define UINT_FAST32_MAX UINT32_MAX +#define UINT_FAST64_MAX UINT64_MAX + +// 7.18.2.4 Limits of integer types capable of holding object pointers +#ifdef _WIN64 // [ +# define INTPTR_MIN INT64_MIN +# define INTPTR_MAX INT64_MAX +# define UINTPTR_MAX UINT64_MAX +#else // _WIN64 ][ +# define INTPTR_MIN INT32_MIN +# define INTPTR_MAX INT32_MAX +# define UINTPTR_MAX UINT32_MAX +#endif // _WIN64 ] + +// 7.18.2.5 Limits of greatest-width integer types +#define INTMAX_MIN INT64_MIN +#define INTMAX_MAX INT64_MAX +#define UINTMAX_MAX UINT64_MAX + +// 7.18.3 Limits of other integer types + +#ifdef _WIN64 // [ +# define PTRDIFF_MIN _I64_MIN +# define PTRDIFF_MAX _I64_MAX +#else // _WIN64 ][ +# define PTRDIFF_MIN _I32_MIN +# define PTRDIFF_MAX _I32_MAX +#endif // _WIN64 ] + +#define SIG_ATOMIC_MIN INT_MIN +#define SIG_ATOMIC_MAX INT_MAX + +#ifndef SIZE_MAX // [ +# ifdef _WIN64 // [ +# define SIZE_MAX _UI64_MAX +# else // _WIN64 ][ +# define SIZE_MAX _UI32_MAX +# endif // _WIN64 ] +#endif // SIZE_MAX ] + +// WCHAR_MIN and WCHAR_MAX are also defined in +#ifndef WCHAR_MIN // [ +# define WCHAR_MIN 0 +#endif // WCHAR_MIN ] +#ifndef WCHAR_MAX // [ +# define WCHAR_MAX _UI16_MAX +#endif // WCHAR_MAX ] + +#define WINT_MIN 0 +#define WINT_MAX _UI16_MAX + +#endif // __STDC_LIMIT_MACROS ] + + +// 7.18.4 Limits of other integer types + +#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260 + +// 7.18.4.1 Macros for minimum-width integer constants + +#define INT8_C(val) val##i8 +#define INT16_C(val) val##i16 +#define INT32_C(val) val##i32 +#define INT64_C(val) val##i64 + +#define UINT8_C(val) val##ui8 +#define UINT16_C(val) val##ui16 +#define UINT32_C(val) val##ui32 +#define UINT64_C(val) val##ui64 + +// 7.18.4.2 Macros for greatest-width integer constants +#define INTMAX_C INT64_C +#define UINTMAX_C UINT64_C + +#endif // __STDC_CONSTANT_MACROS ] + + +#endif // _MSC_STDINT_H_ ] diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-maven-plugin/pom.xml jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-maven-plugin/pom.xml --- jtreg7-7.3.1+1/hawt-jni/hawtjni-maven-plugin/pom.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-maven-plugin/pom.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,168 @@ + + + + 4.0.0 + + + org.fusesource.hawtjni + hawtjni-project + 1.18 + + + hawtjni-maven-plugin + maven-plugin + + HawtJNI Maven Plugin + Use HawtJNI from a maven plugin + + + ${mavenVersion} + + + + 3.6.3 + ${project.version} + + + + + org.fusesource.hawtjni + hawtjni-generator + ${project.version} + + + + + org.apache.maven + maven-plugin-api + ${mavenVersion} + + + org.apache.maven + maven-project + 2.0.11 + + + + org.codehaus.plexus + plexus-utils + 3.3.0 + + + + org.codehaus.plexus + plexus-interpolation + 1.26 + + + + org.apache.maven + maven-artifact-manager + 2.0.11 + + + org.apache.maven + maven-artifact + 2.0.11 + + + + org.apache.maven + maven-archiver + 2.4 + + + org.codehaus.plexus + plexus-archiver + 4.2.2 + + + org.codehaus.plexus + plexus-container-default + + + org.codehaus.plexus + plexus-component-api + + + + + org.codehaus.plexus + plexus-io + 3.2.0 + + + org.codehaus.plexus + plexus-container-default + + + org.codehaus.plexus + plexus-component-api + + + + + + org.apache.maven.plugin-tools + maven-plugin-annotations + 3.6.0 + provided + + + + + + + + + org.apache.maven.plugins + maven-plugin-plugin + 3.6.0 + + + + + + org.apache.maven.plugins + maven-plugin-plugin + + + default-descriptor + process-classes + + + + help-goal + + helpmojo + + + + + + + + + + + org.apache.maven.plugins + maven-plugin-plugin + + + + diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-maven-plugin/src/main/java/org/fusesource/hawtjni/maven/BuildMojo.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-maven-plugin/src/main/java/org/fusesource/hawtjni/maven/BuildMojo.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-maven-plugin/src/main/java/org/fusesource/hawtjni/maven/BuildMojo.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-maven-plugin/src/main/java/org/fusesource/hawtjni/maven/BuildMojo.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,457 @@ +/** + * Copyright (C) 2009-2011 FuseSource Corp. + * http://fusesource.com + * + * 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.fusesource.hawtjni.maven; + +import java.io.*; +import java.net.URL; +import java.util.List; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.factory.ArtifactFactory; +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.ArtifactResolver; +import org.apache.maven.model.Dependency; +import org.apache.maven.model.Resource; +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugin.MojoExecutionException; +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.project.MavenProject; +import org.codehaus.plexus.archiver.UnArchiver; +import org.codehaus.plexus.archiver.manager.ArchiverManager; +import org.codehaus.plexus.util.FileUtils; +import org.codehaus.plexus.util.IOUtil; +import org.codehaus.plexus.util.cli.CommandLineException; +import org.fusesource.hawtjni.runtime.Library; + +/** + * This goal builds the JNI module which was previously + * generated with the generate goal. It adds the JNI module + * to the test resource path so that unit tests can load + * the freshly built JNI library. + * + * @author Hiram Chirino + */ +@Mojo(name = "build", defaultPhase = LifecyclePhase.GENERATE_TEST_RESOURCES) +public class BuildMojo extends AbstractMojo { + + /** + * The maven project. + */ + @Parameter(defaultValue = "${project}", readonly = true) + protected MavenProject project; + + /** + * Remote repositories + */ + @Parameter(defaultValue = "${project.remoteArtifactRepositories}", readonly = true) + protected List remoteArtifactRepositories; + + /** + * Local maven repository. + */ + @Parameter(defaultValue = "${localRepository}", readonly = true) + protected ArtifactRepository localRepository; + + /** + * Artifact factory, needed to download the package source file + */ + @Component + protected ArtifactFactory artifactFactory; + + /** + * Artifact resolver, needed to download the package source file + */ + @Component + protected ArtifactResolver artifactResolver; + + /** + */ + @Component + private ArchiverManager archiverManager; + + /** + * The base name of the library, used to determine generated file names. + */ + @Parameter(defaultValue = "${project.artifactId}") + private String name; + + /** + * Where the unpacked build package is located. + */ + @Parameter(defaultValue = "${project.build.directory}/generated-sources/hawtjni/native-package") + private File packageDirectory; + + /** + * The output directory where the built JNI library will placed. This directory will be added + * to as a test resource path so that unit tests can verify the built JNI library. + * + * The library will placed under the META-INF/native/${platform} directory that the HawtJNI + * Library uses to find JNI libraries as classpath resources. + */ + @Parameter(defaultValue = "${project.build.directory}/generated-sources/hawtjni/lib") + private File libDirectory; + + /** + * The directory where the build will be produced. It creates a native-build and native-dist directory + * under the specified directory. + */ + @Parameter(defaultValue = "${project.build.directory}") + private File buildDirectory; + + /** + * Should we skip executing the autogen.sh file. + */ + @Parameter(defaultValue = "${skip-autogen}") + private boolean skipAutogen; + + /** + * Should we force executing the autogen.sh file. + */ + @Parameter(defaultValue = "${force-autogen}") + private boolean forceAutogen; + + /** + * Extra arguments you want to pass to the autogen.sh command. + */ + @Parameter + private List autogenArgs; + + /** + * Should we skip executing the configure command. + */ + @Parameter(defaultValue = "${skip-configure}") + private boolean skipConfigure; + + /** + * Should we force executing the configure command. + */ + @Parameter(defaultValue = "${force-configure}") + private boolean forceConfigure; + + /** + * Should we display all the native build output? + */ + @Parameter(defaultValue = "${hawtjni-verbose}") + private boolean verbose; + + /** + * Extra arguments you want to pass to the configure command. + */ + @Parameter + private List configureArgs; + + /** + * The platform identifier of this build. If not specified, + * it will be automatically detected. + */ + @Parameter + private String platform; + + /** + * The classifier of the package archive that will be created. + */ + @Parameter(defaultValue = "native-src") + private String sourceClassifier; + + /** + * If the source build could not be fully generated, perhaps the autotools + * were not available on this platform, should we attempt to download + * a previously deployed source package and build that? + */ + @Parameter(defaultValue = "true") + private boolean downloadSourcePackage = true; + + /** + * The dependency to download to get the native sources. + */ + @Parameter + private Dependency nativeSrcDependency; + + /** + * URL to where we can down the source package + */ + @Parameter(defaultValue = "${native-src-url}") + private String nativeSrcUrl; + + /** + * The build tool to use on Windows systems. Set + * to 'msbuild', 'vcbuild', or 'detect' + */ + @Parameter(defaultValue = "detect") + private String windowsBuildTool; + + /** + * The name of the msbuild/vcbuild project to use. + * Defaults to 'vs2010' for 'msbuild' + * and 'vs2008' for 'vcbuild'. + */ + @Parameter + private String windowsProjectName; + + private final CLI cli = new CLI(); + + public void execute() throws MojoExecutionException { + cli.verbose = verbose; + cli.log = getLog(); + try { + File buildDir = new File(buildDirectory, "native-build"); + buildDir.mkdirs(); + if ( CLI.IS_WINDOWS ) { + vsBasedBuild(buildDir); + } else { + configureBasedBuild(buildDir); + } + + getLog().info("Adding test resource root: "+libDirectory.getAbsolutePath()); + Resource testResource = new Resource(); + testResource.setDirectory(libDirectory.getAbsolutePath()); + this.project.addTestResource(testResource); //(); + + } catch (Exception e) { + throw new MojoExecutionException("build failed: "+e, e); + } + } + + private void vsBasedBuild(File buildDir) throws CommandLineException, MojoExecutionException, IOException { + + FileUtils.copyDirectoryStructureIfModified(packageDirectory, buildDir); + + Library library = new Library(name); + String libPlatform = this.platform != null ? this.platform : Library.getPlatform(); + String platform; + String configuration="release"; + if( "windows32".equals(libPlatform) ) { + platform = "Win32"; + } else if( "windows64".equals(libPlatform) ) { + platform = "x64"; + } else { + throw new MojoExecutionException("Unsupported platform: "+libPlatform); + } + + boolean useMSBuild = false; + String tool = windowsBuildTool.toLowerCase().trim(); + if( "detect".equals(tool) ) { + String toolset = System.getenv("PlatformToolset"); + if( "Windows7.1SDK".equals(toolset) ) { + useMSBuild = true; + } else { + String vcinstalldir = System.getenv("VCINSTALLDIR"); + if( vcinstalldir!=null ) { + if( vcinstalldir.contains("Microsoft Visual Studio 10") || + vcinstalldir.contains("Microsoft Visual Studio 11") || + vcinstalldir.contains("Microsoft Visual Studio 12") || + vcinstalldir.contains("Microsoft Visual Studio 14") || + vcinstalldir.contains("Microsoft Visual Studio\\2017") + ) { + useMSBuild = true; + } + } + } + } else if( "msbuild".equals(tool) ) { + useMSBuild = true; + } else if( "vcbuild".equals(tool) ) { + useMSBuild = false; + } else { + throw new MojoExecutionException("Invalid setting for windowsBuildTool: "+windowsBuildTool); + } + + if( useMSBuild ) { + // vcbuild was removed.. use the msbuild tool instead. + int rc = cli.system(buildDir, new String[]{"msbuild", (windowsProjectName != null ? windowsProjectName : "vs2010") + ".vcxproj", "/property:Platform="+platform, "/property:Configuration="+configuration}); + if( rc != 0 ) { + throw new MojoExecutionException("vcbuild failed with exit code: "+rc); + } + } else { + // try to use a vcbuild.. + int rc = cli.system(buildDir, new String[]{"vcbuild", "/platform:"+platform, (windowsProjectName != null ? windowsProjectName : "vs2008") + ".vcproj", configuration}); + if( rc != 0 ) { + throw new MojoExecutionException("vcbuild failed with exit code: "+rc); + } + } + + File libFile=FileUtils.resolveFile(buildDir, "target/"+platform+"-"+configuration+"/lib/"+library.getLibraryFileName()); + if( !libFile.exists() ) { + throw new MojoExecutionException("vcbuild did not generate: "+libFile); + } + + File target=FileUtils.resolveFile(libDirectory, library.getPlatformSpecificResourcePath(libPlatform)); + FileUtils.copyFile(libFile, target); + + } + + + private void configureBasedBuild(File buildDir) throws IOException, MojoExecutionException, CommandLineException { + + File configure = new File(packageDirectory, "configure"); + if( configure.exists() ) { + FileUtils.copyDirectoryStructureIfModified(packageDirectory, buildDir); + } else if (downloadSourcePackage) { + downloadNativeSourcePackage(buildDir); + } else { + if( !buildDir.exists() ) { + throw new MojoExecutionException("The configure script is missing from the generated native source package and downloadSourcePackage is disabled: "+configure); + } + } + + configure = new File(buildDir, "configure"); + File autogen = new File(buildDir, "autogen.sh"); + File makefile = new File(buildDir, "Makefile"); + + File distDirectory = new File(buildDir, "target"); + File distLibDirectory = new File(distDirectory, "lib"); + distLibDirectory.mkdirs(); + + if( autogen.exists() && !skipAutogen ) { + if( (!configure.exists() && !CLI.IS_WINDOWS) || forceAutogen ) { + cli.setExecutable(autogen); + int rc = cli.system(buildDir, new String[] {"./autogen.sh"}, autogenArgs); + if( rc != 0 ) { + throw new MojoExecutionException("./autogen.sh failed with exit code: "+rc); + } + } + } + + if( configure.exists() && !skipConfigure ) { + if( !makefile.exists() || forceConfigure ) { + + File autotools = new File(buildDir, "autotools"); + File[] listFiles = autotools.listFiles(); + if( listFiles!=null ) { + for (File file : listFiles) { + cli.setExecutable(file); + } + } + + cli.setExecutable(configure); + int rc = cli.system(buildDir, new String[]{"./configure", "--disable-ccache", "--prefix="+distDirectory.getCanonicalPath(), "--libdir="+distDirectory.getCanonicalPath()+"/lib"}, configureArgs); + if( rc != 0 ) { + throw new MojoExecutionException("./configure failed with exit code: "+rc); + } + } + } + + int rc = cli.system(buildDir, new String[]{"make", "install"}); + if( rc != 0 ) { + throw new MojoExecutionException("make based build failed with exit code: "+rc); + } + + Library library = new Library(name); + + File libFile = new File(distLibDirectory, library.getLibraryFileName()); + if( !libFile.exists() ) { + throw new MojoExecutionException("Make based build did not generate: "+libFile); + } + + if( platform == null ) { + platform = library.getPlatform(); + } + + File target=FileUtils.resolveFile(libDirectory, library.getPlatformSpecificResourcePath(platform)); + FileUtils.copyFile(libFile, target); + } + + public void downloadNativeSourcePackage(File buildDir) throws MojoExecutionException { + File packageZipFile; + if( nativeSrcUrl ==null || nativeSrcUrl.trim().length()==0 ) { + Artifact artifact=null; + if( nativeSrcDependency==null ) { + artifact = artifactFactory.createArtifactWithClassifier(project.getGroupId(), project.getArtifactId(), project.getVersion(), "zip", sourceClassifier); + } else { + artifact = artifactFactory.createArtifactWithClassifier(nativeSrcDependency.getGroupId(), nativeSrcDependency.getArtifactId(), nativeSrcDependency.getVersion(), nativeSrcDependency.getType(), nativeSrcDependency.getClassifier()); + } + try { + artifactResolver.resolveAlways(artifact, remoteArtifactRepositories, localRepository); + } catch (ArtifactResolutionException e) { + throw new MojoExecutionException("Error downloading.", e); + } catch (ArtifactNotFoundException e) { + throw new MojoExecutionException("Requested download does not exist.", e); + } + + packageZipFile = artifact.getFile(); + if( packageZipFile.isDirectory() ) { + // Yep. looks like we are running on mvn 3, seem like + // mvn 3 does not actually download the artifact. it just points us + // to our own build. + throw new MojoExecutionException("Add a '-Dnative-src-url=file:...' to have maven download the native package"); + } + } else { + try { + packageZipFile = new File(buildDirectory, "native-build.zip"); + URL url = new URL(nativeSrcUrl.trim()); + InputStream is = url.openStream(); + try { + FileOutputStream os = new FileOutputStream(packageZipFile); + try { + IOUtil.copy(is, os); + } finally { + IOUtil.close(is); + } + + } finally { + IOUtil.close(is); + } + } catch (Exception e) { + throw new MojoExecutionException("Error downloading: "+ nativeSrcUrl, e); + } + } + + try { + File dest = new File(buildDirectory, "native-build-extracted"); + getLog().info("Extracting "+packageZipFile+" to "+dest); + + UnArchiver unArchiver = archiverManager.getUnArchiver("zip"); + unArchiver.setSourceFile(packageZipFile); + unArchiver.extract("", dest); + + + File source = findSourceRoot(dest); + if( source==null ) { + throw new MojoExecutionException("Extracted package did not look like it contained a native source build."); + } + FileUtils.copyDirectoryStructureIfModified(source, buildDir); + + } catch (MojoExecutionException e) { + throw e; + } catch (Throwable e) { + throw new MojoExecutionException("Could not extract the native source package.", e); + } + } + + private File findSourceRoot(File dest) { + if(dest.isDirectory()) { + if( new File(dest, "configure").exists() ) { + return dest; + } else { + for (File file : dest.listFiles()) { + File root = findSourceRoot(file); + if( root!=null ) { + return root; + } + } + return null; + } + } else { + return null; + } + } + +} diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-maven-plugin/src/main/java/org/fusesource/hawtjni/maven/CLI.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-maven-plugin/src/main/java/org/fusesource/hawtjni/maven/CLI.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-maven-plugin/src/main/java/org/fusesource/hawtjni/maven/CLI.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-maven-plugin/src/main/java/org/fusesource/hawtjni/maven/CLI.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,100 @@ +package org.fusesource.hawtjni.maven; + +import java.io.File; +import java.util.List; +import java.util.regex.Pattern; + +import org.apache.maven.plugin.logging.Log; +import org.codehaus.plexus.util.cli.CommandLineException; +import org.codehaus.plexus.util.cli.CommandLineUtils; +import org.codehaus.plexus.util.cli.Commandline; +import org.codehaus.plexus.util.cli.StreamConsumer; +import org.codehaus.plexus.util.cli.CommandLineUtils.StringStreamConsumer; + +public class CLI { + + public static final boolean IS_WINDOWS = isWindows(); + + static private boolean isWindows() { + String name = System.getProperty("os.name").toLowerCase().trim(); + return name.startsWith("win"); + } + + public boolean verbose; + public Log log; + + + public void setExecutable(File path) { + if( IS_WINDOWS ) { + return; + } + try { + // These are Java 1.6 Methods.. + if( !path.canExecute() ) { + path.setExecutable(true); + } + } catch (NoSuchMethodError e1) { + // Do it the old fasioned way... + try { + system(path.getParentFile(), new String[] { "chmod", "a+x", path.getCanonicalPath() }); + } catch (Throwable e2) { + } + } + } + + public int system(File wd, String[] command) throws CommandLineException { + return system(wd, command, null); + } + + public int system(File wd, String[] command, List args) throws CommandLineException { + Commandline cli = new Commandline(); + cli.setWorkingDirectory(wd); + for (String c : command) { + cli.createArg().setValue(c); + } + if( args!=null ) { + for (String arg : args) { + cli.createArg().setValue(arg); + } + } + log.info("executing: "+cli); + + StreamConsumer consumer = new StreamConsumer() { + public void consumeLine(String line) { + log.info(line); + } + }; + if( !verbose ) { + consumer = new StringStreamConsumer(); + } + int rc = CommandLineUtils.executeCommandLine(cli, null, consumer, consumer); + if( rc!=0 ) { + if( !verbose ) { + // We only display output if the command fails.. + String output = ((StringStreamConsumer)consumer).getOutput(); + if( output.length()>0 ) { + String nl = System.getProperty( "line.separator"); + String[] lines = output.split(Pattern.quote(nl)); + for (String line : lines) { + log.info(line); + } + } + } + log.info("rc: "+rc); + } else { + if( !verbose ) { + String output = ((StringStreamConsumer)consumer).getOutput(); + if( output.length()>0 ) { + String nl = System.getProperty( "line.separator"); + String[] lines = output.split(Pattern.quote(nl)); + for (String line : lines) { + log.debug(line); + } + } + } + log.debug("rc: "+rc); + } + return rc; + } + +} diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-maven-plugin/src/main/java/org/fusesource/hawtjni/maven/GenerateMojo.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-maven-plugin/src/main/java/org/fusesource/hawtjni/maven/GenerateMojo.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-maven-plugin/src/main/java/org/fusesource/hawtjni/maven/GenerateMojo.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-maven-plugin/src/main/java/org/fusesource/hawtjni/maven/GenerateMojo.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,412 @@ +/** + * Copyright (C) 2009-2011 FuseSource Corp. + * http://fusesource.com + * + * 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.fusesource.hawtjni.maven; + +import java.io.File; +import java.io.IOException; +import java.io.Reader; +import java.net.URL; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.apache.maven.artifact.Artifact; +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; +import org.apache.maven.project.MavenProject; +import org.codehaus.plexus.interpolation.InterpolatorFilterReader; +import org.codehaus.plexus.interpolation.MapBasedValueSource; +import org.codehaus.plexus.interpolation.StringSearchInterpolator; +import org.codehaus.plexus.util.FileUtils; +import org.codehaus.plexus.util.FileUtils.FilterWrapper; +import org.fusesource.hawtjni.generator.HawtJNI; +import org.fusesource.hawtjni.generator.ProgressMonitor; + +/** + * This goal generates the native source code and a + * autoconf/msbuild based build system needed to + * build a JNI library for any HawtJNI annotated + * classes in your maven project. + * + * @author Hiram Chirino + */ +@Mojo(name = "generate", defaultPhase = LifecyclePhase.PROCESS_CLASSES) +public class GenerateMojo extends AbstractMojo { + + /** + * The maven project. + */ + @Parameter(defaultValue = "${project}", readonly = true) + protected MavenProject project; + + /** + * The directory where the native source files are located. + */ + @Parameter + private File nativeSourceDirectory; + + /** + * The directory where the generated native source files are located. + */ + @Parameter(defaultValue = "${project.build.directory}/generated-sources/hawtjni/native-src") + private File generatedNativeSourceDirectory; + + /** + * The base name of the library, used to determine generated file names. + */ + @Parameter(defaultValue = "${project.artifactId}") + private String name; + + /** + * The copyright header template that will be added to the generated source files. + * Use the '%END_YEAR%' token to have it replaced with the current year. + */ + @Parameter(defaultValue = "") + private String copyright; + + /** + * Restrict looking for JNI classes to the specified package. + */ + @Parameter + private List packages = new ArrayList(); + + /** + * The directory where the java classes files are located. + */ + @Parameter(defaultValue = "${project.build.outputDirectory}") + private File classesDirectory; + + /** + * The directory where the generated build package is located.. + */ + @Parameter(defaultValue = "${project.build.directory}/generated-sources/hawtjni/native-package") + private File packageDirectory; + + /** + * The list of additional files to be included in the package will be + * placed. + */ + @Parameter(defaultValue = "${basedir}/src/main/native-package") + private File customPackageDirectory; + + /** + * The text encoding of the files. + */ + @Parameter(defaultValue = "UTF-8") + private String encoding; + + /** + * Should we skip executing the autogen.sh file. + */ + @Parameter(defaultValue = "${skip-autogen}") + private boolean skipAutogen; + + /** + * Should we force executing the autogen.sh file. + */ + @Parameter(defaultValue = "${force-autogen}") + private boolean forceAutogen; + + /** + * Should we display all the native build output? + */ + @Parameter(defaultValue = "${hawtjni-verbose}") + private boolean verbose; + + /** + * Extra arguments you want to pass to the autogen.sh command. + */ + @Parameter + private List autogenArgs; + + /** + * Set this value to false to disable the callback support in HawtJNI. + * Disabling callback support can substantially reduce the size + * of the generated native library. + */ + @Parameter(defaultValue = "true") + private boolean callbacks; + + /** + * The build tool to use on Windows systems. Set + * to 'msbuild', 'vcbuild', or 'detect' or 'none' + */ + @Parameter(defaultValue = "detect") + private String windowsBuildTool; + + /** + * The name of the msbuild/vcbuild project to use. + * Defaults to 'vs2010' for 'msbuild' + * and 'vs2008' for 'vcbuild'. + */ + @Parameter + private String windowsProjectName; + + /** + * Set this value to true to include the import of a custom properties file in your vcxproj (not applicable + * to vs2008). This greatly simplifies the configurability of your project. + */ + @Parameter(defaultValue = "false") + private boolean windowsCustomProps; + + /** + * The tools version used in the header of your vcxproj (not applicable to vs2008). + */ + @Parameter(defaultValue = "4.0") + private String windowsToolsVersion; + + /** + * The target platform version used in your vcxproj (not applicable to vs2008). + * Not supplied by default. + */ + @Parameter + private String windowsTargetPlatformVersion; + + /** + * The platform toolset version used in your vcxproj (not applicable to vs2008). + * Not supplied by default. + */ + @Parameter + private String windowsPlatformToolset; + + private File targetSrcDir; + + private CLI cli = new CLI(); + + public void execute() throws MojoExecutionException { + cli.verbose = verbose; + cli.log = getLog(); + if (nativeSourceDirectory == null) { + generateNativeSourceFiles(); + } else { + copyNativeSourceFiles(); + } + generateBuildSystem(); + } + + private void copyNativeSourceFiles() throws MojoExecutionException { + try { + FileUtils.copyDirectory(nativeSourceDirectory, generatedNativeSourceDirectory); + } catch (Exception e) { + throw new MojoExecutionException("Copy of Native source failed: "+e, e); + } + } + + private void generateNativeSourceFiles() throws MojoExecutionException { + HawtJNI generator = new HawtJNI(); + generator.setClasspaths(getClasspath()); + generator.setName(name); + generator.setCopyright(copyright); + generator.setNativeOutput(generatedNativeSourceDirectory); + generator.setPackages(packages); + generator.setCallbacks(callbacks); + generator.setProgress(new ProgressMonitor() { + public void step() { + } + public void setTotal(int total) { + } + public void setMessage(String message) { + getLog().info(message); + } + }); + try { + generator.generate(); + } catch (Exception e) { + throw new MojoExecutionException("Native source code generation failed: "+e, e); + } + } + + private void generateBuildSystem() throws MojoExecutionException { + try { + packageDirectory.mkdirs(); + new File(packageDirectory, "m4").mkdirs(); + targetSrcDir = new File(packageDirectory, "src"); + targetSrcDir.mkdirs(); + + if( customPackageDirectory!=null && customPackageDirectory.isDirectory() ) { + FileUtils.copyDirectoryStructureIfModified(customPackageDirectory, packageDirectory); + } + + if( generatedNativeSourceDirectory!=null && generatedNativeSourceDirectory.isDirectory() ) { + FileUtils.copyDirectoryStructureIfModified(generatedNativeSourceDirectory, targetSrcDir); + } + + copyTemplateResource("readme.md", false); + copyTemplateResource("configure.ac", true); + copyTemplateResource("Makefile.am", true); + copyTemplateResource("m4/custom.m4", false); + copyTemplateResource("m4/jni.m4", false); + copyTemplateResource("m4/osx-universal.m4", false); + + // To support windows based builds.. + String tool = windowsBuildTool.toLowerCase().trim(); + if( "detect".equals(tool) ) { + copyTemplateResource("vs2008.vcproj", (windowsProjectName != null ? windowsProjectName : "vs2008") + ".vcproj", true); + copyTemplateResource("vs2010.vcxproj", (windowsProjectName != null ? windowsProjectName : "vs2010") + ".vcxproj", true); + if (windowsCustomProps) { + copyTemplateResource("vs2010.custom.props", (windowsProjectName != null ? windowsProjectName : "vs2010") + ".custom.props", true); + } + } else if( "msbuild".equals(tool) ) { + copyTemplateResource("vs2010.vcxproj", (windowsProjectName != null ? windowsProjectName : "vs2010") + ".vcxproj", true); + if (windowsCustomProps) { + copyTemplateResource("vs2010.custom.props", (windowsProjectName != null ? windowsProjectName : "vs2010") + ".custom.props", true); + } + } else if( "vcbuild".equals(tool) ) { + copyTemplateResource("vs2008.vcproj", (windowsProjectName != null ? windowsProjectName : "vs2008") + ".vcproj", true); + } else if( "none".equals(tool) ) { + } else { + throw new MojoExecutionException("Invalid setting for windowsBuildTool: "+windowsBuildTool); + } + + File autogen = new File(packageDirectory, "autogen.sh"); + File configure = new File(packageDirectory, "configure"); + if( !autogen.exists() ) { + copyTemplateResource("autogen.sh", false); + cli.setExecutable(autogen); + } + if( !skipAutogen ) { + if( (!configure.exists() && !CLI.IS_WINDOWS) || forceAutogen ) { + try { + cli.system(packageDirectory, new String[] {"./autogen.sh"}, autogenArgs); + } catch (Exception e) { + e.printStackTrace(); + } + } + } + + + } catch (Exception e) { + throw new MojoExecutionException("Native build system generation failed: "+e, e); + } + } + + @SuppressWarnings("unchecked") + private ArrayList getClasspath() throws MojoExecutionException { + ArrayList artifacts = new ArrayList(); + try { + artifacts.add(classesDirectory.getCanonicalPath()); + for (Artifact artifact : (Set) project.getArtifacts()) { + File file = artifact.getFile(); + getLog().debug("Including: " + file); + artifacts.add(file.getCanonicalPath()); + } + } catch (IOException e) { + throw new MojoExecutionException("Could not determine project classath.", e); + } + return artifacts; + } + + private void copyTemplateResource(String file, boolean filter) throws MojoExecutionException { + copyTemplateResource(file, file, filter); + } + + private void copyTemplateResource(String file, String output, boolean filter) throws MojoExecutionException { + try { + File target = FileUtils.resolveFile(packageDirectory, output); + if( target.isFile() && target.canRead() ) { + return; + } + URL source = getClass().getClassLoader().getResource("project-template/" + file); + File tmp = FileUtils.createTempFile("tmp", "txt", new File(project.getBuild().getDirectory())); + try { + FileUtils.copyURLToFile(source, tmp); + FileUtils.copyFile(tmp, target, encoding, filters(filter), true); + } finally { + tmp.delete(); + } + } catch (IOException e) { + throw new MojoExecutionException("Could not extract template resource: "+file, e); + } + } + + @SuppressWarnings("unchecked") + private FilterWrapper[] filters(boolean filter) throws IOException { + if( !filter ) { + return new FilterWrapper[0]; + } + + final String startExp = "@"; + final String endExp = "@"; + final String escapeString = "\\"; + final Map values = new HashMap(); + values.put("PROJECT_NAME", name); + values.put("PROJECT_NAME_UNDER_SCORE", name.replaceAll("\\W", "_")); + values.put("VERSION", project.getVersion()); + + List cpp_files = new ArrayList(); + cpp_files.addAll(FileUtils.getFileNames(targetSrcDir, "**/*.cpp", null, false)); + cpp_files.addAll(FileUtils.getFileNames(targetSrcDir, "**/*.cxx", null, false)); + + List files = new ArrayList(); + files.addAll(cpp_files); + files.addAll(FileUtils.getFileNames(targetSrcDir, "**/*.c", null, false)); + files.addAll(FileUtils.getFileNames(targetSrcDir, "**/*.m", null, false)); + String sources = ""; + String xml_sources = ""; + String vs10_sources = ""; + boolean first = true; + for (String f : files) { + if( !first ) { + sources += "\\\n"; + } else { + values.put("FIRST_SOURCE_FILE", "src/"+f.replace('\\', '/')); + first=false; + } + sources += " src/"+f; + + xml_sources+=" \n"; + vs10_sources+=" \n"; //VS adds trailing space and eases compares + } + + if( cpp_files.isEmpty() ) { + values.put("AC_PROG_CHECKS", "AC_PROG_CC"); + } else { + values.put("AC_PROG_CHECKS", "AC_PROG_CXX"); + } + + values.put("PROJECT_SOURCES", sources); + values.put("PROJECT_XML_SOURCES", xml_sources); + values.put("PROJECT_VS10_SOURCES", vs10_sources); + + values.put("CUSTOM_PROPS", windowsCustomProps ? "" : ""); + values.put("TOOLS_VERSION", windowsToolsVersion); + values.put("TARGET_PLATFORM_VERSION", windowsTargetPlatformVersion != null ? + "" + windowsTargetPlatformVersion + "" : ""); + values.put("PLATFORM_TOOLSET", windowsPlatformToolset != null ? + "" + windowsPlatformToolset + "" : ""); + + FileUtils.FilterWrapper wrapper = new FileUtils.FilterWrapper() { + public Reader getReader(Reader reader) { + StringSearchInterpolator propertiesInterpolator = new StringSearchInterpolator(startExp, endExp); + propertiesInterpolator.addValueSource(new MapBasedValueSource(values)); + propertiesInterpolator.setEscapeString(escapeString); + InterpolatorFilterReader interpolatorFilterReader = new InterpolatorFilterReader(reader, propertiesInterpolator, startExp, endExp); + interpolatorFilterReader.setInterpolateWithPrefixPattern(false); + return interpolatorFilterReader; + } + }; + return new FilterWrapper[] { wrapper }; + } + + +} diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-maven-plugin/src/main/java/org/fusesource/hawtjni/maven/PackageJarMojo.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-maven-plugin/src/main/java/org/fusesource/hawtjni/maven/PackageJarMojo.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-maven-plugin/src/main/java/org/fusesource/hawtjni/maven/PackageJarMojo.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-maven-plugin/src/main/java/org/fusesource/hawtjni/maven/PackageJarMojo.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,232 @@ +/** + * Copyright (C) 2009-2011 FuseSource Corp. + * http://fusesource.com + * + * 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.fusesource.hawtjni.maven; + +import java.io.File; +import java.util.List; + +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugin.MojoExecutionException; +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.project.MavenProject; +import org.apache.maven.project.MavenProjectHelper; +import org.codehaus.plexus.archiver.jar.JarArchiver; +import org.codehaus.plexus.archiver.jar.Manifest; +import org.codehaus.plexus.archiver.jar.Manifest.Attribute; +import org.codehaus.plexus.archiver.manager.ArchiverManager; +import org.fusesource.hawtjni.runtime.Library; + +/** + * This goal allows allows you to package the JNI library created by build goal + * in a JAR which the HawtJNI runtime can unpack when the library needs to be + * loaded. + * + * This platform specific jar is attached with a classifier which matches the + * current platform. + * + * @author Hiram Chirino + */ +@Mojo(name = "package-jar", defaultPhase = LifecyclePhase.PREPARE_PACKAGE) +public class PackageJarMojo extends AbstractMojo { + + /** + * The maven project. + */ + @Parameter(defaultValue = "${project}", readonly = true) + protected MavenProject project; + + /** + * The base name of the library, used to determine generated file names. + */ + @Parameter(defaultValue = "${project.artifactId}") + private String name; + + /** + */ + @Component + private ArchiverManager archiverManager; + + /** + */ + @Component + private MavenProjectHelper projectHelper; + + /** + * The output directory where the built JNI library will placed. This + * directory will be added to as a test resource path so that unit tests can + * verify the built JNI library. + * + * The library will placed under the META-INF/native/${platform} directory + * that the HawtJNI Library uses to find JNI libraries as classpath + * resources. + */ + @Parameter(defaultValue = "${project.build.directory}/generated-sources/hawtjni/lib") + private File libDirectory; + + /** + * The platform identifier of this build. If not specified, + * it will be automatically detected. + * + * @parameter + */ + @Parameter + private String platform; + + /** + * Should a classifier of the native jar be set + * to match the platform? + */ + @Parameter(defaultValue = "true") + private boolean classified; + + /** + * The osgi platforms that the library match for. Example value: + * osname=MacOS;processor=x86-64 + */ + @Parameter + private List osgiPlatforms; + + public void execute() throws MojoExecutionException { + try { + + Library library = new Library(name); + if (platform == null) { + platform = Library.getPlatform(); + } + + String classifier = null; + if( classified ) { + classifier = platform; + + String packageName = project.getArtifactId() + "-" + project.getVersion() + "-" + platform; + JarArchiver archiver = (JarArchiver) archiverManager.getArchiver("jar"); + + File packageFile = new File(new File(project.getBuild().getDirectory()), packageName + ".jar"); + archiver.setDestFile(packageFile); + archiver.setIncludeEmptyDirs(true); + archiver.addDirectory(libDirectory); + + Manifest manifest = new Manifest(); + manifest.addConfiguredAttribute(new Attribute("Bundle-SymbolicName", project.getArtifactId() + "-" + platform)); + manifest.addConfiguredAttribute(new Attribute("Bundle-Name", name + " for " + platform)); + manifest.addConfiguredAttribute(new Attribute("Bundle-NativeCode", getNativeCodeValue(library))); + manifest.addConfiguredAttribute(new Attribute("Bundle-Version", project.getVersion())); + manifest.addConfiguredAttribute(new Attribute("Bundle-ManifestVersion", "2")); + manifest.addConfiguredAttribute(new Attribute("Bundle-Description", project.getDescription())); + archiver.addConfiguredManifest(manifest); + + archiver.createArchive(); + + projectHelper.attachArtifact(project, "jar", classifier, packageFile); + + } else { + projectHelper.addResource(project, libDirectory.getCanonicalPath(), null, null); + } + + } catch (Exception e) { + throw new MojoExecutionException("packaging failed: " + e, e); + } + } + + public String getNativeCodeValue(Library library) { + if (osgiPlatforms == null || osgiPlatforms.isEmpty() ) { + return library.getPlatformSpecificResourcePath(platform) + ";" +"osname=" + getOsgiOSName() + ";processor=" + getOsgiProcessor()+ ",*"; + } + boolean first=true; + String rc = ""; + for (String s : osgiPlatforms) { + if( !first ) { + rc += ","; + } + first = false; + if( "*".equals(s) ) { + rc += s; + } else { + rc += library.getPlatformSpecificResourcePath(platform) + ";"+s; + } + } + return rc; + } + + public String getOsgiOSName() { + String name = System.getProperty("os.name"); + + String trimmed = name.toLowerCase().trim(); + if (trimmed.startsWith("win")) { + return "Win32"; + } else if (trimmed.startsWith("linux")) { + return "Linux"; + } else if (trimmed.startsWith("macos") || trimmed.startsWith("mac os")) { + return "MacOS"; + } else if (trimmed.startsWith("aix")) { + return "AIX"; + } else if (trimmed.startsWith("hpux")) { + return "HPUX"; + } else if (trimmed.startsWith("irix")) { + return "IRIX"; + } else if (trimmed.startsWith("netware")) { + return "Netware"; + } else if (trimmed.startsWith("openbsd")) { + return "OpenBSD"; + } else if (trimmed.startsWith("netbsd")) { + return "NetBSD"; + } else if (trimmed.startsWith("os2") || trimmed.startsWith("os/2")) { + return "OS2"; + } else if (trimmed.startsWith("qnx") || trimmed.startsWith("procnto")) { + return "QNX"; + } else if (trimmed.startsWith("solaris")) { + return "Solaris"; + } else if (trimmed.startsWith("sunos")) { + return "SunOS"; + } else if (trimmed.startsWith("vxworks")) { + return "VxWorks"; + } + return name; + } + + public String getOsgiProcessor() { + String name = System.getProperty("os.arch"); + String trimmed = name.toLowerCase().trim(); + if (trimmed.startsWith("x86-64") || trimmed.startsWith("amd64") || trimmed.startsWith("em64") || trimmed.startsWith("x86_64")) { + return "x86-64"; + } else if (trimmed.startsWith("x86") || trimmed.startsWith("pentium") || trimmed.startsWith("i386") + || trimmed.startsWith("i486") || trimmed.startsWith("i586") || trimmed.startsWith("i686")) { + return "x86"; + } else if (trimmed.startsWith("68k")) { + return "68k"; + } else if (trimmed.startsWith("arm")) { + return "ARM"; + } else if (trimmed.startsWith("alpha")) { + return "Alpha"; + } else if (trimmed.startsWith("ignite") || trimmed.startsWith("psc1k")) { + return "Ignite"; + } else if (trimmed.startsWith("mips")) { + return "Mips"; + } else if (trimmed.startsWith("parisc")) { + return "PArisc"; + } else if (trimmed.startsWith("powerpc") || trimmed.startsWith("power") || trimmed.startsWith("ppc")) { + return "PowerPC"; + } else if (trimmed.startsWith("sparc")) { + return "Sparc"; + } + return name; + } + +} diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-maven-plugin/src/main/java/org/fusesource/hawtjni/maven/PackageSourceMojo.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-maven-plugin/src/main/java/org/fusesource/hawtjni/maven/PackageSourceMojo.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-maven-plugin/src/main/java/org/fusesource/hawtjni/maven/PackageSourceMojo.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-maven-plugin/src/main/java/org/fusesource/hawtjni/maven/PackageSourceMojo.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,109 @@ +/** + * Copyright (C) 2009-2011 FuseSource Corp. + * http://fusesource.com + * + * 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.fusesource.hawtjni.maven; + +import java.io.File; + +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugin.MojoExecutionException; +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.project.MavenProject; +import org.apache.maven.project.MavenProjectHelper; +import org.codehaus.plexus.archiver.Archiver; +import org.codehaus.plexus.archiver.manager.ArchiverManager; + +/** + * This goal creates a source zip file of the native build + * module and attaches it to the build so that it can get + * deployed. + * + * @author Hiram Chirino + */ +@Mojo(name = "package-source", defaultPhase = LifecyclePhase.PACKAGE) +public class PackageSourceMojo extends AbstractMojo { + + /** + * The maven project. + */ + @Parameter(defaultValue = "${project}", readonly = true) + protected MavenProject project; + + /** + */ + @Component + private ArchiverManager archiverManager; + + /** + */ + @Component + private MavenProjectHelper projectHelper; + + /** + * The directory where the generated native files are located.. + */ + @Parameter(defaultValue = "${project.build.directory}/generated-sources/hawtjni/native-package") + private File packageDirectory; + + /** + * The classifier of the package archive that will be created. + */ + @Parameter(defaultValue = "native-src") + private String sourceClassifier; + + /** + * Should we skip executing the autogen.sh file. + */ + @Parameter(defaultValue = "${skip-autogen}") + private boolean skipAutogen; + + + public void execute() throws MojoExecutionException { + try { + + String packageName = project.getArtifactId()+"-"+project.getVersion()+"-"+sourceClassifier; + File packageFile = new File(new File(project.getBuild().getDirectory()), packageName+".zip"); + + // Verify the the configure script got generated before packaging. + File configure = new File(packageDirectory, "configure"); + if( !skipAutogen && !configure.exists() ) { + // Looks like this platform could not generate the + // configure script. So don't install deploy + // partially created source package. + getLog().info(""); + getLog().warn("Will NOT package the native sources to: "+packageFile); + getLog().info(" Native source build directory did not contain a 'configure' script."); + getLog().info(" To ignore this warning and package it up anyways, configure the plugin with: true"); + getLog().info(""); + return; + } + + Archiver archiver = archiverManager.getArchiver( "zip" ); + archiver.setDestFile( packageFile); + archiver.setIncludeEmptyDirs(true); + archiver.addDirectory(packageDirectory, packageName+"/"); + archiver.createArchive(); + projectHelper.attachArtifact( project, "zip", sourceClassifier, packageFile ); + + } catch (Exception e) { + throw new MojoExecutionException("packageing failed: "+e, e); + } + } + +} diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/Makefile.am jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/Makefile.am --- jtreg7-7.3.1+1/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/Makefile.am 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,26 @@ +# --------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# --------------------------------------------------------------------------- + +ACLOCAL_AMFLAGS = -I m4 + +AM_CXXFLAGS = -std=gnu++11 + +lib_LTLIBRARIES = lib@PROJECT_NAME@.la +# lib@PROJECT_NAME_UNDER_SCORE@_la_CFLAGS = +#lib@PROJECT_NAME_UNDER_SCORE@_la_LDFLAGS = + +lib@PROJECT_NAME_UNDER_SCORE@_la_SOURCES =@PROJECT_SOURCES@ diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/autogen.sh jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/autogen.sh --- jtreg7-7.3.1+1/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/autogen.sh 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/autogen.sh 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,44 @@ +#!/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. +# --------------------------------------------------------------------------- + +auto_clean() { + AUTO_FILES=" + configure config.log config.status + autom4te.cache autotools aclocal.m4 libtool + m4/libtool.m4 m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4 m4/lt~obsolete.m4 + Makefile.in Makefile + src/Makefile src/Makefile.in + src/config.in src/config.h src/config.h.in* src/stamp-h1 + " + for f in "$AUTO_FILES" ; do + rm -Rf $f + done +} +auto_reconf() { + autoreconf --force --install -I m4 +} + +case "$1" in + clean) echo "auto clean..." + auto_clean + ;; + *) echo "auto reconf..." + auto_clean + auto_reconf + ;; +esac diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/configure.ac jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/configure.ac --- jtreg7-7.3.1+1/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/configure.ac 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/configure.ac 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,67 @@ +# --------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# --------------------------------------------------------------------------- + +## -------------------------------- +## Initialization macros. +## -------------------------------- +AC_PREREQ([2.61]) +AC_INIT([@PROJECT_NAME@], [@VERSION@]) +AC_CONFIG_AUX_DIR([autotools]) +AC_CONFIG_MACRO_DIR([m4]) +AC_CONFIG_SRCDIR([@FIRST_SOURCE_FILE@]) +AC_CONFIG_HEADERS([src/config.h]) +AC_CANONICAL_HOST +AC_CANONICAL_SYSTEM + +## ----------------------------------------------- +## Application Checks +## ----------------------------------------------- +@AC_PROG_CHECKS@ +AC_PROG_INSTALL +# Make AM_PROG_AR work before automake 1.12 +m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) +AC_PROG_LIBTOOL([disable-static]) + +## ----------------------------------------------- +## API Checks +## ----------------------------------------------- +WITH_JNI_JDK + +CUSTOM_M4_SETUP + +WITH_OSX_UNIVERSAL + +CFLAGS="$CFLAGS $JNI_EXTRA_CFLAGS" +AC_SUBST(CFLAGS) +CXXFLAGS="$CXXFLAGS $JNI_EXTRA_CFLAGS" +AC_SUBST(CXXFLAGS) +LDFLAGS="$LDFLAGS $JNI_EXTRA_LDFLAGS -release @VERSION@" +AC_SUBST(LDFLAGS) + +## ----------------------------------------------------- +## Generate the files +## ----------------------------------------------------- +AM_INIT_AUTOMAKE([subdir-objects no-dependencies -Wall -Werror foreign]) +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT + +echo " + ($PACKAGE_NAME) version $PACKAGE_VERSION + Prefix.........: $prefix + C Compiler.....: $CC $CFLAGS + Linker.........: $LD $LDFLAGS $LIBS +" diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/m4/custom.m4 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/m4/custom.m4 --- jtreg7-7.3.1+1/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/m4/custom.m4 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/m4/custom.m4 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +dnl --------------------------------------------------------------------------- +dnl Copyright (C) 2009-2011 FuseSource Corp. +dnl http://fusesource.com +dnl +dnl Licensed under the Apache License, Version 2.0 (the "License"); +dnl you may not use this file except in compliance with the License. +dnl You may obtain a copy of the License at +dnl +dnl http://www.apache.org/licenses/LICENSE-2.0 +dnl +dnl Unless required by applicable law or agreed to in writing, software +dnl distributed under the License is distributed on an "AS IS" BASIS, +dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +dnl See the License for the specific language governing permissions and +dnl limitations under the License. +dnl --------------------------------------------------------------------------- + +AC_DEFUN([CUSTOM_M4_SETUP], +[ + # + # This is just a stub. If you wish to customize your configure.ac + # just copy this file to src/main/native-package/m4/custom.m4 + # then replace add your configure.ac statements here. + # + AC_CHECK_HEADER([pthread.h],[AC_DEFINE([HAVE_PTHREAD_H], [1], [Define to 1 if you have the header file.])]) + +]) \ No newline at end of file diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/m4/jni.m4 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/m4/jni.m4 --- jtreg7-7.3.1+1/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/m4/jni.m4 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/m4/jni.m4 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,163 @@ +dnl --------------------------------------------------------------------------- +dnl Copyright (C) 2009-2011 FuseSource Corp. +dnl http://fusesource.com +dnl +dnl Licensed under the Apache License, Version 2.0 (the "License"); +dnl you may not use this file except in compliance with the License. +dnl You may obtain a copy of the License at +dnl +dnl http://www.apache.org/licenses/LICENSE-2.0 +dnl +dnl Unless required by applicable law or agreed to in writing, software +dnl distributed under the License is distributed on an "AS IS" BASIS, +dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +dnl See the License for the specific language governing permissions and +dnl limitations under the License. +dnl --------------------------------------------------------------------------- +dnl --------------------------------------------------------------------------- +dnl SYNOPSIS: +dnl +dnl WITH_JNI_JDK() +dnl +dnl Adds the --with-jni-jdk=PATH option. If not provided, it searches +dnl for the JDK in the default OS locations. +dnl +dnl This macro calls: +dnl AC_SUBST(JNI_JDK) +dnl AC_SUBST(JNI_EXTRA_CFLAGS) +dnl AC_SUBST(JNI_EXTRA_LDFLAGS) +dnl +dnl AUTHOR: Hiram Chrino +dnl --------------------------------------------------------------------------- + +AC_DEFUN([WITH_JNI_JDK], +[ + AC_PREREQ([2.61]) + AC_ARG_WITH(jni-jdk, + [AS_HELP_STRING([--with-jni-jdk=PATH], + [Location of the Java Development Kit. Defaults to your JAVA_HOME setting and falls back to where it is typically installed on your OS])], + [ + if test "$withval" = "no" || test "$withval" = "yes"; then + AC_MSG_ERROR([--with-jni-jdk: PATH to JDK not supplied]) + fi + CHECK_JNI_JDK([$withval], [], [AC_MSG_ERROR([JDK not found. Invalid --with-jni-jdk PATH])]) + ],[ + + if test -n "$JAVA_HOME" ; then + AC_MSG_NOTICE([JAVA_HOME was set, checking to see if it's a JDK we can use...]) + CHECK_JNI_JDK([$JAVA_HOME], [], []) + fi + + __JNI_GUESS=`which javac` + AS_IF(test -z "$JNI_JDK" && test -n "$__JNI_GUESS", [ + AC_MSG_NOTICE([javac was on your path, checking to see if it's part of a JDK we can use...]) + # transitively resolve the symbolic links to javac + while file -h "$__JNI_GUESS" 2>/dev/null | grep " symbolic link to " >/dev/null; do + __JNI_LINK=$( file -h $__JNI_GUESS | sed 's/.*symbolic link to //' | sed "s/'$//" | sed 's/^`//' ) + __JNI_GUESS=$(cd $(dirname $__JNI_GUESS); cd $(dirname $__JNI_LINK); echo "$(pwd)/$(basename $__JNI_LINK)") + done + # move 2 dirs up to the home dir... + __JNI_GUESS=$(dirname $(dirname $__JNI_GUESS)) + CHECK_JNI_JDK([$__JNI_GUESS], [], [],[]) + ],[]) + + AS_IF(test -z "$JNI_JDK", [ + case "$host_os" in + darwin*) __JNI_GUESS="/System/Library/Frameworks/JavaVM.framework";; + freebsd*) __JNI_GUESS=$(env JAVAVM_DRYRUN=yes /usr/local/bin/java | grep '^JAVA_HOME' | cut -c11-);; + *) __JNI_GUESS="/usr";; + esac + AC_MSG_NOTICE([Taking a guess as to where your OS installs the JDK by default...]) + CHECK_JNI_JDK([$__JNI_GUESS], [], [AC_MSG_ERROR([JDK not found. Please use the --with-jni-jdk option])]) + ],[]) + ]) +]) + +dnl --------------------------------------------------------------------------- +dnl +dnl JNI_CHECK_JDK_HOME(PATH, [ACTION-SUCCESS], [ACTION-FAILURE]) +dnl +dnl Tests to see if the given path is a valid JDK home location with +dnl with a JNI headers and library that can be compiled against. +dnl +dnl This macro calls: +dnl +dnl AC_SUBST(JNI_JDK) +dnl AC_SUBST(JNI_EXTRA_CFLAGS) +dnl AC_SUBST(JNI_EXTRA_LDFLAGS) +dnl +dnl AUTHOR: Hiram Chrino +dnl --------------------------------------------------------------------------- +AC_DEFUN([CHECK_JNI_JDK],[ + AC_PREREQ([2.61]) + __JNI_JDK_HOME="$1" + AC_MSG_CHECKING(if '$__JNI_JDK_HOME' is a JDK) + + __JNI_INCLUDE="$__JNI_JDK_HOME/include" + # OSX had to be a little different. + case "$host_os" in + darwin*) + AS_IF(test -r "$__JNI_JDK_HOME/Headers/jni.h",[ + __JNI_INCLUDE="$__JNI_JDK_HOME/Headers"; + ]) + esac + + + AS_IF(test -r "$__JNI_INCLUDE/jni.h",[ + # Also include the os specific include dirs in the JNI_CFLAGS + __JNI_CFLAGS="-I$__JNI_INCLUDE" + case "$host_os" in + darwin*) __JNI_INCLUDE_EXTRAS="darwin";; + freebsd*) __JNI_INCLUDE_EXTRAS="freebsd";; + linux*) __JNI_INCLUDE_EXTRAS="linux genunix";; + openbsd*) __JNI_INCLUDE_EXTRAS="openbsd";; + osf*) __JNI_INCLUDE_EXTRAS="alpha";; + solaris*) __JNI_INCLUDE_EXTRAS="solaris";; + mingw*) __JNI_INCLUDE_EXTRAS="win32";; + cygwin*) __JNI_INCLUDE_EXTRAS="win32";; + *) __JNI_INCLUDE_EXTRAS="genunix";; + esac + + for f in $__JNI_INCLUDE_EXTRAS ; do + if test -d "$__JNI_INCLUDE/$f"; then + __JNI_CFLAGS="$__JNI_CFLAGS -I$__JNI_INCLUDE/$f" + fi + done + + saved_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $__JNI_CFLAGS" + JNI_VERSION="1_2" + AC_LANG_PUSH(C) + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[@%:@include ]],[[ + #ifndef JNI_VERSION_$JNI_VERSION + # error JNI version $JNI_VERSION is not supported. + #endif + ]]) + ],[ + + JNI_JDK=$"$__JNI_JDK_HOME" + JNI_EXTRA_CFLAGS="$__JNI_CFLAGS" + AC_SUBST(JNI_JDK) + AC_SUBST(JNI_EXTRA_CFLAGS) + case $host_os in + darwin*) + JNI_EXTRA_LDFLAGS="-shrext .jnilib -dynamiclib" ;; + esac + AC_SUBST(JNI_EXTRA_LDFLAGS) + + + AC_MSG_RESULT([yes]) + $2 + ],[ + AC_MSG_RESULT([no]) + $3 + ]) + AC_LANG_POP() + CPPFLAGS="$saved_CPPFLAGS" + ],[ + AC_MSG_RESULT([no]) + $3 + ]) +]) + diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/m4/osx-universal.m4 jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/m4/osx-universal.m4 --- jtreg7-7.3.1+1/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/m4/osx-universal.m4 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/m4/osx-universal.m4 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,115 @@ +dnl --------------------------------------------------------------------------- +dnl Copyright (C) 2009-2011 FuseSource Corp. +dnl http://fusesource.com +dnl +dnl Licensed under the Apache License, Version 2.0 (the "License"); +dnl you may not use this file except in compliance with the License. +dnl You may obtain a copy of the License at +dnl +dnl http://www.apache.org/licenses/LICENSE-2.0 +dnl +dnl Unless required by applicable law or agreed to in writing, software +dnl distributed under the License is distributed on an "AS IS" BASIS, +dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +dnl See the License for the specific language governing permissions and +dnl limitations under the License. +dnl --------------------------------------------------------------------------- +dnl --------------------------------------------------------------------------- +dnl SYNOPSIS: +dnl +dnl WITH_OSX_UNIVERSAL() +dnl +dnl Allows creating universal binaries on the +dnl +dnl Adds the --with-universal=ARCH option. This will will +dnl set -isysroot option to the location of the MacOSX${OSX_VERSION}.sdk. +dnl if OSX_VERSION is not defined, it will set it to the latest version +dnl of the SDK installed on your system. +dnl +dnl You must use the no-dependencies option when automake is initialized. +dnl for example: AM_INIT_AUTOMAKE([no-dependencies]) +dnl +dnl This macro calls: +dnl AC_SUBST(CFLAGS) +dnl AC_SUBST(CXXFLAGS) +dnl AC_SUBST(LDFLAGS) +dnl AC_SUBST(OSX_VERSION) +dnl +dnl AUTHOR: Hiram Chrino +dnl --------------------------------------------------------------------------- + +AC_DEFUN([WITH_OSX_UNIVERSAL], +[ + AC_PREREQ([2.61]) + case "$host_os" in + darwin*) + + AC_MSG_CHECKING(OS X SDK version) + AC_ARG_WITH([osxsdk], + [AS_HELP_STRING([--with-osxsdk@<:@=VERSION@:>@], + [OS X SDK version to build against. Example: --with-osxsdk=10.6])], + [ + OSX_UNIVERSAL="$withval" + ],[ + OSX_SDKS_DIR="" + OSX_VERSION="" + for v in 10.0 10.1 10.2 10.3 10.4 10.5 10.6 10.7 10.8 10.9 10.10 10.11 10.12 10.13 10.14 10.15; do + for location in "/Developer/SDKs" "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs" ; do + if test -z "${OSX_VERSION}" && test -d "${location}/MacOSX${v}.sdk" ; then + OSX_SDKS_DIR="${location}" + OSX_VERSION="${v}" + fi + done + done + ]) + AC_MSG_RESULT([$OSX_VERSION]) + AC_SUBST(OSX_SDKS_DIR) + AC_SUBST(OSX_VERSION) + + AC_MSG_CHECKING(whether to build universal binaries) + AC_ARG_WITH([universal], + [AS_HELP_STRING([--with-universal@<:@=ARCH@:>@], + [Build a universal binary. Set to a space separated architecture list. Pick from: i386, x86_64, ppc, and/or ppc64. @<:@default="i386 x86_64"@:>@])], + [ + AS_IF(test "$withval" = "no", [ + OSX_UNIVERSAL="" + AC_MSG_RESULT([no]) + ], test "$withval" = "yes", [ + OSX_UNIVERSAL="i386 x86_64" + AC_MSG_RESULT([yes, archs: $OSX_UNIVERSAL]) + ],[ + OSX_UNIVERSAL="$withval" + AC_MSG_RESULT([yes, archs: $OSX_UNIVERSAL]) + ]) + ],[ + OSX_UNIVERSAL="" + AC_MSG_RESULT([no]) + ]) + + AS_IF(test -n "$OSX_UNIVERSAL", [ + for i in $OSX_UNIVERSAL ; do + CFLAGS="-arch $i $CFLAGS" + CXXFLAGS="-arch $i $CXXFLAGS" + LDFLAGS="-arch $i $LDFLAGS" + done + + + for f in $__JNI_INCLUDE_EXTRAS ; do + if test -d "$__JNI_INCLUDE/$f"; then + __JNI_CFLAGS="$__JNI_CFLAGS -I$__JNI_INCLUDE/$f" + fi + done + + + CFLAGS="-isysroot ${OSX_SDKS_DIR}/MacOSX${OSX_VERSION}.sdk $CFLAGS" + CXXFLAGS="-isysroot ${OSX_SDKS_DIR}/MacOSX${OSX_VERSION}.sdk $CXXFLAGS" + LDFLAGS="-syslibroot,${OSX_SDKS_DIR}/MacOSX${OSX_VERSION}.sdk $LDFLAGS" + AC_SUBST(CFLAGS) + AC_SUBST(CXXFLAGS) + AC_SUBST(LDFLAGS) + ]) + ;; + esac +]) + + diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/readme.md jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/readme.md --- jtreg7-7.3.1+1/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/readme.md 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/readme.md 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,57 @@ +Building on Unix/Linux/OS X +--------------------------- + +The configure script will customize the way the software is built and +installed into your system along with detecting the available libraries +that have been installed. To use the default configuration just run: + + ./configure + +For more help on how to customize the build configuration, run: + + ./configure --help + +Once the configure script has run successfully, you are ready to build. +Run: + + make + +This will build all of the core ActiveMQ CPP source code. To build and +install the code into the system directories, run: + + make install + +You will have to become the superuser in order to be able to install the +JNI libraries. + + +### OS X Lion requirements + +Install brew. It will depends on XCode being installed along with +the command line tools. Then use brew to install autoconf, automake, +and libtool. + + brew install autoconf automake libtool + +Building on Windows +------------------- + +Download and install the free [Microsoft Windows SDK][1]. The SDK includes +all the headers, libraries, and build tools needed to compile the JNI library. + +Set the `JAVA_HOME` environment variable to the location where your JDK is +installed. + +Use the installed command window and change to the directory that this file is located in and then run: + +For recent SDK Versions: + + msbuild vs2010.vcxproj (or ) + +For legacy SDK Versions: + + vcbuild vs2008.vcproj + +The dll files will be located under the target directory. + +[1]: https://developer.microsoft.com/en-us/windows/downloads \ No newline at end of file diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/vs2008.vcproj jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/vs2008.vcproj --- jtreg7-7.3.1+1/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/vs2008.vcproj 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/vs2008.vcproj 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,167 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@PROJECT_XML_SOURCES@ + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/vs2010.custom.props jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/vs2010.custom.props --- jtreg7-7.3.1+1/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/vs2010.custom.props 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/vs2010.custom.props 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/vs2010.vcxproj jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/vs2010.vcxproj --- jtreg7-7.3.1+1/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/vs2010.vcxproj 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-maven-plugin/src/main/resources/project-template/vs2010.vcxproj 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,188 @@ + + + + + + debug + Win32 + + + debug + x64 + + + release + Win32 + + + release + x64 + + + + @PROJECT_NAME@ + @PROJECT_NAME@ + @TARGET_PLATFORM_VERSION@ + + + + DynamicLibrary + Unicode + @PLATFORM_TOOLSET@ + + + DynamicLibrary + Unicode + @PLATFORM_TOOLSET@ + true + + + DynamicLibrary + @PLATFORM_TOOLSET@ + Unicode + + + DynamicLibrary + Unicode + @PLATFORM_TOOLSET@ + true + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(ProjectDir)/target/$(Platform)-$(Configuration)/lib\ + $(ProjectDir)/target/$(Platform)-$(Configuration)/obj\ + false + $(ProjectDir)/target/$(Platform)-$(Configuration)/lib\ + $(ProjectDir)/target/$(Platform)-$(Configuration)/obj\ + false + $(ProjectDir)/target/$(Platform)-$(Configuration)/lib\ + $(ProjectDir)/target/$(Platform)-$(Configuration)/obj\ + true + $(ProjectDir)/target/$(Platform)-$(Configuration)/lib\ + $(ProjectDir)/target/$(Platform)-$(Configuration)/obj\ + true + + @CUSTOM_PROPS@ + + + $(JAVA_HOME)\include;$(JAVA_HOME)\include\win32;$(ProjectDir)\src\windows;%(AdditionalIncludeDirectories) + MaxSpeed + true + Speed + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + + + MultiThreadedDLL + true + false + + + Level3 + ProgramDatabase + StdCall + + + true + Windows + true + true + MachineX86 + + + + + $(JAVA_HOME)\include;$(JAVA_HOME)\include\win32;$(ProjectDir)\src\windows;%(AdditionalIncludeDirectories) + MaxSpeed + true + Speed + WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + + + MultiThreadedDLL + true + false + + + Level3 + ProgramDatabase + StdCall + + + true + Windows + true + true + MachineX64 + + + + + $(JAVA_HOME)\include;$(JAVA_HOME)\include\win32;$(ProjectDir)\src\windows;%(AdditionalIncludeDirectories) + Disabled + Speed + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + + + EnableFastChecks + MultiThreadedDebugDLL + false + + + Level3 + EditAndContinue + StdCall + + + true + Windows + MachineX86 + + + + + $(JAVA_HOME)\include;$(JAVA_HOME)\include\win32;$(ProjectDir)\src\windows;%(AdditionalIncludeDirectories) + Disabled + Speed + WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + + + EnableFastChecks + MultiThreadedDebugDLL + false + + + Level3 + EditAndContinue + StdCall + + + true + Windows + MachineX64 + + + +@PROJECT_VS10_SOURCES@ + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-runtime/pom.xml jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-runtime/pom.xml --- jtreg7-7.3.1+1/hawt-jni/hawtjni-runtime/pom.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-runtime/pom.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,59 @@ + + + + 4.0.0 + + + org.fusesource.hawtjni + hawtjni-project + 1.18 + + + hawtjni-runtime + HawtJNI Runtime + The API that projects using HawtJNI should build against. + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + org.fusesource.hawtjni.runtime + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + attach-javadocs + + jar + + + + + + + + diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/ArgFlag.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/ArgFlag.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/ArgFlag.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/ArgFlag.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,81 @@ +/******************************************************************************* + * Copyright (C) 2009-2011 FuseSource Corp. + * Copyright (c) 2004, 2008 IBM Corporation and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + *******************************************************************************/ +package org.fusesource.hawtjni.runtime; + +/** + * + * @author Hiram Chirino + */ +public enum ArgFlag { + + /** + * Indicate that a native method parameter is an out only variable. + * This only makes sense if the parameter is a structure or an array + * of primitives. It is an optimization to avoid copying the java + * memory to C memory on the way in. + */ + NO_IN, + + /** + * Indicate that a native method parameter is an in only variable. + * This only makes sense if the parameter is a structure or an array + * of primitives. It is an optimization to avoid copying the C memory + * from java memory on the way out. + */ + NO_OUT, + + /** + * Indicate that GetPrimitiveArrayCritical() should be used instead + * of Get<PrimitiveType>ArrayElements() when transferring array of + * primitives from/to C. This is an optimization to avoid copying + * memory and must be used carefully. It is ok to be used in + * MoveMemory() and memmove() natives. + */ + CRITICAL, + + /** + * Indicate that the associated C local variable for a native method + * parameter should be initialized with zeros. + */ + INIT, + + /** + * Indicate that the parameter is a pointer. + */ + POINTER_ARG, + + /** + * Indicate that a structure parameter should be passed by value + * instead of by reference. This dereferences the parameter by + * prepending *. The parameter must not be NULL. + */ + BY_VALUE, + + /** + * Indicate that GetStringChars()should be used instead of + * GetStringUTFChars() to get the characters of a java.lang.String + * passed as a parameter to native methods. + */ + UNICODE, + + /** + * Indicate that the parameter of a native method is the sentinel + * (last parameter of a variable argument C function). The generated + * code is always the literal NULL. Some compilers expect the sentinel + * to be the literal NULL and output a warning if otherwise. + */ + SENTINEL, + + /** + * Indicate that the native parameter is a C# managed object. + */ + CS_OBJECT, + +} \ No newline at end of file diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/Callback.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/Callback.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/Callback.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/Callback.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,263 @@ +/******************************************************************************* + * Copyright (c) 2000, 2007 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.fusesource.hawtjni.runtime; + +/** + * Instances of this class represent entry points into Java which can be invoked + * from operating system level callback routines. + *

+ * IMPORTANT: A callback is only valid when invoked on the thread which created + * it. The results are undefined (and typically bad) when a callback is passed + * out to the operating system (or other code) in such a way that the callback + * is called from a different thread. + */ + +public class Callback { + + Object object; + + String method, signature; + + int argCount; + + long /* int */ address, errorResult; + + boolean isStatic, isArrayBased; + + static final String PTR_SIGNATURE = "J"; /* C.PTR_SIZEOF == 4 ? "I" : "J"; */ + + static final String SIGNATURE_0 = getSignature(0); + static final String SIGNATURE_1 = getSignature(1); + static final String SIGNATURE_2 = getSignature(2); + static final String SIGNATURE_3 = getSignature(3); + static final String SIGNATURE_4 = getSignature(4); + + static final String SIGNATURE_N = "([" + PTR_SIGNATURE + ")" + PTR_SIGNATURE; + + /** + * Constructs a new instance of this class given an object to send the + * message to, a string naming the method to invoke and an argument count. + * Note that, if the object is an instance of Class it is + * assumed that the method is a static method on that class. + * + * @param object + * the object to send the message to + * @param method + * the name of the method to invoke + * @param argCount + * the number of arguments that the method takes + */ + public Callback(Object object, String method, int argCount) { + this(object, method, argCount, false); + } + + /** + * Constructs a new instance of this class given an object to send the + * message to, a string naming the method to invoke, an argument count and a + * flag indicating whether or not the arguments will be passed in an array. + * Note that, if the object is an instance of Class it is + * assumed that the method is a static method on that class. + * + * @param object + * the object to send the message to + * @param method + * the name of the method to invoke + * @param argCount + * the number of arguments that the method takes + * @param isArrayBased + * true if the arguments should be passed in an + * array and false otherwise + */ + public Callback(Object object, String method, int argCount, boolean isArrayBased) { + this(object, method, argCount, isArrayBased, 0); + } + + /** + * Constructs a new instance of this class given an object to send the + * message to, a string naming the method to invoke, an argument count, a + * flag indicating whether or not the arguments will be passed in an array + * and a value to return when an exception happens. Note that, if the object + * is an instance of Class it is assumed that the method is a + * static method on that class. + * + * @param object + * the object to send the message to + * @param method + * the name of the method to invoke + * @param argCount + * the number of arguments that the method takes + * @param isArrayBased + * true if the arguments should be passed in an + * array and false otherwise + * @param errorResult + * the return value if the java code throws an exception + */ + public Callback(Object object, String method, int argCount, boolean isArrayBased, long /* int */errorResult) { + + /* Set the callback fields */ + this.object = object; + this.method = method; + this.argCount = argCount; + this.isStatic = object instanceof Class; + this.isArrayBased = isArrayBased; + this.errorResult = errorResult; + + /* Inline the common cases */ + if (isArrayBased) { + signature = SIGNATURE_N; + } else { + switch (argCount) { + case 0: + signature = SIGNATURE_0; + break; //$NON-NLS-1$ + case 1: + signature = SIGNATURE_1; + break; //$NON-NLS-1$ + case 2: + signature = SIGNATURE_2; + break; //$NON-NLS-1$ + case 3: + signature = SIGNATURE_3; + break; //$NON-NLS-1$ + case 4: + signature = SIGNATURE_4; + break; //$NON-NLS-1$ + default: + signature = getSignature(argCount); + } + } + + /* Bind the address */ + address = bind(this, object, method, signature, argCount, isStatic, isArrayBased, errorResult); + } + + /** + * Allocates the native level resources associated with the callback. This + * method is only invoked from within the constructor for the argument. + * + * @param callback + * the callback to bind + * @param object + * the callback's object + * @param method + * the callback's method + * @param signature + * the callback's method signature + * @param argCount + * the callback's method argument count + * @param isStatic + * whether the callback's method is static + * @param isArrayBased + * whether the callback's method is array based + * @param errorResult + * the callback's error result + */ + static native synchronized long /* int */ bind(Callback callback, Object object, String method, String signature, int argCount, boolean isStatic, boolean isArrayBased, + long /* int */errorResult); + + /** + * Releases the native level resources associated with the callback, and + * removes all references between the callback and other objects. This helps + * to prevent (bad) application code from accidentally holding onto + * extraneous garbage. + */ + public void dispose() { + if (object == null) + return; + unbind(this); + object = method = signature = null; + address = 0; + } + + /** + * Returns the address of a block of machine code which will invoke the + * callback represented by the receiver. + * + * @return the callback address + */ + public long /* int */getAddress() { + return address; + } + + /** + * Returns the SWT platform name. + * + * @return the platform name of the currently running SWT + */ + public static native String getPlatform(); + + /** + * Returns the number of times the system has been recursively entered + * through a callback. + *

+ * Note: This should not be called by application code. + *

+ * + * @return the entry count + * + * @since 2.1 + */ + public static native int getEntryCount(); + + static String getSignature(int argCount) { + String signature = "("; //$NON-NLS-1$ + for (int i = 0; i < argCount; i++) + signature += PTR_SIGNATURE; + signature += ")" + PTR_SIGNATURE; //$NON-NLS-1$ + return signature; + } + + /** + * Indicates whether or not callbacks which are triggered at the native + * level should cause the messages described by the matching + * Callback objects to be invoked. This method is used to + * safely shut down SWT when it is run within environments which can + * generate spurious events. + *

+ * Note: This should not be called by application code. + *

+ * + * @param enable + * true if callbacks should be invoked + */ + public static final native synchronized void setEnabled(boolean enable); + + /** + * Returns whether or not callbacks which are triggered at the native level + * should cause the messages described by the matching Callback + * objects to be invoked. This method is used to safely shut down SWT when + * it is run within environments which can generate spurious events. + *

+ * Note: This should not be called by application code. + *

+ * + * @return true if callbacks should not be invoked + */ + public static final native synchronized boolean getEnabled(); + + /** + * Immediately wipes out all native level state associated with all + * callbacks. + *

+ * WARNING: This operation is extremely dangerous, and + * should never be performed by application code. + *

+ */ + public static final native synchronized void reset(); + + /** + * Releases the native level resources associated with the callback. + * + * @see #dispose + */ + static final native synchronized void unbind(Callback callback); + +} diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/ClassFlag.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/ClassFlag.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/ClassFlag.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/ClassFlag.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,46 @@ +/******************************************************************************* + * Copyright (C) 2009-2011 FuseSource Corp. + * Copyright (c) 2004, 2008 IBM Corporation and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + *******************************************************************************/ +package org.fusesource.hawtjni.runtime; + +/** + * + * @author Hiram Chirino + */ +public enum ClassFlag { + /** + * Indicate that the item should not be generated. For example, + * custom natives are coded by hand. + */ + CLASS_SKIP, + + /** + * Indicate that the platform source is in C++ + */ + CPP, + + /** + * Indicate that this class will define a structure + */ + STRUCT, + + /** + * Indicate that structure name is a typedef (It should + * not be prefixed with 'struct' to reference it.) + */ + TYPEDEF, + + /** + * Indicate that the struct should get zeroed out before + * setting any of it's fields. Comes in handy when + * you don't map all the struct fields to java fields but + * still want the fields that are not mapped initialized. + */ + ZERO_OUT, +} \ No newline at end of file diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/FieldFlag.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/FieldFlag.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/FieldFlag.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/FieldFlag.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,58 @@ +/******************************************************************************* + * Copyright (C) 2009-2011 FuseSource Corp. + * Copyright (c) 2004, 2008 IBM Corporation and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + *******************************************************************************/ +package org.fusesource.hawtjni.runtime; + +/** + * + * @author Hiram Chirino + */ +public enum FieldFlag { + /** + * Indicate that the item should not be generated. For example, + * custom natives are coded by hand. + */ + FIELD_SKIP, + + /** + * Indicate that the field represents a constant or global + * variable. It is expected that the java field will be declared + * static. + */ + CONSTANT, + + /** + * Indicate that the field is a pointer. + */ + POINTER_FIELD, + + /** + * Indicate that the field is a shared pointer. + */ + + SHARED_PTR, + + /** + * Indicate that the getter method used is not part of + * the structure. Useful for using wrappers to access + * certain structure fields. + * + * Only useful when the getter is declared explicitly. + */ + GETTER_NONMEMBER, + + /** + * Indicate that the setter method used is not part of + * the structure. Useful for using wrappers to access + * certain structure fields. + * + * Only useful when the setter is declared explicitly. + */ + SETTER_NONMEMBER, +} diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/JNIEnv.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/JNIEnv.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/JNIEnv.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/JNIEnv.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ +/** + * Copyright (C) 2010, FuseSource Corp. All rights reserved. + */ +package org.fusesource.hawtjni.runtime; + +/** + *

+ * This is a marker class. Methods that take this as an argument + * will receive that actual native 'JNIEnv *' value. Since this + * class cannot be instantiated, Java callers must pass null + * for the value. + *

+ * + * @author Hiram Chirino + */ +public class JNIEnv { + private JNIEnv() {} +} diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/JniArg.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/JniArg.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/JniArg.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/JniArg.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,30 @@ +/******************************************************************************* + * Copyright (C) 2009-2011 FuseSource Corp. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + *******************************************************************************/ +package org.fusesource.hawtjni.runtime; + +/** + * + */ +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import static java.lang.annotation.ElementType.*; + +import java.lang.annotation.Documented; + +@Documented +@Target({PARAMETER}) +@Retention(RetentionPolicy.RUNTIME) +public @interface JniArg { + + ArgFlag[] flags() default {}; + String cast() default ""; + +} diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/JniClass.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/JniClass.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/JniClass.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/JniClass.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,32 @@ +/******************************************************************************* + * Copyright (C) 2009-2011 FuseSource Corp. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + *******************************************************************************/ +package org.fusesource.hawtjni.runtime; + +/** + * + */ +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import static java.lang.annotation.ElementType.*; + +import java.lang.annotation.Documented; + +@Documented +@Target({TYPE}) +@Retention(RetentionPolicy.RUNTIME) +public @interface JniClass { + + ClassFlag[] flags() default {}; + + String conditional() default ""; + + String name() default ""; +} diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/JniField.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/JniField.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/JniField.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/JniField.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,35 @@ +/******************************************************************************* + * Copyright (C) 2009-2011 FuseSource Corp. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + *******************************************************************************/ +package org.fusesource.hawtjni.runtime; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import static java.lang.annotation.ElementType.*; + +import java.lang.annotation.Documented; + +/** + * + * @author Hiram Chirino + */ +@Documented +@Target({FIELD}) +@Retention(RetentionPolicy.RUNTIME) +public @interface JniField { + + String cast() default ""; + String accessor() default ""; + String getter() default ""; + String setter() default ""; + String conditional() default ""; + FieldFlag[] flags() default {}; + +} diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/JniMethod.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/JniMethod.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/JniMethod.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/JniMethod.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,36 @@ +/******************************************************************************* + * Copyright (C) 2009-2011 FuseSource Corp. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + *******************************************************************************/ +package org.fusesource.hawtjni.runtime; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import static java.lang.annotation.ElementType.*; + +import java.lang.annotation.Documented; + +/** + * + * @author Hiram Chirino + */ +@Documented +@Target({METHOD}) +@Retention(RetentionPolicy.RUNTIME) +public @interface JniMethod { + + String cast() default ""; +// Pointer pointer() default Pointer.DETERMINE_FROM_CAST; + String accessor() default ""; + MethodFlag[] flags() default {}; + String copy() default ""; + String conditional() default ""; + + JniArg[] callbackArgs() default {}; +} diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/Library.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/Library.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/Library.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/Library.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,550 @@ +/******************************************************************************* + * Copyright (C) 2009-2011 FuseSource Corp. + * Copyright (c) 2000, 2009 IBM Corporation and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + *******************************************************************************/ +package org.fusesource.hawtjni.runtime; + +import java.io.*; +import java.lang.reflect.Method; +import java.net.URL; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Set; + +/** + * Used to find and load a JNI library, eventually after having extracted it. + * + * It will search for the library in order at the following locations: + *
    + *
  1. in the custom library path: If the "library.${name}.path" System property is set to a directory, + * subdirectories are searched: + *
      + *
    1. "${platform}/${arch}" + *
    2. "${platform}" + *
    3. "${os}" + *
    + * for 2 namings of the library: + *
      + *
    1. as "${name}-${version}" library name if the version can be determined. + *
    2. as "${name}" library name + *
    + *
  2. system library path: This is where the JVM looks for JNI libraries by default. + *
      + *
    1. as "${name}${bit-model}-${version}" library name if the version can be determined. + *
    2. as "${name}-${version}" library name if the version can be determined. + *
    3. as "${name}" library name + *
    + *
  3. classpath path: If the JNI library can be found on the classpath, it will get extracted + * and then loaded. This way you can embed your JNI libraries into your packaged JAR files. + * They are looked up as resources in this order: + *
      + *
    1. "META-INF/native/${platform}/${arch}/${library[-version]}": Store your library here if you want to embed + * more than one platform JNI library on different processor archs in the jar. + *
    2. "META-INF/native/${platform}/${library[-version]}": Store your library here if you want to embed more + * than one platform JNI library in the jar. + *
    3. "META-INF/native/${os}/${library[-version]}": Store your library here if you want to embed more + * than one platform JNI library in the jar but don't want to take bit model into account. + *
    4. "META-INF/native/${library[-version]}": Store your library here if your JAR is only going to embedding one + * platform library. + *
    + * The file extraction is attempted until it succeeds in the following directories. + *
      + *
    1. The directory pointed to by the "library.${name}.path" System property (if set) + *
    2. a temporary directory (uses the "java.io.tmpdir" System property) + *
    + *
+ * + * where: + *
    + *
  • "${name}" is the name of library + *
  • "${version}" is the value of "library.${name}.version" System property if set. + * Otherwise it is set to the ImplementationVersion property of the JAR's Manifest
  • + *
  • "${os}" is your operating system, for example "osx", "linux", or "windows"
  • + *
  • "${bit-model}" is "64" if the JVM process is a 64 bit process, otherwise it's "32" if the + * JVM is a 32 bit process
  • + *
  • "${arch}" is the architecture for the processor, for example "amd64" or "sparcv9"
  • + *
  • "${platform}" is "${os}${bit-model}", for example "linux32" or "osx64"
  • + *
  • "${library[-version]}": is the normal jni library name for the platform (eventually with -${version}) suffix. + * For example "${name}.dll" on + * windows, "lib${name}.jnilib" on OS X, and "lib${name}.so" on linux
  • + *
+ * + * @author Hiram Chirino + * @see System#mapLibraryName(String) + */ +public class Library { + + public static final String STRATEGY_PROPERTY = "hawtjni.strategy"; + public static final String STRATEGY_SHA1 = "sha1"; + public static final String STRATEGY_TEMP = "temp"; + + static final String SLASH = System.getProperty("file.separator"); + + static final String STRATEGY = System.getProperty(STRATEGY_PROPERTY, + "windows".equals(getOperatingSystem()) ? STRATEGY_SHA1 : STRATEGY_TEMP); + + final private String name; + final private String version; + final private ClassLoader classLoader; + private boolean loaded; + private String nativeLibraryPath; + private URL nativeLibrarySourceUrl; + + public Library(String name) { + this(name, null, null); + } + + public Library(String name, Class clazz) { + this(name, version(clazz), clazz.getClassLoader()); + } + + public Library(String name, String version) { + this(name, version, null); + } + + public Library(String name, String version, ClassLoader classLoader) { + if( name == null ) { + throw new IllegalArgumentException("name cannot be null"); + } + this.name = name; + this.version = version; + this.classLoader= classLoader; + } + + private static String version(Class clazz) { + try { + return clazz.getPackage().getImplementationVersion(); + } catch (Throwable e) { + } + return null; + } + + /** + * Get the path to the native library loaded. + * @return the path (should not be null once the library is loaded) + * @since 1.16 + */ + public String getNativeLibraryPath() { + return nativeLibraryPath; + } + + /** + * Get the URL to the native library source that has been extracted (if it was extracted). + * @return the url to the source (in classpath) + * @since 1.16 + */ + public URL getNativeLibrarySourceUrl() { + return nativeLibrarySourceUrl; + } + + public static String getOperatingSystem() { + String name = System.getProperty("os.name").toLowerCase().trim(); + if( name.startsWith("linux") ) { + return "linux"; + } + if( name.startsWith("mac os x") ) { + return "osx"; + } + if( name.startsWith("win") ) { + return "windows"; + } + return name.replaceAll("\\W+", "_"); + + } + + public static String getPlatform() { + return getOperatingSystem()+getBitModel(); + } + + public static int getBitModel() { + String prop = System.getProperty("sun.arch.data.model"); + if (prop == null) { + prop = System.getProperty("com.ibm.vm.bitmode"); + } + if( prop!=null ) { + return Integer.parseInt(prop); + } + // GraalVM support, see https://github.com/fusesource/jansi/issues/162 + String arch = System.getProperty("os.arch"); + if (arch.endsWith("64") && "Substrate VM".equals(System.getProperty("java.vm.name"))) { + return 64; + } + return -1; // we don't know.. + } + + /** + * Load the native library. + */ + synchronized public void load() { + if( loaded ) { + return; + } + doLoad(); + loaded = true; + } + + private void doLoad() { + /* Perhaps a custom version is specified */ + String version = System.getProperty("library."+name+".version"); + if (version == null) { + version = this.version; + } + ArrayList errors = new ArrayList(); + + String[] specificDirs = getSpecificSearchDirs(); + String libFilename = map(name); + String versionlibFilename = (version == null) ? null : map(name + "-" + version); + + /* Try loading library from a custom library path */ + String customPath = System.getProperty("library."+name+".path"); + if (customPath != null) { + for ( String dir: specificDirs ) { + if( version!=null && load(errors, file(customPath, dir, versionlibFilename)) ) + return; + if( load(errors, file(customPath, dir, libFilename)) ) + return; + } + } + + /* Try loading library from java library path */ + if( version!=null && loadLibrary(errors, name + getBitModel() + "-" + version) ) + return; + if( version!=null && loadLibrary(errors, name + "-" + version) ) + return; + if( loadLibrary(errors, name) ) + return; + + + /* Try extracting the library from the jar */ + if( classLoader!=null ) { + String targetLibName = version != null ? versionlibFilename : libFilename; + for ( String dir: specificDirs ) { + if( version!=null && extractAndLoad(errors, customPath, dir, versionlibFilename, targetLibName) ) + return; + if( extractAndLoad(errors, customPath, dir, libFilename, targetLibName) ) + return; + } + } + + /* Failed to find the library */ + UnsatisfiedLinkError e = new UnsatisfiedLinkError("Could not load library. Reasons: " + errors.toString()); + try { + Method method = Throwable.class.getMethod("addSuppressed", Throwable.class); + for (Throwable t : errors) { + method.invoke(e, t); + } + } catch (Throwable ignore) { + } + throw e; + } + + @Deprecated + final public String getArchSpecifcResourcePath() { + return getArchSpecificResourcePath(); + } + final public String getArchSpecificResourcePath() { + return "META-INF/native/"+ getPlatform() + "/" + System.getProperty("os.arch") + "/" +map(name); + } + + @Deprecated + final public String getOperatingSystemSpecifcResourcePath() { + return getOperatingSystemSpecificResourcePath(); + } + final public String getOperatingSystemSpecificResourcePath() { + return getPlatformSpecificResourcePath(getOperatingSystem()); + } + @Deprecated + final public String getPlatformSpecifcResourcePath() { + return getPlatformSpecificResourcePath(); + } + final public String getPlatformSpecificResourcePath() { + return getPlatformSpecificResourcePath(getPlatform()); + } + @Deprecated + final public String getPlatformSpecifcResourcePath(String platform) { + return getPlatformSpecificResourcePath(platform); + } + final public String getPlatformSpecificResourcePath(String platform) { + return "META-INF/native/"+platform+"/"+map(name); + } + + @Deprecated + final public String getResorucePath() { + return getResourcePath(); + } + final public String getResourcePath() { + return "META-INF/native/"+map(name); + } + + final public String getLibraryFileName() { + return map(name); + } + + /** + * Search directories for library:
    + *
  • ${platform}/${arch} to enable platform JNI library for different processor archs
  • + *
  • ${platform} to enable platform JNI library
  • + *
  • ${os} to enable OS JNI library
  • + *
  • no directory
  • + *
+ * @return the list + * @since 1.15 + */ + final public String[] getSpecificSearchDirs() { + return new String[] { + getPlatform() + "/" + System.getProperty("os.arch"), + getPlatform(), + getOperatingSystem(), + "." + }; + } + + private boolean extractAndLoad(ArrayList errors, String customPath, String dir, String libName, String targetLibName) { + String resourcePath = "META-INF/native/" + ( dir == null ? "" : (dir + '/')) + libName; + URL resource = classLoader.getResource(resourcePath); + if( resource !=null ) { + + int idx = targetLibName.lastIndexOf('.'); + String prefix = targetLibName.substring(0, idx)+"-"; + String suffix = targetLibName.substring(idx); + + // Use the user provided path, + // then fallback to the java temp directory, + // and last, use the user home folder + for (File path : Arrays.asList( + customPath != null ? file(customPath) : null, + file(System.getProperty("java.io.tmpdir")), + file(System.getProperty("user.home"), ".hawtjni", name))) { + if( path!=null ) { + // Try to extract it to the custom path... + File target; + if (STRATEGY_SHA1.equals(STRATEGY)) { + target = extractSha1(errors, resource, prefix, suffix, path); + } else { + target = extractTemp(errors, resource, prefix, suffix, path); + } + if( target!=null ) { + if( load(errors, target) ) { + nativeLibrarySourceUrl = resource; + return true; + } + } + } + } + } + return false; + } + + private File file(String ...paths) { + File rc = null ; + for (String path : paths) { + if( rc == null ) { + rc = new File(path); + } else if( path != null ) { + rc = new File(rc, path); + } + } + return rc; + } + + private String map(String libName) { + /* + * libraries in the Macintosh use the extension .jnilib but the some + * VMs map to .dylib. + */ + libName = System.mapLibraryName(libName); + String ext = ".dylib"; + if (libName.endsWith(ext)) { + libName = libName.substring(0, libName.length() - ext.length()) + ".jnilib"; + } + return libName; + } + + private File extractSha1(ArrayList errors, URL source, String prefix, String suffix, File directory) { + File target = null; + directory = directory.getAbsoluteFile(); + if (!directory.exists()) { + if (!directory.mkdirs()) { + errors.add(new IOException("Unable to create directory: " + directory)); + return null; + } + } + try { + String sha1 = computeSha1(source.openStream()); + String sha1f = ""; + target = new File(directory, prefix + sha1 + suffix); + + if (target.isFile() && target.canRead()) { + sha1f = computeSha1(new FileInputStream(target)); + } + if (sha1f.equals(sha1)) { + return target; + } + + FileOutputStream os = null; + InputStream is = null; + try { + is = source.openStream(); + if (is != null) { + byte[] buffer = new byte[4096]; + os = new FileOutputStream(target); + int read; + while ((read = is.read(buffer)) != -1) { + os.write(buffer, 0, read); + } + chmod755(target); + } + return target; + } finally { + close(os); + close(is); + } + } catch (Throwable e) { + IOException io; + if (target != null) { + target.delete(); + io = new IOException("Unable to extract library from " + source + " to " + target); + } else { + io = new IOException("Unable to create temporary file in " + directory); + } + io.initCause(e); + errors.add(io); + } + return null; + } + + private String computeSha1(InputStream is) throws NoSuchAlgorithmException, IOException { + String sha1; + try { + MessageDigest mDigest = MessageDigest.getInstance("SHA1"); + int read; + byte[] buffer = new byte[4096]; + while ((read = is.read(buffer)) != -1) { + mDigest.update(buffer, 0, read); + } + byte[] result = mDigest.digest(); + StringBuilder sb = new StringBuilder(); + for (byte b : result) { + sb.append(Integer.toString((b & 0xff) + 0x100, 16).substring(1)); + } + sha1 = sb.toString(); + } finally { + close(is); + } + return sha1; + } + + private File extractTemp(ArrayList errors, URL source, String prefix, String suffix, File directory) { + File target = null; + directory = directory.getAbsoluteFile(); + if (!directory.exists()) { + if (!directory.mkdirs()) { + errors.add(new IOException("Unable to create directory: " + directory)); + return null; + } + } + try { + FileOutputStream os = null; + InputStream is = null; + try { + target = File.createTempFile(prefix, suffix, directory); + is = source.openStream(); + if (is != null) { + byte[] buffer = new byte[4096]; + os = new FileOutputStream(target); + int read; + while ((read = is.read(buffer)) != -1) { + os.write(buffer, 0, read); + } + chmod755(target); + } + target.deleteOnExit(); + return target; + } finally { + close(os); + close(is); + } + } catch (Throwable e) { + IOException io; + if (target != null) { + target.delete(); + io = new IOException("Unable to extract library from " + source + " to " + target); + } else { + io = new IOException("Unable to create temporary file in " + directory); + } + io.initCause(e); + errors.add(io); + } + return null; + } + + static private void close(Closeable file) { + if (file != null) { + try { + file.close(); + } catch (Exception ignore) { + } + } + } + + private void chmod755(File file) { + if (getPlatform().startsWith("windows")) + return; + // Use Files.setPosixFilePermissions if we are running Java 7+ to avoid forking the JVM for executing chmod + try { + ClassLoader classLoader = getClass().getClassLoader(); + // Check if the PosixFilePermissions exists in the JVM, if not this will throw a ClassNotFoundException + Class posixFilePermissionsClass = classLoader.loadClass("java.nio.file.attribute.PosixFilePermissions"); + // Set permissionSet = PosixFilePermissions.fromString("rwxr-xr-x") + Method fromStringMethod = posixFilePermissionsClass.getMethod("fromString", String.class); + Object permissionSet = fromStringMethod.invoke(null, "rwxr-xr-x"); + // Path path = file.toPath() + Object path = file.getClass().getMethod("toPath").invoke(file); + // Files.setPosixFilePermissions(path, permissionSet) + Class pathClass = classLoader.loadClass("java.nio.file.Path"); + Class filesClass = classLoader.loadClass("java.nio.file.Files"); + Method setPosixFilePermissionsMethod = filesClass.getMethod("setPosixFilePermissions", pathClass, Set.class); + setPosixFilePermissionsMethod.invoke(null, path, permissionSet); + } catch (Throwable ignored) { + // Fallback to starting a new process + try { + Runtime.getRuntime().exec(new String[]{"chmod", "755", file.getCanonicalPath()}).waitFor(); + } catch (Throwable e) { + } + } + } + + private boolean load(ArrayList errors, File lib) { + try { + System.load(lib.getPath()); + nativeLibraryPath = lib.getPath(); + return true; + } catch (UnsatisfiedLinkError e) { + LinkageError le = new LinkageError("Unable to load library from " + lib); + le.initCause(e); + errors.add(le); + } + return false; + } + + private boolean loadLibrary(ArrayList errors, String lib) { + try { + System.loadLibrary(lib); + nativeLibraryPath = "java.library.path,sun.boot.library.pathlib:" + lib; + return true; + } catch (UnsatisfiedLinkError e) { + LinkageError le = new LinkageError("Unable to load library " + lib); + le.initCause(e); + errors.add(le); + } + return false; + } + +} diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/MethodFlag.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/MethodFlag.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/MethodFlag.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/MethodFlag.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,116 @@ +/******************************************************************************* + * Copyright (C) 2009-2011 FuseSource Corp. + * Copyright (c) 2000, 2008 IBM Corporation and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + *******************************************************************************/ +package org.fusesource.hawtjni.runtime; + +/** + * + * @author Hiram Chirino + */ +public enum MethodFlag { + /** + * Indicate that the item should not be generated. For example, + * custom natives are coded by hand. + */ + METHOD_SKIP, + + /** + * Indicate that a native method should be looked up dynamically. It + * is useful when having a dependence on a given library is not + * desirable. The library name is specified in the *_custom.h file. + */ + DYNAMIC, + + /** + * Indicate that the native method represents a constant or global + * variable instead of a function. This omits () from the generated + * code. + */ + CONSTANT_GETTER, + + /** + * Indicate that the C function should be casted to a prototype + * generated from the parameters of the native method. Useful for + * variable argument C functions. + */ + CAST, + + /** + * Indicate that the native is part of the Java Native Interface. For + * example: NewGlobalRef(). + */ + JNI, + + /** + * Indicate that the native method represents a structure global + * variable and the address of it should be returned to Java. This is + * done by prepending &. + */ + ADDRESS, + + /** + * Indicate that the native method is calling a C++ object's method. + */ + CPP_METHOD, + + /** + * Indicate that the native method is a C++ constructor that allocates + * an object on the heap. + */ + CPP_NEW, + + /** + * Indicate that the native method is a C++ destructor that + * deallocates an object from the heap. + */ + CPP_DELETE, + + /** + * Indicate that the native method is a C# constructor that allocates + * an object on the managed (i.e. garbage collected) heap. + */ + CS_NEW, + + /** + * Indicate that the native method's return value is a + * C# managed object. + */ + CS_OBJECT, + + /** + * Indicate that the native method represents a setter for a field in + * an object or structure + */ + SETTER, + + /** + * Indicate that the native method represents a getter for a field in + * an object or structure. + */ + GETTER, + + /** + * Indicate that the native method takes 2 arguments, a collection and + * an item, and the += operator is used to add the item to the + * collection. + */ + ADDER, + + /** + * Indicate that the return value is a pointer. + */ + POINTER_RETURN, + + /** + * Indicate that this method will be the constant initializer for + * the class. When called, it will set all the static constant fields + * to the values defined in your platform. + */ + CONSTANT_INITIALIZER, +} \ No newline at end of file diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/NativeStats.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/NativeStats.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/NativeStats.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/NativeStats.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,220 @@ +/******************************************************************************* + * Copyright (C) 2009-2011 FuseSource Corp. + * Copyright (c) 2004, 2006 IBM Corporation and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + *******************************************************************************/ +package org.fusesource.hawtjni.runtime; + +import java.io.PrintStream; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map.Entry; + +/** + * Instructions on how to use the NativeStats tool with a standalone SWT + * example: + *
    + *
  1. Compile the native libraries defining the NATIVE_STATS flag.
  2. + *
  3. Add the following code around the sections of + * interest to dump the native calls done in that section. + *
    + *      StatsInterface si = MyFooStatsInterface.INSTANCE;
    + *      NativeStats stats = new NativeStats(si); 
    + *      ... // your code
    + *      stats.diff().dump(System.out);
    + *      
    + *
  4. + *
  5. Or add the following code at a given point to dump a snapshot of + * the native calls done until that point. + *
    + *      stats.snapshot().dump(System.out);
    + *      
    + *
  6. + *
+ * + * @author Hiram Chirino + */ +public class NativeStats { + + public interface StatsInterface { + String getNativeClass(); + int functionCount(); + String functionName(int ordinal); + int functionCounter(int ordinal); + } + + public static class NativeFunction implements Comparable { + private final int ordinal; + private final String name; + private int counter; + + public NativeFunction(int ordinal, String name, int callCount) { + this.ordinal = ordinal; + this.name = name; + this.counter = callCount; + } + void subtract(NativeFunction func) { + this.counter -= func.counter; + } + + public int getCounter() { + return counter; + } + public void setCounter(int counter) { + this.counter = counter; + } + + public String getName() { + return name; + } + + public int getOrdinal() { + return ordinal; + } + + public int compareTo(NativeFunction func) { + return func.counter - counter; + } + + public void reset() { + counter=0; + } + + public NativeFunction copy() { + return new NativeFunction(ordinal, name, counter); + } + } + + private final HashMap> snapshot; + + public NativeStats(StatsInterface... classes) { + this(Arrays.asList(classes)); + } + + public NativeStats(Collection classes) { + this(snapshot(classes)); + } + + private NativeStats(HashMap> snapshot) { + this.snapshot = snapshot; + } + + public void reset() { + for (ArrayList functions : snapshot.values()) { + for (NativeFunction function : functions) { + function.reset(); + } + } + } + + public void update() { + for (Entry> entry : snapshot.entrySet()) { + StatsInterface si = entry.getKey(); + for (NativeFunction function : entry.getValue()) { + function.setCounter( si.functionCounter(function.getOrdinal()) ); + } + } + } + + public NativeStats snapshot() { + NativeStats copy = copy(); + copy.update(); + return copy; + } + + public NativeStats copy() { + HashMap> rc = new HashMap>(snapshot.size()*2); + for (Entry> entry : snapshot.entrySet()) { + ArrayList list = new ArrayList(entry.getValue().size()); + for (NativeFunction function : entry.getValue()) { + list.add(function.copy()); + } + rc.put(entry.getKey(), list); + } + return new NativeStats(rc); + } + + public NativeStats diff() { + HashMap> rc = new HashMap>(snapshot.size()*2); + for (Entry> entry : snapshot.entrySet()) { + StatsInterface si = entry.getKey(); + ArrayList list = new ArrayList(entry.getValue().size()); + for (NativeFunction original : entry.getValue()) { + NativeFunction copy = original.copy(); + copy.setCounter( si.functionCounter(copy.getOrdinal()) ); + copy.subtract(original); + list.add(copy); + } + rc.put(si, list); + } + return new NativeStats(rc); + } + + /** + * Dumps the stats to the print stream in a JSON format. + * @param ps Print stream. + */ + public void dump(PrintStream ps) { + boolean firstSI=true; + for (Entry> entry : snapshot.entrySet()) { + StatsInterface si = entry.getKey(); + ArrayList funcs = entry.getValue(); + + int total = 0; + for (NativeFunction func : funcs) { + total += func.getCounter(); + } + + if( !firstSI ) { + ps.print(", "); + } + firstSI=false; + ps.print("["); + if( total>0 ) { + ps.println("{ "); + ps.println(" \"class\": \""+si.getNativeClass()+"\","); + ps.println(" \"total\": "+total+", "); + ps.print(" \"functions\": {"); + boolean firstFunc=true; + for (NativeFunction func : funcs) { + if (func.getCounter() > 0) { + if( !firstFunc ) { + ps.print(","); + } + firstFunc=false; + ps.println(); + ps.print(" \""+func.getName()+"\": "+func.getCounter()); + } + } + ps.println(); + ps.println(" }"); + ps.print("}"); + } + ps.print("]"); + } + } + + static private HashMap> snapshot(Collection classes) { + HashMap> rc = new HashMap>(); + for (StatsInterface sc : classes) { + int count = sc.functionCount(); + ArrayList functions = new ArrayList(count); + for (int i = 0; i < count; i++) { + String name = (String) sc.functionName(i); + functions.add(new NativeFunction(i, name, 0)); + } + Collections.sort(functions); + rc.put(sc, functions); + } + return rc; + } + + +} diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/PointerMath.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/PointerMath.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/PointerMath.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/PointerMath.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright (C) 2009-2011 FuseSource Corp. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + *******************************************************************************/ +package org.fusesource.hawtjni.runtime; + +/** + * + * @author Hiram Chirino + */ +public class PointerMath { + + private static final boolean bits32 = Library.getBitModel() == 32; + + final public static long add(long ptr, long n) { + if(bits32) { + return (int)(ptr + n); + } else { + return ptr + n; + } + } + +} diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/T32.java jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/T32.java --- jtreg7-7.3.1+1/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/T32.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/T32.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,22 @@ +/******************************************************************************* + * Copyright (C) 2009-2011 FuseSource Corp. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + *******************************************************************************/ +package org.fusesource.hawtjni.runtime; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import static java.lang.annotation.ElementType.*; + +import java.lang.annotation.Documented; + +@Documented +@Target({FIELD, METHOD, PARAMETER, LOCAL_VARIABLE}) +@Retention(RetentionPolicy.RUNTIME) +public @interface T32 { +} diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-website/ext/ScalatePackage.scala jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/ext/ScalatePackage.scala --- jtreg7-7.3.1+1/hawt-jni/hawtjni-website/ext/ScalatePackage.scala 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/ext/ScalatePackage.scala 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,30 @@ +/** + * Copyright (C) 2009-2011 the original author or authors. + * See the notice.md file distributed with this work for additional + * information regarding copyright ownership. + * + * 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 org.fusesource.scalate.support.TemplatePackage +import org.fusesource.scalate.{Binding, TemplateSource} + +/** + * Defines the template package of reusable imports, attributes and methods across templates + */ +class ScalatePackage extends TemplatePackage { + def header(source: TemplateSource, bindings: List[Binding]) = + """ + // common imports go here + import _root_.Website._; + """ +} diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-website/ext/Website.scala jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/ext/Website.scala --- jtreg7-7.3.1+1/hawt-jni/hawtjni-website/ext/Website.scala 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/ext/Website.scala 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,71 @@ +/** + * Copyright (C) 2009-2011 the original author or authors. + * See the notice.md file distributed with this work for additional + * information regarding copyright ownership. + * + * 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 org.fusesource.scalate.RenderContext + +package + +/** + *

+ *

+ * + * @author Hiram Chirino + */ +object Website { + + val project_name= "HawtJNI" + val project_slogan= "Making JNI easy and fast." + val project_id= "hawtjni" + val project_issue_url= "https://github.com/fusesource/hawtjni/issues" + val project_forums_url= "http://groups.google.com/group/hawtjni" + val project_wiki_url= "https://github.com/fusesource/hawtjni/wiki" + val project_logo= "/images/project-logo.png" + val project_version= "1.17" + val project_snapshot_version= "1.18-SNAPSHOT" + val project_versions = List( + project_version, + "1.16", + "1.15", + "1.14", + "1.13", + "1.12", + "1.11", + "1.10", + "1.9", + "1.8", + "1.7", + "1.6", + "1.5", + "1.4", + "1.3", + "1.2", + "1.1", + "1.0" + ) + + val project_keywords= "jni,java,jna,c,objective-c,c++,c#" + + // ------------------------------------------------------------------- + val github_page= "http://github.com/fusesource/hawtjni" + val git_user_url= "git://github.com/fusesource/hawtjni.git" + val git_commiter_url= "git@github.com:fusesources/hawtjni.git" + + val project_maven_groupId= "org.fusesource.hawtjni" + val project_maven_artifactId= "hawtjni-runtime" + + val website_base_url= "http://fusesource.github.io/hawtjni/" +} diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-website/ext/scalate/Boot.scala jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/ext/scalate/Boot.scala --- jtreg7-7.3.1+1/hawt-jni/hawtjni-website/ext/scalate/Boot.scala 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/ext/scalate/Boot.scala 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,66 @@ +/** + * Copyright (C) 2009-2011 the original author or authors. + * See the notice.md file distributed with this work for additional + * information regarding copyright ownership. + * + * 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 scalate + +import org.fusesource.scalate.util.Logging +import java.util.concurrent.atomic.AtomicBoolean +import _root_.Website._ +import org.fusesource.scalate._ +import org.fusesource.scalamd.{MacroDefinition, Markdown} +import java.util.regex.Matcher +import org.fusesource.scalate.wikitext.Pygmentize + +class Boot(engine: TemplateEngine) extends Logging { + + private var _initialised = new AtomicBoolean(false) + + def run: Unit = { + if (_initialised.compareAndSet(false, true)) { + + def filter(m:Matcher):String = { + val filter_name = m.group(1) + val body = m.group(2) + engine.filter(filter_name) match { + case Some(filter)=> + filter.filter(RenderContext(), body) + case None=> "

filter not found: %s

%s
".format(filter_name, body) + } + } + + def pygmentize(m:Matcher):String = Pygmentize.pygmentize(m.group(2), m.group(1)) + + // add some macros to markdown. + Markdown.macros :::= List( + MacroDefinition("""\{filter::(.*?)\}(.*?)\{filter\}""", "s", filter, true), + MacroDefinition("""\{pygmentize::(.*?)\}(.*?)\{pygmentize\}""", "s", pygmentize, true), + MacroDefinition("""\{pygmentize\_and\_compare::(.*?)\}(.*?)\{pygmentize\_and\_compare\}""", "s", pygmentize, true), + MacroDefinition("""\$\{project_version\}""", "", _ => project_version.toString, true), + MacroDefinition("""\$\{project_name\}""", "", _ => project_name.toString, true), + MacroDefinition("""\$\{project_id\}""", "", _ => project_id.toString, true), + MacroDefinition("""\$\{project_issue_url\}""", "", _ => project_issue_url.toString, true), + MacroDefinition("""\$\{website_base_url\}""", "", _ => website_base_url.toString, true) + ) + + for( ssp <- engine.filter("ssp"); md <- engine.filter("markdown") ) { + engine.pipelines += "ssp.md"-> List(ssp, md) + engine.pipelines += "ssp.markdown"-> List(ssp, md) + } + info("Bootstrapped website gen for: %s".format(project_name)) + } + } +} \ No newline at end of file diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-website/pom.xml jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/pom.xml --- jtreg7-7.3.1+1/hawt-jni/hawtjni-website/pom.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/pom.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,259 @@ + + + + + 4.0.0 + + + org.fusesource.hawtjni + hawtjni-project + 1.17 + + + hawtjni-website + + ${project.artifactId} + The HawtJNI Website + pom + + + Tomcat60 + + + + + hawtjni-gh-pages + scm:git:https://github.com/fusesource/hawtjni.git + + + + + + + org.scala-lang + scala-library + ${scala-version} + + + org.scala-lang + scala-compiler + ${scala-version} + + + + org.fusesource.scalate + scalate-wikitext + ${scalate-version} + + + org.fusesource.scalate + scalate-page + ${scalate-version} + + + org.fusesource.scalamd + scalamd + ${scalamd-version} + + + org.slf4j + slf4j-log4j12 + ${slf4j-version} + + + + + org.fusesource.scalate + scalate-test + ${scalate-version} + test + + + + org.fusesource.hawtjni + hawtjni-runtime + ${project.version} + javadoc + test + + + + + + ext + + + + true + maven-source-plugin + + + attach-sources + + jar + + + + + + + org.scala-tools + maven-scala-plugin + ${scala-plugin-version} + + + + compile + + + + + + -Xmx1024m + + ${scala-version} + + + + + maven-surefire-plugin + + once + + false + false + + **/*Test.* + + + + + + org.fusesource.scalate + maven-scalate-plugin + ${scalate-version} + + + ${basedir}/src + + + + + sitegen + + sitegen + + package + + + + + + org.apache.maven.plugins + maven-scm-publish-plugin + 1.1 + + gh-pages + ${project.build.directory}/sitegen + + + + gh-pages + + publish-scm + + install + + + + + + org.mortbay.jetty + jetty-maven-plugin + ${jetty-plugin-version} + + ${basedir}/src + + + scalate.editor + ${env.SCALATE_EDITOR} + + + scalate.workdir + ${basedir}/target/_scalate + + + scalate.mode + development + + + 0 + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 2.2 + + + unpack + package + + unpack + + + + + org.fusesource.hawtjni + hawtjni-runtime + javadoc + ${basedir}/target/sitegen/documentation/api + + + + + + + + + + + + + org.fusesource.mvnplugins + maven-linkchecker-plugin + ${mvnplugins-version} + + + http://github.com/ + http://git.or.cz/ + http://localhost:8080/ + http://repo.fusesource.com/ + http://search.twitter.com/ + http://www.chengin.com/ + + + + + + + + + diff -Nru jtreg7-7.3.1+1/hawt-jni/hawtjni-website/src/WEB-INF/scalate/layouts/default.jade jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/src/WEB-INF/scalate/layouts/default.jade --- jtreg7-7.3.1+1/hawt-jni/hawtjni-website/src/WEB-INF/scalate/layouts/default.jade 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/hawt-jni/hawtjni-website/src/WEB-INF/scalate/layouts/default.jade 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,87 @@ +!!! Basic +:plain + +- response.setContentType("text/html") +-@ var title : String = "" +-@ var body: String = null +-@ var overview: String = null +-@ var spot: String = null +-@ var blog: String = null +-@ var head: String = null +- val include_console = engine.isDevelopmentMode && engine.resourceLoader.exists("/org/fusesource/scalate/console/console_head.scaml") +html(lang="en") + head + meta(content="text/html; charset=utf-8" http-equiv="Content-Type") + meta(content="#{project_slogan}" name="description") + meta(content="#{project_keywords}" name="keywords") + meta(content="#{project_name}" name="author") + link(type="text/css" rel="stylesheet" href={uri("/styles/impact/css/pygmentize.css")}) + link(type="text/css" rel="stylesheet" href={uri("/styles/impact/css/site.css")}) + + - if (head!=null) + !~~ head + + -# + - if (include_console) + - include("/org/fusesource/scalate/console/console_head.scaml") + link(href={uri("/css/scalate/console.css")} rel="stylesheet" type="text/css") + + title= title + body + div#navigation + div.wrapper + - include("/_navigation.ssp.md") + + - if (overview!=null) + div#overview + div.wrapper + -if ( project_logo!=null ) + div.logo + img(src="#{uri(project_logo)}" alt="#{project_name} logo") + div.message + !~~ overview + + - if (spot!=null) + div#spot + div.wrapper + !~~ spot + + - if (body!=null) + div#content + div.wrapper + !~~ body + + - if (blog!=null) + div#blog + div.wrapper + !~~ blog + + -# + - if (include_console) + = include("/org/fusesource/scalate/console/console.scaml") + -# + :javascript + var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); + document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); + + + \n" + + "\n"; + + public static void generateLog( + ITestContext testContext, + String host, + String outputDirectory, + Collection failedConfs, + Collection skippedConfs, + Collection passedTests, + Collection failedTests, + Collection skippedTests, + Collection percentageTests) { + try (PrintWriter writer = + new PrintWriter(Utils.openWriter(outputDirectory, getOutputFile(testContext)))) { + + writer + .append("\n\n") + .append("TestNG: ") + .append(testContext.getName()) + .append("\n") + .append(HtmlHelper.getCssString()) + .append(HEAD) + .append("\n") + .append("\n"); + + Date startDate = testContext.getStartDate(); + Date endDate = testContext.getEndDate(); + long duration = (endDate.getTime() - startDate.getTime()) / 1000; + int passed = + testContext.getPassedTests().size() + + testContext.getFailedButWithinSuccessPercentageTests().size(); + int failed = testContext.getFailedTests().size(); + int skipped = testContext.getSkippedTests().size(); + String hostLine = + Utils.isStringEmpty(host) ? "" : "Remote host:" + host + "\n"; + + writer + .append("

") + .append(testContext.getName()) + .append("

") + .append("\n") + .append("\n") + // .append("\n") + // .append("\n") + .append("\n") + .append("\n") + .append("\n") + .append("\n") + .append(hostLine) + .append("\n") + .append("\n") + .append("\n") + .append("\n") + .append("\n") + .append("\n") + .append("
Property + // file:").append(m_testRunner.getPropertyFileName()).append("
Tests passed/Failed/Skipped:") + .append(Integer.toString(passed)) + .append("/") + .append(Integer.toString(failed)) + .append("/") + .append(Integer.toString(skipped)) + .append("
Started on:") + .append(testContext.getStartDate().toString()) + .append("
Total time:") + .append(Long.toString(duration)) + .append(" seconds (") + .append(Long.toString(endDate.getTime() - startDate.getTime())) + .append(" ms)
Included groups:") + .append(arrayToString(testContext.getIncludedGroups())) + .append("
Excluded groups:") + .append(arrayToString(testContext.getExcludedGroups())) + .append("

\n"); + + writer.append( + "(Hover the method name to see the test class name)

\n"); + if (!failedConfs.isEmpty()) { + generateTable( + writer, "FAILED CONFIGURATIONS", failedConfs, "failed", CONFIGURATION_COMPARATOR); + } + if (!skippedConfs.isEmpty()) { + generateTable( + writer, "SKIPPED CONFIGURATIONS", skippedConfs, "skipped", CONFIGURATION_COMPARATOR); + } + if (!failedTests.isEmpty()) { + generateTable(writer, "FAILED TESTS", failedTests, "failed", NAME_COMPARATOR); + } + if (!percentageTests.isEmpty()) { + generateTable( + writer, + "FAILED TESTS BUT WITHIN SUCCESS PERCENTAGE", + percentageTests, + "percent", + NAME_COMPARATOR); + } + if (!passedTests.isEmpty()) { + generateTable(writer, "PASSED TESTS", passedTests, "passed", NAME_COMPARATOR); + } + if (!skippedTests.isEmpty()) { + generateTable(writer, "SKIPPED TESTS", skippedTests, "skipped", NAME_COMPARATOR); + } + + writer.append("\n"); + } catch (IOException e) { + if (TestRunner.getVerbose() > 1) { + Logger.getLogger(TestRunner.class).error(e.getMessage(), e); + } else { + log(e.getMessage()); + } + } + } + + private static void log(String s) { + Logger.getLogger(TestHTMLReporter.class).info("[TestHTMLReporter] " + s); + } + + private static class NameComparator implements Comparator { + + @Override + public int compare(ITestResult o1, ITestResult o2) { + String c1 = o1.getMethod().getMethodName(); + String c2 = o2.getMethod().getMethodName(); + return c1.compareTo(c2); + } + } + + private static class ConfigurationComparator implements Comparator { + + @Override + public int compare(ITestResult o1, ITestResult o2) { + ITestNGMethod tm1 = o1.getMethod(); + ITestNGMethod tm2 = o2.getMethod(); + return annotationValue(tm2) - annotationValue(tm1); + } + + private static int annotationValue(ITestNGMethod method) { + if (method.isBeforeSuiteConfiguration()) { + return 10; + } + if (method.isBeforeTestConfiguration()) { + return 9; + } + if (method.isBeforeClassConfiguration()) { + return 8; + } + if (method.isBeforeGroupsConfiguration()) { + return 7; + } + if (method.isBeforeMethodConfiguration()) { + return 6; + } + if (method.isAfterMethodConfiguration()) { + return 5; + } + if (method.isAfterGroupsConfiguration()) { + return 4; + } + if (method.isAfterClassConfiguration()) { + return 3; + } + if (method.isAfterTestConfiguration()) { + return 2; + } + if (method.isAfterSuiteConfiguration()) { + return 1; + } + + return 0; + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/reporters/TextReporter.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/TextReporter.java --- jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/reporters/TextReporter.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/TextReporter.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,204 @@ +package org.testng.reporters; + +import static org.testng.internal.Utils.isStringNotBlank; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; +import org.testng.ITestContext; +import org.testng.ITestListener; +import org.testng.ITestNGMethod; +import org.testng.ITestResult; +import org.testng.collections.Lists; +import org.testng.internal.Utils; + +/** A simple reporter that collects the results and prints them on standard out. */ +public class TextReporter implements ITestListener { + + private static final String LINE = "\n===============================================\n"; + + private final int m_verbose; + private final String m_testName; + + public TextReporter(String testName, int verbose) { + m_testName = testName; + m_verbose = verbose; + } + + @Override + public void onFinish(ITestContext context) { + if (m_verbose >= 2) { + logResults(context); + } + } + + private static List resultsToMethods(Collection results) { + return results.stream().map(ITestResult::getMethod).collect(Collectors.toList()); + } + + private void logResults(ITestContext context) { + // Log Text + Set results = context.getFailedConfigurations().getAllResults(); + for (ITestResult tr : results) { + Throwable ex = tr.getThrowable(); + String stackTrace = ""; + if (ex != null && m_verbose >= 2) { + stackTrace = Utils.shortStackTrace(ex, false); + } + + logResult( + "FAILED CONFIGURATION", + Utils.detailedMethodName(tr.getMethod(), false), + tr.getMethod().getDescription(), + stackTrace, + tr.getParameters(), + tr.getMethod().getParameterTypes()); + } + + results = context.getSkippedConfigurations().getAllResults(); + for (ITestResult tr : results) { + logResult( + "SKIPPED CONFIGURATION", + Utils.detailedMethodName(tr.getMethod(), false), + tr.getMethod().getDescription(), + null, + tr.getParameters(), + tr.getMethod().getParameterTypes()); + } + + results = context.getPassedTests().getAllResults(); + for (ITestResult tr : results) { + logResult("PASSED", tr, null); + } + + results = context.getFailedTests().getAllResults(); + for (ITestResult tr : results) { + Throwable ex = tr.getThrowable(); + String stackTrace = ""; + if (ex != null && m_verbose >= 2) { + stackTrace = Utils.shortStackTrace(ex, false); + } + + logResult("FAILED", tr, stackTrace); + } + + results = context.getSkippedTests().getAllResults(); + List rawskipped = new ArrayList<>(results); + List skippedTests = Lists.newArrayList(); + List retriedTests = Lists.newArrayList(); + for (ITestResult result : rawskipped) { + if (result.wasRetried()) { + retriedTests.add(result); + } else { + skippedTests.add(result); + } + } + + logExceptions("SKIPPED", skippedTests); + logExceptions("RETRIED", retriedTests); + + List ft = resultsToMethods(context.getFailedTests().getAllResults()); + StringBuilder logBuf = new StringBuilder(LINE); + logBuf.append(" ").append(m_testName).append("\n"); + logBuf + .append(" Tests run: ") + .append(context.getAllTestMethods().length) + .append(", Failures: ") + .append(ft.size()) + .append(", Skips: ") + .append(resultsToMethods(skippedTests).size()); + if (!retriedTests.isEmpty()) { + logBuf.append(", Retries: ").append(resultsToMethods(retriedTests).size()); + } + int confFailures = context.getFailedConfigurations().size(); + int confSkips = context.getSkippedConfigurations().size(); + if (confFailures > 0 || confSkips > 0) { + logBuf + .append("\n") + .append(" Configuration Failures: ") + .append(confFailures) + .append(", Skips: ") + .append(confSkips); + } + logBuf.append(LINE); + logResult("", logBuf.toString()); + } + + private void logResult(String status, ITestResult tr, String stackTrace) { + logResult( + status, + tr.getName(), + tr.getMethod().getDescription(), + stackTrace, + tr.getParameters(), + tr.getMethod().getParameterTypes()); + } + + private void logExceptions(String status, List results) { + results.forEach( + tr -> { + Throwable throwable = tr.getThrowable(); + logResult(status, tr, throwable != null ? Utils.shortStackTrace(throwable, false) : null); + }); + } + + private void logResult(String status, String message) { + StringBuilder buf = new StringBuilder(); + if (isStringNotBlank(status)) { + buf.append(status).append(": "); + } + buf.append(message); + + System.out.println(buf); + } + + private void logResult( + String status, + String name, + String description, + String stackTrace, + Object[] params, + Class[] paramTypes) { + StringBuilder msg = new StringBuilder(name); + + if (null != params && params.length > 0) { + msg.append("("); + + // The error might be a data provider parameter mismatch, so make + // a special case here + if (params.length != paramTypes.length) { + msg.append(name) + .append(": Wrong number of arguments were passed by ") + .append("the Data Provider: found ") + .append(params.length) + .append(" but ") + .append("expected ") + .append(paramTypes.length) + .append(")"); + } else { + for (int i = 0; i < params.length; i++) { + if (i > 0) { + msg.append(", "); + } + msg.append(Utils.toString(params[i], paramTypes[i])); + } + + msg.append(")"); + } + } + if (!Utils.isStringEmpty(description)) { + msg.append("\n"); + for (int i = 0; i < status.length() + 2; i++) { + msg.append(" "); + } + msg.append(description); + } + if (!Utils.isStringEmpty(stackTrace)) { + msg.append("\n").append(stackTrace); + } + + logResult(status, msg.toString()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/reporters/VerboseReporter.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/VerboseReporter.java --- jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/reporters/VerboseReporter.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/VerboseReporter.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,275 @@ +package org.testng.reporters; + +import java.util.Arrays; +import java.util.Collection; +import org.testng.IConfigurationListener; +import org.testng.ITestContext; +import org.testng.ITestListener; +import org.testng.ITestNGMethod; +import org.testng.ITestResult; +import org.testng.internal.Utils; + +/** + * Reporter printing out detailed messages about what TestNG is going to run and what is the status + * of what has been just run. + * + *

To see messages from this reporter, either run Ant in verbose mode ('ant -v') or set verbose + * level to 5 or higher + * + * @since 6.4 + */ +public class VerboseReporter implements IConfigurationListener, ITestListener { + + /** Default prefix for messages printed out by this reporter */ + public static final String LISTENER_PREFIX = "[VerboseTestNG] "; + + private String suiteName; + private final String prefix; + + private enum Status { + SUCCESS(ITestResult.SUCCESS), + FAILURE(ITestResult.FAILURE), + SKIP(ITestResult.SKIP), + SUCCESS_PERCENTAGE_FAILURE(ITestResult.SUCCESS_PERCENTAGE_FAILURE), + STARTED(ITestResult.STARTED); + private int status; + + Status(int i) { + status = i; + } + } + + /** + * Create VerboseReporter with custom prefix + * + * @param prefix prefix for messages printed out by this reporter + */ + public VerboseReporter(String prefix) { + this.prefix = prefix; + } + + @Override + public void beforeConfiguration(ITestResult tr) { + logTestResult(Status.STARTED, tr, true); + } + + @Override + public void onConfigurationFailure(ITestResult tr) { + logTestResult(Status.FAILURE, tr, true); + } + + @Override + public void onConfigurationSkip(ITestResult tr) { + logTestResult(Status.SKIP, tr, true); + } + + @Override + public void onConfigurationSuccess(ITestResult tr) { + logTestResult(Status.SUCCESS, tr, true); + } + + @Override + public void onTestStart(ITestResult tr) { + logTestResult(Status.STARTED, tr, false); + } + + @Override + public void onTestFailure(ITestResult tr) { + logTestResult(Status.FAILURE, tr, false); + } + + @Override + public void onTestFailedButWithinSuccessPercentage(ITestResult tr) { + logTestResult(Status.SUCCESS_PERCENTAGE_FAILURE, tr, false); + } + + @Override + public void onTestSkipped(ITestResult tr) { + logTestResult(Status.SKIP, tr, false); + } + + @Override + public void onTestSuccess(ITestResult tr) { + logTestResult(Status.SUCCESS, tr, false); + } + + @Override + public void onStart(ITestContext ctx) { + suiteName = ctx.getName(); + log( + "RUNNING: Suite: \"" + + suiteName + + "\" containing \"" + + ctx.getAllTestMethods().length + + "\" Tests (config: " + + ctx.getSuite().getXmlSuite().getFileName() + + ")"); + } + + @Override + public void onFinish(ITestContext context) { + logResults(context); + suiteName = null; + } + + private ITestNGMethod[] resultsToMethods(Collection results) { + return results.stream().map(ITestResult::getMethod).toArray(ITestNGMethod[]::new); + } + + /** Print out test summary */ + private void logResults(ITestContext context) { + // + // Log test summary + // + ITestNGMethod[] ft = resultsToMethods(context.getFailedTests().getAllResults()); + StringBuilder sb = new StringBuilder("\n===============================================\n"); + sb.append(" ").append(suiteName).append("\n"); + sb.append(" Tests run: ").append(context.getAllTestMethods().length); + sb.append(", Failures: ").append(ft.length); + sb.append(", Skips: ") + .append(Arrays.toString(resultsToMethods(context.getSkippedTests().getAllResults()))); + int confFailures = context.getFailedConfigurations().size(); + int confSkips = context.getSkippedConfigurations().size(); + if (confFailures > 0 || confSkips > 0) { + sb.append("\n").append(" Configuration Failures: ").append(confFailures); + sb.append(", Skips: ").append(confSkips); + } + sb.append("\n==============================================="); + log(sb.toString()); + } + + /** + * Log meaningful message for passed in arguments. Message itself is of form: $status: + * "$suiteName" - $methodDeclaration ($actualArguments) finished in $x ms ($run of $totalRuns) + * + * @param st status of passed in itr + * @param itr test result to be described + * @param isConfMethod is itr describing configuration method + */ + private void logTestResult(Status st, ITestResult itr, boolean isConfMethod) { + StringBuilder sb = new StringBuilder(); + String stackTrace = ""; + switch (st) { + case STARTED: + sb.append("INVOKING"); + break; + case SKIP: + sb.append("SKIPPED"); + stackTrace = + itr.getThrowable() != null ? Utils.shortStackTrace(itr.getThrowable(), false) : ""; + break; + case FAILURE: + sb.append("FAILED"); + stackTrace = + itr.getThrowable() != null ? Utils.shortStackTrace(itr.getThrowable(), false) : ""; + break; + case SUCCESS: + sb.append("PASSED"); + break; + case SUCCESS_PERCENTAGE_FAILURE: + sb.append("PASSED with failures"); + break; + default: + // not happen + throw new RuntimeException("Unsupported test status:" + itr.getStatus()); + } + if (isConfMethod) { + sb.append(" CONFIGURATION: "); + } else { + sb.append(": "); + } + ITestNGMethod tm = itr.getMethod(); + int identLevel = sb.length(); + sb.append(getMethodDeclaration(tm, itr)); + Object[] params = itr.getParameters(); + Class[] paramTypes = itr.getMethod().getParameterTypes(); + if (null != params && params.length > 0) { + // The error might be a data provider parameter mismatch, so make + // a special case here + if (params.length != paramTypes.length) { + sb.append("Wrong number of arguments were passed by the Data Provider: found "); + sb.append(params.length); + sb.append(" but expected "); + sb.append(paramTypes.length); + } else { + sb.append("(value(s): "); + for (int i = 0; i < params.length; i++) { + if (i > 0) { + sb.append(", "); + } + sb.append(Utils.toString(params[i], paramTypes[i])); + } + sb.append(")"); + } + } + if (Status.STARTED != st) { + sb.append(" finished in "); + sb.append(itr.getEndMillis() - itr.getStartMillis()); + sb.append(" ms"); + if (!Utils.isStringEmpty(tm.getDescription())) { + sb.append("\n"); + for (int i = 0; i < identLevel; i++) { + sb.append(" "); + } + sb.append(tm.getDescription()); + } + if (tm.getInvocationCount() > 1) { + sb.append(" ("); + sb.append(tm.getCurrentInvocationCount()); + sb.append(" of "); + sb.append(tm.getInvocationCount()); + sb.append(")"); + } + if (!Utils.isStringEmpty(stackTrace)) { + sb.append("\n") + .append( + stackTrace, 0, stackTrace.lastIndexOf(RuntimeBehavior.getDefaultLineSeparator())); + } + } else { + if (!isConfMethod && tm.getInvocationCount() > 1) { + sb.append(" success: "); + sb.append(tm.getSuccessPercentage()); + sb.append("%"); + } + } + log(sb.toString()); + } + + protected void log(String message) { + // prefix all output lines + System.out.println(message.replaceAll("(?m)^", prefix)); + } + + /** + * @param method method to be described + * @return FQN of a class + method declaration for a method passed in ie. + * test.triangle.CheckCount.testCheckCount(java.lang.String) + */ + private String getMethodDeclaration(ITestNGMethod method, ITestResult tr) { + + // see Utils.detailedMethodName + // perhaps should rather adopt the original method instead + StringBuilder buf = new StringBuilder(); + buf.append("\""); + if (suiteName != null) { + buf.append(suiteName); + } else { + buf.append("UNKNOWN"); + } + buf.append("\""); + buf.append(" - "); + String tempName = Utils.annotationFormFor(method); + if (!tempName.isEmpty()) { + buf.append(Utils.annotationFormFor(method)).append(" "); + } + buf.append(method.getQualifiedName()); + Class[] objects = tr.getMethod().getParameterTypes(); + buf.append("(").append(Utils.stringifyTypes(objects)).append(")"); + return buf.toString(); + } + + @Override + public String toString() { + return "VerboseReporter{" + "suiteName=" + suiteName + '}'; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/reporters/XMLConstants.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/XMLConstants.java --- jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/reporters/XMLConstants.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/XMLConstants.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,73 @@ +package org.testng.reporters; + +/** + * interface groups the XML constants tries to emulate what's in + * org.apache.tools.ant.taskdefs.optional.junit.XMLConstants to be compatible with junitreport + */ +public interface XMLConstants { + /** the testsuites element for the aggregate document */ + String TESTSUITES = "testsuites"; + + /** the testsuite element */ + String TESTSUITE = "testsuite"; + + /** the testcase element */ + String TESTCASE = "testcase"; + + /** the error element */ + String ERROR = "error"; + + /** the failure element */ + String FAILURE = "failure"; + + String SKIPPED = "skipped"; + + /** the system-err element */ + String SYSTEM_ERR = "system-err"; + + /** the system-out element */ + String SYSTEM_OUT = "system-out"; + + /** package attribute for the aggregate document */ + String ATTR_PACKAGE = "package"; + + /** name attribute for property, testcase and testsuite elements */ + String ATTR_NAME = "name"; + + /** time attribute for testcase and testsuite elements */ + String ATTR_TIME = "time"; + + /** errors attribute for testsuite elements */ + String ATTR_ERRORS = "errors"; + + /** failures attribute for testsuite elements */ + String ATTR_FAILURES = "failures"; + + /** ignored attribute for testsuite elements */ + String ATTR_IGNORED = "ignored"; + + /** tests attribute for testsuite elements */ + String ATTR_TESTS = "tests"; + + /** type attribute for failure and error elements */ + String ATTR_TYPE = "type"; + + /** message attribute for failure elements */ + String ATTR_MESSAGE = "message"; + + /** the properties element */ + String PROPERTIES = "properties"; + + /** the property element */ + String PROPERTY = "property"; + + /** value attribute for property elements */ + String ATTR_VALUE = "value"; + + /** classname attribute for testcase elements */ + String ATTR_CLASSNAME = "classname"; + + String ATTR_HOSTNAME = "hostname"; + + String ATTR_TIMESTAMP = "timestamp"; +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/reporters/XMLReporter.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/XMLReporter.java --- jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/reporters/XMLReporter.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/XMLReporter.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,229 @@ +package org.testng.reporters; + +import java.io.File; +import java.util.Collection; +import java.util.Date; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import org.testng.IReporter; +import org.testng.ISuite; +import org.testng.ISuiteResult; +import org.testng.ITestContext; +import org.testng.ITestNGMethod; +import org.testng.ITestResult; +import org.testng.Reporter; +import org.testng.internal.Utils; +import org.testng.util.TimeUtils; +import org.testng.xml.XmlSuite; + +/** The main entry for the XML generation operation */ +public class XMLReporter implements IReporter, ICustomizeXmlReport { + + private final XMLReporterConfig config = new XMLReporterConfig(); + private XMLStringBuffer rootBuffer; + + @Override + public void generateReport( + List xmlSuites, List suites, String outputDirectory) { + if (Utils.isStringEmpty(config.getOutputDirectory())) { + config.setOutputDirectory(outputDirectory); + } + + // Calculate passed/failed/skipped + int passed = 0; + int failed = 0; + int skipped = 0; + int ignored = 0; + int retried = 0; + for (ISuite s : suites) { + Map suiteResults = s.getResults(); + for (ISuiteResult sr : suiteResults.values()) { + ITestContext testContext = sr.getTestContext(); + passed += testContext.getPassedTests().size(); + failed += testContext.getFailedTests().size(); + int retriedPerTest = 0; + int skippedPerTest = 0; + for (ITestResult result : testContext.getSkippedTests().getAllResults()) { + if (result.wasRetried()) { + retriedPerTest++; + } else { + skippedPerTest++; + } + } + skipped += skippedPerTest; + retried += retriedPerTest; + ignored += testContext.getExcludedMethods().size(); + } + } + + rootBuffer = new XMLStringBuffer(); + Properties p = new Properties(); + p.put("passed", passed); + p.put("failed", failed); + p.put("skipped", skipped); + if (retried > 0) { + p.put("retried", retried); + } + p.put("ignored", ignored); + p.put("total", passed + failed + skipped + ignored + retried); + rootBuffer.push(XMLReporterConfig.TAG_TESTNG_RESULTS, p); + writeReporterOutput(rootBuffer); + for (ISuite suite : suites) { + writeSuite(suite); + } + rootBuffer.pop(); + Utils.writeUtf8File(config.getOutputDirectory(), fileName(), rootBuffer, null /* no prefix */); + } + + @Override + public void addCustomTagsFor(XMLStringBuffer xmlBuffer, ITestResult testResult) {} + + public String fileName() { + return RuntimeBehavior.getDefaultFileNameForXmlReports(); + } + + private void writeReporterOutput(XMLStringBuffer xmlBuffer) { + // TODO: Cosmin - maybe a element isn't indicated for each line + xmlBuffer.push(XMLReporterConfig.TAG_REPORTER_OUTPUT); + List output = Reporter.getOutput(); + for (String line : output) { + if (line != null) { + xmlBuffer.push(XMLReporterConfig.TAG_LINE); + xmlBuffer.addCDATA(line); + xmlBuffer.pop(); + } + } + xmlBuffer.pop(); + } + + private void writeSuite(ISuite suite) { + switch (config.getFileFragmentationLevel()) { + case XMLReporterConfig.FF_LEVEL_NONE: + writeSuiteToBuffer(rootBuffer, suite); + break; + case XMLReporterConfig.FF_LEVEL_SUITE: + case XMLReporterConfig.FF_LEVEL_SUITE_RESULT: + File suiteFile = referenceSuite(rootBuffer, suite); + writeSuiteToFile(suiteFile, suite); + break; + default: + throw new AssertionError("Unexpected value: " + config.getFileFragmentationLevel()); + } + } + + private void writeSuiteToFile(File suiteFile, ISuite suite) { + XMLStringBuffer xmlBuffer = new XMLStringBuffer(); + writeSuiteToBuffer(xmlBuffer, suite); + File parentDir = suiteFile.getParentFile(); + suiteFile.getParentFile().mkdirs(); + if (parentDir.exists() || suiteFile.getParentFile().exists()) { + Utils.writeUtf8File(parentDir.getAbsolutePath(), fileName(), xmlBuffer.toXML()); + } + } + + private File referenceSuite(XMLStringBuffer xmlBuffer, ISuite suite) { + String relativePath = suite.getName() + File.separatorChar + fileName(); + File suiteFile = new File(config.getOutputDirectory(), relativePath); + Properties attrs = new Properties(); + attrs.setProperty(XMLReporterConfig.ATTR_URL, relativePath); + xmlBuffer.addEmptyElement(XMLReporterConfig.TAG_SUITE, attrs); + return suiteFile; + } + + private void writeSuiteToBuffer(XMLStringBuffer xmlBuffer, ISuite suite) { + xmlBuffer.push(XMLReporterConfig.TAG_SUITE, getSuiteAttributes(suite)); + writeSuiteGroups(xmlBuffer, suite); + + Map results = suite.getResults(); + XMLSuiteResultWriter suiteResultWriter = new XMLSuiteResultWriter(config, this); + for (Map.Entry result : results.entrySet()) { + suiteResultWriter.writeSuiteResult(xmlBuffer, result.getValue()); + } + + xmlBuffer.pop(); + } + + private void writeSuiteGroups(XMLStringBuffer xmlBuffer, ISuite suite) { + xmlBuffer.push(XMLReporterConfig.TAG_GROUPS); + Map> methodsByGroups = suite.getMethodsByGroups(); + for (Map.Entry> entry : methodsByGroups.entrySet()) { + Properties groupAttrs = new Properties(); + groupAttrs.setProperty(XMLReporterConfig.ATTR_NAME, entry.getKey()); + xmlBuffer.push(XMLReporterConfig.TAG_GROUP, groupAttrs); + Set groupMethods = getUniqueMethodSet(entry.getValue()); + for (ITestNGMethod groupMethod : groupMethods) { + Properties methodAttrs = new Properties(); + methodAttrs.setProperty(XMLReporterConfig.ATTR_NAME, groupMethod.getMethodName()); + methodAttrs.setProperty(XMLReporterConfig.ATTR_METHOD_SIG, groupMethod.toString()); + methodAttrs.setProperty(XMLReporterConfig.ATTR_CLASS, groupMethod.getRealClass().getName()); + xmlBuffer.addEmptyElement(XMLReporterConfig.TAG_METHOD, methodAttrs); + } + xmlBuffer.pop(); + } + xmlBuffer.pop(); + } + + private Properties getSuiteAttributes(ISuite suite) { + Properties props = new Properties(); + props.setProperty(XMLReporterConfig.ATTR_NAME, suite.getName()); + + // Calculate the duration + Map results = suite.getResults(); + Date minStartDate = new Date(); + Date maxEndDate = null; + // TODO: We could probably optimize this in order not to traverse this twice + for (Map.Entry result : results.entrySet()) { + ITestContext testContext = result.getValue().getTestContext(); + Date startDate = testContext.getStartDate(); + Date endDate = testContext.getEndDate(); + if (minStartDate.after(startDate)) { + minStartDate = startDate; + } + if (maxEndDate == null || maxEndDate.before(endDate)) { + maxEndDate = endDate != null ? endDate : startDate; + } + } + // The suite could be completely empty + if (maxEndDate == null) { + maxEndDate = minStartDate; + } + addDurationAttributes(config, props, minStartDate, maxEndDate); + return props; + } + + /** + * Add started-at, finished-at and duration-ms attributes to the <suite> tag + * + * @param config The reporter config + * @param attributes The properties + * @param minStartDate The minimum start date + * @param maxEndDate The maximum end date + */ + public static void addDurationAttributes( + XMLReporterConfig config, Properties attributes, Date minStartDate, Date maxEndDate) { + + String startTime = + TimeUtils.formatTimeInLocalOrSpecifiedTimeZone( + minStartDate.getTime(), config.getTimestampFormat()); + String endTime = + TimeUtils.formatTimeInLocalOrSpecifiedTimeZone( + maxEndDate.getTime(), config.getTimestampFormat()); + long duration = maxEndDate.getTime() - minStartDate.getTime(); + + attributes.setProperty(XMLReporterConfig.ATTR_STARTED_AT, startTime); + attributes.setProperty(XMLReporterConfig.ATTR_FINISHED_AT, endTime); + attributes.setProperty(XMLReporterConfig.ATTR_DURATION_MS, Long.toString(duration)); + } + + private Set getUniqueMethodSet(Collection methods) { + return new LinkedHashSet<>(methods); + } + + @Override + public XMLReporterConfig getConfig() { + return config; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/reporters/XMLSuiteResultWriter.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/XMLSuiteResultWriter.java --- jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/reporters/XMLSuiteResultWriter.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/XMLSuiteResultWriter.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,353 @@ +package org.testng.reporters; + +import java.io.File; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import org.testng.IDataProviderMethod; +import org.testng.IResultMap; +import org.testng.ISuiteResult; +import org.testng.ITestContext; +import org.testng.ITestResult; +import org.testng.Reporter; +import org.testng.collections.Lists; +import org.testng.collections.Maps; +import org.testng.collections.Sets; +import org.testng.internal.Utils; +import org.testng.util.Strings; +import org.testng.util.TimeUtils; + +/** + * Utility writing an ISuiteResult to an XMLStringBuffer. Depending on the settings in the + * config property it might generate an additional XML file with the actual content and only + * reference the file with an url attribute in the passed XMLStringBuffer. + * + * @author Cosmin Marginean, Mar 16, 2007 + */ +public class XMLSuiteResultWriter { + + private final XMLReporterConfig config; + private final ICustomizeXmlReport customizer; + + public XMLSuiteResultWriter(XMLReporterConfig config, ICustomizeXmlReport customizer) { + this.config = config; + this.customizer = customizer; + } + + /** + * Writes the specified ISuiteResult in the given XMLStringBuffer. Please consider that depending + * on the settings in the config property it might generate an additional XML file + * with the actual content and only reference the file with an url attribute in the + * passed XMLStringBuffer. + * + * @param xmlBuffer The XML buffer where to write or reference the suite result + * @param suiteResult The ISuiteResult to serialize + */ + public void writeSuiteResult(XMLStringBuffer xmlBuffer, ISuiteResult suiteResult) { + if (XMLReporterConfig.FF_LEVEL_SUITE_RESULT != config.getFileFragmentationLevel()) { + writeAllToBuffer(xmlBuffer, suiteResult); + } else { + String parentDir = + config.getOutputDirectory() + + File.separatorChar + + suiteResult.getTestContext().getSuite().getName(); + File file = referenceSuiteResult(xmlBuffer, parentDir, suiteResult); + XMLStringBuffer suiteXmlBuffer = new XMLStringBuffer(); + writeAllToBuffer(suiteXmlBuffer, suiteResult); + Utils.writeUtf8File( + file.getAbsoluteFile().getParent(), file.getName(), suiteXmlBuffer.toXML()); + } + } + + private void writeAllToBuffer(XMLStringBuffer xmlBuffer, ISuiteResult suiteResult) { + xmlBuffer.push(XMLReporterConfig.TAG_TEST, getSuiteResultAttributes(suiteResult)); + Set testResults = Sets.newHashSet(); + ITestContext testContext = suiteResult.getTestContext(); + addAllTestResults(testResults, testContext.getPassedTests()); + addAllTestResults(testResults, testContext.getFailedTests()); + addAllTestResults(testResults, testContext.getSkippedTests()); + addAllTestResults(testResults, testContext.getPassedConfigurations()); + addAllTestResults(testResults, testContext.getSkippedConfigurations()); + addAllTestResults(testResults, testContext.getFailedConfigurations()); + addAllTestResults(testResults, testContext.getFailedButWithinSuccessPercentageTests()); + addTestResults(xmlBuffer, testResults); + xmlBuffer.pop(); + } + + @SuppressWarnings("unchecked") + private void addAllTestResults(Set testResults, IResultMap resultMap) { + if (resultMap != null) { + // Sort the results chronologically before adding them + List allResults = new ArrayList<>(resultMap.getAllResults()); + + new ArrayList(allResults) + .sort( + (Comparator) + (o1, o2) -> (int) (o1.getStartMillis() - o2.getStartMillis())); + + testResults.addAll(allResults); + } + } + + private File referenceSuiteResult( + XMLStringBuffer xmlBuffer, String parentDir, ISuiteResult suiteResult) { + Properties attrs = new Properties(); + String suiteResultName = suiteResult.getTestContext().getName() + ".xml"; + attrs.setProperty(XMLReporterConfig.ATTR_URL, suiteResultName); + xmlBuffer.addEmptyElement(XMLReporterConfig.TAG_TEST, attrs); + return new File(parentDir + File.separatorChar + suiteResultName); + } + + private Properties getSuiteResultAttributes(ISuiteResult suiteResult) { + Properties attributes = new Properties(); + ITestContext tc = suiteResult.getTestContext(); + attributes.setProperty(XMLReporterConfig.ATTR_NAME, tc.getName()); + XMLReporter.addDurationAttributes(config, attributes, tc.getStartDate(), tc.getEndDate()); + return attributes; + } + + private void addTestResults(XMLStringBuffer xmlBuffer, Set testResults) { + Map> testsGroupedByClass = buildTestClassGroups(testResults); + for (Map.Entry> result : testsGroupedByClass.entrySet()) { + Properties attributes = new Properties(); + String className = result.getKey(); + if (config.isSplitClassAndPackageNames()) { + int dot = className.lastIndexOf('.'); + attributes.setProperty( + XMLReporterConfig.ATTR_NAME, dot > -1 ? className.substring(dot + 1) : className); + attributes.setProperty( + XMLReporterConfig.ATTR_PACKAGE, dot > -1 ? className.substring(0, dot) : "[default]"); + } else { + attributes.setProperty(XMLReporterConfig.ATTR_NAME, className); + } + + xmlBuffer.push(XMLReporterConfig.TAG_CLASS, attributes); + List sortedResults = result.getValue(); + Collections.sort(sortedResults); + for (ITestResult testResult : sortedResults) { + addTestResult(xmlBuffer, testResult); + } + xmlBuffer.pop(); + } + } + + private Map> buildTestClassGroups(Set testResults) { + Map> map = Maps.newHashMap(); + for (ITestResult result : testResults) { + String className = result.getTestClass().getName(); + List list = map.computeIfAbsent(className, k -> Lists.newArrayList()); + list.add(result); + } + return map; + } + + private void addTestResult(XMLStringBuffer xmlBuffer, ITestResult testResult) { + Properties attribs = getTestResultAttributes(testResult); + attribs.setProperty(XMLReporterConfig.ATTR_STATUS, getStatusString(testResult.getStatus())); + if (testResult.wasRetried()) { + attribs.setProperty(XMLReporterConfig.ATTR_RETRIED, Boolean.TRUE.toString()); + } + xmlBuffer.push(XMLReporterConfig.TAG_TEST_METHOD, attribs); + addTestMethodParams(xmlBuffer, testResult); + addTestResultException(xmlBuffer, testResult); + addTestResultOutput(xmlBuffer, testResult); + if (config.isGenerateTestResultAttributes()) { + addTestResultAttributes(xmlBuffer, testResult); + } + customizer.addCustomTagsFor(xmlBuffer, testResult); + xmlBuffer.pop(); + } + + private String getStatusString(int testResultStatus) { + switch (testResultStatus) { + case ITestResult.SUCCESS: + return "PASS"; + case ITestResult.FAILURE: + return "FAIL"; + case ITestResult.SKIP: + return "SKIP"; + case ITestResult.SUCCESS_PERCENTAGE_FAILURE: + return "SUCCESS_PERCENTAGE_FAILURE"; + default: + throw new AssertionError("Unexpected value: " + testResultStatus); + } + } + + private Properties getTestResultAttributes(ITestResult testResult) { + Properties attributes = new Properties(); + if (!testResult.getMethod().isTest()) { + attributes.setProperty(XMLReporterConfig.ATTR_IS_CONFIG, "true"); + } + attributes.setProperty(XMLReporterConfig.ATTR_NAME, testResult.getMethod().getMethodName()); + String testInstanceName = testResult.getTestName(); + if (null != testInstanceName) { + attributes.setProperty(XMLReporterConfig.ATTR_TEST_INSTANCE_NAME, testInstanceName); + } + String description = testResult.getMethod().getDescription(); + if (!Utils.isStringEmpty(description)) { + attributes.setProperty(XMLReporterConfig.ATTR_DESC, description); + } + + attributes.setProperty( + XMLReporterConfig.ATTR_METHOD_SIG, removeClassName(testResult.getMethod().toString())); + + String startTime = + TimeUtils.formatTimeInLocalOrSpecifiedTimeZone( + testResult.getStartMillis(), config.getTimestampFormat()); + String endTime = + TimeUtils.formatTimeInLocalOrSpecifiedTimeZone( + testResult.getEndMillis(), config.getTimestampFormat()); + attributes.setProperty(XMLReporterConfig.ATTR_STARTED_AT, startTime); + attributes.setProperty(XMLReporterConfig.ATTR_FINISHED_AT, endTime); + long duration = testResult.getEndMillis() - testResult.getStartMillis(); + String strDuration = Long.toString(duration); + attributes.setProperty(XMLReporterConfig.ATTR_DURATION_MS, strDuration); + + if (config.isGenerateGroupsAttribute()) { + String groupNamesStr = Utils.arrayToString(testResult.getMethod().getGroups()); + if (!Utils.isStringEmpty(groupNamesStr)) { + attributes.setProperty(XMLReporterConfig.ATTR_GROUPS, groupNamesStr); + } + } + + if (config.isGenerateDependsOnMethods()) { + String dependsOnStr = Utils.arrayToString(testResult.getMethod().getMethodsDependedUpon()); + if (!Utils.isStringEmpty(dependsOnStr)) { + attributes.setProperty(XMLReporterConfig.ATTR_DEPENDS_ON_METHODS, dependsOnStr); + } + } + + if (config.isGenerateDependsOnGroups()) { + String dependsOnStr = Utils.arrayToString(testResult.getMethod().getGroupsDependedUpon()); + if (!Utils.isStringEmpty(dependsOnStr)) { + attributes.setProperty(XMLReporterConfig.ATTR_DEPENDS_ON_GROUPS, dependsOnStr); + } + } + + IDataProviderMethod dp = testResult.getMethod().getDataProviderMethod(); + if (dp != null) { + String dataProvider = dp.getName(); + if (!Strings.isNullOrEmpty(dataProvider)) { + attributes.setProperty(XMLReporterConfig.ATTR_DATA_PROVIDER, dataProvider); + } + } + + return attributes; + } + + private String removeClassName(String methodSignature) { + int firstParanthesisPos = methodSignature.indexOf("("); + int dotAferClassPos = methodSignature.substring(0, firstParanthesisPos).lastIndexOf("."); + return methodSignature.substring(dotAferClassPos + 1); + } + + public void addTestMethodParams(XMLStringBuffer xmlBuffer, ITestResult testResult) { + Object[] parameters = testResult.getParameters(); + if ((parameters != null) && (parameters.length > 0)) { + xmlBuffer.push(XMLReporterConfig.TAG_PARAMS); + for (int i = 0; i < parameters.length; i++) { + addParameter(xmlBuffer, parameters[i], i); + } + xmlBuffer.pop(); + } + } + + private void addParameter(XMLStringBuffer xmlBuffer, Object parameter, int i) { + Properties attrs = new Properties(); + attrs.setProperty(XMLReporterConfig.ATTR_INDEX, String.valueOf(i)); + xmlBuffer.push(XMLReporterConfig.TAG_PARAM, attrs); + if (parameter == null) { + Properties valueAttrs = new Properties(); + valueAttrs.setProperty(XMLReporterConfig.ATTR_IS_NULL, "true"); + xmlBuffer.addEmptyElement(XMLReporterConfig.TAG_PARAM_VALUE, valueAttrs); + } else { + xmlBuffer.push(XMLReporterConfig.TAG_PARAM_VALUE); + xmlBuffer.addCDATA(parameter.toString()); + xmlBuffer.pop(); + } + xmlBuffer.pop(); + } + + private void addTestResultException(XMLStringBuffer xmlBuffer, ITestResult testResult) { + Throwable exception = testResult.getThrowable(); + if (exception != null) { + Properties exceptionAttrs = new Properties(); + exceptionAttrs.setProperty(XMLReporterConfig.ATTR_CLASS, exception.getClass().getName()); + xmlBuffer.push(XMLReporterConfig.TAG_EXCEPTION, exceptionAttrs); + + if (!Utils.isStringEmpty(exception.getMessage())) { + xmlBuffer.push(XMLReporterConfig.TAG_MESSAGE); + xmlBuffer.addCDATA(exception.getMessage()); + xmlBuffer.pop(); + } + + XMLReporterConfig.StackTraceLevels level = calculateStackTraceLevels(testResult); + switch (level) { + case SHORT: + xmlBuffer.push(XMLReporterConfig.TAG_SHORT_STACKTRACE); + xmlBuffer.addCDATA(Utils.shortStackTrace(exception, false)); + xmlBuffer.pop(); + break; + case FULL: + xmlBuffer.push(XMLReporterConfig.TAG_FULL_STACKTRACE); + xmlBuffer.addCDATA(Utils.longStackTrace(exception, false)); + xmlBuffer.pop(); + break; + default: + // everything else is ignored for now. + } + + xmlBuffer.pop(); + } + } + + private XMLReporterConfig.StackTraceLevels calculateStackTraceLevels(ITestResult testResult) { + XMLReporterConfig.StackTraceLevels stackTraceoutputMethod = config.getStackTraceOutput(); + if (testResult.isSuccess()) { + stackTraceoutputMethod = config.getStackTraceOutputLevelForPassedTests(); + } + return stackTraceoutputMethod; + } + + private void addTestResultOutput(XMLStringBuffer xmlBuffer, ITestResult testResult) { + // TODO: Cosmin - maybe a element isn't indicated for each line + xmlBuffer.push(XMLReporterConfig.TAG_REPORTER_OUTPUT); + List output = Reporter.getOutput(testResult); + for (String line : output) { + if (line != null) { + xmlBuffer.push(XMLReporterConfig.TAG_LINE); + xmlBuffer.addCDATA(line); + xmlBuffer.pop(); + } + } + xmlBuffer.pop(); + } + + private void addTestResultAttributes(XMLStringBuffer xmlBuffer, ITestResult testResult) { + if (testResult.getAttributeNames() != null && testResult.getAttributeNames().size() > 0) { + xmlBuffer.push(XMLReporterConfig.TAG_ATTRIBUTES); + for (String attrName : testResult.getAttributeNames()) { + if (attrName == null) { + continue; + } + Object attrValue = testResult.getAttribute(attrName); + + Properties attributeAttrs = new Properties(); + attributeAttrs.setProperty(XMLReporterConfig.ATTR_NAME, attrName); + if (attrValue == null) { + attributeAttrs.setProperty(XMLReporterConfig.ATTR_IS_NULL, "true"); + xmlBuffer.addEmptyElement(XMLReporterConfig.TAG_ATTRIBUTE, attributeAttrs); + } else { + xmlBuffer.push(XMLReporterConfig.TAG_ATTRIBUTE, attributeAttrs); + xmlBuffer.addCDATA(attrValue.toString()); + xmlBuffer.pop(); + } + } + xmlBuffer.pop(); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/reporters/jq/BannerPanel.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/BannerPanel.java --- jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/reporters/jq/BannerPanel.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/BannerPanel.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package org.testng.reporters.jq; + +import org.testng.reporters.XMLStringBuffer; + +public class BannerPanel extends BasePanel { + + public BannerPanel(Model model) { + super(model); + } + + @Override + public void generate(XMLStringBuffer xsb) { + xsb.push(D, C, "top-banner-root"); + xsb.addRequired(S, "Test results", C, "top-banner-title-font"); + xsb.addRequired(B, "Switch Retro Theme", I, "button", C, "button"); + xsb.addEmptyElement("br"); + int failedCount = getModel().getAllFailedResults().size(); + String testResult = failedCount > 0 ? ", " + pluralize(failedCount, "failed test") : ""; + String subTitle = pluralize(getModel().getSuites().size(), "suite") + testResult; + xsb.addRequired(S, subTitle, C, "top-banner-font-1"); + xsb.pop(D); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/reporters/jq/BaseMultiSuitePanel.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/BaseMultiSuitePanel.java --- jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/reporters/jq/BaseMultiSuitePanel.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/BaseMultiSuitePanel.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,41 @@ +package org.testng.reporters.jq; + +import org.testng.ISuite; +import org.testng.reporters.XMLStringBuffer; + +public abstract class BaseMultiSuitePanel extends BasePanel implements INavigatorPanel { + + abstract String getHeader(ISuite suite); + + abstract String getContent(ISuite suite, XMLStringBuffer xsb); + + public BaseMultiSuitePanel(Model model) { + super(model); + } + + @Override + public void generate(XMLStringBuffer xsb) { + for (ISuite s : getSuites()) { + xsb.push(D, C, "panel", "panel-name", getPanelName(s)); + xsb.push(D, C, "main-panel-header rounded-window-top"); + xsb.addOptional(S, getHeader(s), C, "header-content"); + xsb.pop(D); + + xsb.push(D, C, "main-panel-content rounded-window-bottom"); + xsb.addString(getContent(s, xsb)); + xsb.pop(D); + + xsb.pop(D); + } + } + + @Override + public String getClassName() { + return null; + } + + @Override + public String getPanelName(ISuite suite) { + return getPrefix() + suiteToTag(suite); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/reporters/jq/BasePanel.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/BasePanel.java --- jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/reporters/jq/BasePanel.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/BasePanel.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,38 @@ +package org.testng.reporters.jq; + +import java.util.List; +import org.testng.ISuite; + +public abstract class BasePanel implements IPanel { + public static final String C = "class"; + public static final String D = "div"; + public static final String S = "span"; + public static final String B = "button"; + public static final String I = "id"; + + private Model m_model; + + public BasePanel(Model model) { + m_model = model; + } + + protected Model getModel() { + return m_model; + } + + protected List getSuites() { + return getModel().getSuites(); + } + + protected static String pluralize(int count, String singular) { + return Integer.toString(count) + + " " + + (count == 0 || count > 1 + ? (singular.endsWith("s") ? singular + "es" : singular + "s") + : singular); + } + + protected static String suiteToTag(ISuite suite) { + return suite.getName().replaceAll("[^A-Za-z0-9]", "_"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/reporters/jq/ChronologicalPanel.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/ChronologicalPanel.java --- jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/reporters/jq/ChronologicalPanel.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/ChronologicalPanel.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,101 @@ +package org.testng.reporters.jq; + +import java.util.Collections; +import java.util.Comparator; +import java.util.List; +import org.testng.IInvokedMethod; +import org.testng.ISuite; +import org.testng.ITestNGMethod; +import org.testng.ITestResult; +import org.testng.reporters.XMLStringBuffer; + +public class ChronologicalPanel extends BaseMultiSuitePanel { + + public ChronologicalPanel(Model model) { + super(model); + } + + @Override + public String getPrefix() { + return "chronological-"; + } + + @Override + public String getHeader(ISuite suite) { + return "Methods in chronological order"; + } + + @Override + public String getContent(ISuite suite, XMLStringBuffer main) { + XMLStringBuffer xsb = new XMLStringBuffer(main.getCurrentIndent()); + List invokedMethods = suite.getAllInvokedMethods(); + + Collections.sort( + invokedMethods, + new Comparator() { + @Override + public int compare(IInvokedMethod arg0, IInvokedMethod arg1) { + return (int) + (arg0.getTestResult().getStartMillis() - arg1.getTestResult().getStartMillis()); + } + }); + + String currentClass = ""; + long start = 0; + for (IInvokedMethod im : invokedMethods) { + ITestNGMethod m = im.getTestMethod(); + // for (ITestResult tr : results) { + // ITestNGMethod m = tr.getMethod(); + String cls = "test-method"; + if (m.isBeforeSuiteConfiguration()) { + cls = "configuration-suite before"; + } else if (m.isAfterSuiteConfiguration()) { + cls = "configuration-suite after"; + } else if (m.isBeforeTestConfiguration()) { + cls = "configuration-test before"; + } else if (m.isAfterTestConfiguration()) { + cls = "configuration-test after"; + } else if (m.isBeforeClassConfiguration()) { + cls = "configuration-class before"; + } else if (m.isAfterClassConfiguration()) { + cls = "configuration-class after"; + } else if (m.isBeforeMethodConfiguration()) { + cls = "configuration-method before"; + } else if (m.isAfterMethodConfiguration()) { + cls = "configuration-method after"; + } + ITestResult tr = im.getTestResult(); + String methodName = Model.getTestResultName(tr); + + if (!m.getTestClass().getName().equals(currentClass)) { + if (!"".equals(currentClass)) { + xsb.pop(D); + } + xsb.push(D, C, "chronological-class"); + xsb.addRequired(D, m.getTestClass().getName(), C, "chronological-class-name"); + currentClass = m.getTestClass().getName(); + } + xsb.push(D, C, cls); + if (tr.getStatus() == ITestResult.FAILURE) { + xsb.push("img", "src", Model.getImage("failed")); + xsb.pop("img"); + } + + // No need to check for skipped methods since by definition, they were never + // invoked. + + xsb.addRequired(S, methodName, C, "method-name"); + if (start == 0) { + start = tr.getStartMillis(); + } + xsb.addRequired(S, Long.toString(tr.getStartMillis() - start) + " ms", C, "method-start"); + xsb.pop(D); + } + return xsb.toXML(); + } + + @Override + public String getNavigatorLink(ISuite suite) { + return "Chronological view"; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/reporters/jq/GroupPanel.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/GroupPanel.java --- jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/reporters/jq/GroupPanel.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/GroupPanel.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,48 @@ +package org.testng.reporters.jq; + +import java.util.Collections; +import java.util.List; +import org.testng.ISuite; +import org.testng.reporters.XMLStringBuffer; + +public class GroupPanel extends BaseMultiSuitePanel { + public GroupPanel(Model model) { + super(model); + } + + @Override + public String getPrefix() { + return "group-"; + } + + @Override + public String getHeader(ISuite suite) { + return "Groups for " + suite.getName(); + } + + @Override + public String getContent(ISuite suite, XMLStringBuffer main) { + XMLStringBuffer xsb = new XMLStringBuffer(main.getCurrentIndent()); + List sortedGroups = getModel().getGroups(suite.getName()); + Collections.sort(sortedGroups); + for (String group : sortedGroups) { + xsb.push(D, C, "test-group"); + xsb.addRequired(S, group, C, "test-group-name"); + xsb.addEmptyElement("br"); + List sortedMethods = getModel().getMethodsInGroup(group); + for (String method : sortedMethods) { + xsb.push(D, C, "method-in-group"); + xsb.addRequired(S, method, C, "method-in-group-name"); + xsb.addEmptyElement("br"); + xsb.pop(D); + } + xsb.pop(D); + } + return xsb.toXML(); + } + + @Override + public String getNavigatorLink(ISuite suite) { + return pluralize(getModel().getGroups(suite.getName()).size(), "group"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/reporters/jq/INavigatorPanel.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/INavigatorPanel.java --- jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/reporters/jq/INavigatorPanel.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/INavigatorPanel.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package org.testng.reporters.jq; + +import org.testng.ISuite; + +/** Panels that are accessible from the navigator. */ +public interface INavigatorPanel extends IPanel { + String getPanelName(ISuite suite); + + String getNavigatorLink(ISuite suite); + + String getClassName(); + + String getPrefix(); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/reporters/jq/IPanel.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/IPanel.java --- jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/reporters/jq/IPanel.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/IPanel.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,7 @@ +package org.testng.reporters.jq; + +import org.testng.reporters.XMLStringBuffer; + +public interface IPanel { + void generate(XMLStringBuffer xsb); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/reporters/jq/IgnoredMethodsPanel.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/IgnoredMethodsPanel.java --- jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/reporters/jq/IgnoredMethodsPanel.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/IgnoredMethodsPanel.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,52 @@ +package org.testng.reporters.jq; + +import org.testng.ISuite; +import org.testng.ITestNGMethod; +import org.testng.collections.Maps; +import org.testng.collections.SetMultiMap; +import org.testng.reporters.XMLStringBuffer; + +public class IgnoredMethodsPanel extends BaseMultiSuitePanel { + + public IgnoredMethodsPanel(Model model) { + super(model); + } + + @Override + public String getPrefix() { + return "ignored-methods-"; + } + + @Override + public String getHeader(ISuite suite) { + return pluralize(suite.getExcludedMethods().size(), "ignored method"); + } + + @Override + public String getContent(ISuite suite, XMLStringBuffer main) { + XMLStringBuffer xsb = new XMLStringBuffer(main.getCurrentIndent()); + SetMultiMap, ITestNGMethod> map = Maps.newSetMultiMap(); + + for (ITestNGMethod method : suite.getExcludedMethods()) { + map.put(method.getTestClass().getRealClass(), method); + } + + for (Class c : map.keySet()) { + xsb.push(D, C, "ignored-class-div"); + xsb.addRequired(S, c.getName(), C, "ignored-class-name"); + xsb.push(D, C, "ignored-methods-div"); + for (ITestNGMethod m : map.get(c)) { + xsb.addRequired(S, m.getMethodName(), C, "ignored-method-name"); + xsb.addEmptyElement("br"); + } + xsb.pop(D); + xsb.pop(D); + } + return xsb.toXML(); + } + + @Override + public String getNavigatorLink(ISuite suite) { + return "Ignored methods"; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/reporters/jq/Main.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/Main.java --- jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/reporters/jq/Main.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/Main.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,113 @@ +package org.testng.reporters.jq; + +import static org.testng.reporters.jq.BasePanel.C; +import static org.testng.reporters.jq.BasePanel.D; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.util.Arrays; +import java.util.List; +import org.testng.IReporter; +import org.testng.ISuite; +import org.testng.internal.Utils; +import org.testng.log4testng.Logger; +import org.testng.reporters.Files; +import org.testng.reporters.XMLStringBuffer; +import org.testng.xml.XmlSuite; + +public class Main implements IReporter { + private static final String TESTNG_RESOURCE_PREFIX = "/org/testng/"; + private static final String[] RESOURCES = + new String[] { + "jquery.min.js", + "testng-reports.css", + "testng-reports.js", + "testng-reports1.css", + "testng-reports2.js", + "passed.png", + "failed.png", + "skipped.png", + "navigator-bullet.png", + "bullet_point.png", + "collapseall.gif" + }; + public static final String REPORT_HEADER_FILE = "header"; + + @Override + public void generateReport( + List xmlSuites, List suites, String outputDirectory) { + Model m_model = new Model(suites); + + XMLStringBuffer xsb = new XMLStringBuffer(" "); + + // Generate the top banner + new BannerPanel(m_model).generate(xsb); + + // All the panels selectable from the navigator + List panels = + Arrays.asList( + new TestNgXmlPanel(m_model), + new TestPanel(m_model), + new GroupPanel(m_model), + new TimesPanel(m_model), + new ReporterPanel(m_model), + new IgnoredMethodsPanel(m_model), + new ChronologicalPanel(m_model)); + + // Generate the navigator on the left hand side + new NavigatorPanel(m_model, panels).generate(xsb); + + xsb.push(D, C, "wrapper"); + xsb.push(D, "class", "main-panel-root"); + + // + // Generate the main suite panel + // + new SuitePanel(m_model).generate(xsb); + + // Generate all the navigator panels + for (INavigatorPanel panel : panels) { + panel.generate(xsb); + } + + xsb.pop(D); // main-panel-root + xsb.pop(D); // wrapper + + xsb.addString(" \n"); + xsb.addString("\n"); + xsb.addString("\n"); + + String all; + try { + try (InputStream header = + getClass().getResourceAsStream(TESTNG_RESOURCE_PREFIX + REPORT_HEADER_FILE)) { + if (header == null) { + throw new RuntimeException("Couldn't find resource header"); + } + for (String fileName : RESOURCES) { + try (InputStream is = load(fileName)) { + if (is == null) { + throw new AssertionError("Couldn't find resource: " + fileName); + } + Files.copyFile(is, new File(outputDirectory, fileName)); + } + } + all = Files.readFile(header); + Utils.writeUtf8File(outputDirectory, "index.html", xsb, all); + } + } catch (IOException e) { + Logger.getLogger(Main.class).error(e.getMessage(), e); + } + } + + private InputStream load(String fileName) { + String path; + if (fileName.equals("jquery.min.js")) { + path = "/META-INF/resources/webjars/jquery/3.5.1/jquery.min.js"; + } else { + path = Main.TESTNG_RESOURCE_PREFIX + fileName; + } + return getClass().getResourceAsStream(path); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/reporters/jq/Model.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/Model.java --- jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/reporters/jq/Model.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/Model.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,208 @@ +package org.testng.reporters.jq; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import org.testng.IResultMap; +import org.testng.ISuite; +import org.testng.ISuiteResult; +import org.testng.ITestContext; +import org.testng.ITestResult; +import org.testng.collections.ListMultiMap; +import org.testng.collections.Lists; +import org.testng.collections.Maps; +import org.testng.collections.SetMultiMap; +import org.testng.internal.Utils; + +public class Model { + private ListMultiMap m_model = Maps.newListMultiMap(); + private List m_suites = null; + private Map m_testTags = Maps.newHashMap(); + private Map m_testResultMap = Maps.newHashMap(); + private Map m_failedResultsByClass = Maps.newHashMap(); + private Map m_skippedResultsByClass = Maps.newHashMap(); + private Map m_passedResultsByClass = Maps.newHashMap(); + private List m_allFailedResults = Lists.newArrayList(); + // Each suite is mapped to failed.png, skipped.png or nothing (which means passed.png) + private Map m_statusBySuiteName = Maps.newHashMap(); + private SetMultiMap m_groupsBySuiteName = Maps.newSetMultiMap(); + private SetMultiMap m_methodsByGroup = Maps.newSetMultiMap(); + + public Model(List suites) { + m_suites = suites; + init(); + } + + public List getSuites() { + return m_suites; + } + + private void init() { + int testCounter = 0; + for (ISuite suite : m_suites) { + List passed = Lists.newArrayList(); + List failed = Lists.newArrayList(); + List skipped = Lists.newArrayList(); + Map suiteResults = suite.getResults(); + for (ISuiteResult sr : suiteResults.values()) { + ITestContext context = sr.getTestContext(); + m_testTags.put(context.getName(), "test-" + testCounter++); + failed.addAll(context.getFailedTests().getAllResults()); + skipped.addAll(context.getSkippedTests().getAllResults()); + passed.addAll(context.getPassedTests().getAllResults()); + IResultMap[] map = + new IResultMap[] { + context.getFailedTests(), context.getSkippedTests(), context.getPassedTests() + }; + for (IResultMap m : map) { + for (ITestResult tr : m.getAllResults()) { + m_testResultMap.put(tr, getTestResultName(tr)); + } + } + } + + // Process them in the order passed, skipped and failed, so that the failed + // icon overrides all the others and the skipped icon overrides passed. + + // Passed + { + ResultsByClass rbc = new ResultsByClass(); + for (ITestResult tr : passed) { + rbc.addResult(tr.getTestClass().getRealClass(), tr); + updateGroups(suite, tr); + } + m_passedResultsByClass.put(suite, rbc); + } + + // Skipped + { + ResultsByClass rbc = new ResultsByClass(); + for (ITestResult tr : skipped) { + m_statusBySuiteName.put(suite.getName(), "skipped"); + rbc.addResult(tr.getTestClass().getRealClass(), tr); + updateGroups(suite, tr); + } + m_skippedResultsByClass.put(suite, rbc); + } + + // Failed + { + ResultsByClass rbc = new ResultsByClass(); + for (ITestResult tr : failed) { + m_statusBySuiteName.put(suite.getName(), "failed"); + rbc.addResult(tr.getTestClass().getRealClass(), tr); + m_allFailedResults.add(tr); + updateGroups(suite, tr); + } + m_failedResultsByClass.put(suite, rbc); + } + + m_model.putAll(suite, failed); + m_model.putAll(suite, skipped); + m_model.putAll(suite, passed); + } + } + + private void updateGroups(ISuite suite, ITestResult tr) { + String[] groups = tr.getMethod().getGroups(); + m_groupsBySuiteName.putAll(suite.getName(), Arrays.asList(groups)); + for (String group : groups) { + m_methodsByGroup.put(group, tr.getMethod().getMethodName()); + } + } + + public ResultsByClass getFailedResultsByClass(ISuite suite) { + return m_failedResultsByClass.get(suite); + } + + public ResultsByClass getSkippedResultsByClass(ISuite suite) { + return m_skippedResultsByClass.get(suite); + } + + public ResultsByClass getPassedResultsByClass(ISuite suite) { + return m_passedResultsByClass.get(suite); + } + + public String getTag(ITestResult tr) { + return m_testResultMap.get(tr); + } + + public List getTestResults(ISuite suite) { + return m_model.get(suite); + } + + private static String getMethodName(String name) { + if (name == null) { + return ""; + } + return name; + } + + public static String getTestResultName(ITestResult tr) { + StringBuilder result = new StringBuilder(getMethodName(tr.getMethod().getMethodName())); + Object[] parameters = tr.getParameters(); + if (parameters.length > 0) { + result.append("("); + StringBuilder p = new StringBuilder(); + for (int i = 0; i < parameters.length; i++) { + if (i > 0) p.append(", "); + p.append(Utils.toString(parameters[i])); + } + if (p.length() > 100) { + String s = p.toString().substring(0, 100); + s = s + "..."; + result.append(s); + } else { + result.append(p.toString()); + } + result.append(")"); + } + + return result.toString(); + } + + public List getAllFailedResults() { + return m_allFailedResults; + } + + public static String getImage(String tagClass) { + return tagClass + ".png"; + } + + public String getStatusForSuite(String suiteName) { + String result = m_statusBySuiteName.get(suiteName); + return result != null ? result : "passed"; + } + + public List getGroups(String name) { + List result = Lists.newArrayList(m_groupsBySuiteName.get(name)); + Collections.sort(result); + return result; + } + + public List getMethodsInGroup(String groupName) { + List result = Lists.newArrayList(m_methodsByGroup.get(groupName)); + Collections.sort(result); + return result; + } + + public List getAllTestResults(ISuite suite) { + return getAllTestResults(suite, true /* tests only */); + } + + public List getAllTestResults(ISuite suite, boolean testsOnly) { + List result = Lists.newArrayList(); + for (ISuiteResult sr : suite.getResults().values()) { + result.addAll(sr.getTestContext().getPassedTests().getAllResults()); + result.addAll(sr.getTestContext().getFailedTests().getAllResults()); + result.addAll(sr.getTestContext().getSkippedTests().getAllResults()); + if (!testsOnly) { + result.addAll(sr.getTestContext().getPassedConfigurations().getAllResults()); + result.addAll(sr.getTestContext().getFailedConfigurations().getAllResults()); + result.addAll(sr.getTestContext().getSkippedConfigurations().getAllResults()); + } + } + return result; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/reporters/jq/NavigatorPanel.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/NavigatorPanel.java --- jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/reporters/jq/NavigatorPanel.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/NavigatorPanel.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,290 @@ +package org.testng.reporters.jq; + +import java.util.List; +import java.util.Map; +import java.util.function.Predicate; +import org.testng.ISuite; +import org.testng.ISuiteResult; +import org.testng.ITestContext; +import org.testng.ITestResult; +import org.testng.collections.Lists; +import org.testng.reporters.XMLStringBuffer; + +public class NavigatorPanel extends BasePanel { + + private List m_panels; + + public NavigatorPanel(Model model, List panels) { + super(model); + m_panels = panels; + } + + @Override + public void generate(XMLStringBuffer main) { + main.push(D, C, "navigator-root"); + main.push(D, C, "navigator-suite-header"); + main.addRequired(S, "All suites"); + main.push("a", C, "collapse-all-link", "href", "#", "title", "Collapse/expand all the suites"); + main.push("img", "src", "collapseall.gif", C, "collapse-all-icon"); + main.pop("img"); + main.pop("a"); + main.pop(D); + for (ISuite suite : getSuites()) { + if (suite.getResults().size() == 0) { + continue; + } + + String suiteName = "suite-" + suiteToTag(suite); + + XMLStringBuffer header = new XMLStringBuffer(main.getCurrentIndent()); + + Map results = suite.getResults(); + int failed = 0; + int skipped = 0; + int passed = 0; + for (ISuiteResult result : results.values()) { + ITestContext context = result.getTestContext(); + failed += context.getFailedTests().size(); + skipped += context.getSkippedTests().size(); + passed += context.getPassedTests().size(); + } + + // Suite name in big font + header.push(D, C, "suite"); + header.push(D, C, "rounded-window"); + // Extra div so the highlighting logic will only highlight this line and not + // the entire container + header.push(D, C, "suite-header light-rounded-window-top"); + header.push("a", "href", "#", "panel-name", suiteName, C, "navigator-link"); + header.addOptional( + S, + suite.getName(), + C, + "suite-name border-" + getModel().getStatusForSuite(suite.getName())); + header.pop("a"); + header.pop(D); + + header.push(D, C, "navigator-suite-content"); + + generateInfo(header, suite); + generateResult(header, failed, skipped, passed, suite, suiteName); + + header.pop("ul"); + + header.pop(D); // suite-section-content + header.pop(D); // suite-header + header.pop(D); // suite + + header.pop(D); // result-section + + header.pop(D); // navigator-suite-content + + main.addString(header.toXML()); + } + main.pop(D); + } + + private void generateResult( + XMLStringBuffer header, int failed, int skipped, int passed, ISuite suite, String suiteName) { + // + // Results + // + header.push(D, C, "result-section"); + + header.push(D, C, "suite-section-title"); + header.addRequired(S, "Results"); + header.pop(D); + + // Method stats + int total = failed + skipped + passed; + String stats = + String.format( + "%s, %s %s %s", + pluralize(total, "method"), + maybe(failed, "failed", ", "), + maybe(skipped, "skipped", ", "), + maybe(passed, "passed", "")); + header.push(D, C, "suite-section-content"); + header.push("ul"); + header.push("li"); + header.addOptional(S, stats, C, "method-stats"); + header.pop("li"); + + generateMethodList( + "Failed methods", + new ResultsByStatus(suite, "failed", ITestResult.FAILURE), + suiteName, + header); + Predicate skip = result -> !result.wasRetried(); + IResultProvider provider = new ResultsByStatus(suite, "skipped", ITestResult.SKIP, skip); + generateMethodList("Skipped methods", provider, suiteName, header); + provider = new ResultsByStatus(suite, "skipped", ITestResult.SKIP, ITestResult::wasRetried); + generateMethodList("Retried methods", provider, suiteName, header); + provider = new ResultsByStatus(suite, "passed", ITestResult.SUCCESS); + generateMethodList("Passed methods", provider, suiteName, header); + } + + private void generateInfo(XMLStringBuffer header, ISuite suite) { + // + // Info + // + header.push(D, C, "suite-section-title"); + header.addRequired(S, "Info"); + header.pop(D); + + header.push(D, C, "suite-section-content"); + + header.push("ul"); + + // All the panels + for (INavigatorPanel panel : m_panels) { + addLinkTo(header, panel, suite); + } + + header.pop("ul"); + header.pop(D); // suite-section-content + } + + private void addLinkTo(XMLStringBuffer header, INavigatorPanel panel, ISuite suite) { + String text = panel.getNavigatorLink(suite); + header.push("li"); + header.push("a", "href", "#", "panel-name", panel.getPanelName(suite), C, "navigator-link "); + String className = panel.getClassName(); + if (className != null) { + header.addOptional(S, text, C, className); + } else { + header.addOptional(S, text); + } + header.pop("a"); + header.pop("li"); + } + + private static String maybe(int count, String s, String sep) { + return count > 0 ? count + " " + s + sep : ""; + } + + private List getMethodsByStatus( + ISuite suite, int status, Predicate condition) { + List result = Lists.newArrayList(); + List testResults = getModel().getTestResults(suite); + for (ITestResult tr : testResults) { + if (tr.getStatus() == status && condition.test(tr)) { + result.add(tr); + } + } + result.sort(ResultsByClass.METHOD_NAME_COMPARATOR); + + return result; + } + + private interface IResultProvider { + List getResults(); + + String getType(); + } + + private abstract static class BaseResultProvider implements IResultProvider { + protected ISuite m_suite; + protected String m_type; + + public BaseResultProvider(ISuite suite, String type) { + m_suite = suite; + m_type = type; + } + + @Override + public String getType() { + return m_type; + } + } + + private class ResultsByStatus extends BaseResultProvider { + private final int m_status; + private final Predicate condition; + + public ResultsByStatus(ISuite suite, String type, int status) { + this(suite, type, status, (result) -> true); + } + + public ResultsByStatus( + ISuite suite, String type, int m_status, Predicate condition) { + super(suite, type); + this.m_status = m_status; + this.condition = condition; + } + + @Override + public List getResults() { + return getMethodsByStatus(m_suite, m_status, condition); + } + } + + private void generateMethodList( + String name, IResultProvider provider, String suiteName, XMLStringBuffer main) { + XMLStringBuffer xsb = new XMLStringBuffer(main.getCurrentIndent()); + String type = provider.getType(); + String image = Model.getImage(type); + + xsb.push("li"); + + // The methods themselves + xsb.addRequired(S, name, C, "method-list-title " + type); + + // The mark up to show the (hide)/(show) links + xsb.push(S, C, "show-or-hide-methods " + type); + xsb.addRequired( + "a", + " (hide)", + "href", + "#", + C, + "hide-methods " + type + " " + suiteName, + "panel-name", + suiteName); + xsb.addRequired( + "a", + " (show)", + "href", + "#", + C, + "show-methods " + type + " " + suiteName, + "panel-name", + suiteName); + xsb.pop(S); + + // List of methods + xsb.push(D, C, "method-list-content " + type + " " + suiteName); + int count = 0; + List testResults = provider.getResults(); + if (testResults != null) { + testResults.sort(ResultsByClass.METHOD_NAME_COMPARATOR); + for (ITestResult tr : testResults) { + String testName = Model.getTestResultName(tr); + xsb.push(S); + xsb.addEmptyElement("img", "src", image, "width", "3%"); + xsb.addRequired( + "a", + testName, + "href", + "#", + "hash-for-method", + getModel().getTag(tr), + "panel-name", + suiteName, + "title", + tr.getTestClass().getName(), + C, + "method navigator-link"); + xsb.pop(S); + xsb.addEmptyElement("br"); + count++; + } + } + xsb.pop(D); + xsb.pop("li"); + + if (count > 0) { + main.addString(xsb.toXML()); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/reporters/jq/ReporterPanel.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/ReporterPanel.java --- jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/reporters/jq/ReporterPanel.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/ReporterPanel.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,49 @@ +package org.testng.reporters.jq; + +import java.util.List; +import org.testng.ISuite; +import org.testng.ITestResult; +import org.testng.Reporter; +import org.testng.reporters.XMLStringBuffer; + +/** Display the reporter output for each test result. */ +public class ReporterPanel extends BaseMultiSuitePanel { + + public ReporterPanel(Model model) { + super(model); + } + + @Override + public String getPrefix() { + return "reporter-"; + } + + @Override + public String getHeader(ISuite suite) { + return "Reporter output for " + suite.getName(); + } + + @Override + public String getContent(ISuite suite, XMLStringBuffer main) { + XMLStringBuffer xsb = new XMLStringBuffer(main.getCurrentIndent()); + for (ITestResult tr : getModel().getAllTestResults(suite)) { + List lines = Reporter.getOutput(tr); + if (!lines.isEmpty()) { + xsb.push(D, C, "reporter-method-div"); + xsb.addRequired(S, Model.getTestResultName(tr), C, "reporter-method-name"); + xsb.push(D, C, "reporter-method-output-div"); + for (String output : lines) { + xsb.addRequired(S, output, C, "reporter-method-output"); + } + xsb.pop(D); + xsb.pop(D); + } + } + return xsb.toXML(); + } + + @Override + public String getNavigatorLink(ISuite suite) { + return "Reporter output"; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/reporters/jq/ResultsByClass.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/ResultsByClass.java --- jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/reporters/jq/ResultsByClass.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/ResultsByClass.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,36 @@ +package org.testng.reporters.jq; + +import java.util.Collections; +import java.util.Comparator; +import java.util.List; +import java.util.Set; +import org.testng.ITestResult; +import org.testng.collections.ListMultiMap; +import org.testng.collections.Maps; + +public class ResultsByClass { + public static final Comparator METHOD_NAME_COMPARATOR = + new Comparator() { + + @Override + public int compare(ITestResult arg0, ITestResult arg1) { + return arg0.getMethod().getMethodName().compareTo(arg1.getMethod().getMethodName()); + } + }; + + private ListMultiMap, ITestResult> m_results = Maps.newListMultiMap(); + + public void addResult(Class c, ITestResult tr) { + m_results.put(c, tr); + } + + public List getResults(Class c) { + List result = m_results.get(c); + Collections.sort(result, METHOD_NAME_COMPARATOR); + return result; + } + + public Set> getClasses() { + return m_results.keySet(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/reporters/jq/SuitePanel.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/SuitePanel.java --- jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/reporters/jq/SuitePanel.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/SuitePanel.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,103 @@ +package org.testng.reporters.jq; + +import java.util.List; +import org.testng.ISuite; +import org.testng.ITestResult; +import org.testng.internal.Utils; +import org.testng.reporters.XMLStringBuffer; +import org.testng.util.Strings; + +public class SuitePanel extends BasePanel { + + private static final String PASSED = "passed"; + private static final String SKIPPED = "skipped"; + private static final String FAILED = "failed"; + + public SuitePanel(Model model) { + super(model); + } + + @Override + public void generate(XMLStringBuffer xsb) { + for (ISuite suite : getSuites()) { + generateSuitePanel(suite, xsb); + } + } + + private void generateSuitePanel(ISuite suite, XMLStringBuffer xsb) { + String divName = suiteToTag(suite); + xsb.push(D, C, "panel " + divName, "panel-name", "suite-" + divName); + String[] statuses = new String[] {FAILED, SKIPPED, PASSED}; + ResultsByClass[] results = + new ResultsByClass[] { + getModel().getFailedResultsByClass(suite), + getModel().getSkippedResultsByClass(suite), + getModel().getPassedResultsByClass(suite), + }; + + for (int i = 0; i < results.length; i++) { + ResultsByClass byClass = results[i]; + for (Class c : byClass.getClasses()) { + generateClassPanel(c, byClass.getResults(c), xsb, statuses[i], suite); + } + } + xsb.pop(D); + } + + private void generateClassPanel( + Class c, List results, XMLStringBuffer xsb, String status, ISuite suite) { + xsb.push(D, C, "suite-" + suiteToTag(suite) + "-class-" + status); + xsb.push(D, C, "main-panel-header rounded-window-top"); + + // Passed/failed icon + xsb.addEmptyElement("img", "src", Model.getImage(status)); + xsb.addOptional(S, c.getName(), C, "class-name"); + xsb.pop(D); + + xsb.push(D, C, "main-panel-content rounded-window-bottom"); + + for (ITestResult tr : results) { + generateMethod(tr, xsb); + } + xsb.pop(D); + xsb.pop(D); + } + + private void generateMethod(ITestResult tr, XMLStringBuffer xsb) { + xsb.push(D, C, "method"); + xsb.push(D, C, "method-content"); + xsb.push("a", "name", Model.getTestResultName(tr)); + xsb.pop("a"); + xsb.addOptional(S, tr.getMethod().getMethodName(), C, "method-name"); + + // Parameters? + if (tr.getParameters().length > 0) { + StringBuilder sb = new StringBuilder(); + boolean first = true; + for (Object p : tr.getParameters()) { + if (!first) sb.append(", "); + first = false; + sb.append(Utils.toString(p)); + } + xsb.addOptional(S, "(" + sb.toString() + ")", C, "parameters"); + } + + // Exception? + if (tr.getStatus() != ITestResult.SUCCESS && tr.getThrowable() != null) { + StringBuilder stackTrace = new StringBuilder(); + stackTrace.append(Utils.shortStackTrace(tr.getThrowable(), true)); + xsb.addOptional(D, stackTrace.toString() + "\n", C, "stack-trace"); + } + + // Description? + String description = tr.getMethod().getDescription(); + if (!Strings.isNullOrEmpty(description)) { + xsb.push("em"); + xsb.addString("(" + description + ")"); + xsb.pop("em"); + } + + xsb.pop(D); + xsb.pop(D); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/reporters/jq/TestNgXmlPanel.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/TestNgXmlPanel.java --- jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/reporters/jq/TestNgXmlPanel.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/TestNgXmlPanel.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,38 @@ +package org.testng.reporters.jq; + +import org.testng.ISuite; +import org.testng.internal.Utils; +import org.testng.reporters.XMLStringBuffer; + +public class TestNgXmlPanel extends BaseMultiSuitePanel { + + public TestNgXmlPanel(Model model) { + super(model); + } + + @Override + public String getPrefix() { + return "test-xml-"; + } + + @Override + public String getHeader(ISuite suite) { + return suite.getXmlSuite().getFileName(); + } + + @Override + public String getContent(ISuite suite, XMLStringBuffer main) { + XMLStringBuffer xsb = new XMLStringBuffer(main.getCurrentIndent()); + xsb.push("pre"); + xsb.addString(Utils.escapeHtml(suite.getXmlSuite().toXml())); + xsb.pop("pre"); + return xsb.toXML(); + } + + @Override + public String getNavigatorLink(ISuite suite) { + String fqName = suite.getXmlSuite().getFileName(); + if (fqName == null) fqName = "/[unset file name]"; + return fqName.substring(fqName.lastIndexOf("/") + 1); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/reporters/jq/TestPanel.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/TestPanel.java --- jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/reporters/jq/TestPanel.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/TestPanel.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,50 @@ +package org.testng.reporters.jq; + +import org.testng.ISuite; +import org.testng.reporters.XMLStringBuffer; +import org.testng.xml.XmlTest; + +/** Display the list of <test> tags. */ +public class TestPanel extends BaseMultiSuitePanel { + + public TestPanel(Model model) { + super(model); + } + + @Override + public String getPrefix() { + return "testlist-"; + } + + @Override + public String getHeader(ISuite suite) { + return "Tests for " + suite.getName(); + } + + @Override + public String getContent(ISuite suite, XMLStringBuffer main) { + XMLStringBuffer xsb = new XMLStringBuffer(main.getCurrentIndent()); + + xsb.push("ul"); + for (XmlTest test : suite.getXmlSuite().getTests()) { + xsb.push("li"); + int count = test.getXmlClasses().size(); + String name = test.getName() + " (" + pluralize(count, "class") + ")"; + xsb.addRequired(S, name, C, "test-name"); + xsb.pop("li"); + } + xsb.pop("ul"); + + return xsb.toXML(); + } + + @Override + public String getNavigatorLink(ISuite suite) { + return pluralize(suite.getXmlSuite().getTests().size(), "test"); + } + + @Override + public String getClassName() { + return "test-stats"; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/reporters/jq/TimesPanel.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/TimesPanel.java --- jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/reporters/jq/TimesPanel.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/jq/TimesPanel.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,162 @@ +package org.testng.reporters.jq; + +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import org.testng.ISuite; +import org.testng.ISuiteResult; +import org.testng.ITestContext; +import org.testng.ITestNGMethod; +import org.testng.ITestResult; +import org.testng.collections.Maps; +import org.testng.reporters.XMLStringBuffer; +import org.testng.xml.XmlSuite; + +public class TimesPanel extends BaseMultiSuitePanel { + private Map m_totalTime = Maps.newHashMap(); + + public TimesPanel(Model model) { + super(model); + } + + @Override + public String getPrefix() { + return "times-"; + } + + @Override + public String getHeader(ISuite suite) { + return "Times for " + suite.getName(); + } + + private String js(ISuite suite) { + String functionName = "tableData_" + suiteToTag(suite); + StringBuilder result = + new StringBuilder( + "suiteTableInitFunctions.push('" + + functionName + + "');\n" + + "function " + + functionName + + "() {\n" + + "var data = new google.visualization.DataTable();\n" + + "data.addColumn('number', 'Number');\n" + + "data.addColumn('string', 'Method');\n" + + "data.addColumn('string', 'Class');\n" + + "data.addColumn('number', 'Time (ms)');\n"); + + List allTestResults = getModel().getAllTestResults(suite); + result.append("data.addRows(").append(allTestResults.size()).append(");\n"); + + allTestResults.sort((o1, o2) -> (int) (time(o2) - time(o1))); + + int index = 0; + for (ITestResult tr : allTestResults) { + ITestNGMethod m = tr.getMethod(); + long time = tr.getEndMillis() - tr.getStartMillis(); + result + .append("data.setCell(") + .append(index) + .append(", 0, ") + .append(index) + .append(")\n") + .append("data.setCell(") + .append(index) + .append(", 1, '") + .append(m.getMethodName()) + .append("')\n") + .append("data.setCell(") + .append(index) + .append(", 2, '") + .append(m.getTestClass().getName()) + .append("')\n") + .append("data.setCell(") + .append(index) + .append(", 3, ") + .append(time) + .append(");\n"); + Long total = m_totalTime.get(suite.getName()); + if (total == null) { + total = 0L; + } + m_totalTime.put(suite.getName(), total + time); + index++; + } + + result + .append("window.suiteTableData['") + .append(suiteToTag(suite)) + .append("']") + .append("= { tableData: data, tableDiv: 'times-div-") + .append(suiteToTag(suite)) + .append("'}\n") + .append("return data;\n") + .append("}\n"); + + return result.toString(); + } + + @Override + public String getContent(ISuite suite, XMLStringBuffer main) { + XMLStringBuffer xsb = new XMLStringBuffer(main.getCurrentIndent()); + xsb.push(D, C, "times-div"); + xsb.push("script", "type", "text/javascript"); + xsb.addString(js(suite)); + xsb.pop("script"); + long time = maxTime(suite); + xsb.addRequired( + S, String.format("Total running time: %s", prettyDuration(time)), C, "suite-total-time"); + xsb.push(D, "id", "times-div-" + suiteToTag(suite)); + xsb.pop(D); + xsb.pop(D); + return xsb.toXML(); + } + + private String prettyDuration(long totalTime) { + String result; + if (totalTime < 1000) { + result = totalTime + " ms"; + } else if (totalTime < 1000 * 60) { + result = (totalTime / 1000) + " seconds"; + } else if (totalTime < 1000 * 60 * 60) { + result = (totalTime / 1000 / 60) + " minutes"; + } else { + result = (totalTime / 1000 / 60 / 60) + " hours"; + } + return result; + } + + @Override + public String getNavigatorLink(ISuite suite) { + return "Times"; + } + + private static long time(ITestResult o1) { + return o1.getEndMillis() - o1.getStartMillis(); + } + + private long maxTime(ISuite suite) { + boolean testsInParallel = XmlSuite.ParallelMode.TESTS.equals(suite.getXmlSuite().getParallel()); + Long result = m_totalTime.get(suite.getName()); + // there are no running tests in the suite + if (result == null) { + return 0L; + } + if (!testsInParallel) { + return result; + } + Optional maxValue = + suite.getResults().values().stream() + .map(ISuiteResult::getTestContext) + .max(Comparator.comparing(TimesPanel::time)); + if (maxValue.isPresent()) { + return time(maxValue.get()); + } + return result; + } + + private static Long time(ITestContext ctx) { + return ctx.getEndDate().getTime() - ctx.getStartDate().getTime(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/reporters/util/StackTraceTools.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/util/StackTraceTools.java --- jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/reporters/util/StackTraceTools.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/reporters/util/StackTraceTools.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,57 @@ +package org.testng.reporters.util; + +import org.testng.ITestNGMethod; + +/** + * Functionality to allow tools to analyse and subdivide stack traces. + * + * @author Paul Mendelson + * @since 5.3 + * @version $Revision: 173 $ + */ +public final class StackTraceTools { + private StackTraceTools() { + // defeat instantiation. + } + + /** + * @param stack The stack trace + * @param method The test method + * @return topmost position of the test method in the stack, or top of stack if method + * is not in it. + */ + public static int getTestRoot(StackTraceElement[] stack, ITestNGMethod method) { + if (stack == null || method == null) { + return -1; + } + String cname = method.getTestClass().getName(); + for (int x = stack.length - 1; x >= 0; x--) { + if (cname.equals(stack[x].getClassName()) + && method.getMethodName().equals(stack[x].getMethodName())) { + return x; + } + } + return stack.length - 1; + } + + /** + * @param stack The stacktrace + * @param method The test method + * @return topmost position of the test method in the stack, or top of stack if method + * is not in it. + */ + public static StackTraceElement[] getTestNGInstrastructure( + StackTraceElement[] stack, ITestNGMethod method) { + if (method == null || stack == null) { + return new StackTraceElement[] {}; + } + int slot = StackTraceTools.getTestRoot(stack, method); + if (slot >= 0) { + StackTraceElement[] r = new StackTraceElement[stack.length - slot]; + System.arraycopy(stack, slot, r, 0, r.length); + return r; + } else { + return new StackTraceElement[0]; + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/thread/IExecutorFactory.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/thread/IExecutorFactory.java --- jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/thread/IExecutorFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/thread/IExecutorFactory.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,71 @@ +package org.testng.thread; + +import java.util.Comparator; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.TimeUnit; +import org.testng.IDynamicGraph; +import org.testng.ISuite; +import org.testng.ITestNGMethod; + +/** + * Represents the capabilities to be possessed by any implementation that can be plugged into TestNG + * to execute nodes from a {@link org.testng.IDynamicGraph} object. + */ +public interface IExecutorFactory { + + /** + * @param name - The name to be used as a prefix for all created threads. + * @param graph - A {@link org.testng.IDynamicGraph} object that represents the graph of methods + * and the hierarchy of execution. + * @param factory - A {@link IThreadWorkerFactory} factory to create threads. + * @param corePoolSize the number of threads to keep in the pool, even if they are idle, unless + * {@code allowCoreThreadTimeOut} is set + * @param maximumPoolSize the maximum number of threads to allow in the pool + * @param keepAliveTime when the number of threads is greater than the core, this is the maximum + * time that excess idle threads will wait for new tasks before terminating. + * @param unit the time unit for the {@code keepAliveTime} argument + * @param workQueue the queue to use for holding tasks before they are executed. This queue will + * hold only the {@code Runnable} tasks submitted by the {@code execute} method. + * @param comparator - A {@link Comparator} to order nodes internally. + * @return - A new {@link ITestNGThreadPoolExecutor} that is capable of running suites in + * parallel. + */ + ITestNGThreadPoolExecutor newSuiteExecutor( + String name, + IDynamicGraph graph, + IThreadWorkerFactory factory, + int corePoolSize, + int maximumPoolSize, + long keepAliveTime, + TimeUnit unit, + BlockingQueue workQueue, + Comparator comparator); + + /** + * @param name - The name to be used as a prefix for all created threads. + * @param graph - A {@link IDynamicGraph} object that represents the graph of methods and the + * hierarchy of execution. + * @param factory - A {@link IThreadWorkerFactory} factory to create threads. + * @param corePoolSize the number of threads to keep in the pool, even if they are idle, unless + * {@code allowCoreThreadTimeOut} is set + * @param maximumPoolSize the maximum number of threads to allow in the pool + * @param keepAliveTime when the number of threads is greater than the core, this is the maximum + * time that excess idle threads will wait for new tasks before terminating. + * @param unit the time unit for the {@code keepAliveTime} argument + * @param workQueue the queue to use for holding tasks before they are executed. This queue will + * hold only the {@code Runnable} tasks submitted by the {@code execute} method. + * @param comparator - A {@link Comparator} to order nodes internally. + * @return - A new {@link ITestNGThreadPoolExecutor} that is capable of running test methods in + * parallel. + */ + ITestNGThreadPoolExecutor newTestMethodExecutor( + String name, + IDynamicGraph graph, + IThreadWorkerFactory factory, + int corePoolSize, + int maximumPoolSize, + long keepAliveTime, + TimeUnit unit, + BlockingQueue workQueue, + Comparator comparator); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/thread/ITestNGThreadPoolExecutor.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/thread/ITestNGThreadPoolExecutor.java --- jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/thread/ITestNGThreadPoolExecutor.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/thread/ITestNGThreadPoolExecutor.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,10 @@ +package org.testng.thread; + +import java.util.concurrent.ExecutorService; + +/** Represents the capabilities of a TestNG specific {@link ExecutorService} */ +public interface ITestNGThreadPoolExecutor extends ExecutorService { + + /** Helps kick start the execution and is the point of entry for execution. */ + void run(); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/thread/IThreadWorkerFactory.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/thread/IThreadWorkerFactory.java --- jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/thread/IThreadWorkerFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/thread/IThreadWorkerFactory.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package org.testng.thread; + +import java.util.List; + +/** A factory that creates workers used by {@code GraphThreadPoolExecutor} */ +public interface IThreadWorkerFactory { + + /** + * Creates {@code IWorker} for specified set of tasks. It is not necessary that number of workers + * returned be same as number of tasks entered. + * + * @param freeNodes tasks that need to be executed + * @return list of workers + */ + List> createWorkers(List freeNodes); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/thread/IWorker.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/thread/IWorker.java --- jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/thread/IWorker.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/thread/IWorker.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,30 @@ +package org.testng.thread; + +import java.util.List; + +/** A runnable object that is used by {@code GraphThreadPoolExecutor} to execute tasks */ +public interface IWorker extends Runnable, Comparable> { + + /** @return list of tasks this worker is working on. */ + List getTasks(); + + /** @return the maximum time allowed for the worker to complete the task. */ + long getTimeOut(); + + /** @return the priority of this task. */ + int getPriority(); + + default long getCurrentThreadId() { + return -1; + } + + default void setThreadIdToRunOn(long threadIdToRunOn) {} + + default long getThreadIdToRunOn() { + return -1; + } + + default boolean completed() { + return true; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/util/RetryAnalyzerCount.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/util/RetryAnalyzerCount.java --- jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/util/RetryAnalyzerCount.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/util/RetryAnalyzerCount.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,48 @@ +package org.testng.util; + +import java.util.concurrent.atomic.AtomicInteger; +import org.testng.IRetryAnalyzer; +import org.testng.ITestResult; + +/** + * An implementation of IRetryAnalyzer that allows you to specify the maximum number of times you + * want your test to be retried. + * + * @author tocman@gmail.com (Jeremie Lenfant-Engelmann) + */ +public abstract class RetryAnalyzerCount implements IRetryAnalyzer { + + // Default retry once. + AtomicInteger count = new AtomicInteger(1); + + /** @param count the max number of time the method needs to be retried. */ + protected void setCount(int count) { + this.count.set(count); + } + + /** @return the current counter value */ + protected int getCount() { + return this.count.get(); + } + + /** + * Retries the test if count is not 0. + * + * @param result The result of the test. + */ + @Override + public boolean retry(ITestResult result) { + if (count.getAndDecrement() > 0) { + return retryMethod(result); + } + return false; + } + + /** + * The method implemented by the class that test if the test must be retried or not. + * + * @param result The result of the test. + * @return true if the test must be retried, false otherwise. + */ + public abstract boolean retryMethod(ITestResult result); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/util/TimeUtils.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/util/TimeUtils.java --- jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/util/TimeUtils.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/util/TimeUtils.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,56 @@ +package org.testng.util; + +import java.text.SimpleDateFormat; +import java.time.Duration; +import java.time.Instant; +import java.util.TimeZone; +import org.testng.internal.RuntimeBehavior; +import org.testng.internal.Utils; + +/** A Utility class that deals with time. */ +public final class TimeUtils { + private TimeUtils() {} + + /** + * @param timeInMilliSeconds - The time in milliseconds + * @param format - A format that can be used by {@link SimpleDateFormat} + * @return - A formatted string representation of the time in the timezone as obtained via {@link + * RuntimeBehavior#getTimeZone()} + */ + public static String formatTimeInLocalOrSpecifiedTimeZone( + long timeInMilliSeconds, String format) { + SimpleDateFormat sdf = new SimpleDateFormat(format); + TimeZone timeZone = RuntimeBehavior.getTimeZone(); + sdf.setTimeZone(timeZone); + return sdf.format(timeInMilliSeconds); + } + + /** A sample task to be executed. */ + @FunctionalInterface + public interface Task { + + /** The actual work to be executed. */ + void execute(); + } + + /** + * Helper method that can be used to compute the time. + * + * @param msg - A user friendly message to be shown in the logs. + * @param task - A {@link Task} that represents the task to be executed. + */ + public static void computeAndShowTime(String msg, Task task) { + Instant start = Instant.now(); + try { + task.execute(); + } finally { + Instant finish = Instant.now(); + long timeElapsed = Duration.between(start, finish).toMillis(); + String text = msg + " took " + timeElapsed + " ms."; + Utils.log(text); + if (timeElapsed > 20000) { + Utils.log("[WARNING] Probable slow call ( > 20 seconds): " + text); + } + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/xml/IFileParser.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/xml/IFileParser.java --- jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/xml/IFileParser.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/xml/IFileParser.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package org.testng.xml; + +import java.io.InputStream; +import org.testng.TestNGException; + +public interface IFileParser { + + T parse(String filePath, InputStream is, boolean loadClasses) throws TestNGException; +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/xml/IPostProcessor.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/xml/IPostProcessor.java --- jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/xml/IPostProcessor.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/xml/IPostProcessor.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package org.testng.xml; + +import java.util.Collection; + +/** Used by Parser to perform changes on an XML suite after it's been parsed. */ +public interface IPostProcessor { + + Collection process(Collection suites); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/xml/ISuiteParser.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/xml/ISuiteParser.java --- jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/xml/ISuiteParser.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/xml/ISuiteParser.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,6 @@ +package org.testng.xml; + +public interface ISuiteParser extends IFileParser { + + boolean accept(String fileName); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/xml/LaunchSuite.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/xml/LaunchSuite.java --- jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/xml/LaunchSuite.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/xml/LaunchSuite.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,405 @@ +package org.testng.xml; + +import static org.testng.internal.Utils.isStringNotBlank; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStreamWriter; +import java.nio.charset.Charset; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import org.testng.collections.Lists; +import org.testng.log4testng.Logger; +import org.testng.reporters.XMLStringBuffer; +import org.testng.xml.internal.Parser; + +/** + * This class is used to encapsulate a launch. Various synthetic XML files are created depending on + * whether the user is trying to launch a suite, a class, a method, etc... + */ +public abstract class LaunchSuite { + /** This class's log4testng Logger. */ + private static final Logger LOGGER = Logger.getLogger(LaunchSuite.class); + + protected boolean m_temporary; + + /** + * Constructs a LaunchSuite + * + * @param isTemp the temporary status + */ + protected LaunchSuite(boolean isTemp) { + m_temporary = isTemp; + } + + /** + * Returns the temporary state. + * + * @return the temporary state. + */ + public boolean isTemporary() { + return m_temporary; + } + + /** + * Saves the suite file in the specified directory and returns the file pathname. + * + * @param directory the directory where the suite file is to be saved. + * @return the file pathname of the saved file. + */ + public abstract File save(File directory); + + public abstract XMLStringBuffer getSuiteBuffer(); + + /** ExistingSuite is a non-temporary LaunchSuite based on an existing file. */ + public static class ExistingSuite extends LaunchSuite { + + /** The existing suite path (either relative to the project root or an absolute path) */ + private File m_suitePath; + + /** + * Constructs a ExistingSuite based on an existing file + * + * @param path the path to the existing Launch suite. + */ + public ExistingSuite(File path) { + super(false); + + m_suitePath = path; + } + + @Override + public XMLStringBuffer getSuiteBuffer() { + throw new UnsupportedOperationException("Not implemented yet"); + } + + /** Trying to run an existing XML file: copy its content to where the plug-in expects it. */ + @Override + public File save(File directory) { + return m_suitePath; + } + } + + /** CustomizedSuite TODO cquezel JavaDoc. */ + private abstract static class CustomizedSuite extends LaunchSuite { + protected String m_projectName; + protected String m_suiteName; + + /** The annotation type. May be null. */ + protected Map m_parameters; + + /** The string buffer used to write the XML file. */ + private XMLStringBuffer m_suiteBuffer; + + /** + * Constructs a CustomizedSuite TODO cquezel JavaDoc. + * + * @param projectName + * @param className + * @param parameters + * @param annotationType + */ + private CustomizedSuite( + final String projectName, + final String className, + final Map parameters, + final String annotationType) { + super(true); + + m_projectName = projectName; + m_suiteName = className; + m_parameters = parameters; + } + + /** + * TODO cquezel JavaDoc + * + * @return + */ + protected XMLStringBuffer createContentBuffer() { + XMLStringBuffer suiteBuffer = new XMLStringBuffer(); + suiteBuffer.setDocType("suite SYSTEM \"" + Parser.HTTPS_TESTNG_DTD_URL + "\""); + + Properties attrs = new Properties(); + attrs.setProperty("parallel", XmlSuite.ParallelMode.NONE.toString()); + attrs.setProperty("name", m_suiteName); + suiteBuffer.push("suite", attrs); + + if (m_parameters != null) { + for (Map.Entry entry : m_parameters.entrySet()) { + Properties paramAttrs = new Properties(); + paramAttrs.setProperty("name", entry.getKey()); + paramAttrs.setProperty("value", entry.getValue()); + suiteBuffer.push("parameter", paramAttrs); + suiteBuffer.pop("parameter"); + } + } + + initContentBuffer(suiteBuffer); + + suiteBuffer.pop("suite"); + + return suiteBuffer; + } + + /** + * TODO cquezel JavaDoc + * + * @return + */ + @Override + public XMLStringBuffer getSuiteBuffer() { + if (null == m_suiteBuffer) { + m_suiteBuffer = createContentBuffer(); + } + + return m_suiteBuffer; + } + + /** + * Initializes the content of the xml string buffer. + * + * @param suiteBuffer the string buffer to initialize. + */ + protected abstract void initContentBuffer(XMLStringBuffer suiteBuffer); + + /** + * {@inheritDoc} This implementation saves the suite to the "temp-testng-customsuite.xml" file + * in the specified directory. + */ + @Override + public File save(File directory) { + final File suiteFile = new File(directory, "temp-testng-customsuite.xml"); + + saveSuiteContent(suiteFile, getSuiteBuffer()); + + return suiteFile; + } + + /** + * Saves the content of the string buffer to the specified file. + * + * @param file the file to write to. + * @param content the content to write to the file. + */ + protected void saveSuiteContent(final File file, final XMLStringBuffer content) { + + try (OutputStreamWriter fw = + new OutputStreamWriter(new FileOutputStream(file), Charset.forName("UTF-8"))) { + fw.write(content.getStringBuffer().toString()); + } catch (IOException ioe) { + // TODO CQ is this normal to swallow exception here + LOGGER.error("IO Exception", ioe); + } + } + } + + /** A MethodsSuite is a suite made up of methods. */ + static class MethodsSuite extends CustomizedSuite { + protected Collection m_methodNames; + protected String m_className; + protected int m_logLevel; + + /** + * Constructs a MethodsSuite TODO cquezel JavaDoc. + * + * @param projectName + * @param className + * @param methodNames + * @param parameters + * @param annotationType (may be null) + * @param logLevel + */ + MethodsSuite( + final String projectName, + final String className, + final Collection methodNames, + final Map parameters, + final String annotationType, + final int logLevel) { + super(projectName, className, parameters, annotationType); + + m_className = className; + m_methodNames = methodNames; + m_logLevel = logLevel; + } + + /** {@inheritDoc} */ + @Override + protected void initContentBuffer(XMLStringBuffer suiteBuffer) { + Properties testAttrs = new Properties(); + testAttrs.setProperty("name", m_className); + testAttrs.setProperty("verbose", String.valueOf(m_logLevel)); + + suiteBuffer.push("test", testAttrs); + + suiteBuffer.push("classes"); + + Properties classAttrs = new Properties(); + classAttrs.setProperty("name", m_className); + + if ((null != m_methodNames) && (m_methodNames.size() > 0)) { + suiteBuffer.push("class", classAttrs); + + suiteBuffer.push("methods"); + + for (Object methodName : m_methodNames) { + Properties methodAttrs = new Properties(); + methodAttrs.setProperty("name", (String) methodName); + suiteBuffer.addEmptyElement("include", methodAttrs); + } + + suiteBuffer.pop("methods"); + suiteBuffer.pop("class"); + } else { + suiteBuffer.addEmptyElement("class", classAttrs); + } + suiteBuffer.pop("classes"); + suiteBuffer.pop("test"); + } + } + + static class ClassesAndMethodsSuite extends CustomizedSuite { + protected Map> m_classes; + protected int m_logLevel; + + ClassesAndMethodsSuite( + final String projectName, + final Map> classes, + final Map parameters, + final String annotationType, + final int logLevel) { + super(projectName, "Custom suite", parameters, annotationType); + m_classes = classes; + m_logLevel = logLevel; + } + + /** {@inheritDoc} */ + @Override + protected void initContentBuffer(XMLStringBuffer suiteBuffer) { + Properties testAttrs = new Properties(); + testAttrs.setProperty("name", m_projectName); + testAttrs.setProperty("verbose", String.valueOf(m_logLevel)); + + suiteBuffer.push("test", testAttrs); + + suiteBuffer.push("classes"); + + for (Map.Entry> entry : m_classes.entrySet()) { + Properties classAttrs = new Properties(); + classAttrs.setProperty("name", entry.getKey()); + + Collection methodNames = sanitize(entry.getValue()); + if ((null != methodNames) && (methodNames.size() > 0)) { + suiteBuffer.push("class", classAttrs); + + suiteBuffer.push("methods"); + + for (String methodName : methodNames) { + Properties methodAttrs = new Properties(); + methodAttrs.setProperty("name", methodName); + suiteBuffer.addEmptyElement("include", methodAttrs); + } + + suiteBuffer.pop("methods"); + suiteBuffer.pop("class"); + } else { + suiteBuffer.addEmptyElement("class", classAttrs); + } + } + suiteBuffer.pop("classes"); + suiteBuffer.pop("test"); + } + + private Collection sanitize(Collection source) { + if (null == source) { + return null; + } + + List result = Lists.newArrayList(); + for (String name : source) { + if (isStringNotBlank(name)) { + result.add(name); + } + } + + return result; + } + } + + /** ClassListSuite TODO cquezel JavaDoc. */ + static class ClassListSuite extends CustomizedSuite { + protected Collection m_packageNames; + protected Collection m_classNames; + protected Collection m_groupNames; + protected int m_logLevel; + + ClassListSuite( + final String projectName, + final Collection packageNames, + final Collection classNames, + final Collection groupNames, + final Map parameters, + final String annotationType, + final int logLevel) { + super(projectName, "Custom suite", parameters, annotationType); + + m_packageNames = packageNames; + m_classNames = classNames; + m_groupNames = groupNames; + m_logLevel = logLevel; + } + + /** {@inheritDoc} */ + @Override + protected void initContentBuffer(XMLStringBuffer suiteBuffer) { + Properties testAttrs = new Properties(); + testAttrs.setProperty("name", m_projectName); + testAttrs.setProperty("verbose", String.valueOf(m_logLevel)); + + suiteBuffer.push("test", testAttrs); + + if (null != m_groupNames) { + suiteBuffer.push("groups"); + suiteBuffer.push("run"); + + for (String groupName : m_groupNames) { + Properties includeAttrs = new Properties(); + includeAttrs.setProperty("name", groupName); + suiteBuffer.addEmptyElement("include", includeAttrs); + } + + suiteBuffer.pop("run"); + suiteBuffer.pop("groups"); + } + + // packages belongs to suite according to the latest DTD + if ((m_packageNames != null) && (m_packageNames.size() > 0)) { + suiteBuffer.push("packages"); + + for (String packageName : m_packageNames) { + Properties packageAttrs = new Properties(); + packageAttrs.setProperty("name", packageName); + suiteBuffer.addEmptyElement("package", packageAttrs); + } + suiteBuffer.pop("packages"); + } + + if ((m_classNames != null) && (m_classNames.size() > 0)) { + suiteBuffer.push("classes"); + + for (String className : m_classNames) { + Properties classAttrs = new Properties(); + classAttrs.setProperty("name", className); + suiteBuffer.addEmptyElement("class", classAttrs); + } + + suiteBuffer.pop("classes"); + } + suiteBuffer.pop("test"); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/xml/Parser.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/xml/Parser.java --- jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/xml/Parser.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/xml/Parser.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,22 @@ +package org.testng.xml; + +import java.io.InputStream; + +/** + * Parser is a parser for a TestNG XML test suite file. + * + * @deprecated - This class stands deprecated as of TestNG 7.5.0. There are no + * alternatives for this class. + */ +@SuppressWarnings("unused") +@Deprecated +public class Parser extends org.testng.xml.internal.Parser { + + public Parser(String path) { + super(path); + } + + public Parser(InputStream is) { + super(is); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/xml/SuiteGenerator.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/xml/SuiteGenerator.java --- jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/xml/SuiteGenerator.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/xml/SuiteGenerator.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,57 @@ +package org.testng.xml; + +import java.io.File; +import java.util.Collection; +import java.util.Collections; +import java.util.Map; + +/** + * Factory to create custom suites. + * + * @author Hani Suleiman Date: Jul 25, 2005 Time: 1:12:18 PM + */ +public class SuiteGenerator { + private static final Collection EMPTY_CLASS_LIST = Collections.emptyList(); + + public static LaunchSuite createProxiedXmlSuite(final File xmlSuitePath) { + return new LaunchSuite.ExistingSuite(xmlSuitePath); + } + + public static LaunchSuite createSuite( + String projectName, + Collection packageNames, + Map> classAndMethodNames, + Collection groupNames, + Map parameters, + String annotationType, + int logLevel) { + + LaunchSuite result; + Collection classes = + classAndMethodNames != null ? classAndMethodNames.keySet() : EMPTY_CLASS_LIST; + if ((null != groupNames) && !groupNames.isEmpty()) { + // + // Create a suite from groups + // + result = + new LaunchSuite.ClassListSuite( + projectName, packageNames, classes, groupNames, parameters, annotationType, logLevel); + } else if (packageNames != null && packageNames.size() > 0) { + // + // Create a suite from packages + // + result = + new LaunchSuite.ClassListSuite( + projectName, packageNames, classes, groupNames, parameters, annotationType, logLevel); + } else { + // + // Default suite creation + // + result = + new LaunchSuite.ClassesAndMethodsSuite( + projectName, classAndMethodNames, parameters, annotationType, logLevel); + } + + return result; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/xml/SuiteXmlParser.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/xml/SuiteXmlParser.java --- jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/xml/SuiteXmlParser.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/xml/SuiteXmlParser.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,28 @@ +package org.testng.xml; + +import java.io.IOException; +import java.io.InputStream; +import org.testng.TestNGException; +import org.testng.xml.internal.Parser; +import org.xml.sax.SAXException; + +public class SuiteXmlParser extends XMLParser implements ISuiteParser { + + @Override + public XmlSuite parse(String currentFile, InputStream inputStream, boolean loadClasses) { + TestNGContentHandler contentHandler = new TestNGContentHandler(currentFile, loadClasses); + + try { + parse(inputStream, contentHandler); + + return contentHandler.getSuite(); + } catch (SAXException | IOException e) { + throw new TestNGException(e); + } + } + + @Override + public boolean accept(String fileName) { + return Parser.hasFileScheme(fileName) && fileName.endsWith(".xml"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/xml/TestNGContentHandler.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/xml/TestNGContentHandler.java --- jtreg7-7.3.1+1/testng/testng-core/src/main/java/org/testng/xml/TestNGContentHandler.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/java/org/testng/xml/TestNGContentHandler.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,813 @@ +package org.testng.xml; + +import static org.testng.internal.Utils.isStringBlank; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.net.HttpURLConnection; +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import java.net.URLDecoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Stack; +import org.testng.ITestObjectFactory; +import org.testng.TestNGException; +import org.testng.collections.Lists; +import org.testng.collections.Maps; +import org.testng.internal.RuntimeBehavior; +import org.testng.internal.Utils; +import org.testng.log4testng.Logger; +import org.testng.util.Strings; +import org.testng.xml.internal.Parser; +import org.xml.sax.Attributes; +import org.xml.sax.EntityResolver; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; +import org.xml.sax.helpers.DefaultHandler; + +/** + * Suite definition parser utility. + * + * @author Cedric Beust + * @author Alexandru Popescu + */ +// TODO move to internal +public class TestNGContentHandler extends DefaultHandler { + private XmlSuite m_currentSuite = null; + private XmlTest m_currentTest = null; + private XmlDefine m_currentDefine = null; + private XmlRun m_currentRun = null; + private List m_currentClasses = null; + private int m_currentTestIndex = 0; + private int m_currentClassIndex = 0; + private int m_currentIncludeIndex = 0; + private List m_currentPackages = null; + private XmlPackage m_currentPackage = null; + private final List m_suites = Lists.newArrayList(); + private XmlGroups m_currentGroups = null; + private Map m_currentTestParameters = null; + private Map m_currentSuiteParameters = null; + private Map m_currentClassParameters = null; + private Include m_currentInclude; + + // Borrowed this implementation from this SO post : https://stackoverflow.com/a/29751441/679824 + private final EntityResolver m_redirectionAwareResolver = + (publicId, systemId) -> { + URL url = new URL(systemId); + InputStream stream = getClass().getResourceAsStream(url.getPath()); + if (stream == null) { + String msg = + String.format( + "Failed to read [%s] from CLASSPATH. " + "Attempting to read from [%s].", + url.getPath(), systemId); + Logger.getLogger(getClass()).warn(msg); + HttpURLConnection conn = (HttpURLConnection) url.openConnection(); + + int status = conn.getResponseCode(); + if ((status == HttpURLConnection.HTTP_MOVED_TEMP + || status == HttpURLConnection.HTTP_MOVED_PERM + || status == HttpURLConnection.HTTP_SEE_OTHER)) { + + String newUrl = conn.getHeaderField("Location"); + conn = (HttpURLConnection) new URL(newUrl).openConnection(); + } + stream = conn.getInputStream(); + } + return new InputSource( + Objects.requireNonNull(stream, "Failed to load DTD from " + systemId)); + }; + + enum Location { + SUITE, + TEST, + CLASS, + INCLUDE, + EXCLUDE + } + + private final Stack m_locations = new Stack<>(); + + private XmlClass m_currentClass = null; + private ArrayList m_currentIncludedMethods = null; + private List m_currentExcludedMethods = null; + private ArrayList m_currentSelectors = null; + private XmlMethodSelector m_currentSelector = null; + private String m_currentLanguage = null; + private String m_currentExpression = null; + private final List m_suiteFiles = Lists.newArrayList(); + private boolean m_enabledTest; + private List m_listeners; + + private final String m_fileName; + private final boolean m_loadClasses; + private boolean m_validate = false; + private boolean m_hasWarn = false; + + public TestNGContentHandler(String fileName, boolean loadClasses) { + m_fileName = fileName; + m_loadClasses = loadClasses; + } + + @Override + public InputSource resolveEntity(String publicId, String systemId) + throws SAXException, IOException { + + if (skipConsideringSystemId(systemId)) { + m_validate = true; + InputStream is = loadDtdUsingClassLoader(); + if (is != null) { + return new InputSource(is); + } + // If the classpath loading of DTD fails, then we try to load it from "https" TestNG site. + System.out.println( + "WARNING: couldn't find in classpath " + + systemId + + "\n" + + "Fetching it from " + + Parser.HTTPS_TESTNG_DTD_URL); + return m_redirectionAwareResolver.resolveEntity(publicId, Parser.HTTPS_TESTNG_DTD_URL); + } + // If we are here, then we don't know the host from which user is trying to load the dtd + if (RuntimeBehavior.useSecuredUrlForDtd() && isUnsecuredUrl(systemId)) { + throw new TestNGException(RuntimeBehavior.unsecuredUrlDocumentation()); + } + return m_redirectionAwareResolver.resolveEntity(publicId, systemId); + } + + private static boolean skipConsideringSystemId(String systemId) { + return Strings.isNullOrEmpty(systemId) + || TestNGURLs.isDTDDomainInternallyKnownToTestNG(systemId) + || isMalformedFileSystemBasedSystemId(systemId); + } + + private static boolean isMalformedFileSystemBasedSystemId(String systemId) { + try { + + URL url = new URL(URLDecoder.decode(systemId, StandardCharsets.UTF_8.name()).trim()); + if (url.getProtocol().equals("file")) { + File file = new File(url.getFile()); + boolean isDirectory = file.isDirectory(); + boolean fileExists = file.exists(); + return isDirectory || !fileExists; + } + return false; + } catch (MalformedURLException | UnsupportedEncodingException e) { + return true; + } + } + + private static boolean isUnsecuredUrl(String str) { + URI uri; + try { + uri = new URI(str); + } catch (URISyntaxException e) { + throw new RuntimeException(e); + } + // scheme is null for local uri + return uri.getScheme() != null && uri.getScheme().equals("http"); + } + + private InputStream loadDtdUsingClassLoader() { + InputStream is = getClass().getClassLoader().getResourceAsStream(Parser.TESTNG_DTD); + if (is != null) { + return is; + } + return Thread.currentThread().getContextClassLoader().getResourceAsStream(Parser.TESTNG_DTD); + } + + /** Parse */ + private void xmlSuiteFile(boolean start, Attributes attributes) { + if (start) { + String path = attributes.getValue("path"); + pushLocation(Location.SUITE); + m_suiteFiles.add(path); + } else { + m_currentSuite.setSuiteFiles(m_suiteFiles); + popLocation(); + } + } + + /** Parse */ + private void xmlSuite(boolean start, Attributes attributes) { + if (start) { + pushLocation(Location.SUITE); + String name = attributes.getValue("name"); + if (isStringBlank(name)) { + throw new TestNGException("The tag must define the name attribute"); + } + m_currentSuite = new XmlSuite(); + m_currentSuite.setFileName(m_fileName); + m_currentSuite.setName(name); + m_currentSuiteParameters = Maps.newHashMap(); + + String verbose = attributes.getValue("verbose"); + if (null != verbose) { + m_currentSuite.setVerbose(Integer.parseInt(verbose)); + } + String jUnit = attributes.getValue("junit"); + if (null != jUnit) { + m_currentSuite.setJUnit(Boolean.valueOf(jUnit)); + } + String parallel = attributes.getValue("parallel"); + if (parallel != null) { + XmlSuite.ParallelMode mode = XmlSuite.ParallelMode.getValidParallel(parallel); + if (mode != null) { + m_currentSuite.setParallel(mode); + } else { + Utils.log( + "Parser", + 1, + "[WARN] Unknown value of attribute 'parallel' at suite level: '" + parallel + "'."); + } + } + String parentModule = attributes.getValue("parent-module"); + if (parentModule != null) { + m_currentSuite.setParentModule(parentModule); + } + String guiceStage = attributes.getValue("guice-stage"); + if (guiceStage != null) { + m_currentSuite.setGuiceStage(guiceStage); + } + XmlSuite.FailurePolicy configFailurePolicy = + XmlSuite.FailurePolicy.getValidPolicy(attributes.getValue("configfailurepolicy")); + if (null != configFailurePolicy) { + m_currentSuite.setConfigFailurePolicy(configFailurePolicy); + } + String groupByInstances = attributes.getValue("group-by-instances"); + if (groupByInstances != null) { + m_currentSuite.setGroupByInstances(Boolean.parseBoolean(groupByInstances)); + } + String skip = attributes.getValue("skipfailedinvocationcounts"); + if (skip != null) { + m_currentSuite.setSkipFailedInvocationCounts(Boolean.parseBoolean(skip)); + } + String threadCount = attributes.getValue("thread-count"); + if (null != threadCount) { + m_currentSuite.setThreadCount(Integer.parseInt(threadCount)); + } + String dataProviderThreadCount = attributes.getValue("data-provider-thread-count"); + if (null != dataProviderThreadCount) { + m_currentSuite.setDataProviderThreadCount(Integer.parseInt(dataProviderThreadCount)); + } + String timeOut = attributes.getValue("time-out"); + if (null != timeOut) { + m_currentSuite.setTimeOut(timeOut); + } + String objectFactory = attributes.getValue("object-factory"); + if (null != objectFactory && m_loadClasses) { + try { + m_currentSuite.setObjectFactoryClass( + (Class) Class.forName(objectFactory)); + } catch (Exception e) { + Utils.log( + "Parser", + 1, + "[ERROR] Unable to create custom object factory '" + objectFactory + "' :" + e); + } + } + String preserveOrder = attributes.getValue("preserve-order"); + if (preserveOrder != null) { + m_currentSuite.setPreserveOrder(Boolean.valueOf(preserveOrder)); + } + String allowReturnValues = attributes.getValue("allow-return-values"); + if (allowReturnValues != null) { + m_currentSuite.setAllowReturnValues(Boolean.valueOf(allowReturnValues)); + } + } else { + m_currentSuite.setParameters(m_currentSuiteParameters); + m_suites.add(m_currentSuite); + m_currentSuiteParameters = null; + popLocation(); + } + } + + /** Parse */ + private void xmlDefine(boolean start, Attributes attributes) { + if (start) { + String name = attributes.getValue("name"); + m_currentDefine = new XmlDefine(); + m_currentDefine.setName(name); + } else { + // define is only defined within the context of XmlGroups + m_currentGroups.addDefine(m_currentDefine); + m_currentDefine = null; + } + } + + /** Parse + + + + + + + Binary files /srv/release.debian.org/tmp/8eBn1h2_bd/jtreg7-7.3.1+1/testng/testng-core/src/main/resources/org/testng/navigator-bullet.png and /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/resources/org/testng/navigator-bullet.png differ Binary files /srv/release.debian.org/tmp/8eBn1h2_bd/jtreg7-7.3.1+1/testng/testng-core/src/main/resources/org/testng/passed.png and /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/resources/org/testng/passed.png differ Binary files /srv/release.debian.org/tmp/8eBn1h2_bd/jtreg7-7.3.1+1/testng/testng-core/src/main/resources/org/testng/skipped.png and /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/resources/org/testng/skipped.png differ diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/main/resources/org/testng/testng-reports.css jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/resources/org/testng/testng-reports.css --- jtreg7-7.3.1+1/testng/testng-core/src/main/resources/org/testng/testng-reports.css 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/resources/org/testng/testng-reports.css 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,326 @@ +body { + margin: 0 0 5px 5px; +} + +ul { + margin: 0; +} + +li { + list-style-type: none; +} + +a { + text-decoration: none; +} + +a:hover { + text-decoration: underline; +} + +.navigator-selected { + background: #ffa500; +} + +.wrapper { + position: absolute; + top: 60px; + bottom: 0; + left: 400px; + right: 0; + overflow: auto; +} + +.navigator-root { + position: absolute; + top: 60px; + bottom: 0; + left: 0; + width: 400px; + overflow-y: auto; +} + +.suite { + margin: 0 10px 10px 0; + background-color: #fff8dc; +} + +.suite-name { + padding-left: 10px; + font-size: 25px; + font-family: Times, sans-serif; +} + +.main-panel-header { + padding: 5px; + background-color: #9FB4D9; /*afeeee*/; + font-family: monospace; + font-size: 18px; +} + +.main-panel-content { + padding: 5px; + margin-bottom: 10px; + background-color: #DEE8FC; /*d0ffff*/; +} + +.rounded-window { + border-radius: 10px; + border-style: solid; + border-width: 1px; +} + +.rounded-window-top { + border-top-right-radius: 10px 10px; + border-top-left-radius: 10px 10px; + border-style: solid; + border-width: 1px; + overflow: auto; +} + +.light-rounded-window-top { + border-top-right-radius: 10px 10px; + border-top-left-radius: 10px 10px; +} + +.rounded-window-bottom { + border-style: solid; + border-width: 0 1px 1px 1px; + border-bottom-right-radius: 10px 10px; + border-bottom-left-radius: 10px 10px; + overflow: auto; +} + +.method-name { + font-size: 12px; + font-family: monospace; +} + +.method-content { + border-style: solid; + border-width: 0 0 1px 0; + margin-bottom: 10px; + padding-bottom: 5px; + width: 80%; +} + +.parameters { + font-size: 14px; + font-family: monospace; +} + +.stack-trace { + white-space: pre; + font-family: monospace; + font-size: 12px; + font-weight: bold; + margin-top: 0; + margin-left: 20px; +} + +.testng-xml { + font-family: monospace; +} + +.method-list-content { + margin-left: 10px; +} + +.navigator-suite-content { + margin-left: 10px; + font: 12px 'Lucida Grande'; +} + +.suite-section-title { + margin-top: 10px; + width: 80%; + border-style: solid; + border-width: 1px 0 0 0; + font-family: Times, sans-serif; + font-size: 18px; + font-weight: bold; +} + +.suite-section-content { + list-style-image: url(bullet_point.png); +} + +.top-banner-root { + position: absolute; + top: 0; + height: 45px; + left: 0; + right: 0; + padding: 5px; + margin: 0 0 5px 0; + background-color: #0066ff; + font-family: Times, sans-serif; + color: #fff; + text-align: center; +} +.button{ + position: absolute; + margin-left:500px; + margin-top:8px; + background-color: white; + color:#0066ff; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-weight:bold; + border-color:#0066ff ; + border-radius:25px; + cursor: pointer; + height:30px; + width:150px; + outline:none; + +} + +.top-banner-title-font { + font-size: 25px; +} + +.test-name { + font-family: 'Lucida Grande', sans-serif; + font-size: 16px; +} + +.suite-icon { + padding: 5px; + float: right; + height: 20px; +} + +.test-group { + font: 20px 'Lucida Grande'; + margin: 5px 5px 10px 5px; + border-width: 0 0 1px 0; + border-style: solid; + padding: 5px; +} + +.test-group-name { + font-weight: bold; +} + +.method-in-group { + font-size: 16px; + margin-left: 80px; +} + +table.google-visualization-table-table { + width: 100%; +} + +.reporter-method-name { + font-size: 14px; + font-family: monospace; +} + +.reporter-method-output-div { + padding: 5px; + margin: 0 0 5px 20px; + font-size: 12px; + font-family: monospace; + border-width: 0 0 0 1px; + border-style: solid; +} + +.ignored-class-div { + font-size: 14px; + font-family: monospace; +} + +.ignored-methods-div { + padding: 5px; + margin: 0 0 5px 20px; + font-size: 12px; + font-family: monospace; + border-width: 0 0 0 1px; + border-style: solid; +} + +.border-failed { + border-top-left-radius: 10px 10px; + border-bottom-left-radius: 10px 10px; + border-style: solid; + border-width: 0 0 0 10px; + border-color: #f00; +} + +.border-skipped { + border-top-left-radius: 10px 10px; + border-bottom-left-radius: 10px 10px; + border-style: solid; + border-width: 0 0 0 10px; + border-color: #edc600; +} + +.border-passed { + border-top-left-radius: 10px 10px; + border-bottom-left-radius: 10px 10px; + border-style: solid; + border-width: 0 0 0 10px; + border-color: #19f52d; +} + +.times-div { + text-align: center; + padding: 5px; +} + +.suite-total-time { + font: 16px 'Lucida Grande'; +} + +.configuration-suite { + margin-left: 20px; +} + +.configuration-test { + margin-left: 40px; +} + +.configuration-class { + margin-left: 60px; +} + +.configuration-method { + margin-left: 80px; +} + +.test-method { + margin-left: 100px; +} + +.chronological-class { + background-color: skyblue; + border-style: solid; + border-width: 0 0 1px 1px; +} + +.method-start { + float: right; +} + +.chronological-class-name { + padding: 0 0 0 5px; + color: #008; +} + +.after, .before, .test-method { + font-family: monospace; + font-size: 14px; +} + +.navigator-suite-header { + font-size: 22px; + margin: 0 10px 5px 0; + background-color: #deb887; + text-align: center; +} + +.collapse-all-icon { + padding: 5px; + float: right; +} +/*retro Theme*/ diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/main/resources/org/testng/testng-reports.js jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/resources/org/testng/testng-reports.js --- jtreg7-7.3.1+1/testng/testng-core/src/main/resources/org/testng/testng-reports.js 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/resources/org/testng/testng-reports.js 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,122 @@ +$(document).ready(function() { + $('a.navigator-link').on("click", function() { + // Extract the panel for this link + var panel = getPanelName($(this)); + + // Mark this link as currently selected + $('.navigator-link').parent().removeClass('navigator-selected'); + $(this).parent().addClass('navigator-selected'); + + showPanel(panel); + }); + + installMethodHandlers('failed'); + installMethodHandlers('skipped'); + installMethodHandlers('passed', true); // hide passed methods by default + + $('a.method').on("click", function() { + showMethod($(this)); + return false; + }); + + // Hide all the panels and display the first one (do this last + // to make sure the click() will invoke the listeners) + $('.panel').hide(); + $('.navigator-link').first().trigger("click"); + + // Collapse/expand the suites + $('a.collapse-all-link').on("click", function() { + var contents = $('.navigator-suite-content'); + if (contents.css('display') == 'none') { + contents.show(); + } else { + contents.hide(); + } + }); +}); + +// The handlers that take care of showing/hiding the methods +function installMethodHandlers(name, hide) { + function getContent(t) { + return $('.method-list-content.' + name + "." + t.attr('panel-name')); + } + + function getHideLink(t, name) { + var s = 'a.hide-methods.' + name + "." + t.attr('panel-name'); + return $(s); + } + + function getShowLink(t, name) { + return $('a.show-methods.' + name + "." + t.attr('panel-name')); + } + + function getMethodPanelClassSel(element, name) { + var panelName = getPanelName(element); + var sel = '.' + panelName + "-class-" + name; + return $(sel); + } + + $('a.hide-methods.' + name).on("click", function() { + var w = getContent($(this)); + w.hide(); + getHideLink($(this), name).hide(); + getShowLink($(this), name).show(); + getMethodPanelClassSel($(this), name).hide(); + }); + + $('a.show-methods.' + name).on("click", function() { + var w = getContent($(this)); + w.show(); + getHideLink($(this), name).show(); + getShowLink($(this), name).hide(); + showPanel(getPanelName($(this))); + getMethodPanelClassSel($(this), name).show(); + }); + + if (hide) { + $('a.hide-methods.' + name).trigger("click"); + } else { + $('a.show-methods.' + name).trigger("click"); + } +} + +function getHashForMethod(element) { + return element.attr('hash-for-method'); +} + +function getPanelName(element) { + return element.attr('panel-name'); +} + +function showPanel(panelName) { + $('.panel').hide(); + var panel = $('.panel[panel-name="' + panelName + '"]'); + panel.show(); +} + +function showMethod(element) { + var hashTag = getHashForMethod(element); + var panelName = getPanelName(element); + showPanel(panelName); + var current = document.location.href; + var base = current.substring(0, current.indexOf('#')) + document.location.href = base + '#' + hashTag; + var newPosition = $(document).scrollTop() - 65; + $(document).scrollTop(newPosition); +} + +function drawTable() { + for (var i = 0; i < suiteTableInitFunctions.length; i++) { + window[suiteTableInitFunctions[i]](); + } + + for (var k in window.suiteTableData) { + var v = window.suiteTableData[k]; + var div = v.tableDiv; + var data = v.tableData + var table = new google.visualization.Table(document.getElementById(div)); + table.draw(data, { + showRowNumber : false + }); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/main/resources/org/testng/testng-reports1.css jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/resources/org/testng/testng-reports1.css --- jtreg7-7.3.1+1/testng/testng-core/src/main/resources/org/testng/testng-reports1.css 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/resources/org/testng/testng-reports1.css 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,344 @@ +body { + background-color: whitesmoke; + margin: 0 0 5px 5px; +} +ul { + margin-top: 10px; + margin-left:-10px; +} + li { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + padding:5px 5px; + } + a { + text-decoration: none; + color: black; + font-size: 14px; + } + + a:hover { + color:black ; + text-decoration: underline; + } + + .navigator-selected { + /* #ffa500; Mouse hover color after click Orange.*/ + background:#027368 + } + + .wrapper { + position: absolute; + top: 60px; + bottom: 0; + left: 400px; + right: 0; + margin-right:9px; + overflow: auto;/*imortant*/ + } + + .navigator-root { + position: absolute; + top: 60px; + bottom: 0; + left: 0; + width: 400px; + overflow-y: auto;/*important*/ + } + + .suite { + margin: -5px 10px 10px 5px; + background-color: whitesmoke ;/*Colour of the left bside box*/ + } + + .suite-name { + font-size: 24px; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;/*All TEST SUITE*/ + color: white; + } + + .main-panel-header { + padding: 5px; + background-color: #027368; /*afeeee*/; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + color:white; + font-size: 18px; + } + + .main-panel-content { + padding: 5px; + margin-bottom: 10px; + background-color: #CCD0D1; /*d0ffff*/; /*Belongs to backGround of rightSide boxes*/ + } + + .rounded-window { + border-style: dotted; + border-width: 1px;/*Border of left Side box*/ + background-color: whitesmoke; + border-radius: 10px; + } + + .rounded-window-top { + border-top-right-radius: 10px 10px; + border-top-left-radius: 10px 10px; + border-style: solid; + border-width: 1px; + overflow: auto;/*Top of RightSide box*/ + } + + .light-rounded-window-top { + background-color: #027368; + padding-left:120px; + border-radius: 10px; + + } + + .rounded-window-bottom { + border-bottom-right-radius: 10px 10px; + border-bottom-left-radius: 10px 10px; + overflow: auto;/*Bottom of rightSide box*/ + } + + .method-name { + font-size: 14px; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-weight: bold; + } + + .method-content { + border-style: solid; + border-width: 0 0 1px 0; + margin-bottom: 10px; + padding-bottom: 5px; + width: 100%; + } + + .parameters { + font-size: 14px; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + } + + .stack-trace { + white-space: pre; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 12px; + font-weight: bold; + margin-top: 0; + margin-left: 20px; /*Error Stack Trace Message*/ + } + + .testng-xml { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + } + + .method-list-content { + margin-left: 10px; + } + + .navigator-suite-content { + margin-left: 10px; + font: 12px 'Lucida Grande'; + } + + .suite-section-title { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + font-weight:bold; + background-color: #8C8887; + margin-left: -10px; + margin-top:10px; + padding:6px; + } + + .suite-section-content { + list-style-image: url(bullet_point.png); + background-color: whitesmoke; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + overflow: hidden; + } + + .top-banner-root { + position: absolute; + top: 0; + height: 45px; + left: 0; + right: 0; + padding: 5px; + margin: 0 0 5px 0; + background-color: #027368; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 18px; + color: #fff; + text-align: center;/*Belongs to the Top of Report*//*Status: - Completed*/ + } + + .top-banner-title-font { + font-size: 25px; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + padding: 3px; + float: right; + } + + .test-name { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 16px; + } + + .suite-icon { + padding: 5px; + float: right; + height: 20px; + } + + .test-group { + font: 20px 'Lucida Grande'; + margin: 5px 5px 10px 5px; + border-width: 0 0 1px 0; + border-style: solid; + padding: 5px; + } + + .test-group-name { + font-weight: bold; + } + + .method-in-group { + font-size: 16px; + margin-left: 80px; + } + + table.google-visualization-table-table { + width: 100%; + } + + .reporter-method-name { + font-size: 14px; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + } + + .reporter-method-output-div { + padding: 5px; + margin: 0 0 5px 20px; + font-size: 12px; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + border-width: 0 0 0 1px; + border-style: solid; + } + + .ignored-class-div { + font-size: 14px; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + } + + .ignored-methods-div { + padding: 5px; + margin: 0 0 5px 20px; + font-size: 12px; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + border-width: 0 0 0 1px; + border-style: solid; + } + + .border-failed { + border-radius:2px; + border-style: solid; + border-width: 0 0 0 10px; + border-color: #F20505; + } + + .border-skipped { + border-radius:2px; + border-style: solid; + border-width: 0 0 0 10px; + border-color: #F2BE22; + } + + .border-passed { + border-radius:2px; + border-style: solid; + border-width: 0 0 0 10px; + border-color: #038C73; + } + + .times-div { + text-align: center; + padding: 5px; + } + + .suite-total-time { + font: 16px 'Lucida Grande'; + } + + .configuration-suite { + margin-left: 20px; + } + + .configuration-test { + margin-left: 40px; + } + + .configuration-class { + margin-left: 60px; + } + + .configuration-method { + margin-left: 80px; + } + + .test-method { + margin-left: 100px; + } + + .chronological-class { + background-color: #CCD0D1; + border-width: 0 0 1px 1px;/*Chronological*/ + } + + .method-start { + float: right; + } + + .chronological-class-name { + padding: 0 0 0 5px; + margin-top:5px; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + color: #008; + } + + .after, .before, .test-method { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + margin-top:5px; + } + + .navigator-suite-header { + font-size: 18px; + margin: 0px 10px 10px 5px; + padding: 5px; + border-radius: 10px; + background-color: #027368; + color: white; + font-weight:bold; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + text-align: center; /*All Suites on top of left box*//*Status: -Completed*/ + } + + .collapse-all-icon { + padding: 3px; + float: right; + } + .button{ + position: absolute; + margin-left:500px; + margin-top:8px; + background-color: white; + color:#027368; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-weight:bold; + border-color:#027368; + border-radius:25px; + cursor: pointer; + height:30px; + width:150px; + outline: none; +} +/*Author: - Akhil Gullapalli*/ \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/main/resources/org/testng/testng-reports2.js jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/resources/org/testng/testng-reports2.js --- jtreg7-7.3.1+1/testng/testng-core/src/main/resources/org/testng/testng-reports2.js 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/resources/org/testng/testng-reports2.js 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,76 @@ +window.onload = function () { + let cookies = document.cookie; + let cookieValue = cookies.split('='); + if (cookieValue[1] === 'null' || localStorage.getItem('Theme') === 'null') { + document.getElementById('retro').setAttribute('disabled', 'false'); + } else if (cookieValue[1] === 'Switch Ultra Theme' || + localStorage.getItem('Theme') === 'Switch Ultra Theme') { + document.getElementById('button').innerText = "Switch Retro Theme"; + document.getElementById('retro').setAttribute('disabled', 'false'); + + } else if (cookieValue[1] === 'Switch Retro Theme' || + localStorage.getItem('Theme') === 'Switch Retro Theme') { + if (cookieValue[1] === 'Switch Ultra Theme' || + localStorage.getItem('Theme') === 'Switch Ultra Theme') { + document.getElementById('button').innerText = "Switch Retro Theme"; + document.getElementById('retro').setAttribute('disabled', 'false'); + + document.getElementById('button').innerText = "Switch Ultra Theme"; + document.getElementById('retro').removeAttribute('disabled'); + document.getElementById('ultra').setAttribute('disabled', 'false'); + localStorage.setItem('Theme', select); + + } else if (select === 'Switch Ultra Theme') { + document.getElementById('button').innerText = "Switch Retro Theme"; + document.getElementById('ultra').removeAttribute('disabled'); + document.getElementById('retro').setAttribute('disabled', 'false'); + localStorage.setItem('Theme', select); + } + } else if (cookieValue[1] === 'Switch Retro Theme' || + localStorage.getItem('Theme') === 'Switch Retro Theme') { + document.getElementById('button').innerText = "Switch Ultra Theme"; + document.getElementById('ultra').setAttribute('disabled', 'false'); + } +} +document.getElementById('button').onclick = function () { + let select = document.getElementById('button').innerText; + if (select === 'Switch Retro Theme') { + let d = new Date(); + days = 365; + d.setTime(+d + (days * 86400000)); //24 * 60 * 60 * 1000 + document.cookie = "Theme =" + select + "; expires=" + d.toGMTString() + ";"; + document.getElementById('button').innerText = "Switch Ultra Theme"; + document.getElementById('retro').removeAttribute('disabled'); + document.getElementById('ultra').setAttribute('disabled', 'false'); + localStorage.setItem('Theme', select); + + } else if (select === 'Switch Ultra Theme') { + let d = new Date(); + days = 365; + d.setTime(+d + (days * 86400000)); //24 * 60 * 60 * 1000 + document.cookie = "Theme =" + select + "; expires=" + d.toGMTString() + ";"; + document.getElementById('button').innerText = "Switch Retro Theme"; + document.getElementById('ultra').removeAttribute('disabled'); + document.getElementById('retro').setAttribute('disabled', 'false'); + localStorage.setItem('Theme', select); + } +} +//Function to mouse hovering affect. +document.getElementById('button').onmouseover = function () { + document.getElementById('button').style.borderRadius = "25px"; + document.getElementById('button').style.width = "180px"; + document.getElementById('button').style.height = "45px"; + document.getElementById('button').style.marginTop = "1px"; + +} +//Function to mouse out affect +document.getElementById('button').onmouseout = function () { + document.getElementById('button').style.borderRadius = "25px"; + document.getElementById('button').style.width = "150px"; + document.getElementById('button').style.height = "30px"; + document.getElementById('button').style.marginTop = "8px"; + +} + +//This is the file where we handle the switching of the Themes. +/*Author:- Akhil Gullapalli*/ diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/main/resources/testng-1.0.dtd jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/resources/testng-1.0.dtd --- jtreg7-7.3.1+1/testng/testng-core/src/main/resources/testng-1.0.dtd 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/resources/testng-1.0.dtd 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,213 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/main/resources/testng.css jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/resources/testng.css --- jtreg7-7.3.1+1/testng/testng-core/src/main/resources/testng.css 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/resources/testng.css 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +.invocation-failed, .test-failed { background-color: #DD0000; } +.invocation-percent, .test-percent { background-color: #006600; } +.invocation-passed, .test-passed { background-color: #00AA00; } +.invocation-skipped, .test-skipped { background-color: #CCCC00; } + +.main-page { + font-size: x-large; +} + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/main/resources/testngtasks jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/resources/testngtasks --- jtreg7-7.3.1+1/testng/testng-core/src/main/resources/testngtasks 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/main/resources/testngtasks 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1 @@ +testng=org.testng.TestNGAntTask diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/groovy/test/groovy/EasyJUnitGroovySample.groovy jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/groovy/test/groovy/EasyJUnitGroovySample.groovy --- jtreg7-7.3.1+1/testng/testng-core/src/test/groovy/test/groovy/EasyJUnitGroovySample.groovy 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/groovy/test/groovy/EasyJUnitGroovySample.groovy 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package test.groovy + +import org.junit.Test + +import static groovy.test.GroovyAssert.shouldFail + +// Sample from https://groovy-lang.org/testing.html#_junit_4 +class EasyJUnitGroovySample { + + @Test + void indexOutOfBoundsAccess() { + def numbers = [1, 2, 3, 4] + shouldFail { + numbers.get(4) + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/groovy/test/groovy/GroovyTest.groovy jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/groovy/test/groovy/GroovyTest.groovy --- jtreg7-7.3.1+1/testng/testng-core/src/test/groovy/test/groovy/GroovyTest.groovy 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/groovy/test/groovy/GroovyTest.groovy 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,77 @@ +package test.groovy + +import org.testng.IMethodInstance +import org.testng.IMethodInterceptor +import org.testng.ITestContext +import org.testng.ITestNGListener +import org.testng.TestListenerAdapter +import org.testng.annotations.Test +import org.testng.reporters.JUnitXMLReporter +import test.SimpleBaseTest + +import static org.assertj.core.api.Assertions.assertThat + +class GroovyTest extends SimpleBaseTest { + + @Test + void easyGroovySampleShouldWork() { + def tng = create(EasyJUnitGroovySample) + tng.setJUnit(true) + def adapter = new TestListenerAdapter() + tng.addListener((ITestNGListener)adapter) + tng.run() + + assert adapter.failedTests.isEmpty() + assert adapter.skippedTests.isEmpty() + assert adapter.passedTests.size() == 1 + } + + @Test + void specialNameGroovySampleShouldWork() { + def tng = create(SpecialNameJUnitGroovySample) + tng.setJUnit(true) + def adapter = new TestListenerAdapter() + tng.addListener((ITestNGListener)adapter) + tng.run() + + assert adapter.failedTests.isEmpty() + assert adapter.skippedTests.isEmpty() + assert adapter.passedTests.size() == 1 + } + + @Test + void spockSampleShouldWork() { + def tng = create(SpockSample) + tng.setJUnit(true) + def adapter = new TestListenerAdapter() + tng.addListener((ITestNGListener)adapter) + tng.run() + + assert adapter.failedTests.isEmpty() + assert adapter.skippedTests.isEmpty() + assert adapter.passedTests.size() == 1 + } + + @Test + void reporterWithSpockSampleShouldWork() { + def tng = create(SpockSample) + tng.setJUnit(true) + tng.addListener((ITestNGListener) new JUnitXMLReporter()) + tng.run() + } + + @Test(description = "GITHUB-2360") + void groovyInternalMethodsAreSkipped() { + def tng = create Issue2360Sample + def testMethodNames = [] + IMethodInterceptor methodInterceptor = { List methods, ITestContext context -> + testMethodNames = methods.collect { it.method.methodName } + methods + } + tng.methodInterceptor = methodInterceptor + tng.run() + + assertThat testMethodNames containsExactly "test1", "test2" + } + +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/groovy/test/groovy/Issue2360Sample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/groovy/test/groovy/Issue2360Sample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/groovy/test/groovy/Issue2360Sample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/groovy/test/groovy/Issue2360Sample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,25 @@ +package test.groovy; + +import groovy.transform.Internal; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +/** Sample test used by {@link Issue2360Sample}. */ +@Test +public class Issue2360Sample { + @DataProvider + public static Object[][] foo() { + return new Object[][] {new Object[] {true}, new Object[] {false}}; + } + + public void test1() {} + + @Test(dataProvider = "foo") + public void test2(boolean foo) {} + + @Internal + public void test3() {} + + @Internal + public void test4(boolean foo) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/groovy/test/groovy/SpecialNameJUnitGroovySample.groovy jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/groovy/test/groovy/SpecialNameJUnitGroovySample.groovy --- jtreg7-7.3.1+1/testng/testng-core/src/test/groovy/test/groovy/SpecialNameJUnitGroovySample.groovy 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/groovy/test/groovy/SpecialNameJUnitGroovySample.groovy 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package test.groovy + +import org.junit.Test + +import static groovy.test.GroovyAssert.shouldFail + +// Sample from https://groovy-lang.org/testing.html#_junit_4 +class SpecialNameJUnitGroovySample { + + @Test + void "index Out Of Bounds Access"() { + def numbers = [1, 2, 3, 4] + shouldFail { + numbers.get(4) + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/groovy/test/groovy/SpockSample.groovy jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/groovy/test/groovy/SpockSample.groovy --- jtreg7-7.3.1+1/testng/testng-core/src/test/groovy/test/groovy/SpockSample.groovy 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/groovy/test/groovy/SpockSample.groovy 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package test.groovy + +import spock.lang.Specification + +class SpockSample extends Specification { + + def "adding an element leads to size increase"() { + setup: "a new stack instance is created" + def stack = new Stack() + + when: + stack.push 42 + + then: + stack.size() == 1 + } +} \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/ConverterSample2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/ConverterSample2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/ConverterSample2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/ConverterSample2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,24 @@ +// Not that this file has no package (that's what we are testing) and therefore, +// it is at the wrong location, but it's easier to leave it here. +// Also, do not change the line numbers since the test will make sure +// that the tags are generated in hardcoded line numbers + +import junit.framework.TestCase; + +public class ConverterSample2 extends TestCase { + @Override + protected void setUp() throws Exception { + super.setUp(); + } + + @Override + protected void tearDown() throws Exception { + super.tearDown(); + } + + public final void testClassJunit() {} + + public final void testSetClassId() {} + + public final void testSetClassName() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/ConverterSample4.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/ConverterSample4.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/ConverterSample4.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/ConverterSample4.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,69 @@ +/* + * Created on 12-Sep-2006 by micheb10 + * it is at the wrong location, but it's easier to leave it here. + * Also, do not change the line numbers since the test will make sure + * that the tags are generated in hardcoded line numbers + */ + +/** + * Sample file for the Javadocv annotations to Java 5 annotations converter for the default package + * + * @author micheb10 12-Sep-2006 + */ +public class ConverterSample4 { + /** + * This comment line should be preserved + * + * @testng.before-suite alwaysRun = "true" + */ + public void beforeSuiteAlwaysRun() { + // We are just checking appropriate annotations are added so we don't care about body + } + + /** @testng.test */ + public void plainTest() { + // Empty body + } + + /** + * @testng.test + * @testng.expected-exceptions value = "java.lang.NullPointerException + * java.lang.NumberFormatException" + */ + public void expectedExceptions() { + // Empty body + } + + /** @testng.test groups = "groupA groupB" */ + public void testGroups() { + // Empty body + } + + /** @testng.after-method */ + public void afterMethod() { + // Empty body + } + + /** + * This key should be preserved + * + * @author The author is a standard tag and should not be touched + * @testng.test groups = "groupA" dependsOnMethods = "expectedExceptions" timeOut="3000" + * unrecognised="futureProof" + * @version another standard tag should not be changed + * @testng.expected-exceptions value = "java.lang.NullPointerException + * java.lang.NumberFormatException" + */ + public void testEverything() {} + + /** @testng.data-provider name="test1" */ + public Object[][] dataProvider() { + return null; + } + + /** @testng.factory */ + @SuppressWarnings({"unchecked", "deprecation"}) + public Object[] factory() { + return null; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/NoPackageTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/NoPackageTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/NoPackageTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/NoPackageTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +import org.testng.annotations.AfterMethod; +import org.testng.annotations.Test; + +/** @author Filippo Diotalevi */ +public class NoPackageTest { + private boolean m_run = false; + + @Test(groups = {"nopackage"}) + public void test() { + m_run = true; + } + + @AfterMethod(groups = {"nopackage"}) + public void after() { + assert m_run : "test method was not run"; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/ReporterConfigTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/ReporterConfigTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/ReporterConfigTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/ReporterConfigTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,24 @@ +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertTrue; + +import java.util.Objects; +import org.testng.annotations.Test; +import org.testng.internal.ReporterConfig; + +public class ReporterConfigTest { + + private static final String CLASS_NAME = "org.testng.reporters.XMLReporter"; + private static final String PROP_NAME_1 = "generateTestResultAttributes"; + private static final String PROP_NAME_2 = "generateGroupsAttribute"; + private static final String CONFIG_STR = + CLASS_NAME + ":" + PROP_NAME_1 + "=true," + PROP_NAME_2 + "=true"; + + @Test + public void testDeserialize() { + ReporterConfig config = ReporterConfig.deserialize(CONFIG_STR); + assertEquals(Objects.requireNonNull(config).getClassName(), CLASS_NAME); + String serial = config.serialize(); + assertTrue(serial.contains(PROP_NAME_1 + "=true")); + assertTrue(serial.contains(PROP_NAME_2 + "=true")); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/groovy/transform/Internal.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/groovy/transform/Internal.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/groovy/transform/Internal.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/groovy/transform/Internal.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,10 @@ +package groovy.transform; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target({ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.TYPE, ElementType.FIELD}) +@Retention(RetentionPolicy.RUNTIME) +public @interface Internal {} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/DryRunSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/DryRunSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/DryRunSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/DryRunSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +package org.testng; + +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeSuite; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class DryRunSample { + + @BeforeSuite + public void beforeSuite() { + throw new RuntimeException("Error"); + } + + @BeforeClass + public void beforeClass() { + throw new RuntimeException("error"); + } + + @Test(dataProvider = "dp") + public void test1(int i) {} + + @DataProvider(name = "dp") + public Object[][] getData() { + return new Object[][] {{1}, {2}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/DryRunTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/DryRunTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/DryRunTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/DryRunTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,24 @@ +package org.testng; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.annotations.Test; +import org.testng.internal.RuntimeBehavior; +import test.SimpleBaseTest; + +public class DryRunTest extends SimpleBaseTest { + + @Test + public void testDryRun() { + System.setProperty(RuntimeBehavior.TESTNG_MODE_DRYRUN, "true"); + try { + TestNG tng = create(DryRunSample.class); + TestListenerAdapter listener = new TestListenerAdapter(); + tng.addListener(listener); + tng.run(); + assertThat(listener.getPassedTests()).hasSize(2); + } finally { + System.setProperty(RuntimeBehavior.TESTNG_MODE_DRYRUN, "false"); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/JarFileUtilsTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/JarFileUtilsTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/JarFileUtilsTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/JarFileUtilsTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,170 @@ +package org.testng; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.io.File; +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLClassLoader; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.LinkedList; +import java.util.List; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import org.testng.jarfileutils.JarCreator; +import org.testng.xml.IPostProcessor; +import org.testng.xml.XmlClass; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; + +public class JarFileUtilsTest { + private static File jar = null; + + @BeforeClass + public void generateTestJar() throws IOException { + jar = JarCreator.generateJar(); + } + + @Test + public void testWithValidTestNames() throws MalformedURLException { + JarFileUtils utils = newJarFileUtils(Collections.singletonList("testng-tests-child1")); + runTest( + utils, + 1, + new String[] {"testng-tests-child1"}, + new String[] {"org.testng.jarfileutils.org.testng.SampleTest1"}); + } + + @Test + public void testWithNoTestNames() throws MalformedURLException { + JarFileUtils utils = newJarFileUtils(null); + runTest( + utils, + 3, + new String[] {"testng-tests-child1", "testng-tests-child2", "testng-tests-child3"}, + new String[] { + "org.testng.jarfileutils.org.testng.SampleTest1", + "org.testng.jarfileutils.org.testng.SampleTest2", + "org.testng.jarfileutils.org.testng.SampleTest3" + }); + } + + @Test( + expectedExceptions = TestNGException.class, + expectedExceptionsMessageRegExp = + "\nThe test\\(s\\) <\\[testng-tests-child11\\]> cannot be found.") + public void testWithInvalidTestNames() throws MalformedURLException { + JarFileUtils utils = newJarFileUtils(Collections.singletonList("testng-tests-child11")); + runTest( + utils, + 1, + new String[] {"testng-tests-child1"}, + new String[] {"org.testng.jarfileutils.org.testng.SampleTest1"}); + } + + @Test + public void testWithInvalidXmlFile() throws MalformedURLException { + JarFileUtils utils = + newJarFileUtils( + "invalid-testng-tests.xml", Collections.singletonList("testng-tests-child11")); + runTest( + utils, + 1, + null, + new String[] { + "org.testng.jarfileutils.org.testng.SampleTest1", + "org.testng.jarfileutils.org.testng.SampleTest2", + "org.testng.jarfileutils.org.testng.SampleTest3" + }, + "Jar suite"); + } + + @Test + public void testWithValidTestNamesFromMultiChildSuites() throws MalformedURLException { + JarFileUtils utils = + newJarFileUtils( + Arrays.asList("testng-tests-child2", "testng-tests-child4", "testng-tests-child5")); + String[] expectedTestNames = + new String[] {"testng-tests-child2", "testng-tests-child4", "testng-tests-child5"}; + String[] expectedClassNames = + new String[] { + "org.testng.jarfileutils.org.testng.SampleTest2", + "org.testng.jarfileutils.org.testng.SampleTest4", + "org.testng.jarfileutils.org.testng.SampleTest5" + }; + List suites = utils.extractSuitesFrom(jar); + assertThat(suites).hasSize(3); + XmlSuite suite = suites.get(0); + assertThat(suite.getName()).isEqualTo("testng-tests-suite"); + List testNames = new LinkedList<>(); + List classNames = new LinkedList<>(); + for (XmlSuite xmlSuite : suites) { + extractClassNames(xmlSuite, testNames, classNames); + } + + assertThat(testNames).containsExactly(expectedTestNames); + assertThat(classNames).contains(expectedClassNames); + } + + private static void extractClassNames( + XmlSuite xmlSuite, List testNames, List classNames) { + for (XmlTest xmlTest : xmlSuite.getTests()) { + testNames.add(xmlTest.getName()); + for (XmlClass xmlClass : xmlTest.getXmlClasses()) { + classNames.add(xmlClass.getName()); + } + } + } + + private static void runTest( + JarFileUtils utils, + int numberOfTests, + String[] expectedTestNames, + String[] expectedClassNames) { + runTest(utils, numberOfTests, expectedTestNames, expectedClassNames, "testng-tests-suite"); + } + + private static void runTest( + JarFileUtils utils, + int numberOfTests, + String[] expectedTestNames, + String[] expectedClassNames, + String expectedSuiteName) { + List suites = utils.extractSuitesFrom(jar); + assertThat(suites).hasSize(1); + XmlSuite suite = suites.get(0); + assertThat(suite.getName()).isEqualTo(expectedSuiteName); + assertThat(suite.getTests()).hasSize(numberOfTests); + List testNames = new LinkedList<>(); + List classNames = new LinkedList<>(); + extractClassNames(suite, testNames, classNames); + if (expectedTestNames != null) { + assertThat(testNames).containsExactly(expectedTestNames); + } + assertThat(classNames).contains(expectedClassNames); + } + + public static class FakeProcessor implements IPostProcessor { + + @Override + public Collection process(Collection suites) { + return suites; + } + } + + private static JarFileUtils newJarFileUtils(List testNames) throws MalformedURLException { + return newJarFileUtils("jarfileutils/testng-tests.xml", testNames); + } + + private static JarFileUtils newJarFileUtils(String suiteXmlName, List testNames) + throws MalformedURLException { + URL url = jar.toURI().toURL(); + URLClassLoader classLoader = + new URLClassLoader(new URL[] {url}, ClassLoader.getSystemClassLoader()); + Thread.currentThread().setContextClassLoader(classLoader); + return new JarFileUtils(new FakeProcessor(), suiteXmlName, testNames); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/SampleIModule.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/SampleIModule.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/SampleIModule.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/SampleIModule.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package org.testng; + +import com.google.inject.Module; + +public final class SampleIModule implements IModule { + private static final Module module = binder -> {}; + + @Override + public Module getModule() { + return module; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/ClassHelperTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/ClassHelperTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/ClassHelperTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/ClassHelperTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,151 @@ +package org.testng.internal; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.lang.reflect.Method; +import java.net.URL; +import java.net.URLClassLoader; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Set; +import java.util.UUID; +import org.assertj.core.api.Assertions; +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import org.testng.internal.issue1339.BabyPanda; +import org.testng.internal.issue1339.LittlePanda; +import org.testng.internal.issue1456.TestClassSample; +import org.testng.internal.misamples.AbstractMoves; +import org.testng.internal.misamples.Batman; +import org.testng.internal.misamples.JohnTravoltaMoves; +import org.testng.internal.misamples.MickJagger; +import org.testng.xml.XmlClass; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; + +public class ClassHelperTest { + + @Test + public void testGetAvailableMethods() { + runTest(getExpected(), LittlePanda.class); + } + + @Test + public void testGetAvailableMethodsWhenOverrdingIsInvolved() { + List expected = getExpected("equals", "hashCode", "toString"); + runTest(expected, BabyPanda.class); + } + + @Test + public void testFindClassInSameTest() { + runTest(TestClassSample.class, 1, TestClassSample.class); + } + + @Test + public void testFindClassesInSameTest() { + runTest(TestClassSample.class, 2, TestClassSample.class, BabyPanda.class); + } + + @Test + public void testNoClassDefFoundError() { + URLClassLoader urlClassLoader = + new URLClassLoader(new URL[] {}) { + @Override + public Class loadClass(String name) throws ClassNotFoundException { + throw new NoClassDefFoundError(); + } + }; + ClassHelper.addClassLoader(urlClassLoader); + String fakeClassName = UUID.randomUUID().toString(); + Assert.assertNull( + ClassHelper.forName(fakeClassName), + "The result should be null; no exception should be thrown."); + } + + @Test(dataProvider = "data") + public void testWithDefaultMethodsBeingOverridden( + Class cls, int expectedCount, String... expected) { + Set methods = ClassHelper.getAvailableMethodsExcludingDefaults(cls); + Assertions.assertThat(methods).hasSize(expectedCount); + for (Method m : methods) { + String actual = m.getDeclaringClass().getName() + "." + m.getName(); + Assertions.assertThat(expected).contains(actual); + } + } + + @DataProvider(name = "data") + public Object[][] getTestData() { + return new Object[][] { + {MickJagger.class, 1, MickJagger.class.getName() + ".dance"}, + { + JohnTravoltaMoves.class, + 2, + new String[] { + JohnTravoltaMoves.class.getName() + ".walk", AbstractMoves.class.getName() + ".dance" + } + }, + { + Batman.class, + 3, + new String[] { + Batman.class.getName() + ".fly", + Batman.class.getName() + ".liftWeights", + Batman.class.getName() + ".yellSlogan" + } + } + }; + } + + private static void runTest(Class classToBeFound, int expectedCount, Class... classes) { + XmlSuite xmlSuite = new XmlSuite(); + xmlSuite.setName("xml_suite"); + newXmlTest("test1", xmlSuite, classes); + newXmlTest("test2", xmlSuite, classes); + newXmlTest("test3", xmlSuite, classes); + XmlClass[] xmlClasses = ClassHelper.findClassesInSameTest(classToBeFound, xmlSuite); + assertThat(xmlClasses.length).isEqualTo(expectedCount); + } + + private static void newXmlTest(String testname, XmlSuite xmlSuite, Class... clazz) { + XmlTest xmlTest = new XmlTest(xmlSuite); + xmlTest.setName(testname); + xmlTest.setXmlClasses(newXmlClass(clazz)); + } + + private static List newXmlClass(Class... classes) { + List xmlClasses = new ArrayList<>(); + for (Class clazz : classes) { + xmlClasses.add(new XmlClass(clazz)); + } + return xmlClasses; + } + + private static void runTest(List expected, Class whichClass) { + Set methods = ClassHelper.getAvailableMethods(whichClass); + // Intentionally not using assertEquals because when this test is executed via gradle an + // additional method + // called "jacocoInit()" is getting added, which does not get added when this test is executed + // individually + int size = expected.size(); + Assert.assertTrue( + methods.size() >= size, "Number of methods found should have been atleast " + size); + for (Method method : methods) { + if ("$jacocoInit".equalsIgnoreCase(method.getName())) { + continue; + } + Assert.assertTrue(expected.contains(method.getName())); + } + } + + private static List getExpected(String... additionalMethods) { + String[] defaultMethods = new String[] {"announcer", "announcer", "inheritable", "inheritable"}; + if (additionalMethods == null) { + return Arrays.asList(defaultMethods); + } + List expected = new ArrayList<>(Arrays.asList(defaultMethods)); + expected.addAll(Arrays.asList(additionalMethods)); + return expected; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/ConsoleReporter.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/ConsoleReporter.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/ConsoleReporter.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/ConsoleReporter.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,40 @@ +package org.testng.internal; + +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.List; +import java.util.Map; +import java.util.Set; +import org.testng.*; +import org.testng.xml.XmlSuite; + +public class ConsoleReporter implements IReporter { + + @Override + public void generateReport( + List xmlSuites, List suites, String outputDirectory) { + for (ISuite suite : suites) { + for (Map.Entry testResult : suite.getResults().entrySet()) { + Set results = + testResult.getValue().getTestContext().getFailedTests().getAllResults(); + if (results.isEmpty()) { + continue; + } + System.out.println( + "Failures in :" + suite.getName() + ", :" + testResult.getKey()); + for (ITestResult result : results) { + String c = result.getMethod().getRealClass().getName(); + String m = result.getMethod().getMethodName() + "()"; + System.out.println(c + "." + m); + if (result.getThrowable() != null) { + StringWriter sw = new StringWriter(); + PrintWriter writer = new PrintWriter(sw); + result.getThrowable().printStackTrace(writer); + System.out.println( + String.format("StackTrace:\n %s \n", Utils.filterTrace(sw.toString()))); + } + } + } + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/DynamicGraphHelperTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/DynamicGraphHelperTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/DynamicGraphHelperTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/DynamicGraphHelperTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,259 @@ +package org.testng.internal; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; +import org.testng.ITestClass; +import org.testng.ITestNGMethod; +import org.testng.ITestObjectFactory; +import org.testng.annotations.DataProvider; +import org.testng.annotations.IAnnotation; +import org.testng.annotations.ITestAnnotation; +import org.testng.annotations.Test; +import org.testng.collections.Lists; +import org.testng.collections.Maps; +import org.testng.collections.Sets; +import org.testng.internal.annotations.AnnotationHelper; +import org.testng.internal.annotations.DefaultAnnotationTransformer; +import org.testng.internal.annotations.IAnnotationFinder; +import org.testng.internal.annotations.JDK15AnnotationFinder; +import org.testng.internal.dynamicgraph.FactoryTestClassSample; +import org.testng.internal.dynamicgraph.FakeTestClass; +import org.testng.internal.dynamicgraph.FakeWrappedFactoryMethod; +import org.testng.internal.dynamicgraph.HardDependencyTestClassSample; +import org.testng.internal.dynamicgraph.HardDependencyViaGroupsTestClassSample; +import org.testng.internal.dynamicgraph.IndependentTestClassSample; +import org.testng.internal.dynamicgraph.SequentialClassA; +import org.testng.internal.dynamicgraph.SequentialClassB; +import org.testng.internal.dynamicgraph.SoftDependencyTestClassSample; +import org.testng.internal.dynamicgraph.testpackage.PackageTestClassA; +import org.testng.internal.dynamicgraph.testpackage.PackageTestClassBAbstract; +import org.testng.internal.dynamicgraph.testpackage.PackageTestClassBB; +import org.testng.internal.objects.InstanceCreator; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.SimpleBaseTest; + +public class DynamicGraphHelperTest extends SimpleBaseTest { + + private static final IAnnotationFinder finder = + new JDK15AnnotationFinder(new DefaultAnnotationTransformer()); + + @Test + public void testCreateDynamicGraphAllIndependent() { + DynamicGraph graph = newGraph(IndependentTestClassSample.class); + assertThat(graph.getFreeNodes()).hasSize(2); + assertThat(graph.getEdges()).isEmpty(); + } + + @Test(dataProvider = "getDependencyData") + public void testCreateDynamicGraphWithDependency(Class clazz) { + DynamicGraph graph = newGraph(clazz); + assertThat(graph.getFreeNodes()).hasSize(1); + Map edges = searchForMethod("b", graph); + assertThat(edges).hasSize(1); + edges = searchForMethod("a", graph); + assertThat(edges).isEmpty(); + } + + @Test(dataProvider = "getSoftDependencyData") + public void testCreateDynamicGraphWithSoftDependency(Class clazz) { + DynamicGraph graph = newGraph(clazz); + assertThat(graph.getFreeNodes()).hasSize(2); + Map edges = searchForMethod("b", graph); + assertThat(edges).isEmpty(); + edges = searchForMethod("a", graph); + assertThat(edges).isEmpty(); + } + + @DataProvider(name = "getDependencyData") + public Object[][] getDependencyData() { + return new Object[][] { + {HardDependencyTestClassSample.class}, {HardDependencyViaGroupsTestClassSample.class} + }; + } + + @DataProvider(name = "getSoftDependencyData") + public Object[][] getSoftDependencyData() { + return new Object[][] {{SoftDependencyTestClassSample.class}}; + } + + @Test + public void testCreateDynamicGraphWithPreserveOrderAndNoParallelism() { + Class[] classes = new Class[] {SequentialClassA.class, SequentialClassB.class}; + XmlTest xmlTest = createXmlTest("suite", "test", classes); + xmlTest.setPreserveOrder(true); + xmlTest.setParallel(XmlSuite.ParallelMode.NONE); + DynamicGraph graph = newGraph(xmlTest, classes); + List methodNames = + Arrays.asList("testMethodOneSequentialClassB", "testMethodTwoSequentialClassB"); + for (String methodName : methodNames) { + Map edges = searchForMethod(methodName, graph); + assertThat(extractDestinationInfoFromEdge(edges)) + .contains("testMethodOneSequentialClassA", "testMethodTwoSequentialClassA"); + } + } + + @Test + public void testCreateDynamicGraphWithGroupByInstances() { + Class[] classes = new Class[] {FactoryTestClassSample.class}; + XmlTest xmlTest = createXmlTest("suite", "test", classes); + xmlTest.setGroupByInstances(true); + ITestNGMethod[] methods = methods(ITestAnnotation.class, xmlTest, classes); + List methodList = Lists.newLinkedList(); + List objects = Lists.newLinkedList(); + objects.add(new FactoryTestClassSample("one")); + objects.add(new FactoryTestClassSample("two")); + for (FactoryTestClassSample object : objects) { + for (ITestNGMethod method : methods) { + methodList.add(new FakeWrappedFactoryMethod(method, object)); + } + } + ITestNGMethod[] allMethods = methodList.toArray(new ITestNGMethod[0]); + for (Class clazz : classes) { + ITestClass testClass = new FakeTestClass(clazz); + List tstMethods = Lists.newArrayList(); + MethodHelper.fixMethodsWithClass(allMethods, testClass, tstMethods); + } + + DynamicGraph graph = DynamicGraphHelper.createDynamicGraph(allMethods, xmlTest); + Map edges = searchForMethod("testMethod", graph, "two"); + Set actualObjectIds = Sets.newHashSet(); + List actualMethodNames = Lists.newLinkedList(); + for (ITestNGMethod to : edges.keySet()) { + actualObjectIds.add(to.getInstance().toString()); + actualMethodNames.add(to.getMethodName()); + } + assertThat(actualObjectIds).containsExactly("one"); + assertThat(actualMethodNames).contains("testMethod", "anotherTestMethod"); + } + + @DataProvider + public Object[][] classesFromPackage() { + return new Object[][] { + { + new Class[] { + PackageTestClassA.class, PackageTestClassBAbstract.class, PackageTestClassBB.class + } + }, + {new Class[] {PackageTestClassA.class, PackageTestClassBB.class}} + }; + } + + @Test(dataProvider = "classesFromPackage") + public void testCreateDynamicGraphWithPackageWithAbstractClassPreserveOrderTrue( + Class[] classes) { + XmlTest xmlTest = createXmlTest("2249_suite", "2249_test", classes); + xmlTest.setPreserveOrder(true); + DynamicGraph graph = newGraph(xmlTest, classes); + assertThat( + graph.getFreeNodes().stream() + .map(ITestNGMethod::getMethodName) + .collect(Collectors.toList())) + .containsExactly("a1", "a2"); + } + + @Test(dataProvider = "classesFromPackage") + public void testCreateDynamicGraphWithPackageWithoutAbstractClass(Class[] classes) { + XmlTest xmlTest = createXmlTest("2249_suite", "2249_test", classes); + xmlTest.setPreserveOrder(false); + DynamicGraph graph = newGraph(xmlTest, classes); + assertThat( + graph.getFreeNodes().stream() + .map(ITestNGMethod::getMethodName) + .collect(Collectors.toList())) + .containsExactly("a1", "a2", "b2", "b1"); + } + + private static List extractDestinationInfoFromEdge(Map edges) { + List destinations = Lists.newLinkedList(); + for (ITestNGMethod to : edges.keySet()) { + destinations.add(to.getMethodName()); + } + return destinations; + } + + private static Map searchForMethod( + String methodName, DynamicGraph graph) { + return searchForMethod(methodName, graph, null); + } + + private static Map searchForMethod( + String methodName, DynamicGraph graph, Object instance) { + for (Map.Entry> edge : graph.getEdges().entrySet()) { + if (edge.getKey().getMethodName().equals(methodName) + && (instance == null + || edge.getKey().getInstance().toString().equals(instance.toString()))) { + return edge.getValue(); + } + } + return Maps.newHashMap(); + } + + private static DynamicGraph newGraph(Class... classes) { + XmlTest xmlTest = createXmlTest("suite", "test", classes); + return newGraph(xmlTest, classes); + } + + private static DynamicGraph newGraph(XmlTest xmlTest, Class... classes) { + ITestNGMethod[] methods = methods(ITestAnnotation.class, xmlTest, classes); + return DynamicGraphHelper.createDynamicGraph(methods, xmlTest); + } + + private static ITestNGMethod[] methods( + Class annotationClass, XmlTest xmlTest, Class... classes) { + List allMethods = Lists.newArrayList(); + for (Class clazz : classes) { + List tstMethods = associateInstanceToMethods(clazz, xmlTest, annotationClass); + allMethods.addAll(tstMethods); + } + return allMethods.toArray(new ITestNGMethod[0]); + } + + private static List associateInstanceToMethods( + Class clazz, XmlTest xmlTest, Class annotationClass) { + ITestClass testClass = new FakeTestClass(clazz); + ITestNGMethod[] rawMethods = methods(clazz, xmlTest, annotationClass); + Object object = newInstance(clazz); + List fixedMethods = Lists.newArrayList(); + if (object == null) { + // Looks like there was a non default constructor on the class (maybe because its driven by a + // factory) + // So lets not try to associate the instance. We will use the method as is. + fixedMethods.addAll(Arrays.asList(rawMethods)); + } else { + for (ITestNGMethod each : rawMethods) { + ITestNGMethod m = + new TestNGMethod( + new ITestObjectFactory() {}, + each.getConstructorOrMethod().getMethod(), + finder, + xmlTest, + object); + fixedMethods.add(m); + } + } + List tstMethods = Lists.newArrayList(); + MethodHelper.fixMethodsWithClass( + fixedMethods.toArray(new ITestNGMethod[0]), testClass, tstMethods); + return tstMethods; + } + + private static Object newInstance(Class clazz) { + try { + return InstanceCreator.newInstance(clazz); + } catch (Exception e) { + return null; + } + } + + private static ITestNGMethod[] methods( + Class clazz, XmlTest xmlTest, Class annotationClass) { + return AnnotationHelper.findMethodsWithAnnotation( + new ITestObjectFactory() {}, clazz, annotationClass, finder, xmlTest); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/DynamicGraphTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/DynamicGraphTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/DynamicGraphTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/DynamicGraphTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,428 @@ +package org.testng.internal; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import org.testng.Assert; +import org.testng.IDynamicGraph; +import org.testng.IDynamicGraph.Status; +import org.testng.ITestNGMethod; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.collections.ListMultiMap; +import org.testng.collections.Lists; +import org.testng.collections.Maps; +import org.testng.internal.dynamicgraph.EdgeWeightTestSample1; +import org.testng.internal.dynamicgraph.EdgeWeightTestSample2; +import org.testng.internal.dynamicgraph.LotsOfEdgesTest; +import org.testng.xml.XmlSuite; +import test.InvokedMethodNameListener; +import test.SimpleBaseTest; +import test.TestClassContainerForGitHubIssue1360; + +public class DynamicGraphTest extends SimpleBaseTest { + + private static class Node { + private final String name; + + private Node(String name) { + this.name = name; + } + + @Override + public String toString() { + return name; + } + } + + @SafeVarargs + private static void assertFreeNodesEquals(IDynamicGraph graph, T... expected) { + assertFreeNodesEquals(graph, Arrays.asList(expected)); + } + + private static void assertFreeNodesEquals(IDynamicGraph graph, List expected) { + // Compare free nodes using isEqualTo instead of containsOnly as we care about ordering too. + assertThat(graph.getFreeNodes()).isEqualTo(expected); + } + + @Test + public void test8() { + /* + digraph test8 { + a1; + a2; + b1 -> {a1; a2;} + b2 -> {a1; a2;} + c1 -> {b1; b2;} + x; + y; + } + */ + DynamicGraph dg = new DynamicGraph<>(); + Node a1 = new Node("a1"); + Node a2 = new Node("a2"); + Node b1 = new Node("b1"); + Node b2 = new Node("b2"); + Node c1 = new Node("c1"); + dg.addNode(a1); + dg.addNode(a2); + dg.addNode(b1); + dg.addNode(b2); + dg.addNode(c1); + dg.addEdges(1, b1, Arrays.asList(a1, a2)); + dg.addEdges(1, b2, Arrays.asList(a1, a2)); + dg.addEdges(1, c1, Arrays.asList(b1, b2)); + dg.addEdges(0, a2, Arrays.asList(a1, b1, c1)); + dg.addEdges(0, b2, Arrays.asList(a1, b1, c1)); + Node x = new Node("x"); + Node y = new Node("y"); + dg.addNode(x); + dg.addNode(y); + dg.addEdges(0, a1, Arrays.asList(x, y)); + dg.addEdges(0, b1, Arrays.asList(x, y)); + dg.addEdges(0, c1, Arrays.asList(x, y)); + + assertFreeNodesEquals(dg, x, y); + + dg.setStatus(dg.getFreeNodes(), Status.RUNNING); + assertFreeNodesEquals(dg); + dg.setStatus(x, Status.FINISHED); + dg.setStatus(y, Status.FINISHED); + assertFreeNodesEquals(dg, a1); + + dg.setStatus(a1, Status.RUNNING); + assertFreeNodesEquals(dg); + dg.setStatus(a1, Status.FINISHED); + assertFreeNodesEquals(dg, a2); + + dg.setStatus(a2, Status.RUNNING); + assertFreeNodesEquals(dg); + dg.setStatus(a2, Status.FINISHED); + assertFreeNodesEquals(dg, b1); + + dg.setStatus(b1, Status.RUNNING); + assertFreeNodesEquals(dg); + dg.setStatus(b1, Status.FINISHED); + assertFreeNodesEquals(dg, b2); + + dg.setStatus(b2, Status.RUNNING); + assertFreeNodesEquals(dg); + dg.setStatus(b2, Status.FINISHED); + assertFreeNodesEquals(dg, c1); + } + + @Test + public void test2() { + /* + digraph test2 { + a1; + a2; + b1 -> {a1; a2;} + x; + } + */ + DynamicGraph dg = new DynamicGraph<>(); + Node a1 = new Node("a1"); + Node a2 = new Node("a2"); + Node b1 = new Node("b1"); + dg.addNode(a1); + dg.addNode(a2); + dg.addNode(b1); + dg.addEdges(1, b1, Arrays.asList(a1, a2)); + dg.addEdges(0, a2, Arrays.asList(a1, b1)); + Node x = new Node("x"); + dg.addNode(x); + dg.addEdge(0, a1, x); + dg.addEdge(0, b1, x); + + assertFreeNodesEquals(dg, x); + + dg.setStatus(x, Status.RUNNING); + assertFreeNodesEquals(dg); + dg.setStatus(x, Status.FINISHED); + assertFreeNodesEquals(dg, a1); + + dg.setStatus(a1, Status.RUNNING); + assertFreeNodesEquals(dg); + dg.setStatus(a1, Status.FINISHED); + assertFreeNodesEquals(dg, a2); + + dg.setStatus(a2, Status.RUNNING); + assertFreeNodesEquals(dg); + dg.setStatus(a2, Status.FINISHED); + assertFreeNodesEquals(dg, b1); + + Node b2 = new Node("b2"); // 2 + dg.setStatus(b2, Status.RUNNING); + dg.setStatus(b1, Status.FINISHED); + assertFreeNodesEquals(dg); + } + + @Test + public void test3() { + DynamicGraph dg = new DynamicGraph<>(); + Node a = new Node("a"); + Node b = new Node("b"); + Node c = new Node("c"); + dg.addNode(a); + dg.addNode(b); + dg.addNode(c); + dg.addEdge(1, a, b); + dg.addEdge(0, c, b); + dg.addEdge(0, b, a); + + assertFreeNodesEquals(dg, b); + + dg.setStatus(b, Status.RUNNING); + assertFreeNodesEquals(dg); + dg.setStatus(b, Status.FINISHED); + assertFreeNodesEquals(dg, a); + + dg.setStatus(a, Status.RUNNING); + assertFreeNodesEquals(dg); + dg.setStatus(a, Status.FINISHED); + assertFreeNodesEquals(dg, c); + + dg.setStatus(c, Status.RUNNING); + assertFreeNodesEquals(dg); + dg.setStatus(c, Status.FINISHED); + assertFreeNodesEquals(dg); + } + + @Test + public void test4() { + DynamicGraph dg = new DynamicGraph<>(); + Node a = new Node("a"); + Node b = new Node("b"); + dg.addNode(a); + dg.addNode(b); + dg.addEdge(0, b, a); + + assertFreeNodesEquals(dg, a); + + dg.setStatus(a, Status.RUNNING); + assertFreeNodesEquals(dg); + + dg.setStatus(a, Status.FINISHED); + assertFreeNodesEquals(dg, b); + + dg.setStatus(b, Status.RUNNING); + assertFreeNodesEquals(dg); + + dg.setStatus(b, Status.FINISHED); + assertFreeNodesEquals(dg); + } + + @Test + public void testOrderingOfEdgesWithSameWeight() { + Class[] classes = + new Class[] { + TestClassContainerForGitHubIssue1360.TestNG1.class, + TestClassContainerForGitHubIssue1360.TestNG2.class, + TestClassContainerForGitHubIssue1360.TestNG3.class + }; + List methods = extractTestNGMethods(classes); + DynamicGraph graph = new DynamicGraph<>(); + + ListMultiMap methodsByPriority = Maps.newListMultiMap(); + for (ITestNGMethod method : methods) { + methodsByPriority.put(method.getPriority(), method); + graph.addNode(method); + } + List availablePriorities = Lists.newArrayList(methodsByPriority.keySet()); + Collections.sort(availablePriorities); + Integer previousPriority = methods.size() > 0 ? availablePriorities.get(0) : 0; + for (int i = 1; i < availablePriorities.size(); i++) { + Integer currentPriority = availablePriorities.get(i); + for (ITestNGMethod p0Method : methodsByPriority.get(previousPriority)) { + for (ITestNGMethod p1Method : methodsByPriority.get(currentPriority)) { + graph.addEdge(1, p1Method, p0Method); + } + } + previousPriority = currentPriority; + } + List expected = + Arrays.asList("TestNG1.test1TestNG1", "TestNG2.test1TestNG2", "TestNG3.test1TestNG3"); + runAssertion(graph, expected); + expected = + Arrays.asList("TestNG1.test2TestNG1", "TestNG2.test2TestNG2", "TestNG3.test2TestNG3"); + runAssertion(graph, expected); + + expected = + Arrays.asList("TestNG1.test3TestNG1", "TestNG2.test3TestNG2", "TestNG3.test3TestNG3"); + runAssertion(graph, expected); + } + + @Test + public void edgeWeightTest1() { + List expectedOrder1 = Arrays.asList("t1", "t2", "t3"); + TestNG tng = create(EdgeWeightTestSample1.class); + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener(listener); + tng.run(); + Assert.assertEquals(listener.getSucceedMethodNames(), expectedOrder1); + } + + @Test + public void edgeWeightTest2() { + List expectedOrder2 = Arrays.asList("t1", "t2", "t3", "t4", "t5"); + TestNG tng = create(EdgeWeightTestSample2.class); + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener(listener); + tng.run(); + Assert.assertEquals(listener.getSucceedMethodNames(), expectedOrder2); + } + + private static void runAssertion(IDynamicGraph graph, List expected) { + List p1Methods = graph.getFreeNodes(); + Assert.assertEquals(p1Methods.size(), 3); + graph.setStatus(p1Methods, Status.FINISHED); + for (ITestNGMethod p1Method : p1Methods) { + Assert.assertTrue(expected.contains(constructName(p1Method))); + } + } + + private static String constructName(ITestNGMethod method) { + return method.getConstructorOrMethod().getDeclaringClass().getSimpleName() + + "." + + method.getMethodName(); + } + + @Test + public void testDuplicationFunctionality() { + XmlSuite suite = createXmlSuite("suite", "test", TestClassSample.class); + TestNG testng = create(suite); + MethodMultiplyingInterceptor tla = new MethodMultiplyingInterceptor(); + testng.addListener(tla); + testng.run(); + int expected = tla.getMultiplyCount() + tla.getOriginalMethodCount(); + assertThat(tla.getPassedTests().size()).isEqualTo(expected); + } + + @Test(expectedExceptions = IllegalStateException.class) + public void testPreventCycles() { + // Cycles having the same weight should throw an IllegalStateException immediately. + DynamicGraph dg = new DynamicGraph<>(); + dg.addEdge(0, "a", "b"); + dg.addEdge(0, "b", "a"); + } + + @Test + public void testAllowedCycles() { + // Cycles with differing weights are explicitly allowed as the graph will discard the lowest + // weighted edge in + // order to free up the cycle. + DynamicGraph dg = new DynamicGraph<>(); + dg.addEdge(0, "a", "b"); + + // Different weight is allowed + dg.addEdge(1, "b", "a"); + } + + @Test + public void testGainWeight() { + DynamicGraph dg = new DynamicGraph<>(); + dg.addEdge(1, "a", "b"); + assertThat(dg.getEdges().values().size()).isEqualTo(1); + assertThat(dg.getEdges().get("a").get("b")).isEqualTo(1); + + // Duplicated edge, but with lower weight + dg.addEdge(0, "a", "b"); + + // Should only be one edge with same weight + assertThat(dg.getEdges().values().size()).isEqualTo(1); + assertThat(dg.getEdges().get("a").get("b")).isEqualTo(1); + + // Duplicated edge, but with higher weight + dg.addEdge(2, "a", "b"); + + // Should only be one edge with weight of 2 now. + assertThat(dg.getEdges().values().size()).isEqualTo(1); + assertThat(dg.getEdges().get("a").get("b")).isEqualTo(2); + } + + /** + * Inefficient algorithms within DynamicGraph can quickly make the execution time explode. This + * test puts some minimal limits on the time it takes to process the graph. At the time of the + * addition of this test, it took less than 100ms to execute. 2000ms gives enough headroom to + * prevent flaky failures because of external conditions such as slower or lower CPU resources. + */ + @Test(timeOut = 2000) + public void testLotsOfEdges() { + // https://github.com/cbeust/testng/issues/1710 + TestNG tng = create(LotsOfEdgesTest.class); + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener(listener); + tng.run(); + } + + /** + * Test that DynamicGraph correctly handles selecting free nodes so that independent nodes can be + * processed in parallel. + */ + @Test + public void testParallel() { + DynamicGraph dg = new DynamicGraph<>(); + List fizz = Lists.newArrayList(); + List buzz = Lists.newArrayList(); + List fizzBuzz = Lists.newArrayList(); + List other = Lists.newArrayList(); + + for (int i = 0; i < 100; i++) { + dg.addNode(i); + + if (i % 15 == 0) { + fizzBuzz.add(i); + } else if (i % 5 == 0) { + buzz.add(i); + } else if (i % 3 == 0) { + fizz.add(i); + } else { + other.add(i); + } + } + + // Fizzbuzz based dependencies – fizz depends on other, buzz depends on fizz, fizzbuzz depends + // on buzz. + for (Integer f : fizz) { + for (Integer o : other) { + dg.addEdge(0, f, o); + } + } + + for (Integer b : buzz) { + for (Integer f : fizz) { + dg.addEdge(0, b, f); + } + } + + for (Integer fb : fizzBuzz) { + for (Integer b : buzz) { + dg.addEdge(0, fb, b); + } + } + + // other is ready + assertFreeNodesEquals(dg, other); + dg.setStatus(other, Status.FINISHED); + + // fizz is ready + assertFreeNodesEquals(dg, fizz); + dg.setStatus(fizz, Status.FINISHED); + + // buzz is ready + assertFreeNodesEquals(dg, buzz); + dg.setStatus(buzz, Status.FINISHED); + + // fizzbuzz is ready + assertFreeNodesEquals(dg, fizzBuzz); + dg.setStatus(fizzBuzz, Status.FINISHED); + + // all done + assertThat(dg.getFreeNodes()).isEmpty(); + assertThat(dg.getNodeCountWithStatus(Status.READY)).isEqualTo(0); + assertThat(dg.getNodeCountWithStatus(Status.FINISHED)).isEqualTo(100); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/GroupsHelperTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/GroupsHelperTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/GroupsHelperTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/GroupsHelperTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,48 @@ +package org.testng.internal; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import org.testng.collections.Maps; + +public class GroupsHelperTest { + + @Test + public void testCreateGroupsWithoutMetaGroups() { + Map expected = Maps.newHashMap(); + expected.put("foo", "foo"); + Map actual = + GroupsHelper.createGroups(Collections.emptyMap(), Collections.singletonList("foo")); + assertThat(actual).containsAllEntriesOf(expected); + } + + @Test(dataProvider = "getTestData") + public void testCreateGroupsWithMetaGroups( + String metaGrpName, List grpName, Map expected) { + Map> metaGroups = Maps.newHashMap(); + metaGroups.put(metaGrpName, Collections.singletonList(metaGrpName)); + Map actual = GroupsHelper.createGroups(metaGroups, grpName); + assertThat(actual).containsAllEntriesOf(expected); + } + + @DataProvider(name = "getTestData") + public Object[][] getTestData() { + return new Object[][] { + {"bar", Collections.singletonList("foo"), constructExpectedMap("foo")}, + {"bar", Arrays.asList("foo", "bar"), constructExpectedMap("foo", "bar")} + }; + } + + private static Map constructExpectedMap(String... keys) { + Map map = Maps.newHashMap(); + for (String key : keys) { + map.put(key, key); + } + return map; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/MethodHelperTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/MethodHelperTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/MethodHelperTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/MethodHelperTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,44 @@ +package org.testng.internal; + +import org.testng.ITestNGMethod; +import org.testng.ITestObjectFactory; +import org.testng.Reporter; +import org.testng.TestNGException; +import org.testng.annotations.Test; +import org.testng.internal.annotations.IAnnotationFinder; +import org.testng.internal.annotations.JDK15AnnotationFinder; +import org.testng.internal.issue2195.TestClass; +import test.tmp.AnnotationTransformer; + +public class MethodHelperTest { + + @Test(expectedExceptions = {TestNGException.class}) + public void findDependedUponMethods() throws NoSuchMethodException { + + TestClass testClass = new TestClass(); + ConstructorOrMethod constructorOrMethod = + new ConstructorOrMethod(testClass.getClass().getMethod("dummyMethod")); + IAnnotationFinder annotationFinder = new JDK15AnnotationFinder(new AnnotationTransformer()); + ITestNGMethod method = + new ConfigurationMethod( + new ITestObjectFactory() {}, + constructorOrMethod, + annotationFinder, + false, + false, + false, + false, + false, + false, + true, + false, + new String[0], + new String[0], + Reporter.getCurrentTestResult().getTestContext().getCurrentXmlTest(), + testClass); + method.addMethodDependedUpon("dummyDependsOnMethod"); + ITestNGMethod[] methods = new ITestNGMethod[0]; + + MethodHelper.findDependedUponMethods(method, methods); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/MethodInstanceTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/MethodInstanceTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/MethodInstanceTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/MethodInstanceTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,545 @@ +package org.testng.internal; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.concurrent.Callable; +import org.testng.Assert; +import org.testng.IClass; +import org.testng.IRetryAnalyzer; +import org.testng.ITestClass; +import org.testng.ITestNGMethod; +import org.testng.ITestResult; +import org.testng.annotations.Test; +import org.testng.xml.XmlClass; +import org.testng.xml.XmlInclude; +import org.testng.xml.XmlTest; + +/** + * Unit tests for {@link MethodInstance}. + * + * @author Andreas Kluth + */ +public class MethodInstanceTest { + + public static void main(String[] args) { + new MethodInstanceTest().sortByIndexSatisfiesContract(); + } + + @Test + public void sortByIndexSatisfiesContract() { + + // Build a list of entries imposing the same behavior as the live suite, reduced to the + // minimum to create the same condition. + List methods = new ArrayList<>(); + methods.add(buildMethodInstance("unittests", "StateTest", 1, "aCategorization")); + methods.add(buildMethodInstance("unittests", "StateTest", 1, "bCategorization")); + methods.add(buildMethodInstance("unittests", "StateTest", 1, "cCategorization")); + methods.add(buildMethodInstance("unittests", "StateTest", 1, "dCategorization")); + methods.add(buildMethodInstance("unittests", "StateTest", 1, "eCategorization")); + methods.add(buildMethodInstance("unittests", "StateTest", 1, "fCategorization")); + methods.add(buildMethodInstance("unittests", "StatusTest", 2, "aStatus")); + methods.add(buildTestNgFactoryMethodInstance("unittests")); + methods.add(buildTestNgFactoryMethodInstance("unittests")); + methods.add(buildTestNgFactoryMethodInstance("unittests")); + methods.add(buildTestNgFactoryMethodInstance("unittests")); + methods.add(buildTestNgFactoryMethodInstance("unittests")); + methods.add(buildTestNgFactoryMethodInstance("unittests")); + methods.add(buildTestNgFactoryMethodInstance("unittests")); + methods.add(buildTestNgFactoryMethodInstance("unittests")); + methods.add(buildTestNgFactoryMethodInstance("unittests")); + methods.add(buildTestNgFactoryMethodInstance("unittests")); + methods.add(buildMethodInstance("unittests", "ChangeTest", 3, "aChangeTest")); + methods.add(buildMethodInstance("unittests", "ChangeTest", 3, "bChangeTest")); + methods.add(buildMethodInstance("unittests", "ChangeTest", 3, "cChangeTest")); + methods.add(buildMethodInstance("unittests", "ChangeTest", 3, "dChangeTest")); + methods.add(buildMethodInstance("unittests", "ChangeTest", 3, "eChangeTest")); + methods.add(buildMethodInstance("unittests", "ChangeTest", 3, "fChangeTest")); + methods.add(buildMethodInstance("unittests", "ChangeTest", 3, "gChangeTest")); + methods.add(buildMethodInstance("unittests", "ChangeTest", 3, "eChangeTest")); + methods.add(buildMethodInstance("unittests", "ChangeTest", 3, "hChangeTest")); + methods.add(buildMethodInstance("unittests", "ChangeTest", 3, "iChangeTest")); + methods.add(buildMethodInstance("unittests", "IdentifierClassTest", 4, "aIdentifier")); + methods.add(buildMethodInstance("unittests", "IdentifierClassTest", 4, "bIdentifier")); + methods.add(buildMethodInstance("unittests", "StatisticsTest", 0, "aStatistics")); + methods.add(buildMethodInstance("unittests", "StatisticsTest", 0, "bStatistics")); + methods.add(buildMethodInstance("unittests", "StatisticsTest", 0, "cStatistics")); + + try { + methods.sort(MethodInstance.SORT_BY_INDEX); + } catch (IllegalArgumentException ex) { + Assert.fail("Comparison method violates its general contract!"); + } + } + + private MethodInstance buildTestNgFactoryMethodInstance(String xmlTestName) { + TestClassStub testClass = new TestClassStub(new XmlTestStub(xmlTestName), null); + return new MethodInstance(new TestNGMethodStub(null, testClass)); + } + + private MethodInstance buildMethodInstance( + String xmlTestName, String xmlClassName, int xmlClassIndex, String methodName) { + TestClassStub testClass = + new TestClassStub( + new XmlTestStub(xmlTestName), new XmlClassStub(xmlClassName, xmlClassIndex)); + return new MethodInstance(new TestNGMethodStub(methodName, testClass)); + } + + public static class XmlClassStub extends XmlClass { + + private int index; + private String name; + + public XmlClassStub(String name, int index) { + this.name = name; + this.index = index; + } + + @Override + public String getName() { + return name; + } + + @Override + public int getIndex() { + return index; + } + + @Override + public List getIncludedMethods() { + return Collections.emptyList(); + } + } + + public static class XmlTestStub extends XmlTest { + + private String name; + + public XmlTestStub(String name) { + this.name = name; + } + + @Override + public String getName() { + return name; + } + } + + public static class TestClassStub implements ITestClass { + + private XmlTest xmlTest; + private XmlClass xmlClass; + + public TestClassStub(XmlTest xmlTest, XmlClass xmlClass) { + this.xmlTest = xmlTest; + this.xmlClass = xmlClass; + } + + @Override + public String getName() { + return null; + } + + @Override + public XmlTest getXmlTest() { + return xmlTest; + } + + @Override + public XmlClass getXmlClass() { + return xmlClass; + } + + @Override + public String getTestName() { + return null; + } + + @Override + public Class getRealClass() { + return xmlClass.getSupportClass(); + } + + @Override + public void addInstance(Object instance) {} + + @Override + public Object[] getInstances(boolean reuse) { + return null; + } + + @Override + public long[] getInstanceHashCodes() { + return null; + } + + @Override + public ITestNGMethod[] getTestMethods() { + return new ITestNGMethod[0]; + } + + @Override + public ITestNGMethod[] getBeforeTestMethods() { + return new ITestNGMethod[0]; + } + + @Override + public ITestNGMethod[] getAfterTestMethods() { + return new ITestNGMethod[0]; + } + + @Override + public ITestNGMethod[] getBeforeClassMethods() { + return new ITestNGMethod[0]; + } + + @Override + public ITestNGMethod[] getAfterClassMethods() { + return new ITestNGMethod[0]; + } + + @Override + public ITestNGMethod[] getBeforeSuiteMethods() { + return new ITestNGMethod[0]; + } + + @Override + public ITestNGMethod[] getAfterSuiteMethods() { + return new ITestNGMethod[0]; + } + + @Override + public ITestNGMethod[] getBeforeTestConfigurationMethods() { + return new ITestNGMethod[0]; + } + + @Override + public ITestNGMethod[] getAfterTestConfigurationMethods() { + return new ITestNGMethod[0]; + } + + @Override + public ITestNGMethod[] getBeforeGroupsMethods() { + return new ITestNGMethod[0]; + } + + @Override + public ITestNGMethod[] getAfterGroupsMethods() { + return new ITestNGMethod[0]; + } + } + + public static class TestNGMethodStub implements ITestNGMethod { + + private TestClassStub testClassStub; + private String methodName; + + public TestNGMethodStub(String methodName, TestClassStub testClassStub) { + this.methodName = methodName; + this.testClassStub = testClassStub; + } + + @Override + public ITestNGMethod clone() { + return (TestNGMethodStub) this; + } + + @Override + public Class getRealClass() { + return null; + } + + @Override + public ITestClass getTestClass() { + return testClassStub; + } + + @Override + public void setTestClass(ITestClass cls) {} + + @Override + public String getMethodName() { + return methodName; + } + + @Override + public Object getInstance() { + return null; + } + + @Override + public long[] getInstanceHashCodes() { + return null; + } + + @Override + public String[] getGroups() { + return null; + } + + @Override + public String[] getGroupsDependedUpon() { + return null; + } + + @Override + public String getMissingGroup() { + return null; + } + + @Override + public void setMissingGroup(String group) {} + + @Override + public String[] getBeforeGroups() { + return null; + } + + @Override + public String[] getAfterGroups() { + return null; + } + + @Override + public String[] getMethodsDependedUpon() { + return null; + } + + @Override + public void addMethodDependedUpon(String methodName) {} + + @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 void setTimeOut(long timeOut) {} + + @Override + public int getInvocationCount() { + return 0; + } + + @Override + public void setInvocationCount(int count) {} + + @Override + public void setMoreInvocationChecker(Callable moreInvocationChecker) {} + + @Override + public boolean hasMoreInvocation() { + return false; + } + + @Override + public int getSuccessPercentage() { + return 0; + } + + @Override + public String getId() { + return null; + } + + @Override + public void setId(String id) {} + + @Override + public long getDate() { + return 0; + } + + @Override + public void setDate(long date) {} + + @Override + public boolean canRunFromClass(IClass testClass) { + return false; + } + + @Override + public boolean isAlwaysRun() { + return false; + } + + @Override + public int getThreadPoolSize() { + return 0; + } + + @Override + public void setThreadPoolSize(int threadPoolSize) {} + + @Override + public boolean getEnabled() { + return false; + } + + @Override + public String getDescription() { + return null; + } + + @Override + public void setDescription(String description) {} + + @Override + public void incrementCurrentInvocationCount() {} + + @Override + public int getCurrentInvocationCount() { + return 0; + } + + @Override + public void setParameterInvocationCount(int n) {} + + @Override + public int getParameterInvocationCount() { + return 0; + } + + @Override + public IRetryAnalyzer getRetryAnalyzer(ITestResult result) { + return null; + } + + @Override + public Class getRetryAnalyzerClass() { + return null; + } + + @Override + public void setRetryAnalyzerClass(Class clazz) {} + + @Override + public boolean skipFailedInvocations() { + return false; + } + + @Override + public void setSkipFailedInvocations(boolean skip) {} + + @Override + public long getInvocationTimeOut() { + return 0; + } + + @Override + public boolean ignoreMissingDependencies() { + return false; + } + + @Override + public void setIgnoreMissingDependencies(boolean ignore) {} + + @Override + public List getInvocationNumbers() { + return null; + } + + @Override + public void setInvocationNumbers(List numbers) {} + + @Override + public void addFailedInvocationNumber(int number) {} + + @Override + public List getFailedInvocationNumbers() { + return null; + } + + @Override + public int getPriority() { + return 0; + } + + @Override + public void setPriority(int priority) {} + + @Override + public int getInterceptedPriority() { + return 0; + } + + @Override + public void setInterceptedPriority(int priority) {} + + @Override + public XmlTest getXmlTest() { + return null; + } + + @Override + public ConstructorOrMethod getConstructorOrMethod() { + return null; + } + + @Override + public Map findMethodParameters(XmlTest test) { + return null; + } + + @Override + public String getQualifiedName() { + return getRealClass().getName() + "." + getMethodName(); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/MethodMultiplyingInterceptor.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/MethodMultiplyingInterceptor.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/MethodMultiplyingInterceptor.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/MethodMultiplyingInterceptor.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,45 @@ +package org.testng.internal; + +import java.util.List; +import org.testng.IMethodInstance; +import org.testng.IMethodInterceptor; +import org.testng.ITestContext; +import org.testng.TestListenerAdapter; +import org.testng.collections.Lists; + +public class MethodMultiplyingInterceptor extends TestListenerAdapter + implements IMethodInterceptor { + private int originalMethodCount; + private int multiplyCount = 0; + + @Override + public List intercept(List methods, ITestContext context) { + originalMethodCount = methods.size(); + List newMethods = Lists.newArrayList(); + for (IMethodInstance method : methods) { + newMethods.add(method); + TestClassSample.Occurs occurs = + method + .getMethod() + .getConstructorOrMethod() + .getMethod() + .getAnnotation(TestClassSample.Occurs.class); + if (occurs == null) { + continue; + } + multiplyCount += occurs.times(); + for (int i = 1; i <= occurs.times(); i++) { + newMethods.add(method); + } + } + return newMethods; + } + + public int getOriginalMethodCount() { + return originalMethodCount; + } + + public int getMultiplyCount() { + return multiplyCount; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/ParametersTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/ParametersTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/ParametersTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/ParametersTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,28 @@ +package org.testng.internal; + +import java.lang.reflect.Method; +import org.testng.Assert; +import org.testng.annotations.Optional; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; +import org.testng.internal.Parameters.FilterOutInJectedTypesResult; +import org.testng.internal.annotations.JDK15AnnotationFinder; +import org.testng.xml.XmlTest; + +/** Provide test for package visible methods in org.testng.internal.Parameters */ +public class ParametersTest { + + @Test + @Parameters({"testdata"}) + @SuppressWarnings("unused") + public void filterOutInJectedTypesFromOptionalValuesTest( + XmlTest xmlTest, @Optional("optionaltestdata") String testdata) { + JDK15AnnotationFinder finder = new JDK15AnnotationFinder(null); + Method curMethod = new Object() {}.getClass().getEnclosingMethod(); + FilterOutInJectedTypesResult filterOutResult = + org.testng.internal.Parameters.filterOutInJectedTypesFromOptionalValues( + curMethod.getParameterTypes(), finder.findOptionalValues(curMethod)); + Assert.assertEquals(filterOutResult.getOptionalValues()[0], "optionaltestdata"); + Assert.assertEquals(filterOutResult.getParameterTypes()[0], String.class); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/TestClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/TestClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/TestClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/TestClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package org.testng.internal; + +import static java.lang.annotation.ElementType.METHOD; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; +import org.testng.annotations.Test; + +public class TestClassSample { + @Test + @Occurs(times = 2) + public void testMethod() {} + + @Retention(java.lang.annotation.RetentionPolicy.RUNTIME) + @Target({METHOD}) + public @interface Occurs { + int times() default 1; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/TestListenerHelperTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/TestListenerHelperTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/TestListenerHelperTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/TestListenerHelperTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,80 @@ +package org.testng.internal; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Collections; +import org.testng.DataProviderHolder; +import org.testng.ITestContext; +import org.testng.ITestNGListenerFactory; +import org.testng.ITestObjectFactory; +import org.testng.TestNGException; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import org.testng.collections.Maps; +import org.testng.internal.annotations.DefaultAnnotationTransformer; +import org.testng.internal.annotations.IAnnotationFinder; +import org.testng.internal.annotations.JDK15AnnotationFinder; +import org.testng.internal.listeners.DummyListenerFactory; +import org.testng.internal.listeners.TestClassDoublingupAsListenerFactory; +import org.testng.internal.listeners.TestClassWithCompositeListener; +import org.testng.internal.listeners.TestClassWithListener; +import org.testng.internal.listeners.TestClassWithMultipleListenerFactories; +import org.testng.internal.paramhandler.FakeTestContext; +import org.testng.xml.XmlClass; +import test.SimpleBaseTest; + +public class TestListenerHelperTest { + + private IAnnotationFinder finder = new JDK15AnnotationFinder(new DefaultAnnotationTransformer()); + + @Test(dataProvider = "getTestData") + public void testfindAllListeners(Class clazz, int expectedSize, boolean testFactoryClass) { + TestListenerHelper.ListenerHolder holder = TestListenerHelper.findAllListeners(clazz, finder); + assertThat(holder.getListenerClasses()).hasSize(expectedSize); + if (testFactoryClass) { + assertThat(holder.getListenerFactoryClass()).isNotNull(); + } + } + + @DataProvider(name = "getTestData") + public Object[][] getTestData() { + return new Object[][] { + {TestClassWithListener.class, 1, false}, + {SimpleBaseTest.class, 0, false}, + {TestClassWithCompositeListener.class, 1, true} + }; + } + + @Test( + expectedExceptions = TestNGException.class, + expectedExceptionsMessageRegExp = + "\nFound more than one class implementing ITestNGListenerFactory:class " + + "org.testng.internal.listeners.DummyListenerFactory and class org.testng.internal.listeners.DummyListenerFactory") + public void testFindAllListenersErrorCondition() { + TestListenerHelper.findAllListeners(TestClassWithMultipleListenerFactories.class, finder); + } + + @Test(dataProvider = "getFactoryTestData") + public void testCreateListenerFactory( + Class testClazz, Class listenerClazz) { + ITestContext ctx = new FakeTestContext(testClazz); + ClassInfoMap classMap = new ClassInfoMap(Collections.singletonList(new XmlClass(testClazz))); + ITestObjectFactory objectFactory = new ITestObjectFactory() {}; + Configuration configuration = new Configuration(); + configuration.setObjectFactory(objectFactory); + TestNGClassFinder finder = + new TestNGClassFinder( + classMap, Maps.newHashMap(), configuration, ctx, new DataProviderHolder()); + ITestNGListenerFactory factory = + TestListenerHelper.createListenerFactory(objectFactory, finder, listenerClazz, ctx); + assertThat(factory).isNotNull(); + } + + @DataProvider(name = "getFactoryTestData") + public Object[][] getFactoryTestData() { + return new Object[][] { + {TestClassWithListener.class, DummyListenerFactory.class}, + {TestClassDoublingupAsListenerFactory.class, TestClassDoublingupAsListenerFactory.class} + }; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/UtilsTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/UtilsTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/UtilsTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/UtilsTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,44 @@ +package org.testng.internal; + +import static java.util.Arrays.asList; +import static java.util.Collections.emptyList; +import static org.testng.Assert.assertEquals; +import static org.testng.internal.Utils.join; + +import java.util.List; +import org.testng.annotations.Test; + +/** + * Unit tests for {@link Utils}. + * + * @author Tomas Pollak + */ +public class UtilsTest { + private static final char INVALID_CHAR = 0xFFFE; + private static final char REPLACEMENT_CHAR = 0xFFFD; + + @Test + public void escapeUnicode() { + assertEquals(Utils.escapeUnicode("test"), "test"); + assertEquals( + Utils.escapeUnicode(String.valueOf(INVALID_CHAR)), String.valueOf(REPLACEMENT_CHAR)); + } + + @Test + public void createEmptyStringWhenJoiningEmptyListWithJoin() { + List emptyList = emptyList(); + assertEquals("", join(emptyList, ",")); + } + + @Test + public void joinTwoStringsWithJoinStrings() { + List twoStrings = asList("one", "two"); + assertEquals("one,two", Utils.join(twoStrings, ",")); + } + + @Test + public void createEmptyStringWhenJoiningEmptyListWithJoinStrings() { + List emptyList = emptyList(); + assertEquals("", Utils.join(emptyList, ",")); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/conflistener/FailingAfterClass.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/conflistener/FailingAfterClass.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/conflistener/FailingAfterClass.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/conflistener/FailingAfterClass.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package org.testng.internal.conflistener; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.Test; + +public class FailingAfterClass { + @AfterClass + public void failingAfterClass() { + throw new RuntimeException("expected @AfterClass failure"); + } + + @Test + public void testBeforeFailingAfterClass() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/conflistener/FailingAfterSuite.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/conflistener/FailingAfterSuite.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/conflistener/FailingAfterSuite.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/conflistener/FailingAfterSuite.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package org.testng.internal.conflistener; + +import org.testng.annotations.AfterSuite; +import org.testng.annotations.Test; + +public class FailingAfterSuite { + @AfterSuite(alwaysRun = true) + public void afterSuite() { + throw new RuntimeException("Test exception"); + } + + @Test + public void dummytest() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/conflistener/FailingAfterTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/conflistener/FailingAfterTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/conflistener/FailingAfterTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/conflistener/FailingAfterTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package org.testng.internal.conflistener; + +import org.testng.annotations.AfterTest; +import org.testng.annotations.Test; + +public class FailingAfterTest { + @AfterTest(alwaysRun = true) + public void afterTest() { + throw new RuntimeException("Test exception"); + } + + @AfterTest + public void skippedAfterTest() {} + + @Test + public void dummytest() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/conflistener/FailingBeforeClass.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/conflistener/FailingBeforeClass.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/conflistener/FailingBeforeClass.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/conflistener/FailingBeforeClass.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package org.testng.internal.conflistener; + +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +public class FailingBeforeClass { + @BeforeClass + public void failingBeforeClass() { + throw new RuntimeException("expected @BeforeClass failure"); + } + + @Test + public void testAfterFailingBeforeClass() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/conflistener/FailingBeforeSuite.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/conflistener/FailingBeforeSuite.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/conflistener/FailingBeforeSuite.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/conflistener/FailingBeforeSuite.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package org.testng.internal.conflistener; + +import org.testng.annotations.BeforeSuite; +import org.testng.annotations.Test; + +public class FailingBeforeSuite { + @BeforeSuite + public void beforeSuite() { + throw new RuntimeException("Test exception"); + } + + @Test + public void dummytest() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/conflistener/FailingBeforeTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/conflistener/FailingBeforeTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/conflistener/FailingBeforeTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/conflistener/FailingBeforeTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ +package org.testng.internal.conflistener; + +import org.testng.annotations.BeforeSuite; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.Test; + +public class FailingBeforeTest { + @BeforeSuite + public void passingBeforeSuite() {} + + @BeforeTest + public void beforeTest() { + throw new RuntimeException("Test exception"); + } + + @Test + public void dummytest() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/conflistener/testng.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/conflistener/testng.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/conflistener/testng.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/conflistener/testng.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/EdgeWeightTestSample1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/EdgeWeightTestSample1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/EdgeWeightTestSample1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/EdgeWeightTestSample1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package org.testng.internal.dynamicgraph; + +import org.testng.annotations.Test; + +public class EdgeWeightTestSample1 { + + @Test( + groups = {"g1"}, + priority = 2) + public void t1() {} + + @Test( + groups = {"g2"}, + dependsOnGroups = "g1", + priority = 0) + public void t2() {} + + @Test( + groups = {"g2"}, + dependsOnGroups = "g1", + priority = 1) + public void t3() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/EdgeWeightTestSample2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/EdgeWeightTestSample2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/EdgeWeightTestSample2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/EdgeWeightTestSample2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,32 @@ +package org.testng.internal.dynamicgraph; + +import org.testng.annotations.Test; + +public class EdgeWeightTestSample2 { + + @Test(priority = 1) + public void t1() {} + + @Test( + groups = {"group2"}, + priority = 2) + public void t2() {} + + @Test( + groups = {"group3"}, + dependsOnGroups = "group2", + priority = 3) + public void t3() {} + + @Test( + groups = {"group4"}, + dependsOnGroups = "group3", + priority = 0) + public void t4() {} + + @Test( + groups = {"group4"}, + dependsOnGroups = "group3", + priority = 1) + public void t5() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/FactoryTestClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/FactoryTestClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/FactoryTestClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/FactoryTestClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,30 @@ +package org.testng.internal.dynamicgraph; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +public class FactoryTestClassSample { + private String text; + + @Factory(dataProvider = "getData") + public FactoryTestClassSample(String text) { + this.text = text; + } + + @Test + public void testMethod() {} + + @Test + public void anotherTestMethod() {} + + @Override + public String toString() { + return text; + } + + @DataProvider(name = "getData") + public static Object[][] getData() { + return new Object[][] {{"one"}, {"two"}, {"three"}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/FakeTestClass.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/FakeTestClass.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/FakeTestClass.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/FakeTestClass.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,107 @@ +package org.testng.internal.dynamicgraph; + +import org.testng.ITestClass; +import org.testng.ITestNGMethod; +import org.testng.xml.XmlClass; +import org.testng.xml.XmlTest; + +public class FakeTestClass implements ITestClass { + private Class clazz; + + public FakeTestClass(Class clazz) { + this.clazz = clazz; + } + + @Override + public ITestNGMethod[] getTestMethods() { + return new ITestNGMethod[0]; + } + + @Override + public ITestNGMethod[] getBeforeTestMethods() { + return new ITestNGMethod[0]; + } + + @Override + public ITestNGMethod[] getAfterTestMethods() { + return new ITestNGMethod[0]; + } + + @Override + public ITestNGMethod[] getBeforeClassMethods() { + return new ITestNGMethod[0]; + } + + @Override + public ITestNGMethod[] getAfterClassMethods() { + return new ITestNGMethod[0]; + } + + @Override + public ITestNGMethod[] getBeforeSuiteMethods() { + return new ITestNGMethod[0]; + } + + @Override + public ITestNGMethod[] getAfterSuiteMethods() { + return new ITestNGMethod[0]; + } + + @Override + public ITestNGMethod[] getBeforeTestConfigurationMethods() { + return new ITestNGMethod[0]; + } + + @Override + public ITestNGMethod[] getAfterTestConfigurationMethods() { + return new ITestNGMethod[0]; + } + + @Override + public ITestNGMethod[] getBeforeGroupsMethods() { + return new ITestNGMethod[0]; + } + + @Override + public ITestNGMethod[] getAfterGroupsMethods() { + return new ITestNGMethod[0]; + } + + @Override + public String getName() { + return clazz.getName(); + } + + @Override + public XmlTest getXmlTest() { + return null; + } + + @Override + public XmlClass getXmlClass() { + return new XmlClass(clazz); + } + + @Override + public String getTestName() { + return ""; + } + + @Override + public Class getRealClass() { + return clazz; + } + + @Override + public Object[] getInstances(boolean create) { + return new Object[0]; + } + + @Override + public long[] getInstanceHashCodes() { + return new long[0]; + } + + @Override + public void addInstance(Object instance) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/FakeWrappedFactoryMethod.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/FakeWrappedFactoryMethod.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/FakeWrappedFactoryMethod.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/FakeWrappedFactoryMethod.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package org.testng.internal.dynamicgraph; + +import org.testng.ITestNGMethod; +import org.testng.internal.WrappedTestNGMethod; + +public class FakeWrappedFactoryMethod extends WrappedTestNGMethod { + + private Object instance; + + public FakeWrappedFactoryMethod(ITestNGMethod testNGMethod, Object instance) { + super(testNGMethod); + this.instance = instance; + } + + @Override + public Object getInstance() { + return instance; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/HardDependencyTestClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/HardDependencyTestClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/HardDependencyTestClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/HardDependencyTestClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package org.testng.internal.dynamicgraph; + +import org.testng.annotations.Test; + +public class HardDependencyTestClassSample { + @Test + public void a() {} + + @Test(dependsOnMethods = "a") + public void b() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/HardDependencyViaGroupsTestClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/HardDependencyViaGroupsTestClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/HardDependencyViaGroupsTestClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/HardDependencyViaGroupsTestClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package org.testng.internal.dynamicgraph; + +import org.testng.annotations.Test; + +public class HardDependencyViaGroupsTestClassSample { + @Test(groups = "master") + public void a() {} + + @Test(dependsOnGroups = "master") + public void b() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/IndependentTestClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/IndependentTestClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/IndependentTestClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/IndependentTestClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package org.testng.internal.dynamicgraph; + +import org.testng.annotations.Test; + +public class IndependentTestClassSample { + @Test + public void a() {} + + @Test + public void b() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/LotsOfEdgesTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/LotsOfEdgesTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/LotsOfEdgesTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/LotsOfEdgesTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,386 @@ +package org.testng.internal.dynamicgraph; + +import org.testng.annotations.Test; + +// https://github.com/cbeust/testng/issues/1710 +public class LotsOfEdgesTest { + @Test( + priority = 1, + groups = {"group1"}) + void test_1_1() {} + + @Test( + priority = 2, + groups = {"group1"}) + void test_1_2() {} + + @Test( + priority = 3, + groups = {"group1"}) + void test_1_3() {} + + @Test( + priority = 1, + groups = {"group1"}) + void test_1_4() {} + + @Test( + priority = 2, + groups = {"group1"}) + void test_1_5() {} + + @Test( + priority = 6, + groups = {"group1"}) + void test_1_6() {} + + @Test( + priority = 7, + groups = {"group1"}) + void test_1_7() {} + + @Test( + priority = 8, + groups = {"group1"}) + void test_1_8() {} + + @Test( + priority = 9, + groups = {"group1"}) + void test_1_9() {} + + @Test( + priority = 10, + groups = {"group1"}) + void test_1_10() {} + + @Test( + priority = 1, + groups = {"group1"}) + void test_2_1() {} + + @Test( + priority = 2, + groups = {"group1"}) + void test_2_2() {} + + @Test( + priority = 3, + groups = {"group1"}) + void test_2_3() {} + + @Test( + priority = 1, + groups = {"group1"}) + void test_2_4() {} + + @Test( + priority = 2, + groups = {"group1"}) + void test_2_5() {} + + @Test( + priority = 6, + groups = {"group1"}) + void test_2_6() {} + + @Test( + priority = 7, + groups = {"group1"}) + void test_2_7() {} + + @Test( + priority = 8, + groups = {"group1"}) + void test_2_8() {} + + @Test( + priority = 9, + dependsOnGroups = {"group1"}) + void test_3_9() {} + + @Test( + priority = 10, + dependsOnGroups = {"group1"}) + void test_3_10() {} + + @Test( + priority = 1, + dependsOnGroups = {"group1"}) + void test_4_1() {} + + @Test( + priority = 2, + dependsOnGroups = {"group1"}) + void test_4_2() {} + + @Test( + priority = 3, + dependsOnGroups = {"group1"}) + void test_4_3() {} + + @Test( + priority = 1, + dependsOnGroups = {"group1"}) + void test_4_4() {} + + @Test( + priority = 2, + dependsOnGroups = {"group1"}) + void test_4_5() {} + + @Test( + priority = 6, + dependsOnGroups = {"group1"}) + void test_4_6() {} + + @Test( + priority = 7, + dependsOnGroups = {"group1"}) + void test_4_7() {} + + @Test( + priority = 8, + dependsOnGroups = {"group1"}) + void test_4_8() {} + + @Test( + priority = 9, + dependsOnGroups = {"group1"}) + void test_4_9() {} + + @Test( + priority = 10, + dependsOnGroups = {"group1"}) + void test_4_10() {} + + @Test( + priority = 1, + dependsOnGroups = {"group1"}) + void test_5_1() {} + + @Test( + priority = 2, + dependsOnGroups = {"group1"}) + void test_5_2() {} + + @Test( + priority = 3, + dependsOnGroups = {"group1"}) + void test_5_3() {} + + @Test( + priority = 1, + dependsOnGroups = {"group1"}) + void test_5_4() {} + + @Test( + priority = 2, + dependsOnGroups = {"group1"}) + void test_5_5() {} + + @Test( + priority = 6, + dependsOnGroups = {"group1"}) + void test_5_6() {} + + @Test( + priority = 7, + dependsOnGroups = {"group1"}) + void test_5_7() {} + + @Test( + priority = 8, + dependsOnGroups = {"group1"}) + void test_5_8() {} + + @Test( + priority = 9, + dependsOnGroups = {"group1"}) + void test_5_9() {} + + @Test( + priority = 10, + dependsOnGroups = {"group1"}) + void test_5_10() {} + + @Test(priority = 9) + void test_2_9() {} + + @Test(priority = 10) + void test_2_10() {} + + @Test(priority = 1) + void test_3_1() {} + + @Test(priority = 2) + void test_3_2() {} + + @Test(priority = 3) + void test_3_3() {} + + @Test(priority = 1) + void test_3_4() {} + + @Test(priority = 2) + void test_3_5() {} + + @Test(priority = 6) + void test_3_6() {} + + @Test(priority = 7) + void test_3_7() {} + + @Test(priority = 8) + void test_3_8() {} + + @Test(priority = 1) + void test_6_1() {} + + @Test(priority = 2) + void test_6_2() {} + + @Test(priority = 3) + void test_6_3() {} + + @Test(priority = 1) + void test_6_4() {} + + @Test(priority = 2) + void test_6_5() {} + + @Test(priority = 6) + void test_6_6() {} + + @Test(priority = 7) + void test_6_7() {} + + @Test(priority = 8) + void test_6_8() {} + + @Test(priority = 9) + void test_6_9() {} + + @Test(priority = 10) + void test_6_10() {} + + @Test(priority = 1) + void test_7_1() {} + + @Test(priority = 2) + void test_7_2() {} + + @Test(priority = 3) + void test_7_3() {} + + @Test(priority = 1) + void test_7_4() {} + + @Test(priority = 2) + void test_7_5() {} + + @Test(priority = 6) + void test_7_6() {} + + @Test(priority = 7) + void test_7_7() {} + + @Test(priority = 8) + void test_7_8() {} + + @Test(priority = 9) + void test_7_9() {} + + @Test(priority = 10) + void test_7_10() {} + + @Test(priority = 1) + void test_8_1() {} + + @Test(priority = 2) + void test_8_2() {} + + @Test(priority = 3) + void test_8_3() {} + + @Test(priority = 1) + void test_8_4() {} + + @Test(priority = 2) + void test_8_5() {} + + @Test(priority = 6) + void test_8_6() {} + + @Test(priority = 7) + void test_8_7() {} + + @Test(priority = 8) + void test_8_8() {} + + @Test(priority = 9) + void test_8_9() {} + + @Test(priority = 10) + void test_8_10() {} + + @Test(priority = 1) + void test_9_1() {} + + @Test(priority = 2) + void test_9_2() {} + + @Test(priority = 3) + void test_9_3() {} + + @Test(priority = 1) + void test_9_4() {} + + @Test(priority = 2) + void test_9_5() {} + + @Test(priority = 6) + void test_9_6() {} + + @Test(priority = 7) + void test_9_7() {} + + @Test(priority = 8) + void test_9_8() {} + + @Test(priority = 9) + void test_9_9() {} + + @Test(priority = 10) + void test_9_10() {} + + @Test(priority = 1) + void test_10_1() {} + + @Test(priority = 2) + void test_10_2() {} + + @Test(priority = 3) + void test_10_3() {} + + @Test(priority = 1) + void test_10_4() {} + + @Test(priority = 2) + void test_10_5() {} + + @Test(priority = 6) + void test_10_6() {} + + @Test(priority = 7) + void test_10_7() {} + + @Test(priority = 8) + void test_10_8() {} + + @Test(priority = 9) + void test_10_9() {} + + @Test(priority = 10) + void test_10_10() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/SequentialClassA.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/SequentialClassA.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/SequentialClassA.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/SequentialClassA.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package org.testng.internal.dynamicgraph; + +import org.testng.annotations.Test; + +public class SequentialClassA { + + @Test + public void testMethodOneSequentialClassA() {} + + @Test + public void testMethodTwoSequentialClassA() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/SequentialClassB.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/SequentialClassB.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/SequentialClassB.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/SequentialClassB.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package org.testng.internal.dynamicgraph; + +import org.testng.annotations.Test; + +public class SequentialClassB { + + @Test + public void testMethodOneSequentialClassB() {} + + @Test + public void testMethodTwoSequentialClassB() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/SoftDependencyTestClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/SoftDependencyTestClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/SoftDependencyTestClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/SoftDependencyTestClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package org.testng.internal.dynamicgraph; + +import org.testng.annotations.Test; + +public class SoftDependencyTestClassSample { + @Test(priority = 1) + public void a() {} + + @Test(priority = 2) + public void b() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/testpackage/PackageTestClassA.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/testpackage/PackageTestClassA.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/testpackage/PackageTestClassA.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/testpackage/PackageTestClassA.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package org.testng.internal.dynamicgraph.testpackage; + +import org.testng.annotations.Test; + +public class PackageTestClassA { + + @Test + public void a1() {} + + @Test + public void a2() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/testpackage/PackageTestClassBAbstract.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/testpackage/PackageTestClassBAbstract.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/testpackage/PackageTestClassBAbstract.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/testpackage/PackageTestClassBAbstract.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,6 @@ +package org.testng.internal.dynamicgraph.testpackage; + +public abstract class PackageTestClassBAbstract { + + public void neverMind() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/testpackage/PackageTestClassBB.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/testpackage/PackageTestClassBB.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/testpackage/PackageTestClassBB.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/dynamicgraph/testpackage/PackageTestClassBB.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package org.testng.internal.dynamicgraph.testpackage; + +import org.testng.annotations.Test; + +public class PackageTestClassBB { + + @Test + public void b1() {} + + @Test + public void b2() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/invokers/ParameterHandlerTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/invokers/ParameterHandlerTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/invokers/ParameterHandlerTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/invokers/ParameterHandlerTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,79 @@ +package org.testng.internal.invokers; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Collection; +import java.util.Collections; +import java.util.Iterator; +import java.util.Map; +import org.testng.DataProviderHolder; +import org.testng.IDataProviderListener; +import org.testng.ITestContext; +import org.testng.ITestNGMethod; +import org.testng.ITestObjectFactory; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import org.testng.collections.Maps; +import org.testng.internal.annotations.DefaultAnnotationTransformer; +import org.testng.internal.annotations.IAnnotationFinder; +import org.testng.internal.annotations.JDK15AnnotationFinder; +import org.testng.internal.paramhandler.DataDrivenSampleTestClass; +import org.testng.internal.paramhandler.ExceptionThrowingDataDrivenSampleTestClass; +import org.testng.internal.paramhandler.FakeTestContext; +import org.testng.internal.paramhandler.FakeTestNGMethod; +import org.testng.internal.paramhandler.ParameterizedSampleTestClass; +import org.testng.xml.XmlTest; +import test.SimpleBaseTest; + +public class ParameterHandlerTest extends SimpleBaseTest { + private ParameterHandler handler; + + @BeforeClass + public void beforeClass() { + Collection listeners = Collections.emptyList(); + IAnnotationFinder finder = new JDK15AnnotationFinder(new DefaultAnnotationTransformer()); + handler = + new ParameterHandler(new ITestObjectFactory() {}, finder, new DataProviderHolder(), 0); + } + + @Test + public void testCreateParameters() { + ITestNGMethod testNGMethod = + new FakeTestNGMethod(ParameterizedSampleTestClass.class, "testMethod"); + runTest(testNGMethod, ParameterHolder.ParameterOrigin.ORIGIN_XML); + } + + @Test + public void testCreateParametersUsingDataProvider() { + XmlTest xmlTest = createXmlTest("suite", "test"); + ITestNGMethod testNGMethod = + new FakeTestNGMethod(DataDrivenSampleTestClass.class, "testMethod", xmlTest); + runTest(testNGMethod, ParameterHolder.ParameterOrigin.ORIGIN_DATA_PROVIDER); + } + + @Test + public void testCreateParametersUsingDataProviderNegativeCase() { + XmlTest xmlTest = createXmlTest("suite", "test"); + Class clazz = ExceptionThrowingDataDrivenSampleTestClass.class; + ITestNGMethod testNGMethod = new FakeTestNGMethod(clazz, "testMethod", xmlTest); + ParameterHandler.ParameterBag params = invokeParameterCreation(testNGMethod); + assertThat(params.parameterHolder).isNull(); + assertThat(params.errorResult).isNotNull(); + assertThat(params.errorResult.getThrowable()) + .hasCauseInstanceOf(UnsupportedOperationException.class); + } + + private void runTest(ITestNGMethod testNGMethod, ParameterHolder.ParameterOrigin origin) { + ParameterHandler.ParameterBag params = invokeParameterCreation(testNGMethod); + assertThat(params.parameterHolder).isNotNull(); + assertThat(params.parameterHolder.origin).isEqualByComparingTo(origin); + Iterator iterators = params.parameterHolder.parameters; + assertThat(iterators).containsAll(Collections.singletonList(new Object[] {"bar"})); + } + + private ParameterHandler.ParameterBag invokeParameterCreation(ITestNGMethod method) { + ITestContext context = new FakeTestContext(method.getRealClass()); + Map map = Maps.newHashMap(); + return handler.createParameters(method, map, map, context); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/issue1339/BabyPanda.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/issue1339/BabyPanda.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/issue1339/BabyPanda.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/issue1339/BabyPanda.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,25 @@ +package org.testng.internal.issue1339; + +public class BabyPanda extends LittlePanda { + String name; + + @Override + public String toString() { + return "BabyPanda{" + "name='" + name + '\'' + '}'; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + BabyPanda babyPanda = (BabyPanda) o; + + return name != null ? name.equals(babyPanda.name) : babyPanda.name == null; + } + + @Override + public int hashCode() { + return name != null ? name.hashCode() : 0; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/issue1339/GrandpaBear.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/issue1339/GrandpaBear.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/issue1339/GrandpaBear.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/issue1339/GrandpaBear.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package org.testng.internal.issue1339; + +public class GrandpaBear { + private void secretMethod() {} + + public void announcer() {} + + public void inheritable() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/issue1339/LittlePanda.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/issue1339/LittlePanda.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/issue1339/LittlePanda.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/issue1339/LittlePanda.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,3 @@ +package org.testng.internal.issue1339; + +public class LittlePanda extends PapaBear {} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/issue1339/PapaBear.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/issue1339/PapaBear.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/issue1339/PapaBear.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/issue1339/PapaBear.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package org.testng.internal.issue1339; + +public class PapaBear extends GrandpaBear { + private void secretMethod(String foo) {} + + public void announcer(String foo) {} + + public void inheritable(String foo) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/issue1456/TestClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/issue1456/TestClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/issue1456/TestClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/issue1456/TestClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package org.testng.internal.issue1456; + +import org.testng.ITest; + +public class TestClassSample implements ITest { + private String testname; + + public TestClassSample(String testname) { + this.testname = testname; + } + + @Override + public String getTestName() { + return testname; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/issue2195/BaseClass.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/issue2195/BaseClass.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/issue2195/BaseClass.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/issue2195/BaseClass.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ +package org.testng.internal.issue2195; + +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class BaseClass { + + @BeforeMethod( + alwaysRun = true, + dependsOnMethods = {"dummyDependsOnMethod"}) + public void dummyMethod() {} + + @BeforeMethod + public void dummyDependsOnMethod() {} + + @Test + public void dummyTest() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/issue2195/TestClass.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/issue2195/TestClass.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/issue2195/TestClass.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/issue2195/TestClass.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package org.testng.internal.issue2195; + +import org.testng.annotations.Test; + +@Test(groups = "issue2195") +public class TestClass extends BaseClass { + + public TestClass() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/listeners/DummyListenerFactory.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/listeners/DummyListenerFactory.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/listeners/DummyListenerFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/listeners/DummyListenerFactory.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ +package org.testng.internal.listeners; + +import org.testng.IExecutionListener; +import org.testng.ITestNGListener; +import org.testng.ITestNGListenerFactory; + +public class DummyListenerFactory implements ITestNGListenerFactory, IExecutionListener { + @Override + public ITestNGListener createListener(Class listenerClass) { + return this; + } + + @Override + public void onExecutionStart() {} + + @Override + public void onExecutionFinish() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/listeners/EmptyExecutionListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/listeners/EmptyExecutionListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/listeners/EmptyExecutionListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/listeners/EmptyExecutionListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package org.testng.internal.listeners; + +import org.testng.IExecutionListener; + +public class EmptyExecutionListener implements IExecutionListener { + @Override + public void onExecutionStart() {} + + @Override + public void onExecutionFinish() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/listeners/TestClassDoublingupAsListenerFactory.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/listeners/TestClassDoublingupAsListenerFactory.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/listeners/TestClassDoublingupAsListenerFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/listeners/TestClassDoublingupAsListenerFactory.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package org.testng.internal.listeners; + +import org.testng.ITestNGListener; +import org.testng.ITestNGListenerFactory; +import org.testng.annotations.Test; + +public class TestClassDoublingupAsListenerFactory implements ITestNGListenerFactory { + @Override + public ITestNGListener createListener(Class listenerClass) { + return new EmptyExecutionListener(); + } + + @Test + public void test() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/listeners/TestClassWithCompositeListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/listeners/TestClassWithCompositeListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/listeners/TestClassWithCompositeListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/listeners/TestClassWithCompositeListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,10 @@ +package org.testng.internal.listeners; + +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +@Listeners(DummyListenerFactory.class) +public class TestClassWithCompositeListener { + @Test + public void testMethod() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/listeners/TestClassWithListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/listeners/TestClassWithListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/listeners/TestClassWithListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/listeners/TestClassWithListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,6 @@ +package org.testng.internal.listeners; + +import org.testng.annotations.Listeners; + +@Listeners(EmptyExecutionListener.class) +public class TestClassWithListener {} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/listeners/TestClassWithMultipleListenerFactories.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/listeners/TestClassWithMultipleListenerFactories.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/listeners/TestClassWithMultipleListenerFactories.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/listeners/TestClassWithMultipleListenerFactories.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,6 @@ +package org.testng.internal.listeners; + +import org.testng.annotations.Listeners; + +@Listeners({DummyListenerFactory.class, DummyListenerFactory.class}) +public class TestClassWithMultipleListenerFactories {} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/listeners/parameterindex/ParameterIndexListenerTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/listeners/parameterindex/ParameterIndexListenerTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/listeners/parameterindex/ParameterIndexListenerTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/listeners/parameterindex/ParameterIndexListenerTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package org.testng.internal.listeners.parameterindex; + +import org.testng.TestNG; +import org.testng.annotations.Test; + +public class ParameterIndexListenerTest { + + @Test + public void listenerShouldReceiveRightParameterIndexTest() { + TestNG testng = new TestNG(); + testng.setTestClasses(new Class[] {TestWithProviderTest.class}); + testng.run(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/listeners/parameterindex/ParameterIndexTestListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/listeners/parameterindex/ParameterIndexTestListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/listeners/parameterindex/ParameterIndexTestListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/listeners/parameterindex/ParameterIndexTestListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,25 @@ +package org.testng.internal.listeners.parameterindex; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.ArrayList; +import java.util.List; +import org.testng.ITestContext; +import org.testng.ITestListener; +import org.testng.ITestResult; +import org.testng.internal.TestResult; + +public class ParameterIndexTestListener implements ITestListener { + + private List indexes = new ArrayList<>(); + + @Override + public void onTestSuccess(ITestResult testResult) { + indexes.add(((TestResult) testResult).getParameterIndex()); + } + + @Override + public void onFinish(ITestContext testContext) { + assertThat(indexes).contains(0, 1, 2); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/listeners/parameterindex/TestWithProviderTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/listeners/parameterindex/TestWithProviderTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/listeners/parameterindex/TestWithProviderTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/listeners/parameterindex/TestWithProviderTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,21 @@ +package org.testng.internal.listeners.parameterindex; + +import static org.testng.AssertJUnit.assertTrue; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +@Listeners(ParameterIndexTestListener.class) +public class TestWithProviderTest { + + @DataProvider + public Object[] integerValues() { + return new Object[] {1, 4, 4}; + } + + @Test(dataProvider = "integerValues") + public void ShouldBeLessThan5(int value) { + assertTrue(value < 5); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/misamples/AbstractMoves.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/misamples/AbstractMoves.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/misamples/AbstractMoves.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/misamples/AbstractMoves.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package org.testng.internal.misamples; + +public abstract class AbstractMoves implements IDance { + + @Override + public void dance() {} + + public abstract void walk(); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/misamples/Batman.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/misamples/Batman.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/misamples/Batman.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/misamples/Batman.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,13 @@ +package org.testng.internal.misamples; + +public class Batman implements SuperHeroCapabilities { + + @Override + public void fly() {} + + @Override + public void liftWeights() {} + + @Override + public void yellSlogan() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/misamples/IDance.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/misamples/IDance.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/misamples/IDance.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/misamples/IDance.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,6 @@ +package org.testng.internal.misamples; + +public interface IDance { + + default void dance() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/misamples/JohnTravoltaMoves.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/misamples/JohnTravoltaMoves.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/misamples/JohnTravoltaMoves.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/misamples/JohnTravoltaMoves.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,7 @@ +package org.testng.internal.misamples; + +public class JohnTravoltaMoves extends AbstractMoves { + + @Override + public void walk() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/misamples/MickJagger.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/misamples/MickJagger.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/misamples/MickJagger.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/misamples/MickJagger.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,7 @@ +package org.testng.internal.misamples; + +public class MickJagger implements IDance { + + @Override + public void dance() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/misamples/SuperHeroCapabilities.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/misamples/SuperHeroCapabilities.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/misamples/SuperHeroCapabilities.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/misamples/SuperHeroCapabilities.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,10 @@ +package org.testng.internal.misamples; + +public interface SuperHeroCapabilities { + + default void yellSlogan() {} + + void fly(); + + void liftWeights(); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/objects/GuiceHelperTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/objects/GuiceHelperTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/objects/GuiceHelperTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/objects/GuiceHelperTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,69 @@ +package org.testng.internal.objects; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertNotNull; + +import com.google.inject.Injector; +import com.google.inject.Module; +import com.google.inject.Stage; +import org.testng.Assert; +import org.testng.IInjectorFactory; +import org.testng.ITest; +import org.testng.ITestObjectFactory; +import org.testng.SampleIModule; +import org.testng.annotations.Guice; +import org.testng.annotations.Test; +import org.testng.internal.ClassImpl; +import org.testng.internal.paramhandler.FakeTestContext; +import test.guice.FakeInjector; + +@Guice +public final class GuiceHelperTest { + + private final GuiceHelper guiceHelper = new GuiceHelper(new FakeTestContext()); + + @Test(description = "GITHUB-2273") + public void getInjector_spiModule_injectorHasModule() { + MockInjector injector = + (MockInjector) guiceHelper.getInjector(new MockClass(), new MockInjectorFactory()); + + assertNotNull(injector); + Module[] modules = injector.getModules(); + assertNotNull(modules); + assertEquals(modules.length, 1); + Assert.assertEquals(modules[0], new SampleIModule().getModule()); + } + + private static final class MockInjectorFactory implements IInjectorFactory { + @Override + @SuppressWarnings("deprecation") + public Injector getInjector(Stage stage, Module... modules) { + return new MockInjector(modules); + } + } + + private static final class MockInjector extends FakeInjector { + private final Module[] modules; + + public MockInjector(Module[] modules) { + this.modules = modules; + } + + public Module[] getModules() { + return modules; + } + } + + private static final class MockClass extends ClassImpl { + public MockClass() { + super( + new FakeTestContext(), + GuiceHelperTest.class, + null, + (ITest) () -> "GITHUB-2273", + null, + null, + new ITestObjectFactory() {}); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/objects/InstanceCreatorTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/objects/InstanceCreatorTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/objects/InstanceCreatorTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/objects/InstanceCreatorTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,34 @@ +package org.testng.internal.objects; + +import java.util.Map; +import org.testng.Assert; +import org.testng.IClass; +import org.testng.ITest; +import org.testng.ITestObjectFactory; +import org.testng.annotations.Test; +import org.testng.collections.Maps; +import org.testng.internal.annotations.DefaultAnnotationTransformer; +import org.testng.internal.annotations.IAnnotationFinder; +import org.testng.internal.annotations.JDK15AnnotationFinder; +import org.testng.internal.issue1456.TestClassSample; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; + +public class InstanceCreatorTest { + private static final String GITHUB_1456 = "GITHUB-1456"; + + @Test(description = GITHUB_1456) + public void testCreateInstance1WithOneArgStringParamForConstructor() { + Class declaringClass = TestClassSample.class; + Map, IClass> classes = Maps.newHashMap(); + XmlTest xmlTest = new XmlTest(new XmlSuite()); + xmlTest.setName(GITHUB_1456); + IAnnotationFinder finder = new JDK15AnnotationFinder(new DefaultAnnotationTransformer()); + ITestObjectFactory objectFactory = new ObjectFactoryImpl(); + Object object = + SimpleObjectDispenser.createInstance( + declaringClass, classes, xmlTest, finder, objectFactory, false, ""); + Assert.assertTrue(object instanceof ITest); + Assert.assertEquals(((ITest) object).getTestName(), GITHUB_1456); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/paramhandler/DataDrivenSampleTestClass.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/paramhandler/DataDrivenSampleTestClass.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/paramhandler/DataDrivenSampleTestClass.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/paramhandler/DataDrivenSampleTestClass.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package org.testng.internal.paramhandler; + +import org.assertj.core.api.Assertions; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class DataDrivenSampleTestClass { + @Test(dataProvider = "dp") + public void testMethod(String i) { + Assertions.assertThat(i).isNotEmpty(); + } + + @DataProvider(name = "dp") + public Object[][] getData() { + return new Object[][] {{"bar"}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/paramhandler/ExceptionThrowingDataDrivenSampleTestClass.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/paramhandler/ExceptionThrowingDataDrivenSampleTestClass.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/paramhandler/ExceptionThrowingDataDrivenSampleTestClass.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/paramhandler/ExceptionThrowingDataDrivenSampleTestClass.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package org.testng.internal.paramhandler; + +import org.assertj.core.api.Assertions; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class ExceptionThrowingDataDrivenSampleTestClass { + @Test(dataProvider = "dp") + public void testMethod(String i) { + Assertions.assertThat(i).isNotEmpty(); + } + + @DataProvider(name = "dp") + public Object[][] getData() { + throw new UnsupportedOperationException("unsupported-operation"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/paramhandler/FakeSuite.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/paramhandler/FakeSuite.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/paramhandler/FakeSuite.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/paramhandler/FakeSuite.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,143 @@ +package org.testng.internal.paramhandler; + +import com.google.inject.Injector; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Set; +import org.testng.IInvokedMethod; +import org.testng.ISuite; +import org.testng.ISuiteResult; +import org.testng.ITestNGListener; +import org.testng.ITestNGMethod; +import org.testng.ITestObjectFactory; +import org.testng.SuiteRunState; +import org.testng.collections.Maps; +import org.testng.collections.Sets; +import org.testng.internal.annotations.DefaultAnnotationTransformer; +import org.testng.internal.annotations.IAnnotationFinder; +import org.testng.internal.annotations.JDK15AnnotationFinder; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; + +public class FakeSuite implements ISuite { + + private XmlTest xmlTest; + + public FakeSuite(XmlTest xmlTest) { + this.xmlTest = xmlTest; + } + + @Override + public String getName() { + return ""; + } + + @Override + public Map getResults() { + return Maps.newHashMap(); + } + + @Override + public ITestObjectFactory getObjectFactory() { + return new ITestObjectFactory() {}; + } + + @Override + public String getOutputDirectory() { + return ""; + } + + @Override + public String getParallel() { + return ""; + } + + @Override + public String getParentModule() { + return ""; + } + + @Override + public String getGuiceStage() { + return ""; + } + + @Override + public String getParameter(String parameterName) { + return ""; + } + + @Override + public Map> getMethodsByGroups() { + return Maps.newHashMap(); + } + + @Override + public List getAllInvokedMethods() { + return Collections.emptyList(); + } + + @Override + public Collection getExcludedMethods() { + return Collections.emptyList(); + } + + @Override + public void run() {} + + @Override + public String getHost() { + return ""; + } + + @Override + public SuiteRunState getSuiteState() { + return new SuiteRunState(); + } + + @Override + public IAnnotationFinder getAnnotationFinder() { + return new JDK15AnnotationFinder(new DefaultAnnotationTransformer()); + } + + @Override + public XmlSuite getXmlSuite() { + return this.xmlTest.getSuite(); + } + + @Override + public void addListener(ITestNGListener listener) {} + + @Override + public Injector getParentInjector() { + return null; + } + + @Override + public void setParentInjector(Injector injector) {} + + @Override + public List getAllMethods() { + return Collections.emptyList(); + } + + @Override + public Object getAttribute(String name) { + return new Object(); + } + + @Override + public void setAttribute(String name, Object value) {} + + @Override + public Set getAttributeNames() { + return Sets.newHashSet(); + } + + @Override + public Object removeAttribute(String name) { + return new Object(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/paramhandler/FakeTestContext.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/paramhandler/FakeTestContext.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/paramhandler/FakeTestContext.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/paramhandler/FakeTestContext.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,145 @@ +package org.testng.internal.paramhandler; + +import java.util.Collection; +import java.util.Collections; +import java.util.Date; +import java.util.Map; +import java.util.Set; +import org.testng.IResultMap; +import org.testng.ISuite; +import org.testng.ITestContext; +import org.testng.ITestNGMethod; +import org.testng.collections.Maps; +import org.testng.xml.XmlClass; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; + +public class FakeTestContext implements ITestContext { + private final XmlTest xmlTest; + private final ISuite suite; + + public FakeTestContext(Class clazz) { + this(new Class[] {clazz}); + } + + public FakeTestContext(Class... classes) { + XmlSuite xmlSuite = new XmlSuite(); + xmlSuite.setName("xml_suite"); + xmlTest = new XmlTest(xmlSuite); + for (Class clazz : classes) { + xmlTest.getXmlClasses().add(new XmlClass(clazz)); + } + Map map = Maps.newHashMap(); + map.put("foo", "bar"); + xmlTest.setParameters(map); + suite = new FakeSuite(xmlTest); + } + + @Override + public String getName() { + return null; + } + + @Override + public Date getStartDate() { + return null; + } + + @Override + public Date getEndDate() { + return null; + } + + @Override + public IResultMap getPassedTests() { + return null; + } + + @Override + public IResultMap getSkippedTests() { + return null; + } + + @Override + public IResultMap getFailedButWithinSuccessPercentageTests() { + return null; + } + + @Override + public IResultMap getFailedTests() { + return null; + } + + @Override + public String[] getIncludedGroups() { + return new String[0]; + } + + @Override + public String[] getExcludedGroups() { + return new String[0]; + } + + @Override + public String getOutputDirectory() { + return null; + } + + @Override + public ISuite getSuite() { + return suite; + } + + @Override + public ITestNGMethod[] getAllTestMethods() { + return new ITestNGMethod[0]; + } + + @Override + public String getHost() { + return null; + } + + @Override + public Collection getExcludedMethods() { + return Collections.emptyList(); + } + + @Override + public IResultMap getPassedConfigurations() { + return null; + } + + @Override + public IResultMap getSkippedConfigurations() { + return null; + } + + @Override + public IResultMap getFailedConfigurations() { + return null; + } + + @Override + public XmlTest getCurrentXmlTest() { + return xmlTest; + } + + @Override + public Object getAttribute(String name) { + return null; + } + + @Override + public void setAttribute(String name, Object value) {} + + @Override + public Set getAttributeNames() { + return Collections.emptySet(); + } + + @Override + public Object removeAttribute(String name) { + return null; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/paramhandler/FakeTestNGMethod.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/paramhandler/FakeTestNGMethod.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/paramhandler/FakeTestNGMethod.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/paramhandler/FakeTestNGMethod.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,343 @@ +package org.testng.internal.paramhandler; + +import java.lang.reflect.Method; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.concurrent.Callable; +import org.testng.IClass; +import org.testng.IRetryAnalyzer; +import org.testng.ITestClass; +import org.testng.ITestNGMethod; +import org.testng.ITestResult; +import org.testng.internal.ConstructorOrMethod; +import org.testng.internal.MethodInstanceTest; +import org.testng.internal.reflect.ReflectionHelper; +import org.testng.xml.XmlClass; +import org.testng.xml.XmlTest; + +public class FakeTestNGMethod implements ITestNGMethod { + private final ConstructorOrMethod consMethod; + private Class clazz; + private XmlTest xmlTest; + + public FakeTestNGMethod(Class clazz, String methodName) { + this(clazz, methodName, null); + } + + public FakeTestNGMethod(Class clazz, String methodName, XmlTest xmlTest) { + ConstructorOrMethod temp = null; + Method[] methods = ReflectionHelper.getLocalMethods(clazz); + for (Method method : methods) { + if (method.getName().equalsIgnoreCase(methodName)) { + temp = new ConstructorOrMethod(method); + break; + } + } + this.xmlTest = xmlTest; + this.clazz = clazz; + this.consMethod = temp; + } + + @Override + public Class getRealClass() { + return clazz; + } + + @Override + public ITestClass getTestClass() { + return new MethodInstanceTest.TestClassStub(this.xmlTest, new XmlClass(this.clazz)); + } + + @Override + public void setTestClass(ITestClass cls) {} + + @Override + public String getMethodName() { + return null; + } + + @Override + public Object getInstance() { + return null; + } + + @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 group) {} + + @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 methodName) {} + + @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 void setTimeOut(long timeOut) {} + + @Override + public int getInvocationCount() { + return 0; + } + + @Override + public void setInvocationCount(int count) {} + + @Override + public int getSuccessPercentage() { + return 0; + } + + @Override + public String getId() { + return null; + } + + @Override + public void setId(String id) {} + + @Override + public long getDate() { + return 0; + } + + @Override + public void setDate(long date) {} + + @Override + public boolean canRunFromClass(IClass testClass) { + return false; + } + + @Override + public boolean isAlwaysRun() { + return false; + } + + @Override + public int getThreadPoolSize() { + return 0; + } + + @Override + public void setThreadPoolSize(int threadPoolSize) {} + + @Override + public boolean getEnabled() { + return false; + } + + @Override + public String getDescription() { + return null; + } + + @Override + public void setDescription(String description) {} + + @Override + public void incrementCurrentInvocationCount() {} + + @Override + public int getCurrentInvocationCount() { + return 0; + } + + @Override + public void setParameterInvocationCount(int n) {} + + @Override + public int getParameterInvocationCount() { + return 0; + } + + @Override + public void setMoreInvocationChecker(Callable moreInvocationChecker) {} + + @Override + public boolean hasMoreInvocation() { + return false; + } + + @Override + public ITestNGMethod clone() { + throw new UnsupportedOperationException("Not supported"); + } + + @Override + public IRetryAnalyzer getRetryAnalyzer(ITestResult result) { + return null; + } + + @Override + public Class getRetryAnalyzerClass() { + return null; + } + + @Override + public void setRetryAnalyzerClass(Class clazz) {} + + @Override + public boolean skipFailedInvocations() { + return false; + } + + @Override + public void setSkipFailedInvocations(boolean skip) {} + + @Override + public long getInvocationTimeOut() { + return 0; + } + + @Override + public boolean ignoreMissingDependencies() { + return false; + } + + @Override + public void setIgnoreMissingDependencies(boolean ignore) {} + + @Override + public List getInvocationNumbers() { + return Collections.emptyList(); + } + + @Override + public void setInvocationNumbers(List numbers) {} + + @Override + public void addFailedInvocationNumber(int number) {} + + @Override + public List getFailedInvocationNumbers() { + return Collections.emptyList(); + } + + @Override + public int getPriority() { + return 0; + } + + @Override + public void setPriority(int priority) {} + + @Override + public int getInterceptedPriority() { + return 0; + } + + @Override + public void setInterceptedPriority(int priority) {} + + @Override + public XmlTest getXmlTest() { + return null; + } + + @Override + public ConstructorOrMethod getConstructorOrMethod() { + return consMethod; + } + + @Override + public Map findMethodParameters(XmlTest test) { + return test.getLocalParameters(); + } + + @Override + public String getQualifiedName() { + return null; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/paramhandler/ParameterizedSampleTestClass.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/paramhandler/ParameterizedSampleTestClass.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/internal/paramhandler/ParameterizedSampleTestClass.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/internal/paramhandler/ParameterizedSampleTestClass.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,10 @@ +package org.testng.internal.paramhandler; + +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; + +public class ParameterizedSampleTestClass { + @Test + @Parameters("foo") + public void testMethod(String foo) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/jarfileutils/JarCreator.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/jarfileutils/JarCreator.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/jarfileutils/JarCreator.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/jarfileutils/JarCreator.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,54 @@ +package org.testng.jarfileutils; + +import java.io.File; +import java.io.IOException; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.testng.jarfileutils.org.testng.SampleTest1; +import org.testng.jarfileutils.org.testng.SampleTest2; +import org.testng.jarfileutils.org.testng.SampleTest3; +import org.testng.jarfileutils.org.testng.SampleTest4; +import org.testng.jarfileutils.org.testng.SampleTest5; + +public class JarCreator { + + private static final String PREFIX = "testng"; + private static final String ARCHIVE_NAME = "testng-tests.jar"; + + public static File generateJar() throws IOException { + return generateJar(getTestClasses(), getResources(), PREFIX, ARCHIVE_NAME); + } + + public static File generateJar(Class[] classes) throws IOException { + return generateJar(classes, new String[] {}, PREFIX, ARCHIVE_NAME); + } + + public static File generateJar( + Class[] classes, String[] resources, String prefix, String archiveName) + throws IOException { + File jarFile = File.createTempFile(prefix, ".jar"); + JavaArchive archive = ShrinkWrap.create(JavaArchive.class, archiveName).addClasses(classes); + for (String resource : resources) { + archive = archive.addAsResource(resource); + } + archive.as(ZipExporter.class).exportTo(jarFile, true); + return jarFile; + } + + private static Class[] getTestClasses() { + return new Class[] { + SampleTest1.class, SampleTest2.class, SampleTest3.class, SampleTest4.class, SampleTest5.class + }; + } + + private static String[] getResources() { + return new String[] { + "jarfileutils/testng-tests.xml", + "jarfileutils/child.xml", + "jarfileutils/child/child.xml", + "jarfileutils/child/childofchild/childofchild.xml", + "jarfileutils/childofchild/childofchild.xml" + }; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/jarfileutils/org/testng/SampleTest1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/jarfileutils/org/testng/SampleTest1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/jarfileutils/org/testng/SampleTest1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/jarfileutils/org/testng/SampleTest1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package org.testng.jarfileutils.org.testng; + +import org.testng.annotations.Test; + +public class SampleTest1 { + @Test + public void test1() {} + + @Test + public void test2() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/jarfileutils/org/testng/SampleTest2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/jarfileutils/org/testng/SampleTest2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/jarfileutils/org/testng/SampleTest2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/jarfileutils/org/testng/SampleTest2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package org.testng.jarfileutils.org.testng; + +import org.testng.annotations.Test; + +public class SampleTest2 { + @Test + public void test1() {} + + @Test + public void test2() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/jarfileutils/org/testng/SampleTest3.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/jarfileutils/org/testng/SampleTest3.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/jarfileutils/org/testng/SampleTest3.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/jarfileutils/org/testng/SampleTest3.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package org.testng.jarfileutils.org.testng; + +import org.testng.annotations.Test; + +public class SampleTest3 { + @Test + public void test1() {} + + @Test + public void test2() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/jarfileutils/org/testng/SampleTest4.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/jarfileutils/org/testng/SampleTest4.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/jarfileutils/org/testng/SampleTest4.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/jarfileutils/org/testng/SampleTest4.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package org.testng.jarfileutils.org.testng; + +import org.testng.annotations.Test; + +public class SampleTest4 { + @Test + public void test1() {} + + @Test + public void test2() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/jarfileutils/org/testng/SampleTest5.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/jarfileutils/org/testng/SampleTest5.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/jarfileutils/org/testng/SampleTest5.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/jarfileutils/org/testng/SampleTest5.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package org.testng.jarfileutils.org.testng; + +import org.testng.annotations.Test; + +public class SampleTest5 { + @Test + public void test1() {} + + @Test + public void test2() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/log4testng/LoggerTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/log4testng/LoggerTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/log4testng/LoggerTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/log4testng/LoggerTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,236 @@ +package org.testng.log4testng; + +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; +import java.util.Properties; +import org.testng.Assert; +import org.testng.annotations.Test; + +public class LoggerTest { + /** + * This method is for debugging purpose only. + * + * @param pProperties a properties bundle initialised as log4testng property file would be. + * @param pOut the standard output stream to be used for logging. + * @param pErr the standard error stream to be used for logging. + */ + private static synchronized void testInitialize( + Properties pProperties, PrintStream pOut, PrintStream pErr) { + Logger.initialized = true; + Logger.loggers.clear(); + Logger.rootLoggerLevel = Logger.WARN; + Logger.debug = false; + Logger.out = pOut; + Logger.err = pErr; + Logger.checkProperties(pProperties); + } + + /** Makes sure the default debug value is false. */ + @Test + void testDebugDefault() { + Properties props = new Properties(); + ByteArrayOutputStream out1 = new ByteArrayOutputStream(); + ByteArrayOutputStream err1 = new ByteArrayOutputStream(); + PrintStream out2 = new PrintStream(out1); + PrintStream err2 = new PrintStream(err1); + props.put("log4testng.rootLogger", "WARN"); + testInitialize(props, out2, err2); + Assert.assertEquals(out1.toString(), ""); + Assert.assertEquals(err1.toString(), ""); + } + + /** Makes sure the debug value can be turned on and actualls logs something. */ + @Test + void testDebugOn() { + Properties props = new Properties(); + ByteArrayOutputStream out1 = new ByteArrayOutputStream(); + ByteArrayOutputStream err1 = new ByteArrayOutputStream(); + PrintStream out2 = new PrintStream(out1); + PrintStream err2 = new PrintStream(err1); + props.put("log4testng.debug", "true"); + props.put("log4testng.rootLogger", "WARN"); + testInitialize(props, out2, err2); + Assert.assertTrue(out1.toString().startsWith("[log4testng][debug]")); + Assert.assertEquals(err1.toString(), ""); + } + + /** Makes sure the debug value can be turned off and logs nothing. */ + @Test + void testDebugOff() { + Properties props = new Properties(); + ByteArrayOutputStream out1 = new ByteArrayOutputStream(); + ByteArrayOutputStream err1 = new ByteArrayOutputStream(); + PrintStream out2 = new PrintStream(out1); + PrintStream err2 = new PrintStream(err1); + props.put("log4testng.debug", "false"); + props.put("log4testng.rootLogger", "WARN"); + testInitialize(props, out2, err2); + Assert.assertEquals(out1.toString(), ""); + Assert.assertEquals(err1.toString(), ""); + } + + /** Makes sure an illegal debug value throws an exception. */ + @Test + void testDebugError() { + Properties props = new Properties(); + ByteArrayOutputStream out1 = new ByteArrayOutputStream(); + ByteArrayOutputStream err1 = new ByteArrayOutputStream(); + PrintStream out2 = new PrintStream(out1); + PrintStream err2 = new PrintStream(err1); + props.put("log4testng.debug", "unknown"); + props.put("log4testng.rootLogger", "WARN"); + try { + testInitialize(props, out2, err2); + throw new RuntimeException("failure"); + } catch (IllegalArgumentException pEx) { + + // Normal case + Assert.assertEquals(out1.toString(), ""); + Assert.assertEquals(err1.toString(), ""); + } + } + + /** + * Tests that the root logger's default level is WARN and that loggers do not log bellow this + * level and do log in the correct stream for levels equal to and above WARN. + */ + @Test + void testRootLoggerDefault() { + Properties props = new Properties(); + ByteArrayOutputStream out1 = new ByteArrayOutputStream(); + ByteArrayOutputStream err1 = new ByteArrayOutputStream(); + PrintStream out2 = new PrintStream(out1); + PrintStream err2 = new PrintStream(err1); + testInitialize(props, out2, err2); + + Logger strLogger = Logger.getLogger(String.class); + strLogger.trace("trace should not appear"); + Assert.assertEquals(out1.toString(), ""); + Assert.assertEquals(err1.toString(), ""); + strLogger.debug("debug should not appear"); + Assert.assertEquals(out1.toString(), ""); + Assert.assertEquals(err1.toString(), ""); + strLogger.info("info should not appear"); + Assert.assertEquals(out1.toString(), ""); + Assert.assertEquals(err1.toString(), ""); + strLogger.warn("warn should appear"); + int outlength = out1.toString().length(); + Assert.assertTrue(out1.toString().startsWith("[java.lang.String] [WARN] warn should appear")); + Assert.assertEquals(err1.toString(), ""); + strLogger.error("error should appear"); + Assert.assertEquals(out1.toString().length(), outlength); + Assert.assertTrue(err1.toString().startsWith("[java.lang.String] [ERROR] error should appear")); + strLogger.fatal("fatal should appear"); + Assert.assertEquals(out1.toString().length(), outlength); + Assert.assertTrue(err1.toString().contains("[java.lang.String] [FATAL] fatal should appear")); + } + + /** Test setting the root logger level */ + @Test + void testRootLoggerSet() { + Properties props = new Properties(); + ByteArrayOutputStream out1 = new ByteArrayOutputStream(); + ByteArrayOutputStream err1 = new ByteArrayOutputStream(); + PrintStream out2 = new PrintStream(out1); + PrintStream err2 = new PrintStream(err1); + props.put("log4testng.rootLogger", "DEBUG"); + testInitialize(props, out2, err2); + + Logger strLogger = Logger.getLogger(String.class); + strLogger.trace("trace should appear"); + Assert.assertEquals(out1.toString(), ""); + Assert.assertEquals(err1.toString(), ""); + strLogger.debug("debug should appear"); + Assert.assertTrue(out1.toString().startsWith("[java.lang.String] [DEBUG] debug should appear")); + Assert.assertEquals(err1.toString(), ""); + } + + /** Test setting the root logger to an illegal level value throws an exception. */ + @Test + void testRootLoggerSetError() { + Properties props = new Properties(); + ByteArrayOutputStream out1 = new ByteArrayOutputStream(); + ByteArrayOutputStream err1 = new ByteArrayOutputStream(); + PrintStream out2 = new PrintStream(out1); + PrintStream err2 = new PrintStream(err1); + props.put("log4testng.rootLogger", "unknown"); + try { + testInitialize(props, out2, err2); + throw new RuntimeException("failure"); + } catch (IllegalArgumentException pEx) { + + // Normal case + Assert.assertEquals(out1.toString(), ""); + Assert.assertEquals(err1.toString(), ""); + } + } + + /** Test setting a user logger level */ + @Test + void testUserLoggerSet() { + Properties props = new Properties(); + ByteArrayOutputStream out1 = new ByteArrayOutputStream(); + ByteArrayOutputStream err1 = new ByteArrayOutputStream(); + PrintStream out2 = new PrintStream(out1); + PrintStream err2 = new PrintStream(err1); + props.put("log4testng.logger.java.lang.String", "DEBUG"); + testInitialize(props, out2, err2); + + Logger strLogger = Logger.getLogger(String.class); + strLogger.trace("trace should not appear"); + Assert.assertEquals(out1.toString(), ""); + Assert.assertEquals(err1.toString(), ""); + strLogger.debug("debug should appear"); + int outLength = out1.toString().length(); + Assert.assertTrue(out1.toString().startsWith("[java.lang.String] [DEBUG] debug should appear")); + Assert.assertEquals(err1.toString(), ""); + + Logger classLogger = Logger.getLogger(Class.class); + classLogger.debug("debug should not appear"); + Assert.assertEquals(out1.toString().length(), outLength); + Assert.assertEquals(err1.toString(), ""); + classLogger.warn("warn should appear"); + Assert.assertTrue(out1.toString().contains("[java.lang.Class] [WARN] warn should appear")); + Assert.assertEquals(err1.toString(), ""); + } + + /** Test setting a user logger to an illegal level value throws an exception */ + @Test + void testUserLoggerSetError() { + Properties props = new Properties(); + ByteArrayOutputStream out1 = new ByteArrayOutputStream(); + ByteArrayOutputStream err1 = new ByteArrayOutputStream(); + PrintStream out2 = new PrintStream(out1); + PrintStream err2 = new PrintStream(err1); + props.put("log4testng.logger.java.lang.String", "unknown"); + try { + testInitialize(props, out2, err2); + throw new RuntimeException("failure"); + } catch (IllegalArgumentException pEx) { + + // Normal case + Assert.assertEquals(out1.toString(), ""); + Assert.assertEquals(err1.toString(), ""); + } + } + + /** Tests setting a partial logger name (a hierarchy scope) */ + @Test + void testUserLoggerSetHierarchy() { + Properties props = new Properties(); + ByteArrayOutputStream out1 = new ByteArrayOutputStream(); + ByteArrayOutputStream err1 = new ByteArrayOutputStream(); + PrintStream out2 = new PrintStream(out1); + PrintStream err2 = new PrintStream(err1); + props.put("log4testng.logger.java.lang", "DEBUG"); + testInitialize(props, out2, err2); + + Logger strLogger = Logger.getLogger(String.class); + strLogger.trace("trace should not appear"); + Assert.assertEquals(out1.toString(), ""); + Assert.assertEquals(err1.toString(), ""); + strLogger.debug("debug should appear"); + Assert.assertTrue(out1.toString().startsWith("[java.lang.String] [DEBUG] debug should appear")); + Assert.assertEquals(err1.toString(), ""); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/reporters/FailedInformationOnConsoleReporter.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/reporters/FailedInformationOnConsoleReporter.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/reporters/FailedInformationOnConsoleReporter.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/reporters/FailedInformationOnConsoleReporter.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,81 @@ +package org.testng.reporters; + +import java.util.Arrays; +import java.util.List; +import org.testng.IReporter; +import org.testng.IResultMap; +import org.testng.ISuite; +import org.testng.ISuiteResult; +import org.testng.ITestContext; +import org.testng.ITestResult; +import org.testng.internal.Utils; +import org.testng.util.Strings; +import org.testng.xml.XmlSuite; + +public class FailedInformationOnConsoleReporter implements IReporter { + + @Override + public void generateReport(List xmlSuites, List suites, String outDir) { + suites.forEach(FailedInformationOnConsoleReporter::generateReport); + } + + private static void generateReport(ISuite suite) { + suite.getResults().forEach(FailedInformationOnConsoleReporter::generateReport); + } + + private static void generateReport(String name, ISuiteResult suiteResult) { + ITestContext ctx = suiteResult.getTestContext(); + IResultMap failedConfigs = ctx.getFailedConfigurations(); + boolean hasFailedConfigs = !failedConfigs.getAllMethods().isEmpty(); + + IResultMap failedTests = ctx.getFailedTests(); + boolean hasFailedTests = !failedTests.getAllResults().isEmpty(); + if (!hasFailedConfigs && !hasFailedTests) { + return; + } + + if (hasFailedConfigs) { + System.err.println(Strings.repeat("=", 100)); + System.err.println( + "::::::Failed Configurations for Suite ::: [" + + name + + "] ::: Test name [" + + ctx.getName() + + "]::::::"); + System.err.println(Strings.repeat("=", 100)); + failedConfigs.getAllResults().forEach(FailedInformationOnConsoleReporter::generateReport); + System.err.println(Strings.repeat("=", 100)); + System.err.println("\n\n"); + } + + if (hasFailedTests) { + System.err.println(Strings.repeat("=", 100)); + System.err.println( + "::::::Failed Tests for Suite ::: [" + + name + + "] ::: Test name [" + + ctx.getName() + + "]::::::"); + System.err.println(Strings.repeat("=", 100)); + failedTests.getAllResults().forEach(FailedInformationOnConsoleReporter::generateReport); + System.err.println(Strings.repeat("=", 100)); + System.err.println("\n\n"); + } + } + + private static void generateReport(ITestResult result) { + StringBuilder builder = new StringBuilder(); + String clsname = result.getTestClass().getRealClass().getName() + "."; + String methodname = result.getMethod().getMethodName() + "()"; + builder.append(clsname).append(methodname); + Object[] parameters = result.getParameters(); + if (parameters != null && parameters.length != 0) { + builder.append(" Parameters:").append(Arrays.toString(parameters)); + } + Throwable throwable = result.getThrowable(); + builder.append("\nException:\n"); + builder.append(Utils.shortStackTrace(throwable, false)); + builder.append("\n\n"); + System.err.println(builder.toString()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/reporters/jq/TimesPanelTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/reporters/jq/TimesPanelTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/reporters/jq/TimesPanelTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/reporters/jq/TimesPanelTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,32 @@ +package org.testng.reporters.jq; + +import static org.testng.AssertJUnit.assertTrue; + +import java.util.ArrayList; +import java.util.List; +import org.testng.ISuite; +import org.testng.annotations.Test; +import org.testng.internal.paramhandler.FakeSuite; +import org.testng.reporters.XMLStringBuffer; +import org.testng.xml.XmlTest; +import test.SimpleBaseTest; + +public class TimesPanelTest extends SimpleBaseTest { + + private static final String GITHUB_1931 = "GITHUB-1931 [NPE] TimesPanel.maxTime(ISuite suite)"; + + @Test(description = GITHUB_1931) + public void generateReportTimesPanelContentForSuiteWithoutStartedTests() { + XmlTest xmlTest = createXmlTest("GITHUB_1931", "NPE", Object.class); + ISuite iSuite = new FakeSuite(xmlTest); + List suites = new ArrayList<>(); + suites.add(iSuite); + Model model = new Model(suites); + TimesPanel panel = new TimesPanel(model); + XMLStringBuffer buffer = new XMLStringBuffer(); + panel.getContent(iSuite, buffer); + assertTrue( + "TimesPanel contains total running time", + panel.getContent(iSuite, buffer).contains("Total running time: 0 ms")); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/util/StringsTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/util/StringsTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/util/StringsTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/util/StringsTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,26 @@ +package org.testng.util; + +import static org.testng.Assert.assertEquals; + +import org.testng.annotations.Test; + +/** Unit tests for {@link Strings} */ +public class StringsTest { + @Test + public void joinEmptyArray() { + String[] emptyArray = new String[0]; + assertEquals(Strings.join(",", emptyArray), ""); + } + + @Test + public void joinArrayWithOneElement() { + String[] array = new String[] {"one"}; + assertEquals(Strings.join(",", array), "one"); + } + + @Test + public void joinArrayWithTwoElements() { + String[] array = new String[] {"one", "two"}; + assertEquals(Strings.join(",", array), "one,two"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/xml/FakeHttpXmlParser.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/xml/FakeHttpXmlParser.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/xml/FakeHttpXmlParser.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/xml/FakeHttpXmlParser.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package org.testng.xml; + +import java.io.InputStream; +import org.testng.TestNGException; + +public class FakeHttpXmlParser implements ISuiteParser { + @Override + public boolean accept(String fileName) { + return fileName.startsWith("https") || fileName.startsWith("http"); + } + + @Override + public XmlSuite parse(String filePath, InputStream is, boolean loadClasses) + throws TestNGException { + XmlSuite suite = new XmlSuite(); + suite.setName("fake_suite"); + return suite; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/xml/Issue1716TestSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/xml/Issue1716TestSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/xml/Issue1716TestSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/xml/Issue1716TestSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ +package org.testng.xml; + +import org.testng.annotations.Test; + +public class Issue1716TestSample { + @Test + public void testMethod() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/xml/ParserTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/xml/ParserTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/xml/ParserTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/xml/ParserTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,31 @@ +package org.testng.xml; + +import static org.testng.Assert.assertEquals; + +import java.io.File; +import java.util.List; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import org.testng.xml.internal.Parser; + +public class ParserTest { + + private static final String XML_FILE_NAME = "src/test/resources/a.xml"; + + @Test(dataProvider = "dp") + public void testParsing(String file) throws Exception { + Parser parser = new Parser(file); + List suites = parser.parseToList(); + assertEquals(suites.size(), 1); + } + + @DataProvider(name = "dp") + public Object[][] getData() { + return new Object[][] { + {XML_FILE_NAME}, + {new File(XML_FILE_NAME).toURI().toString()}, + {"https://localhost:4444/testng.xml"}, + {"https://localhost:4444/testng.xml"} + }; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/xml/SuiteXmlParserTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/xml/SuiteXmlParserTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/xml/SuiteXmlParserTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/xml/SuiteXmlParserTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,41 @@ +package org.testng.xml; + +import static test.SimpleBaseTest.getPathToResource; + +import java.io.File; +import java.io.FileInputStream; +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class SuiteXmlParserTest { + + private static final File PARENT = new File(getPathToResource("xml")); + + @DataProvider + private static Object[][] dp() { + return new Object[][] { + {"goodWithDoctype.xml", true}, + {"goodWithoutDoctype.xml", true}, + {"badWithDoctype.xml", false}, // TestNGException -> SAXParseException + {"badWithoutDoctype.xml", false}, // NullPointerException + {"issue174.xml", true} + }; + } + + @Test(dataProvider = "dp") + public void testParse(String fileName, boolean shouldWork) { + SuiteXmlParser parser = new SuiteXmlParser(); + + try (FileInputStream stream = new FileInputStream(new File(PARENT, fileName))) { + XmlSuite suite = parser.parse(fileName, stream, false); + if (!shouldWork) { + Assert.fail("Parsing of " + fileName + " is supposed to fail"); + } + } catch (Exception e) { + if (shouldWork) { + Assert.fail("Parsing of " + fileName + " is supposed to work"); + } + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/xml/XmlSuiteTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/xml/XmlSuiteTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/xml/XmlSuiteTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/xml/XmlSuiteTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,125 @@ +package org.testng.xml; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.io.IOException; +import java.io.OutputStream; +import java.io.PrintStream; +import java.io.StringReader; +import java.util.Arrays; +import java.util.List; +import org.testng.TestNG; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import org.testng.collections.Lists; +import org.testng.xml.internal.Parser; +import test.SimpleBaseTest; + +public class XmlSuiteTest extends SimpleBaseTest { + + @Test + public void testIncludedAndExcludedGroups() { + XmlSuite suite = new XmlSuite(); + suite.addIncludedGroup("foo"); + suite.addExcludedGroup("bar"); + assertThat(suite.getIncludedGroups()).containsExactly("foo"); + assertThat(suite.getExcludedGroups()).containsExactly("bar"); + } + + @Test + public void testIncludedAndExcludedGroupsWithRun() { + XmlRun xmlRun = new XmlRun(); + xmlRun.onInclude("foo"); + xmlRun.onExclude("bar"); + XmlGroups groups = new XmlGroups(); + groups.setRun(xmlRun); + XmlSuite suite = new XmlSuite(); + suite.setGroups(groups); + assertThat(suite.getIncludedGroups()).containsExactly("foo"); + assertThat(suite.getExcludedGroups()).containsExactly("bar"); + } + + @Test(dataProvider = "dp", description = "GITHUB-778") + public void testTimeOut(String timeout, int size, int lineNumber) { + XmlSuite suite = new XmlSuite(); + suite.setTimeOut(timeout); + StringReader stringReader = new StringReader(suite.toXml()); + List resultLines = Lists.newArrayList(); + List lineNumbers = grep(stringReader, "time-out=\"1000\"", resultLines); + assertThat(lineNumbers).size().isEqualTo(size); + assertThat(resultLines).size().isEqualTo(size); + if (size > 0) { + assertThat(lineNumbers.get(size - 1)).isEqualTo(lineNumber); + } + } + + @DataProvider(name = "dp") + public Object[][] getData() { + return new Object[][] { + {"1000", 1, 2}, + {"", 0, 0} + }; + } + + @Test(description = "GITHUB-1668") + public void ensureNoExceptionsAreRaisedWhenMethodSelectorsDefinedAtSuiteLevel() + throws IOException { + Parser parser = new Parser("src/test/resources/xml/issue1668.xml"); + List suites = parser.parseToList(); + XmlSuite xmlsuite = suites.get(0); + TestNG testNG = create(); + testNG.setXmlSuites(suites); + testNG.setUseDefaultListeners(false); + testNG.run(); + // Trigger a call to "toXml()" to ensure that there is no exception raised. + assertThat(xmlsuite.toXml()).isNotEmpty(); + } + + @Test(description = "GITHUB-435") + public void ensureSuiteLevelPackageIsAppliedToAllTests() throws IOException { + Parser parser = new Parser("src/test/resources/xml/issue435.xml"); + List suites = parser.parseToList(); + XmlSuite xmlsuite = suites.get(0); + assertThat(xmlsuite.getTests().get(0).getClasses().size()).isEqualTo(0); + TestNG testNG = create(); + testNG.setXmlSuites(suites); + testNG.setUseDefaultListeners(false); + testNG.run(); + assertThat(xmlsuite.getTests().get(0).getClasses().size()).isEqualTo(1); + } + + @Test(description = "GITHUB-1674") + public void ensureSuiteLevelBeanshellIsAppliedToAllTests() throws IOException { + PrintStream current = System.out; + StringOutputStream stream = new StringOutputStream(); + try { + System.setOut(new PrintStream(stream)); + Parser parser = new Parser("src/test/resources/xml/issue1674.xml"); + List suites = parser.parseToList(); + XmlSuite xmlsuite = suites.get(0); + assertThat(xmlsuite.getTests().get(0).getMethodSelectors().size()).isEqualTo(0); + TestNG testNG = create(); + testNG.setXmlSuites(suites); + testNG.setUseDefaultListeners(false); + testNG.run(); + assertThat(xmlsuite.getTests().get(0).getMethodSelectors().size()).isEqualTo(1); + assertThat(stream.toString()).contains(Arrays.asList("rajni", "kamal", "mgr")); + } finally { + System.setOut(current); + } + } + + static class StringOutputStream extends OutputStream { + private StringBuilder string = new StringBuilder(); + + @Override + public void write(int b) { + this.string.append((char) b); + } + + // Netbeans IDE automatically overrides this toString() + public String toString() { + return this.string.toString(); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/xml/XmlTestTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/xml/XmlTestTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/xml/XmlTestTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/xml/XmlTestTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,52 @@ +package org.testng.xml; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Collections; +import java.util.Map; +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import org.testng.collections.Maps; +import test.SimpleBaseTest; +import test.junitreports.SimpleTestSample; + +public class XmlTestTest extends SimpleBaseTest { + @Test + public void testNameMatchesAny() { + XmlSuite xmlSuite = createDummySuiteWithTestNamesAs("test1"); + XmlTest xmlTest = xmlSuite.getTests().get(0); + assertThat(xmlTest.nameMatchesAny(Collections.singletonList("test1"))).isTrue(); + assertThat(xmlTest.nameMatchesAny(Collections.singletonList("test2"))).isFalse(); + } + + @Test(dataProvider = "dp", description = "GITHUB-1716") + public void testNullOrEmptyParameter(Map data) { + XmlTest test = createXmlTest("suite", "test", Issue1716TestSample.class); + test.setParameters(data); + test.toXml(" "); + Assert.assertTrue(true, "No exceptions should have been thrown"); + } + + @DataProvider(name = "dp") + public Object[][] getData() { + return new Object[][] {{newSetOfParameters(null, "value")}, {newSetOfParameters("foo", null)}}; + } + + @Test(description = "GITHUB-2467") + public void testXMLClassesInCloneMethod() { + XmlSuite xmlSuite = createXmlSuite("suite"); + XmlTest xmlTest = createXmlTest(xmlSuite, "test"); + createXmlClass(xmlTest, SimpleTestSample.class); + XmlTest copyXmlTest = (XmlTest) xmlTest.clone(); + Assert.assertNotNull(copyXmlTest); + Assert.assertNotNull(copyXmlTest.getXmlClasses()); + Assert.assertEquals(xmlTest.getXmlClasses().size(), copyXmlTest.getXmlClasses().size()); + } + + private static Map newSetOfParameters(String key, String value) { + Map map = Maps.newHashMap(); + map.put(key, value); + return map; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/xml/internal/TestNamesMatcherTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/xml/internal/TestNamesMatcherTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/xml/internal/TestNamesMatcherTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/xml/internal/TestNamesMatcherTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,109 @@ +package org.testng.xml.internal; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import org.testng.TestNGException; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import org.testng.collections.CollectionUtils; +import org.testng.collections.Lists; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.SimpleBaseTest; + +public class TestNamesMatcherTest extends SimpleBaseTest { + + @Test + public void testCloneIfContainsTestsWithNamesMatchingAny() { + XmlSuite suite = createDummySuiteWithTestNamesAs("test1", "test2"); + TestNamesMatcher testNamesMatcher = + new TestNamesMatcher(suite, Collections.singletonList("test2")); + List xmlTests = testNamesMatcher.getMatchedTests(); + assertThat(suite.getTests()).hasSameElementsAs(xmlTests); + } + + @Test(description = "GITHUB-1594", dataProvider = "getTestnames") + public void testCloneIfContainsTestsWithNamesMatchingAnyChildSuites( + String testname, boolean foundInParent, boolean foundInChildOfChild) { + XmlSuite parentSuite = createDummySuiteWithTestNamesAs("test1", "test2"); + parentSuite.setName("parent_suite"); + XmlSuite childSuite = createDummySuiteWithTestNamesAs("test3", "test4"); + childSuite.setName("child_suite"); + parentSuite.getChildSuites().add(childSuite); + XmlSuite childOfChildSuite = createDummySuiteWithTestNamesAs("test5", "test6"); + childSuite.getChildSuites().add(childOfChildSuite); + TestNamesMatcher testNamesMatcher = + new TestNamesMatcher(parentSuite, Collections.singletonList(testname)); + List xmlTests = testNamesMatcher.getMatchedTests(); + if (foundInParent) { + assertThat(xmlTests).hasSameElementsAs(parentSuite.getTests()); + } else if (!foundInChildOfChild) { + assertThat(xmlTests).hasSameElementsAs(childSuite.getTests()); + } else { + assertThat(xmlTests).hasSameElementsAs(childOfChildSuite.getTests()); + } + } + + @Test( + expectedExceptions = TestNGException.class, + expectedExceptionsMessageRegExp = "\nPlease provide a valid list of names to check.", + dataProvider = "getData") + public void testCloneIfContainsTestsWithNamesMatchingAnyNegativeCondition( + XmlSuite xmlSuite, List names) { + TestNamesMatcher testNamesHelper = new TestNamesMatcher(xmlSuite, names); + } + + @Test + public void testIfTestnamesComesFromDifferentSuite() { + XmlSuite parentSuite = createDummySuiteWithTestNamesAs("test1", "test2"); + parentSuite.setName("parent_suite"); + XmlSuite childSuite = createDummySuiteWithTestNamesAs("test3", "test4"); + childSuite.setName("child_suite"); + parentSuite.getChildSuites().add(childSuite); + XmlSuite childOfChildSuite = createDummySuiteWithTestNamesAs("test5", "test6"); + childSuite.getChildSuites().add(childOfChildSuite); + TestNamesMatcher testNamesMatcher = + new TestNamesMatcher( + parentSuite, new ArrayList<>(Arrays.asList("test1", "test3", "test5"))); + List matchedTestnames = Lists.newArrayList(); + for (XmlTest xmlTest : testNamesMatcher.getMatchedTests()) { + matchedTestnames.add(xmlTest.getName()); + } + assertThat(matchedTestnames).hasSameElementsAs(Arrays.asList("test1", "test3", "test5")); + } + + @Test( + expectedExceptions = TestNGException.class, + expectedExceptionsMessageRegExp = "\nThe test\\(s\\) \\<\\[test3\\]\\> cannot be found.") + public void testCloneIfContainsTestsWithNamesMatchingAnyWithoutMatch() { + XmlSuite xmlSuite = createDummySuiteWithTestNamesAs("test1", "test2"); + TestNamesMatcher testNamesMatcher = + new TestNamesMatcher(xmlSuite, Collections.singletonList("test3")); + List clonedSuites = testNamesMatcher.getSuitesMatchingTestNames(); + if (!CollectionUtils.hasElements(clonedSuites)) { + throw new TestNGException( + "The test(s) <" + Collections.singletonList("test3").toString() + "> cannot be found."); + } + } + + @DataProvider(name = "getTestnames") + public Object[][] getTestnameToSearchFor() { + return new Object[][] { + {"test4", false, false}, + {"test1", true, false}, + {"test5", false, true} + }; + } + + @DataProvider(name = "getData") + public Object[][] getTestData() { + return new Object[][] { + {new XmlSuite(), null}, + {new XmlSuite(), Collections.emptyList()} + }; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/xml/internal/XmlSuiteUtilsTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/xml/internal/XmlSuiteUtilsTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/xml/internal/XmlSuiteUtilsTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/xml/internal/XmlSuiteUtilsTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,24 @@ +package org.testng.xml.internal; + +import org.testng.TestNGException; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import test.SimpleBaseTest; + +public class XmlSuiteUtilsTest extends SimpleBaseTest { + + @Test( + expectedExceptions = TestNGException.class, + expectedExceptionsMessageRegExp = + "\nTwo tests in the same suite \\[random_suite\\] cannot have the same name: test1") + public void testEnsureNoDuplicateTestsArePresentNegativeCondition() { + XmlSuite suite = createDummySuiteWithTestNamesAs("test1", "test1"); + XmlSuiteUtils.ensureNoDuplicateTestsArePresent(suite); + } + + @Test + public void testEnsureNoDuplicateTestsArePresent() { + XmlSuite suite = createDummySuiteWithTestNamesAs("test1", "test2"); + XmlSuiteUtils.ensureNoDuplicateTestsArePresent(suite); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/xml/issue1668/TestClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/xml/issue1668/TestClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/xml/issue1668/TestClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/xml/issue1668/TestClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package org.testng.xml.issue1668; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class TestClassSample { + @Test + public void testMethod() { + Assert.assertTrue(true); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/xml/issue1674/Testclass.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/xml/issue1674/Testclass.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/xml/issue1674/Testclass.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/xml/issue1674/Testclass.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ +package org.testng.xml.issue1674; + +import org.testng.annotations.Test; + +public class Testclass { + @Test + public void testMethod() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/xml/issue435/Testclass.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/xml/issue435/Testclass.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/org/testng/xml/issue435/Testclass.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/org/testng/xml/issue435/Testclass.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package org.testng.xml.issue435; + +import org.testng.annotations.Test; + +public class Testclass { + @Test(groups = "group1") + public void testMethod1() {} + + @Test(groups = "group2") + public void testMethod2() {} + + @Test(groups = "group3") + public void testMethod3() {} + + @Test(groups = "group4") + public void testMethod4() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/BaseDistributedTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/BaseDistributedTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/BaseDistributedTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/BaseDistributedTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,49 @@ +package test; + +import java.util.List; +import java.util.Map; +import org.testng.Assert; +import org.testng.ITestResult; +import org.testng.collections.Maps; +import org.testng.log4testng.Logger; + +public class BaseDistributedTest { + private boolean m_verbose = false; + + protected void verifyTests(String title, String[] exp, Map> found) { + Map expected = Maps.newHashMap(); + for (String element : exp) { + expected.put(element, element); + } + + Assert.assertEquals( + found.size(), expected.size(), "Verification for " + title + " tests failed:"); + + for (Object o : expected.values()) { + String name = (String) o; + if (null == found.get(name)) { + dumpMap("Expected", expected); + dumpMap("Found", found); + } + + Assert.assertNotNull( + found.get(name), + "Expected to find method " + name + " in " + title + " but didn't find it."); + } + } + + protected void dumpMap(String title, Map m) { + if (m_verbose) { + Logger.getLogger(getClass()).info("==== " + title); + for (Map.Entry entry : m.entrySet()) { + log(entry.getKey() + " => " + entry.getValue()); + } + } + } + + private void log(String s) { + if (m_verbose) { + Logger.getLogger(getClass()).info("[BaseDistributedTest] " + s); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/BaseTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/BaseTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/BaseTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/BaseTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,434 @@ +package test; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import org.testng.Assert; +import org.testng.IClassListener; +import org.testng.IInvokedMethodListener; +import org.testng.ISuite; +import org.testng.ITestObjectFactory; +import org.testng.ITestResult; +import org.testng.ITestRunnerFactory; +import org.testng.SuiteRunner; +import org.testng.TestListenerAdapter; +import org.testng.TestRunner; +import org.testng.annotations.BeforeMethod; +import org.testng.collections.Lists; +import org.testng.collections.Maps; +import org.testng.internal.Configuration; +import org.testng.internal.IConfiguration; +import org.testng.internal.Systematiser; +import org.testng.reporters.JUnitXMLReporter; +import org.testng.reporters.TestHTMLReporter; +import org.testng.xml.XmlClass; +import org.testng.xml.XmlInclude; +import org.testng.xml.XmlMethodSelector; +import org.testng.xml.XmlPackage; +import org.testng.xml.XmlScript; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; + +/** + * Base class for tests + * + * @since May 5, 2004 + */ +public class BaseTest extends BaseDistributedTest { + private static final String m_outputDirectory = "test-output-tests"; + + private XmlSuite m_suite = null; + private final ITestRunnerFactory m_testRunnerFactory; + private final IConfiguration m_configuration; + + private Integer m_verbose = null; + + public BaseTest() { + m_configuration = new Configuration(); + m_configuration.setObjectFactory(new ITestObjectFactory() {}); + m_testRunnerFactory = new InternalTestRunnerFactory(this); + } + + protected void setParallel(XmlSuite.ParallelMode parallel) { + getTest().setParallel(parallel); + } + + protected void setVerbose(int n) { + m_verbose = n; + } + + protected void setTestTimeOut(long n) { + getTest().setTimeOut(n); + } + + protected void setSuiteTimeOut(long n) { + m_suite.setTimeOut(Long.toString(n)); + } + + protected void setJUnit(boolean f) { + getTest().setJUnit(f); + } + + protected void setThreadCount(int count) { + getTest().getSuite().setThreadCount(count); + } + + private Map m_tests = new HashMap<>(); + private Map>> m_passedTests = new HashMap<>(); + private Map>> m_failedTests = new HashMap<>(); + private Map>> m_skippedTests = new HashMap<>(); + private Map>> m_passedConfigs = new HashMap<>(); + private Map>> m_failedConfigs = new HashMap<>(); + private Map>> m_skippedConfigs = new HashMap<>(); + private Map>> m_failedButWithinSuccessPercentageTests = + new HashMap<>(); + + protected Map> getTests(Map>> map) { + return map.computeIfAbsent(getId(), k -> new HashMap<>()); + } + + protected XmlTest getTest() { + return m_tests.get(getId()); + } + + protected void setTests( + Map>> map, Map> m) { + map.put(getId(), m); + } + + public Map> getFailedTests() { + return getTests(m_failedTests); + } + + public Map> getFailedButWithinSuccessPercentageTests() { + return getTests(m_failedButWithinSuccessPercentageTests); + } + + public Map> getPassedTests() { + return getTests(m_passedTests); + } + + public Map> getSkippedTests() { + return getTests(m_skippedTests); + } + + public Map> getFailedConfigs() { + return getTests(m_failedConfigs); + } + + public Map> getPassedConfigs() { + return getTests(m_passedConfigs); + } + + public Map> getSkippedConfigs() { + return getTests(m_skippedConfigs); + } + + public void setSkippedTests(Map> m) { + setTests(m_skippedTests, m); + } + + public void setPassedTests(Map> m) { + setTests(m_passedTests, m); + } + + public void setFailedTests(Map> m) { + setTests(m_failedTests, m); + } + + public void setFailedButWithinSuccessPercentageTests(Map> m) { + setTests(m_failedButWithinSuccessPercentageTests, m); + } + + public void setSkippedConfigs(Map> m) { + setTests(m_skippedConfigs, m); + } + + public void setPassedConfigs(Map> m) { + setTests(m_passedConfigs, m); + } + + public void setFailedConfigs(Map> m) { + setTests(m_failedConfigs, m); + } + + protected void run() { + assert null != getTest() + : "Test wasn't set, maybe @Configuration methodSetUp() was never called"; + setPassedTests(Maps.newHashMap()); + setFailedTests(Maps.newHashMap()); + setSkippedTests(Maps.newHashMap()); + setPassedConfigs(Maps.newHashMap()); + setFailedConfigs(Maps.newHashMap()); + setSkippedConfigs(Maps.newHashMap()); + setFailedButWithinSuccessPercentageTests(Maps.newHashMap()); + + m_suite.setVerbose(m_verbose != null ? m_verbose : 0); + SuiteRunner suite = + new SuiteRunner( + m_configuration, + m_suite, + m_outputDirectory, + m_testRunnerFactory, + Systematiser.getComparator()); + + suite.run(); + } + + protected void addMethodSelector(String className, int priority) { + XmlMethodSelector methodSelector = new XmlMethodSelector(); + methodSelector.setName(className); + methodSelector.setPriority(priority); + getTest().getMethodSelectors().add(methodSelector); + } + + protected void addClasses(Class... classes) { + for (Class clazz : classes) { + addClass(clazz); + } + } + + protected XmlClass addClass(Class cls) { + return addClass(cls.getName()); + } + + protected XmlClass addClass(String className) { + XmlClass result = new XmlClass(className); + getTest().getXmlClasses().add(result); + + return result; + } + + protected void setScript(String language, String expression) { + XmlScript script = new XmlScript(); + script.setExpression(expression); + script.setLanguage(language); + getTest().setScript(script); + } + + protected void addPackage(String pkgName, String[] included, String[] excluded) { + XmlPackage pkg = new XmlPackage(); + pkg.setName(pkgName); + pkg.getInclude().addAll(Arrays.asList(included)); + pkg.getExclude().addAll(Arrays.asList(excluded)); + getTest().getSuite().getXmlPackages().add(pkg); + } + + private XmlClass findClass(String className) { + for (XmlClass cl : getTest().getXmlClasses()) { + if (cl.getName().equals(className)) { + return cl; + } + } + + return addClass(className); + } + + public void addIncludedMethod(String className, String m) { + XmlClass xmlClass = findClass(className); + xmlClass.getIncludedMethods().add(new XmlInclude(m)); + getTest().getXmlClasses().add(xmlClass); + } + + public void addExcludedMethod(String className, String m) { + XmlClass xmlClass = findClass(className); + xmlClass.getExcludedMethods().add(m); + getTest().getXmlClasses().add(xmlClass); + } + + public void addIncludedGroup(String g) { + getTest().addIncludedGroup(g); + } + + public void addExcludedGroup(String g) { + getTest().addExcludedGroup(g); + } + + @BeforeMethod(groups = {"init", "initTest"}) + public void methodSetUp() { + m_suite = new XmlSuite(); + m_suite.setName("Internal_suite"); + XmlTest xmlTest = new XmlTest(m_suite); + xmlTest.setName("Internal_test_failures_are_expected"); + m_tests.put(getId(), xmlTest); + } + + private void addTest(Map> tests, ITestResult t) { + List l = + tests.computeIfAbsent(t.getMethod().getMethodName(), k -> new ArrayList<>()); + l.add(t); + } + + public void addPassedTest(ITestResult t) { + addTest(getPassedTests(), t); + } + + public void addFailedTest(ITestResult t) { + addTest(getFailedTests(), t); + } + + public void addFailedButWithinSuccessPercentageTest(ITestResult t) { + addTest(getFailedButWithinSuccessPercentageTests(), t); + } + + public void addSkippedTest(ITestResult t) { + addTest(getSkippedTests(), t); + } + + public void addPassedConfig(ITestResult t) { + addTest(getPassedConfigs(), t); + } + + public void addFailedConfig(ITestResult t) { + addTest(getFailedConfigs(), t); + } + + public void addSkippedConfig(ITestResult t) { + addTest(getSkippedConfigs(), t); + } + + protected Long getId() { + return 42L; + } + + public XmlSuite getSuite() { + return m_suite; + } + + public void setSuite(XmlSuite suite) { + m_suite = suite; + } + + /** + * Used for instanceCount testing, when we need to look inside the TestResult to count the various + * SUCCESS/FAIL/FAIL_BUT_OK + */ + protected void verifyResults(Map> tests, int expected, String message) { + if (tests.size() > 0) { + Set keys = tests.keySet(); + Object firstKey = keys.iterator().next(); + List passedResult = tests.get(firstKey); + int n = passedResult.size(); + assert n == expected : "Expected " + expected + " " + message + " but found " + n; + } else { + assert expected == 0 : "Expected " + expected + " " + message + " but found " + tests.size(); + } + } + + protected static void verifyInstanceNames( + Map> actual, String[] expected) { + List actualNames = Lists.newArrayList(); + for (Map.Entry> es : actual.entrySet()) { + for (ITestResult tr : es.getValue()) { + Object instance = tr.getInstance(); + actualNames.add(es.getKey() + "#" + (instance != null ? instance.toString() : "")); + } + } + Assert.assertEqualsNoOrder(actualNames.toArray(), expected); + } + + protected void verifyPassedTests(String... expectedPassed) { + verifyTests("Passed", expectedPassed, getPassedTests()); + } + + protected void verifyFailedTests(String... expectedFailed) { + verifyTests("Failed", expectedFailed, getFailedTests()); + } + + protected void verifySkippedTests(String... expectedSkipped) { + verifyTests("Skipped", expectedSkipped, getSkippedTests()); + } + + private static class InternalTestRunnerFactory implements ITestRunnerFactory { + private final BaseTest m_baseTest; + + public InternalTestRunnerFactory(final BaseTest baseTest) { + m_baseTest = baseTest; + } + + @Override + public TestRunner newTestRunner( + ISuite suite, + XmlTest test, + Collection listeners, + List classListeners) { + TestRunner testRunner = + new TestRunner( + m_baseTest.m_configuration, + suite, + test, + false, + listeners, + classListeners, + Systematiser.getComparator()); + + testRunner.addListener(new TestHTMLReporter()); + testRunner.addListener(new JUnitXMLReporter()); + testRunner.addListener(new TestListener(m_baseTest)); + if (listeners != null) { + for (IInvokedMethodListener l : listeners) { + testRunner.addListener(l); + } + } + + return testRunner; + } + } + + protected void runTest(String cls, String[] passed, String[] failed, String[] skipped) { + addClass(cls); + run(); + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Failed", failed, getFailedTests()); + verifyTests("Skipped", skipped, getSkippedTests()); + } +} // BaseTest + +//////////////////////////// + +class TestListener extends TestListenerAdapter { + private static BaseTest m_test = null; + + public TestListener(BaseTest t1) { + m_test = t1; + } + + @Override + public void onTestSuccess(ITestResult tr) { + m_test.addPassedTest(tr); + } + + @Override + public void onTestFailure(ITestResult tr) { + m_test.addFailedTest(tr); + } + + @Override + public void onTestFailedButWithinSuccessPercentage(ITestResult result) { + m_test.addFailedButWithinSuccessPercentageTest(result); + } + + @Override + public void onTestSkipped(ITestResult tr) { + m_test.addSkippedTest(tr); + } + + @Override + public void onConfigurationSuccess(ITestResult tr) { + m_test.addPassedConfig(tr); + } + + @Override + public void onConfigurationFailure(ITestResult tr) { + m_test.addFailedConfig(tr); + } + + @Override + public void onConfigurationSkip(ITestResult tr) { + m_test.addSkippedConfig(tr); + } +} // TestListener diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/CheckSuitesInitializationTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/CheckSuitesInitializationTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/CheckSuitesInitializationTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/CheckSuitesInitializationTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,38 @@ +package test; + +import java.util.Collections; +import org.testng.Assert; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; + +/** + * Check for a bug in how relative paths in suite files were being handled. + * + *

All paths were being resolved using the initial suite's location and not that of the current + * suite being parsed/processed. + * + *

This test checks that TestNG can handle cases where we have the following set of files (all + * linked using relative paths): + * + *

- parent-suite -> [child-suite-1, children/child-suite-3] - children/child-suite-3 -> + * [../child-suite-2, child-suite-4, morechildren/child-suite-5] + * + *

Check the checksuitesinitialization folder under test resources + * + * @author Nalin Makar + */ +public class CheckSuitesInitializationTest extends SimpleBaseTest { + + /** Child suites and tests within different suites have same names */ + @Test + public void check() { + TestListenerAdapter tla = new TestListenerAdapter(); + TestNG tng = create(); + String testngXmlPath = getPathToResource("checksuitesinitialization/parent-suite.xml"); + tng.setTestSuites(Collections.singletonList(testngXmlPath)); + tng.addListener(tla); + tng.run(); + Assert.assertEquals(tla.getPassedTests().size(), 4); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ClassConfigurations.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ClassConfigurations.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ClassConfigurations.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ClassConfigurations.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,50 @@ +package test; + +import org.testng.annotations.AfterTest; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +public class ClassConfigurations { + + static int beforeCount = 0; + static int afterCount = 0; + + @BeforeClass + public void beforeTestClass() { + ++beforeCount; + // System.out.println("@@@@@@ beforeTestClass has been called " + beforeCount + " time(s)"); + } + + @AfterTest + public void afterTest() { + beforeCount = 0; + afterCount = 0; + } + + @AfterTest + public void afterTestClass() { + ++afterCount; + // System.out.println("@@@@@@@ afterTestClass has been called " + afterCount + " time(s)"); + } + + @Test + public void testOne() { + // System.out.println("testOne"); + assert beforeCount == 1; + assert afterCount == 0; + } + + @Test + public void testTwo() { + // System.out.println("testTwo"); + assert beforeCount == 1; + assert afterCount == 0; + } + + @Test + public void testThree() { + // System.out.println("testThree"); + assert beforeCount == 1; + assert afterCount == 0; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/CommandLineTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/CommandLineTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/CommandLineTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/CommandLineTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,175 @@ +package test; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertTrue; + +import com.google.inject.Injector; +import com.google.inject.Module; +import com.google.inject.Stage; +import java.lang.reflect.Field; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.testng.Assert; +import org.testng.CommandLineArgs; +import org.testng.IInjectorFactory; +import org.testng.ITestContext; +import org.testng.ITestResult; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.internal.IConfiguration; +import test.sample.JUnitSample1; +import testhelper.OutputDirectoryPatch; + +public class CommandLineTest { + + /** Test -junit */ + @Test(groups = {"current"}) + public void junitParsing() { + String[] argv = { + "-log", + "0", + "-d", + OutputDirectoryPatch.getOutputDirectory(), + "-junit", + "-testclass", + "test.sample.JUnitSample1" + }; + TestListenerAdapter tla = new TestListenerAdapter(); + TestNG.privateMain(argv, tla); + + List passed = tla.getPassedTests(); + assertEquals(passed.size(), 2); + String test1 = passed.get(0).getMethod().getMethodName(); + String test2 = passed.get(1).getMethod().getMethodName(); + + assertTrue( + JUnitSample1.EXPECTED1.equals(test1) && JUnitSample1.EXPECTED2.equals(test2) + || JUnitSample1.EXPECTED1.equals(test2) && JUnitSample1.EXPECTED2.equals(test1)); + } + + /** Test the absence of -junit */ + @Test(groups = {"current"}) + public void junitParsing2() { + String[] argv = { + "-log", "0", + "-d", OutputDirectoryPatch.getOutputDirectory(), + "-testclass", "test.sample.JUnitSample1" + }; + TestListenerAdapter tla = new TestListenerAdapter(); + TestNG.privateMain(argv, tla); + + List passed = tla.getPassedTests(); + assertEquals(passed.size(), 0); + } + + /** Test the ability to override the default command line Suite name */ + @Test(groups = {"current"}) + public void suiteNameOverride() { + String suiteName = "MySuiteName"; + String[] argv = { + "-log", + "0", + "-d", + OutputDirectoryPatch.getOutputDirectory(), + "-junit", + "-testclass", + "test.sample.JUnitSample1", + "-suitename", + suiteName + }; + TestListenerAdapter tla = new TestListenerAdapter(); + TestNG.privateMain(argv, tla); + + List contexts = tla.getTestContexts(); + assertTrue(contexts.size() > 0); + for (ITestContext context : contexts) { + assertEquals(context.getSuite().getName(), suiteName); + } + } + + /** Test the ability to override the default command line test name */ + @Test(groups = {"current"}) + public void testNameOverride() { + String testName = "My Test Name"; + String[] argv = { + "-log", + "0", + "-d", + OutputDirectoryPatch.getOutputDirectory(), + "-junit", + "-testclass", + "test.sample.JUnitSample1", + "-testname", + testName + }; + TestListenerAdapter tla = new TestListenerAdapter(); + TestNG.privateMain(argv, tla); + + List contexts = tla.getTestContexts(); + assertTrue(contexts.size() > 0); + for (ITestContext context : contexts) { + assertEquals(context.getName(), testName); + } + } + + @Test + public void testUseDefaultListenersArgument() { + TestNG.privateMain( + new String[] { + "-log", "0", "-usedefaultlisteners", "false", "-testclass", "test.sample.JUnitSample1" + }, + null); + } + + @Test + public void testMethodParameter() { + String[] argv = { + "-log", "0", + "-d", OutputDirectoryPatch.getOutputDirectory(), + "-methods", "test.sample.Sample2.method1,test.sample.Sample2.method3", + }; + TestListenerAdapter tla = new TestListenerAdapter(); + TestNG.privateMain(argv, tla); + + List passed = tla.getPassedTests(); + Assert.assertEquals(passed.size(), 2); + Assert.assertTrue( + (passed.get(0).getName().equals("method1") && passed.get(1).getName().equals("method3")) + || (passed.get(1).getName().equals("method1") + && passed.get(0).getName().equals("method3"))); + } + + @SuppressWarnings("deprecation") + @Test(description = "GITHUB-2207") + public void testInjectorFactoryCanBeConfiguredViaProperties() { + Map params = new HashMap<>(); + params.put(CommandLineArgs.DEPENDENCY_INJECTOR_FACTORY, TestInjectorFactory.class.getName()); + TestNG testNG = new TestNG(); + testNG.configure(params); + + IInjectorFactory resolvedInjectorFactory = retrieveInjectionMechanism(testNG); + Assert.assertEquals(resolvedInjectorFactory.getClass(), TestInjectorFactory.class); + } + + private static IInjectorFactory retrieveInjectionMechanism(TestNG testNG) { + try { + Field field = TestNG.class.getDeclaredField("m_configuration"); + field.setAccessible(true); + IConfiguration cfg = (IConfiguration) field.get(testNG); + return cfg.getInjectorFactory(); + } catch (NoSuchFieldException | IllegalAccessException e) { + throw new RuntimeException(e); + } + } + + public static class TestInjectorFactory implements IInjectorFactory { + + @Override + @SuppressWarnings("deprecation") + public Injector getInjector(Stage stage, Module... modules) { + return null; + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/CountSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/CountSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/CountSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/CountSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,33 @@ +package test; + +import org.testng.Assert; +import org.testng.SkipException; +import org.testng.annotations.Test; + +/** + * Use this test to show run/failed/skip result differences between testng-5.12 and testng-5-14 + * + * @author CA Technologies + */ +public class CountSampleTest { + + @Test(groups = {"functional"}) + public void testInvokedAndSkipped() throws SkipException { + // System.out.println("Skipping this test after it is invoked."); + throw new SkipException("This test is skipped after invocation"); + } + + @Test(groups = {"functional"}) + public static void testInvokedAndFailed() { + // System.out.println("Failing this test after it is invoked."); + Assert.fail("Failing this test on purpose"); + } + + @Test( + groups = {"functional"}, + dependsOnMethods = {"testInvokedAndFailed"}) + public static void testWillNotBeInvokedOnlySkipped() { + // System.out.println("This test will be skipped, " + + // "but not invoked because its dependsOnMethod fails."); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/CountTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/CountTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/CountTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/CountTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,36 @@ +package test; + +import java.util.List; +import org.testng.Assert; +import org.testng.IReporter; +import org.testng.ISuite; +import org.testng.ISuiteResult; +import org.testng.ITestContext; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; + +public class CountTest extends SimpleBaseTest { + + @Test(description = "Make sure that skipped methods are accurately counted") + public void skippedMethodsShouldBeCounted() { + TestNG tng = create(CountSampleTest.class); + + IReporter r = + new IReporter() { + @Override + public void generateReport( + List xmlSuites, List suites, String outputDirectory) { + for (ISuite s : suites) { + for (ISuiteResult sr : s.getResults().values()) { + ITestContext ctx = sr.getTestContext(); + Assert.assertEquals(2, ctx.getSkippedTests().size()); + } + } + } + }; + + tng.addListener(r); + tng.run(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/CtorCalledOnce.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/CtorCalledOnce.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/CtorCalledOnce.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/CtorCalledOnce.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,36 @@ +package test; + +import org.testng.annotations.AfterTest; +import org.testng.annotations.Test; + +/** + * this test verifys that the test class is instantiated exactly once regardless of how many test + * methods we have, showing that TestNG semantics is quite different from JUnit + */ +public class CtorCalledOnce { + public static int instantiated = 0; + + public CtorCalledOnce() { + instantiated++; + } + + @Test + public void testMethod1() { + assert instantiated == 1 : "Expected 1, was invoked " + instantiated + " times"; + } + + @Test + public void testMethod2() { + assert instantiated == 1 : "Expected 1, was invoked " + instantiated + " times"; + } + + @Test + public void testMethod3() { + assert instantiated == 1 : "Expected 1, was invoked " + instantiated + " times"; + } + + @AfterTest + public void afterTest() { + instantiated = 0; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/EclipseTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/EclipseTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/EclipseTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/EclipseTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test; + +import org.testng.Assert; +import org.testng.ITestContext; +import org.testng.annotations.Test; + +/** + * Make sure that these test pass when run by the Eclipse plug-in. + * + * @author Cedric Beust + */ +public class EclipseTest { + + @Test + public void xmlFileShouldBeRunAtItsPlaceAndNotCopied(ITestContext ctx) { + String fileName = ctx.getSuite().getXmlSuite().getFileName().replace("\\", "/"); + Assert.assertTrue(fileName.contains("src/test/resources")); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/Exclude.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/Exclude.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/Exclude.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/Exclude.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,45 @@ +package test; + +import org.testng.annotations.Test; + +public class Exclude { + private boolean m_included1 = false; + private boolean m_included2 = false; + private boolean m_excluded1 = true; + private boolean m_excluded2 = true; + + @Test(groups = {"group1"}) + public void included1() { + m_included1 = true; + } + + @Test(groups = {"group1"}) + public void included2() { + m_included2 = true; + } + + @Test(groups = {"group1"}) + public void excluded1() { + m_excluded1 = false; + } + + @Test(groups = {"group1"}) + public void excluded2() { + m_excluded2 = false; + } + + @Test( + dependsOnGroups = {"group1"}, + groups = {"group2"}) + public void verify() { + assert m_included1 && m_included2 && m_excluded1 && m_excluded2 + : "Should all be true: " + + m_included1 + + " " + + m_included2 + + " " + + m_excluded1 + + " " + + m_excluded2; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/FileStringBufferTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/FileStringBufferTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/FileStringBufferTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/FileStringBufferTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,30 @@ +package test; + +import org.testng.annotations.Test; +import org.testng.reporters.FileStringBuffer; + +public class FileStringBufferTest { + + @Test + public void basic() { + { + FileStringBuffer fsb = new FileStringBuffer(5); + String s = "0123456789"; + String s3 = s + s + s; + + fsb.append(s3); + // Assert.assertEquals(s3, fsb.toString()); + } + + { + FileStringBuffer fsb = new FileStringBuffer(5); + String s = "0123456789"; + String s3 = s + s + s; + + fsb.append(s); + fsb.append(s); + fsb.append(s); + // Assert.assertEquals(s3, fsb.toString()); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/GraphTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/GraphTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/GraphTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/GraphTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,195 @@ +package test; + +import java.util.Comparator; +import java.util.List; +import org.testng.Assert; +import org.testng.TestNGException; +import org.testng.annotations.Test; +import org.testng.internal.Graph; +import org.testng.internal.Graph.Node; +import org.testng.internal.Tarjan; + +public class GraphTest { + + private static final Comparator> COMPARATOR = Comparator.comparing(Node::getObject); + + @Test + public void sort() { + Graph g = new Graph<>(COMPARATOR); + g.addNode("3"); + g.addNode("1"); + g.addNode("2.2"); + g.addNode("independent"); + g.addNode("2.1"); + g.addNode("2"); + + g.addPredecessor("3", "2"); + g.addPredecessor("3", "2.1"); + g.addPredecessor("3", "2.2"); + g.addPredecessor("2", "1"); + g.addPredecessor("2.1", "1"); + g.addPredecessor("2.2", "1"); + + g.topologicalSort(); + List l = g.getStrictlySortedNodes(); + int i = 0; + Assert.assertEquals("1", l.get(i)); + i++; + Assert.assertTrue("2".equals(l.get(i)) || "2.1".equals(l.get(i)) || "2.2".equals(l.get(i))); + i++; + Assert.assertTrue("2".equals(l.get(i)) || "2.1".equals(l.get(i)) || "2.2".equals(l.get(i))); + i++; + Assert.assertTrue("2".equals(l.get(i)) || "2.1".equals(l.get(i)) || "2.2".equals(l.get(i))); + i++; + Assert.assertEquals("3", l.get(i)); + + Assert.assertEquals(1, g.getIndependentNodes().size()); + } + + @Test(expectedExceptions = org.testng.TestNGException.class) + public void cycleShouldFail() { + Graph g = createCyclicGraph(); + g.topologicalSort(); + } + + @Test + public void cycleShouldBeCorrect() { + Graph g = null; + try { + g = createCyclicGraph(); + g.topologicalSort(); + } catch (TestNGException ex) { + Tarjan t = new Tarjan<>(g, "1"); + Assert.assertEquals(t.getCycle().size(), 3); + } + } + + private Graph createCyclicGraph() { + Graph g = new Graph<>(COMPARATOR); + g.addNode("3"); + g.addNode("2"); + g.addNode("1"); + + g.addPredecessor("3", "2"); + g.addPredecessor("2", "1"); + g.addPredecessor("1", "3"); + + return g; + } + + @Test + public void findPredecessors() { + Graph g = new Graph<>(COMPARATOR); + g.addNode("3"); + g.addNode("1"); + g.addNode("2.2"); + g.addNode("independent"); + g.addNode("2.1"); + g.addNode("2"); + + // 1 -> 2.1, 2.2, 2.3 --> 3 + g.addPredecessor("3", "2"); + g.addPredecessor("3", "2.1"); + g.addPredecessor("3", "2.2"); + g.addPredecessor("2", "1"); + g.addPredecessor("2.1", "1"); + g.addPredecessor("2.2", "1"); + + // Invoke sort to make sure there is no side effect + g.topologicalSort(); + + // + // Test findPredecessors + // + { + List predecessors = g.findPredecessors("2"); + Assert.assertEquals(1, predecessors.size()); + Assert.assertEquals("1", predecessors.get(0)); + } + + { + List predecessors = g.findPredecessors("3"); + + Assert.assertEquals(4, predecessors.size()); + Assert.assertEquals("1", predecessors.get(0)); + Assert.assertTrue( + predecessors.get(1).equals("2.1") + || predecessors.get(1).equals("2.2") + || predecessors.get(1).equals("2")); + Assert.assertTrue( + predecessors.get(2).equals("2.1") + || predecessors.get(2).equals("2.2") + || predecessors.get(2).equals("2")); + Assert.assertTrue( + predecessors.get(3).equals("2.1") + || predecessors.get(3).equals("2.2") + || predecessors.get(3).equals("2")); + } + } + + // Using an earlier implementation of Graph.findPrecessors, finding + // predecessors in certain kinds of graphs where many nodes have the + // same predecessors could be very slow, since the old implementation + // would explore the same nodes repeatedly. This situation could + // happen when test methods are organized in several groups, with + // dependsOnGroups annotations so that each method in one group depends + // on all of the methods in another group. If there were several + // such groups depending on each other in a chain, the combinatorics + // of the old method became excessive. This test builds a 72-node graph that + // emulates this situation, then call Graph.findPredecessors. The old + // implementation run this in 70+ seconds on my computer, the new implementation + // takes a few milliseconds. In practice, with larger graphs, the former + // slowness could get very extreme, taking hours or more to complete + // in some real user situations. + // + @Test(timeOut = 5000) // If this takes more than 5 seconds we've definitely regressed. + public void findPredecessorsTiming() { + Graph g = new Graph<>(COMPARATOR); + + final String rootNode = "myroot"; + final String independentNode = "independent"; + g.addNode(rootNode); + g.addNode(independentNode); + + final int maxDepth = 7; + final int nodesPerDepth = 10; // must be < 100 + // + // Add maxDepth groups of new nodes, where each group contains nodesPerDepth + // nodes, and each node in a group a depth N has each node in the group + // at depth (N-1) as a predecessor. + // + for (int depth = 1; depth <= maxDepth; depth++) { + for (int i = 0; i < nodesPerDepth; i++) { + String newNode = String.valueOf(i + (100 * depth)); + g.addNode(newNode); + if (depth == 1) { + continue; + } + for (int j = 0; j < nodesPerDepth; j++) { + String prevNode = String.valueOf(j + (100 * (depth - 1))); + g.addPredecessor(newNode, prevNode); + } + } + } + + // Finally, make all of the nodes in the group at depth maxDepth + // be predecessors of rootNode. + // + for (int i = 0; i < nodesPerDepth; i++) { + String node = String.valueOf(i + (100 * maxDepth)); + g.addPredecessor(rootNode, node); + } + + // Now we're done building the graph, which has (maxDepth * nodesPerDepth) + 2 + // nodes. rootNode has all of the other nodes except independentNode + // as predecessors. + + // + // Test findPredecessors + // + { + List predecessors = g.findPredecessors(rootNode); + Assert.assertEquals(predecessors.size(), (maxDepth * nodesPerDepth)); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/IndividualMethodsTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/IndividualMethodsTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/IndividualMethodsTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/IndividualMethodsTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,28 @@ +package test; + +import org.testng.Assert; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +/** + * Test that if an individual method is specified on testng.xml, the @Configuration method still + * runs. + * + *

Created on Aug 1, 2005 + * + * @author cbeust + */ +public class IndividualMethodsTest { + private boolean m_setUpCalled = false; + + @BeforeMethod + public void setUp() { + m_setUpCalled = true; + } + + @Test + public void testMethod() { + // this line causes the test to fail, showing that setUp() hadn't been run + Assert.assertTrue(m_setUpCalled); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/InvocationAndSuccessPercentageTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/InvocationAndSuccessPercentageTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/InvocationAndSuccessPercentageTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/InvocationAndSuccessPercentageTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,91 @@ +package test; + +import org.testng.annotations.Test; + +/** + * This class tests invocationCount and successPercentage + * + * @author cbeust + */ +public class InvocationAndSuccessPercentageTest extends BaseTest { + + @Test + public void invocationCount() { + addClass("test.sample.InvocationCountTest"); + addIncludedGroup("invocationOnly"); + run(); + String[] passed = { + "tenTimesShouldSucceed", + }; + String[] failed = {}; + verifyResults(getPassedTests(), 10, "passed tests"); + // Map passedTests = getPassedTests(); + // Set keys = passedTests.keySet(); + // Object firstKey = keys.iterator().next(); + // ITestResult passedResult = (ITestResult) passedTests.get(firstKey); + // int n = passedResult.getPassedMethods().size(); + // assert n == 10 : + // "Expected 10 tests to have passed, but only found " + n; + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Failed", failed, getFailedTests()); + } + + /** Result expected: 8 passed 2 failed but within success percentage */ + @Test + public void successPercentageThatSucceeds() { + addClass("test.sample.InvocationCountTest"); + addIncludedGroup("successPercentageThatSucceedsOnly"); + run(); + String[] passed = { + "successPercentageShouldSucceed", + }; + String[] failed = {}; + String[] failedButWithinSuccessPercentage = { + "successPercentageShouldSucceed", + }; + verifyTests( + "FailedButWithinSuccessPercentage", + failedButWithinSuccessPercentage, + getFailedButWithinSuccessPercentageTests()); + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Failed", failed, getFailedTests()); + + // Should have 8 passed, 2 failed but within success percentage + verifyResults(getPassedTests(), 8, "passed tests"); + verifyResults( + getFailedButWithinSuccessPercentageTests(), + 2, + "failed_but_within_success_percentage_tests"); + } + + /** Result expected: 8 passed 1 failed but within success percentage 1 failed */ + @Test + public void successPercentageThatFails() { + addClass(test.sample.InvocationCountTest.class); + addIncludedGroup("successPercentageThatFailsOnly"); + run(); + String[] passed = { + "successPercentageShouldFail", + }; + String[] failed = { + "successPercentageShouldFail", + }; + String[] failedButWithinSuccessPercentage = { + "successPercentageShouldFail", + }; + verifyTests( + "FailedButWithinSuccessPercentage", + failedButWithinSuccessPercentage, + getFailedButWithinSuccessPercentageTests()); + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Failed", failed, getFailedTests()); + + // Should have 8 passed, 2 failed but within success percentage + verifyResults(getPassedTests(), 8, "passed tests"); + verifyResults(getFailedTests(), 1, "failed tests"); + verifyResults( + getFailedButWithinSuccessPercentageTests(), + 1, + "failed_but_within_success_percentage_tests"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/InvokedMethodListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/InvokedMethodListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/InvokedMethodListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/InvokedMethodListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,24 @@ +package test; + +import java.util.ArrayList; +import java.util.List; +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.ITestResult; + +public class InvokedMethodListener implements IInvokedMethodListener { + + private final List invokedMethods = new ArrayList<>(); + + @Override + public void beforeInvocation(IInvokedMethod method, ITestResult testResult) { + invokedMethods.add(method.getTestMethod().getMethodName()); + } + + @Override + public void afterInvocation(IInvokedMethod method, ITestResult testResult) {} + + public List getInvokedMethods() { + return invokedMethods; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/InvokedMethodNameListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/InvokedMethodNameListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/InvokedMethodNameListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/InvokedMethodNameListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,209 @@ +package test; + +import com.google.common.base.Joiner; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.ITestContext; +import org.testng.ITestListener; +import org.testng.ITestResult; +import org.testng.Reporter; +import org.testng.collections.Lists; + +// TODO replace other test IInvokedMethodListener by this one +public class InvokedMethodNameListener implements IInvokedMethodListener, ITestListener { + + private final Set testInstances = ConcurrentHashMap.newKeySet(); + private final List foundMethodNames = Collections.synchronizedList(new ArrayList<>()); + private final List invokedMethodNames = Collections.synchronizedList(new ArrayList<>()); + private final List failedMethodNames = Collections.synchronizedList(new ArrayList<>()); + private final List failedBeforeInvocationMethodNames = + Collections.synchronizedList(new ArrayList<>()); + private final List skippedMethodNames = Collections.synchronizedList(new ArrayList<>()); + private final List skippedAfterInvocationMethodNames = + Collections.synchronizedList(new ArrayList<>()); + private final List succeedMethodNames = Collections.synchronizedList(new ArrayList<>()); + private final Map results = new ConcurrentHashMap<>(); + private final Map, List> mapping = new ConcurrentHashMap<>(); + private final boolean skipConfiguration; + private final boolean wantSkippedMethodAfterInvocation; + + public InvokedMethodNameListener() { + this(false); + } + + public InvokedMethodNameListener(boolean skipConfiguration) { + this(skipConfiguration, false); + } + + public InvokedMethodNameListener( + boolean skipConfiguration, boolean wantSkippedMethodAfterInvocation) { + this.skipConfiguration = skipConfiguration; + this.wantSkippedMethodAfterInvocation = wantSkippedMethodAfterInvocation; + } + + @Override + public void beforeInvocation(IInvokedMethod method, ITestResult testResult) { + if (!(skipConfiguration && method.isConfigurationMethod())) { + invokedMethodNames.add(getName(testResult)); + } + testInstances.add(testResult.getInstance()); + } + + @Override + public void afterInvocation(IInvokedMethod method, ITestResult testResult) { + List methodNames = + mapping.computeIfAbsent(testResult.getMethod().getRealClass(), k -> Lists.newArrayList()); + methodNames.add(method.getTestMethod().getMethodName()); + String name = getName(testResult); + switch (testResult.getStatus()) { + case ITestResult.FAILURE: + if (!(skipConfiguration && method.isConfigurationMethod())) { + failedMethodNames.add(name); + } + break; + case ITestResult.SKIP: + if (!(skipConfiguration && method.isConfigurationMethod())) { + if (wantSkippedMethodAfterInvocation) { + skippedAfterInvocationMethodNames.add(name); + } + } + break; + case ITestResult.SUCCESS: + if (!(skipConfiguration && method.isConfigurationMethod())) { + succeedMethodNames.add(name); + } + break; + default: + throw new AssertionError("Unexpected value: " + testResult.getStatus()); + } + } + + @Override + public void onTestStart(ITestResult result) { + foundMethodNames.add(getName(result)); + } + + @Override + public void onTestSuccess(ITestResult result) { + String name = getName(result); + results.put(name, result); + if (!succeedMethodNames.contains(name)) { + throw new IllegalStateException("A succeed test is supposed to be invoked"); + } + } + + @Override + public void onTestFailure(ITestResult result) { + String name = getName(result); + results.put(name, result); + if (!failedMethodNames.contains(name)) { + failedBeforeInvocationMethodNames.add(name); + } + } + + @Override + public void onTestSkipped(ITestResult result) { + String name = getName(result); + results.put(name, result); + if (!skippedAfterInvocationMethodNames.contains(name)) { + skippedMethodNames.add(name); + } + } + + @Override + public void onTestFailedButWithinSuccessPercentage(ITestResult result) { + String name = getName(result); + results.put(name, result); + if (!succeedMethodNames.contains(name) || !failedMethodNames.contains(name)) { + throw new IllegalStateException( + "A FailedButWithinSuccessPercentage test is supposed to be invoked"); + } + } + + @Override + public void onStart(ITestContext context) {} + + @Override + public void onFinish(ITestContext context) {} + + public Set getTestInstances() { + return testInstances; + } + + private static String getName(ITestResult result) { + String testName = result.getName(); + String methodName = result.getMethod().getConstructorOrMethod().getName(); + String name; + if (testName.contains(methodName)) { + name = methodName; + } else { + name = testName + "#" + methodName; + } + if (result.getParameters().length != 0) { + name = + name + + "(" + + Joiner.on(",").useForNull("null").join(getParameterNames(result.getParameters())) + + ")"; + } + return name; + } + + private static List getParameterNames(Object[] parameters) { + List result = new ArrayList<>(parameters.length); + for (Object parameter : parameters) { + if (parameter == null) { + result.add("null"); + } else { + if (parameter instanceof Object[]) { + result.add("[" + Joiner.on(",").useForNull("null").join((Object[]) parameter) + "]"); + } else { + result.add(parameter.toString()); + } + } + } + return result; + } + + public List getInvokedMethodNames() { + return Collections.unmodifiableList(invokedMethodNames); + } + + public List getFailedMethodNames() { + return Collections.unmodifiableList(failedMethodNames); + } + + public List getSkippedMethodNames() { + return Collections.unmodifiableList(skippedMethodNames); + } + + public List getSucceedMethodNames() { + return new ArrayList<>(succeedMethodNames); + } + + public List getFailedBeforeInvocationMethodNames() { + return Collections.unmodifiableList(failedBeforeInvocationMethodNames); + } + + public List getSkippedAfterInvocationMethodNames() { + return Collections.unmodifiableList(skippedAfterInvocationMethodNames); + } + + public ITestResult getResult(String name) { + return results.get(name); + } + + public List getMethodsForTestClass(Class testClass) { + return mapping.get(testClass); + } + + public List getLogs(String name) { + return Reporter.getOutput(getResult(name)); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/JUnit4Test.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/JUnit4Test.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/JUnit4Test.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/JUnit4Test.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,75 @@ +package test; + +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import test.junit4.*; + +public class JUnit4Test extends BaseTest { + + @BeforeMethod(dependsOnGroups = {"initTest"}) + public void initJUnitFlag() { + getTest().setJUnit(true); + } + + @DataProvider + public static Object[][] dp() { + return new Object[][] { + new Object[] { + new Class[] {JUnit4Sample2.class}, + JUnit4Sample2.EXPECTED, + JUnit4Sample2.FAILED, + JUnit4Sample2.SKIPPED + }, + new Object[] { + new Class[] {JUnit4SampleSuite.class}, + JUnit4SampleSuite.EXPECTED, + JUnit4SampleSuite.FAILED, + JUnit4SampleSuite.SKIPPED + }, + new Object[] { + new Class[] {JUnit4Child.class}, JUnit4Child.EXPECTED, new String[0], new String[0] + }, + new Object[] { + new Class[] {InheritedTest.class, JUnit4Sample1.class}, + new String[] {"t1", "t1"}, + new String[0], + new String[0] + }, + new Object[] { + new Class[] {JUnit4ParameterizedTest.class}, + JUnit4ParameterizedTest.EXPECTED, + JUnit4ParameterizedTest.FAILED, + JUnit4ParameterizedTest.SKIPPED + }, + new Object[] { + new Class[] {BeforeClassJUnit4Sample.class}, + new String[0], + new String[0], + new String[] {"myTest"} + }, + new Object[] { + new Class[] {ClassRuleJUnit4Sample.class}, + new String[0], + new String[0], + new String[] {"myTest"} + } + }; + } + + @Test(dataProvider = "dp") + public void testTests( + Class[] classes, + String[] expectedPassedTests, + String[] expectedFailedTests, + String[] expectedSkippedTests) { + addClasses(classes); + assert getTest().isJUnit(); + + run(); + + verifyPassedTests(expectedPassedTests); + verifyFailedTests(expectedFailedTests); + verifySkippedTests(expectedSkippedTests); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/JUnitTest1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/JUnitTest1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/JUnitTest1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/JUnitTest1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,115 @@ +package test; + +import org.testng.Assert; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; +import test.junit.SetNameTest; +import test.sample.JUnitSample1; +import test.sample.JUnitSample2; + +/** + * This class + * + * @author Cedric Beust, May 5, 2004 + */ +public class JUnitTest1 extends BaseTest { + @BeforeMethod(dependsOnGroups = {"initTest"}) + public void initJUnitFlag() { + getTest().setJUnit(true); + } + + @Test + public void methodsThatStartWithTest() { + addClass("test.sample.JUnitSample1"); + assert getTest().isJUnit(); + + run(); + String[] passed = {JUnitSample1.EXPECTED1, JUnitSample1.EXPECTED2}; + String[] failed = {}; + + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Failed", failed, getFailedTests()); + } + + @Test + public void methodsWithSetup() { + addClass("test.sample.JUnitSample2"); + run(); + String[] passed = { + "testSample2ThatSetUpWasRun", + }; + String[] failed = {}; + + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Failed", failed, getFailedTests()); + } + + @Test + public void testSuite() { + addClass("test.sample.AllJUnitTests"); + run(); + String[] passed = { + JUnitSample1.EXPECTED1, /*JUnitSample1.EXPECTED2,*/ JUnitSample2.EXPECTED, + }; + String[] failed = {}; + + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Failed", failed, getFailedTests()); + } + + @Test + public void testNewInstance() { + addClass("test.sample.JUnitSample3"); + run(); + String[] passed = {"test1", "test2"}; + String[] failed = {}; + + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Failed", failed, getFailedTests()); + } + + @Test + public void setUpFailingShouldCauseMethodsToBeSkipped() { + addClass("test.junit.SetUpExceptionSampleTest"); + run(); + String[] passed = {}; + String[] failed = {"testM1" /*, "testM1", "tearDown"*/}; + String[] skipped = { + /*"testM1", "tearDown"*/ + }; + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Skipped", skipped, getSkippedTests()); + verifyTests("Failed", failed, getFailedTests()); + } + + @Test + public void setNameShouldBeInvoked() { + addClass("test.junit.SetNameTest"); + SetNameTest.m_ctorCount = 0; + run(); + String[] passed = { + "testFoo", "testBar", + }; + String[] failed = {}; + String[] skipped = {}; + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Skipped", skipped, getSkippedTests()); + verifyTests("Failed", failed, getFailedTests()); + + Assert.assertEquals( + SetNameTest.m_ctorCount, + 2, + "Expected 2 instances to be created, found " + SetNameTest.m_ctorCount); + } + + @Test + public void testAbstract() { + addClass("test.sample.JUnitSample4"); + run(); + String[] passed = {"testXY", "testXY", "testXY"}; + String[] failed = {}; + + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Failed", failed, getFailedTests()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/JUnitTestClassLoader.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/JUnitTestClassLoader.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/JUnitTestClassLoader.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/JUnitTestClassLoader.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,119 @@ +package test; + +import static org.testng.Assert.*; + +import java.io.File; +import java.util.List; +import org.testng.*; +import org.testng.annotations.Test; +import testhelper.CompiledCode; +import testhelper.SimpleCompiler; +import testhelper.SourceCode; + +public class JUnitTestClassLoader extends ClassLoader { + + @Test + public void testPassAndFail() throws Exception { + String src = + "import org.junit.Test;\n" + + "import static org.junit.Assert.*;\n" + + "public class SimpleTest1 {\n" + + " @Test\n" + + " public void test1() {\n" + + " assertEquals(42, 42);\n" + + " }\n" + + " @Test\n" + + " public void test2() {\n" + + " assertEquals(42, 0);\n" + + " }\n" + + "}\n"; + Listener listener = runJunitTest(src, "SimpleTest1"); + assertEquals(1, listener.success); + assertEquals(1, listener.failure); + } + + @Test + public void testFail() throws Exception { + String src = + "import org.junit.Test;\n" + + "import static org.junit.Assert.*;\n" + + "public class SimpleTest2 {\n" + + " @Test\n" + + " public void test() {\n" + + " assertEquals(42, 0);\n" + + " }\n" + + "}\n"; + Listener listener = runJunitTest(src, "SimpleTest2"); + assertEquals(0, listener.success); + assertEquals(1, listener.failure); + } + + @Test + public void testPass() throws Exception { + String src = + "import org.junit.Test;\n" + + "import static org.junit.Assert.*;\n" + + "public class SimpleTest3 {\n" + + " @Test\n" + + " public void test() {\n" + + " assertEquals(42, 42);\n" + + " }\n" + + "}\n"; + Listener listener = runJunitTest(src, "SimpleTest3"); + assertEquals(1, listener.success); + assertEquals(0, listener.failure); + } + + private Listener runJunitTest(String src, String name) throws Exception { + TestNG tng = new TestNG(false); + Class testClass = compile(src, name); + Listener listener = new Listener(); + tng.setJUnit(true); + tng.addClassLoader(testClass.getClassLoader()); + assertNotEquals( + testClass.getClassLoader(), + this.getClass().getClassLoader(), + "JUnit test must be loaded by a different classloader"); + try { + this.getClass().getClassLoader().loadClass(testClass.getName()); + fail("it must be imposiible to load JUnit test by current classloader"); + } catch (ClassNotFoundException c) { + } + + tng.setTestClasses(new Class[] {testClass}); + tng.addListener(listener); + tng.run(); + return listener; + } + + private Class compile(String src, String name) throws Exception { + File directory = SimpleCompiler.createTempDir(); + SourceCode sourceCode = new SourceCode(name, src, directory, false); + List compiledCode = SimpleCompiler.compileSourceCode(sourceCode); + byte[] bytes = compiledCode.get(0).getByteCode(); + return defineClass(name, bytes, 0, bytes.length); + } + + private static class Listener implements ITestListener { + public int success = 0; + public int failure = 0; + + public void onTestSuccess(ITestResult result) { + success++; + } + + public void onTestFailure(ITestResult result) { + failure++; + } + + public void onTestStart(ITestResult result) {} + + public void onTestSkipped(ITestResult result) {} + + public void onTestFailedButWithinSuccessPercentage(ITestResult result) {} + + public void onStart(ITestContext context) {} + + public void onFinish(ITestContext context) {} + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/MethodTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/MethodTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/MethodTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/MethodTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,47 @@ +package test; + +import org.testng.Assert; +import org.testng.annotations.Test; +import test.sample.Sample2; + +public class MethodTest extends BaseTest { + private static final String CLASS_NAME = Sample2.class.getName(); + + @Test(groups = {"current"}) + public void includeMethodsOnly() { + addClass(CLASS_NAME); + Assert.assertEquals(getTest().getXmlClasses().size(), 1); + addIncludedMethod(CLASS_NAME, ".*method2"); + run(); + String[] passed = { + "method2", + }; + String[] failed = {}; + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Failed", failed, getFailedTests()); + } + + @Test(groups = {"current"}) + public void excludeMethodsOnly() { + addClass(CLASS_NAME); + Assert.assertEquals(getTest().getXmlClasses().size(), 1); + addExcludedMethod(CLASS_NAME, ".*method2"); + run(); + String[] passed = {"method1", "method3"}; + String[] failed = {}; + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Failed", failed, getFailedTests()); + } + + @Test + public void excludePackage() { + addClass(CLASS_NAME); + assert 1 == getTest().getXmlClasses().size(); + addExcludedMethod(CLASS_NAME, ".*"); + run(); + String[] passed = {}; + String[] failed = {}; + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Failed", failed, getFailedTests()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/Misc.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/Misc.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/Misc.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/Misc.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +package test; + +import org.testng.annotations.Test; + +/** + * This class + * + * @author cbeust + */ +public class Misc extends BaseTest { + + @Test + public void makeSureSetUpWithParameterWithNoParametersFails() { + addClass("test.sample.SetUpWithParameterTest"); + // setParallel(XmlSuite.PARALLEL_METHODS); + run(); + String[] passed = {}; + // @Configuration failures are not reported in the ITestListener + String[] failed = {}; + String[] skipped = { + "test", + }; + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Failed", failed, getFailedTests()); + verifyTests("Failed", skipped, getSkippedTests()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/NestedStaticSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/NestedStaticSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/NestedStaticSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/NestedStaticSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package test; + +import org.testng.annotations.Test; + +public class NestedStaticSampleTest { + + @Test + public void f() {} + + public class Nested { + @Test + public void nested() {} + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/NestedStaticTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/NestedStaticTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/NestedStaticTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/NestedStaticTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,37 @@ +package test; + +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import org.testng.Assert; +import org.testng.ITestResult; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.collections.Sets; + +public class NestedStaticTest extends SimpleBaseTest { + + @Test + public void nestedClassShouldBeIncluded() { + TestNG tng = create(NestedStaticSampleTest.class); + TestListenerAdapter tla = new TestListenerAdapter(); + tng.addListener(tla); + tng.run(); + + Set expected = + new HashSet() { + { + add("nested"); + add("f"); + } + }; + Set actual = Sets.newHashSet(); + List passedTests = tla.getPassedTests(); + for (ITestResult t : passedTests) { + actual.add(t.getMethod().getMethodName()); + } + + Assert.assertEquals(actual, expected); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ParameterConstructorTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ParameterConstructorTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ParameterConstructorTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ParameterConstructorTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,51 @@ +package test; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertTrue; + +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; + +/** + * Test parameters passed to constructors + * + * @author cbeust + */ +public class ParameterConstructorTest { + private String m_string; + private int m_int; + private boolean m_boolean; + private byte m_byte; + private char m_char; + private double m_double; + private float m_float; + private long m_long; + private short m_short; + + @Parameters({"string", "int", "boolean", "byte", "char", "double", "float", "long", "short"}) + public ParameterConstructorTest( + String s, int i, boolean bo, byte b, char c, double d, float f, long l, short sh) { + m_string = s; + m_int = i; + m_boolean = bo; + m_byte = b; + m_char = c; + m_double = d; + m_float = f; + m_long = l; + m_short = sh; + } + + @Test + public void verify() { + assertEquals("Cedric", m_string); + assertEquals(42, m_int); + assertTrue(m_boolean); + assertEquals(43, m_byte); + assertEquals('c', m_char); + assertEquals(44.0, m_double, 0.1); + assertEquals(45.0f, m_float, 0.1); + assertEquals(46, m_long); + assertEquals(47, m_short); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ReflectionHelperTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ReflectionHelperTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ReflectionHelperTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ReflectionHelperTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,72 @@ +package test; + +import java.lang.reflect.Method; +import java.util.List; +import org.testng.Assert; +import org.testng.annotations.Test; +import org.testng.collections.Lists; +import org.testng.internal.reflect.ReflectionHelper; +import test.github1405.TestClassSample; +import test.github765.DuplicateCallsSample; + +public class ReflectionHelperTest { + + @Test + public void testMethodCount() { + // Testing exclusion of synthetic methods Refer https://stackoverflow.com/a/5007394 to learn + // more + Method[] methods = prune(ReflectionHelper.getLocalMethods(DuplicateCallsSample.class)); + Assert.assertEquals(methods.length, 2); + + // Testing a straight forward use case of retrieving concrete methods + methods = prune(ReflectionHelper.getLocalMethods(Dog.class)); + Assert.assertEquals(methods.length, 1); + + // When class has no methods count should be zero. + methods = prune(ReflectionHelper.getLocalMethods(Dinosaur.class)); + Assert.assertEquals(methods.length, 0); + + // Abstract methods should be included. + methods = prune(ReflectionHelper.getLocalMethods(Dragon.class)); + Assert.assertEquals(methods.length, 2); + + // main methods should be pruned + methods = prune(ReflectionHelper.getLocalMethods(TestClassSample.class)); + Assert.assertEquals(methods.length, 1); + } + + /** + * @param methods - The list of methods extracted from a Class + * @return - A {@link Method} array which excludes a special method named "jacocoInit" which is + * getting injected into the test class only when the test is executed via Gradle. + */ + private static Method[] prune(Method[] methods) { + List pruned = Lists.newArrayList(methods.length); + for (Method method : methods) { + if (!method.getName().contains("jacocoInit")) { + pruned.add(method); + } + } + return pruned.toArray(new Method[0]); + } + + interface Animal { + void makeSound(); + } + + class Dog implements Animal { + + @Override + public void makeSound() {} + } + + abstract class Dinosaur implements Animal {} + + abstract class Dragon implements Animal { + + @Override + public void makeSound() {} + + abstract void walk(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ReporterApiTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ReporterApiTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ReporterApiTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ReporterApiTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test; + +import org.testng.Reporter; +import org.testng.annotations.Test; + +/** + * Make sure we don't remove public API's from Reporter. + * + * @author Cedric Beust + */ +public class ReporterApiTest { + + @Test + public void testApi() { + Reporter.log("foo"); + Reporter.log("foo", false); + Reporter.log("foo", 2); + Reporter.log("foo", 2, false); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ReturnValueSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ReturnValueSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ReturnValueSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ReturnValueSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test; + +import org.testng.annotations.Test; + +public class ReturnValueSampleTest { + + @Test + public int shouldRun() { + return 0; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ReturnValueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ReturnValueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ReturnValueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ReturnValueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,57 @@ +package test; + +import java.util.Collections; +import org.testng.Assert; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; + +public class ReturnValueTest extends SimpleBaseTest { + + private XmlSuite m_suite; + private XmlTest m_test; + + @BeforeMethod + public void before() { + m_suite = createXmlSuite("suite"); + m_test = createXmlTest(m_suite, "test", ReturnValueSampleTest.class.getName()); + } + + @Test + public void suiteReturnValueTestShouldBeRun() { + m_suite.setAllowReturnValues(true); + runTest(true); + } + + @Test + public void suiteReturnValueTestShouldNotBeRun() { + runTest(false); + } + + @Test + public void testReturnValueTestShouldBeRun() { + m_test.setAllowReturnValues(true); + runTest(true); + } + + private void runTest(boolean allowed) { + TestNG tng = create(); + tng.setXmlSuites(Collections.singletonList(m_suite)); + TestListenerAdapter tla = new TestListenerAdapter(); + tng.addListener(tla); + tng.run(); + + if (allowed) { + Assert.assertEquals(tla.getFailedTests().size(), 0); + Assert.assertEquals(tla.getSkippedTests().size(), 0); + assertTestResultsEqual(tla.getPassedTests(), Collections.singletonList("shouldRun")); + } else { + Assert.assertEquals(tla.getFailedTests().size(), 0); + Assert.assertEquals(tla.getPassedTests().size(), 0); + Assert.assertEquals(tla.getSkippedTests().size(), 0); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/SampleInheritance.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/SampleInheritance.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/SampleInheritance.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/SampleInheritance.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,41 @@ +package test; + +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import test.sample.BaseSampleInheritance; + +public class SampleInheritance extends BaseSampleInheritance { + + // Test dependency of configuration methods + @BeforeClass(groups = {"configuration0"}) + public void configuration0() { + addConfiguration("configuration0"); + // System.out.println("CONFIGURATION 0"); + } + + @BeforeClass( + groups = "final", + dependsOnGroups = {"configuration1"}) + public void configuration2() { + assert m_configurations.size() == 2 : "Expected size 2 found " + m_configurations.size(); + assert "configuration0".equals(m_configurations.get(0)) : "Expected configuration0 to be run"; + assert "configuration1".equals(m_configurations.get(1)) : "Expected configuration1 to be run"; + addConfiguration("configuration2"); + } + + @Test( + groups = "final", + dependsOnGroups = {"inheritedTestMethod"}) + public void inheritedMethodsWereCalledInOrder() { + assert m_invokedBaseMethod : "Didn't invoke test method in base class"; + assert m_invokedBaseConfiguration : "Didn't invoke configuration method in base class"; + } + + @Test(groups = "final2", dependsOnGroups = "final") + public void configurationsWereCalledInOrder() { + assert m_configurations.size() == 3; + assert "configuration0".equals(m_configurations.get(0)) : "Expected configuration0 to be run"; + assert "configuration1".equals(m_configurations.get(1)) : "Expected configuration1 to be run"; + assert "configuration2".equals(m_configurations.get(2)) : "Expected configuration1 to be run"; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/SerializationTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/SerializationTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/SerializationTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/SerializationTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,26 @@ +package test; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.ObjectOutputStream; +import org.testng.ITestContext; +import org.testng.annotations.Test; + +public class SerializationTest { + + @Test(groups = "broken") + public void iSuiteShouldBeSerializable(ITestContext context) throws IOException { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + ObjectOutputStream oos = new ObjectOutputStream(out); + oos.writeObject(context.getSuite()); + oos.close(); + } + + @Test(groups = {"broken", "maven-broken"}) + public void testngMethodShouldBeSerializable(ITestContext context) throws IOException { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + ObjectOutputStream oos = new ObjectOutputStream(out); + oos.writeObject(context.getAllTestMethods()[0]); + oos.close(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/SimpleBaseTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/SimpleBaseTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/SimpleBaseTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/SimpleBaseTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,443 @@ +package test; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.io.Reader; +import java.nio.file.FileVisitResult; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.SimpleFileVisitor; +import java.nio.file.attribute.BasicFileAttributes; +import java.util.AbstractMap; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import java.util.regex.Pattern; +import java.util.stream.Collectors; +import org.testng.Assert; +import org.testng.ITestNGMethod; +import org.testng.ITestObjectFactory; +import org.testng.ITestResult; +import org.testng.TestNG; +import org.testng.TestNGException; +import org.testng.annotations.ITestAnnotation; +import org.testng.collections.Lists; +import org.testng.internal.annotations.AnnotationHelper; +import org.testng.internal.annotations.DefaultAnnotationTransformer; +import org.testng.internal.annotations.IAnnotationFinder; +import org.testng.internal.annotations.JDK15AnnotationFinder; +import org.testng.xml.XmlClass; +import org.testng.xml.XmlGroups; +import org.testng.xml.XmlInclude; +import org.testng.xml.XmlPackage; +import org.testng.xml.XmlRun; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import org.testng.xml.internal.Parser; + +public class SimpleBaseTest { + // System property specifying where the resources (e.g. xml files) can be found + private static final String TEST_RESOURCES_DIR = "test.resources.dir"; + + public static InvokedMethodNameListener run(Class... testClasses) { + return run(false, testClasses); + } + + public static InvokedMethodNameListener run(boolean skipConfiguration, Class... testClasses) { + TestNG tng = create(testClasses); + + return run(skipConfiguration, tng); + } + + public static InvokedMethodNameListener run(XmlSuite... suites) { + return run(false, suites); + } + + public static InvokedMethodNameListener run(boolean skipConfiguration, XmlSuite... suites) { + TestNG tng = create(suites); + + return run(skipConfiguration, tng); + } + + private static InvokedMethodNameListener run(boolean skipConfiguration, TestNG tng) { + InvokedMethodNameListener listener = new InvokedMethodNameListener(skipConfiguration); + tng.addListener(listener); + + tng.run(); + + return listener; + } + + public static TestNG create() { + TestNG result = new TestNG(); + result.setUseDefaultListeners(false); + return result; + } + + public static TestNG create(Class... testClasses) { + TestNG result = create(); + result.setTestClasses(testClasses); + return result; + } + + protected static TestNG create(Path outputDir, Class... testClasses) { + TestNG result = create(testClasses); + result.setOutputDirectory(outputDir.toAbsolutePath().toString()); + return result; + } + + protected static TestNG create(XmlSuite... suites) { + return create(Arrays.asList(suites)); + } + + protected static TestNG create(List suites) { + TestNG result = create(); + result.setXmlSuites(suites); + return result; + } + + protected static TestNG create(Path outputDir, XmlSuite... suites) { + return create(outputDir, Arrays.asList(suites)); + } + + protected static TestNG create(Path outputDir, List suites) { + TestNG result = create(suites); + result.setOutputDirectory(outputDir.toAbsolutePath().toString()); + return result; + } + + protected static TestNG createTests(String suiteName, Class... testClasses) { + return createTests(null, suiteName, testClasses); + } + + protected static TestNG createTests(Path outDir, String suiteName, Class... testClasses) { + XmlSuite suite = createXmlSuite(suiteName); + int i = 0; + for (Class testClass : testClasses) { + createXmlTest(suite, testClass.getName() + i, testClass); + i++; + } + if (outDir == null) { + return create(suite); + } + return create(outDir, suite); + } + + protected static XmlSuite createDummySuiteWithTestNamesAs(String... tests) { + XmlSuite suite = new XmlSuite(); + suite.setName("random_suite"); + for (String test : tests) { + XmlTest xmlTest = new XmlTest(suite); + xmlTest.setName(test); + } + return suite; + } + + protected static XmlSuite createXmlSuite(String name) { + XmlSuite result = new XmlSuite(); + result.setName(name); + return result; + } + + protected static XmlSuite createXmlSuite(Map params) { + XmlSuite result = createXmlSuite(UUID.randomUUID().toString()); + result.setParameters(params); + return result; + } + + protected static XmlSuite createXmlSuite(String suiteName, String testName, Class... classes) { + XmlSuite suite = createXmlSuite(suiteName); + createXmlTest(suite, testName, classes); + return suite; + } + + protected static XmlSuite createXmlSuite(String suiteName, Map params) { + XmlSuite suite = createXmlSuite(suiteName); + suite.setParameters(params); + return suite; + } + + protected static XmlTest createXmlTestWithPackages( + XmlSuite suite, String name, String... packageName) { + XmlTest result = createXmlTest(suite, name); + List xmlPackages = Lists.newArrayList(); + + for (String each : packageName) { + XmlPackage xmlPackage = new XmlPackage(); + xmlPackage.setName(each); + xmlPackages.add(xmlPackage); + } + result.setPackages(xmlPackages); + + return result; + } + + protected static XmlTest createXmlTestWithPackages( + XmlSuite suite, String name, Class... packageName) { + XmlTest result = createXmlTest(suite, name); + List xmlPackages = Lists.newArrayList(); + + for (Class each : packageName) { + XmlPackage xmlPackage = new XmlPackage(); + xmlPackage.setName(each.getPackage().getName()); + xmlPackages.add(xmlPackage); + } + result.setPackages(xmlPackages); + + return result; + } + + protected static XmlTest createXmlTest(String suiteName, String testName) { + XmlSuite suite = createXmlSuite(suiteName); + return createXmlTest(suite, testName); + } + + protected static XmlTest createXmlTest(String suiteName, String testName, Class... classes) { + XmlSuite suite = createXmlSuite(suiteName); + XmlTest xmlTest = createXmlTest(suite, testName); + for (Class clazz : classes) { + xmlTest.getXmlClasses().add(new XmlClass(clazz)); + } + return xmlTest; + } + + protected static XmlTest createXmlTest(XmlSuite suite, String name) { + XmlTest result = new XmlTest(suite); + result.setName(name); + return result; + } + + protected static XmlTest createXmlTest(XmlSuite suite, String name, Map params) { + XmlTest result = new XmlTest(suite); + result.setName(name); + result.setParameters(params); + return result; + } + + protected static XmlTest createXmlTest(XmlSuite suite, String name, Class... classes) { + XmlTest result = createXmlTest(suite, name); + int index = 0; + for (Class c : classes) { + XmlClass xc = new XmlClass(c.getName(), index++, true /* load classes */); + result.getXmlClasses().add(xc); + } + + return result; + } + + protected static XmlClass createXmlClass(XmlTest test, Class testClass) { + XmlClass clazz = new XmlClass(testClass); + test.getXmlClasses().add(clazz); + return clazz; + } + + protected static XmlClass createXmlClass( + XmlTest test, Class testClass, Map params) { + XmlClass clazz = createXmlClass(test, testClass); + clazz.setParameters(params); + return clazz; + } + + protected static XmlInclude createXmlInclude(XmlClass clazz, String method) { + XmlInclude include = new XmlInclude(method); + + include.setXmlClass(clazz); + clazz.getIncludedMethods().add(include); + + return include; + } + + protected static XmlInclude createXmlInclude( + XmlClass clazz, String method, Map params) { + XmlInclude include = createXmlInclude(clazz, method); + include.setParameters(params); + return include; + } + + protected static XmlInclude createXmlInclude( + XmlClass clazz, String method, int index, Integer... list) { + XmlInclude include = new XmlInclude(method, Arrays.asList(list), index); + + include.setXmlClass(clazz); + clazz.getIncludedMethods().add(include); + + return include; + } + + protected static XmlGroups createXmlGroups(XmlSuite suite, String... includedGroupNames) { + XmlGroups xmlGroups = createGroupIncluding(includedGroupNames); + suite.setGroups(xmlGroups); + return xmlGroups; + } + + protected static XmlGroups createXmlGroups(XmlTest test, String... includedGroupNames) { + XmlGroups xmlGroups = createGroupIncluding(includedGroupNames); + test.setGroups(xmlGroups); + return xmlGroups; + } + + private static XmlGroups createGroupIncluding(String... groupNames) { + XmlGroups xmlGroups = new XmlGroups(); + XmlRun xmlRun = new XmlRun(); + for (String group : groupNames) { + xmlRun.onInclude(group); + } + xmlGroups.setRun(xmlRun); + return xmlGroups; + } + + protected static XmlTest createXmlTest(XmlSuite suite, String name, String... classes) { + XmlTest result = createXmlTest(suite, name); + int index = 0; + for (String c : classes) { + XmlClass xc = new XmlClass(c, index++, true /* load classes */); + result.getXmlClasses().add(xc); + } + + return result; + } + + protected static void addMethods(XmlClass cls, String... methods) { + int index = 0; + for (String method : methods) { + XmlInclude include = new XmlInclude(method, index++); + cls.getIncludedMethods().add(include); + } + } + + public static String getPathToResource(String fileName) { + String result = System.getProperty(TEST_RESOURCES_DIR, "src/test/resources"); + if (result == null) { + throw new IllegalArgumentException( + "System property " + TEST_RESOURCES_DIR + " was not defined."); + } + return result + File.separatorChar + fileName; + } + + public static List extractTestNGMethods(Class... classes) { + XmlSuite xmlSuite = new XmlSuite(); + xmlSuite.setName("suite"); + XmlTest xmlTest = createXmlTest(xmlSuite, "tests", classes); + IAnnotationFinder annotationFinder = + new JDK15AnnotationFinder(new DefaultAnnotationTransformer()); + List methods = Lists.newArrayList(); + for (Class clazz : classes) { + methods.addAll( + Arrays.asList( + AnnotationHelper.findMethodsWithAnnotation( + new ITestObjectFactory() {}, + clazz, + ITestAnnotation.class, + annotationFinder, + xmlTest))); + } + return methods; + } + + /** Compare a list of ITestResult with a list of String method names, */ + protected static void assertTestResultsEqual(List results, List methods) { + List resultMethods = Lists.newArrayList(); + for (ITestResult r : results) { + resultMethods.add(r.getMethod().getMethodName()); + } + Assert.assertEquals(resultMethods, methods); + } + + /** Deletes all files and subdirectories under dir. */ + protected static void deleteDir(File dir) { + try { + Files.walkFileTree( + dir.toPath(), + new SimpleFileVisitor() { + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) + throws IOException { + Files.delete(file); + return FileVisitResult.CONTINUE; + } + + @Override + public FileVisitResult postVisitDirectory(Path dir, IOException exc) + throws IOException { + Files.delete(dir); + return FileVisitResult.CONTINUE; + } + }); + } catch (IOException e) { + e.printStackTrace(); + } + } + + protected static File createDirInTempDir(String dir) { + File slashTmpDir = new File(System.getProperty("java.io.tmpdir")); + File mTempDirectory = new File(slashTmpDir, dir); + mTempDirectory.mkdirs(); + mTempDirectory.deleteOnExit(); + return mTempDirectory; + } + + /** + * @param fileName The filename to parse + * @param regexp The regular expression + * @param resultLines An out parameter that will contain all the lines that matched the regexp + * @return A List containing the lines of all the matches + *

Note that the size() of the returned valuewill always be equal to result.size() at the + * end of this function. + */ + protected static List grep(File fileName, String regexp, List resultLines) { + List resultLineNumbers = new ArrayList<>(); + try (Reader reader = new FileReader(fileName)) { + resultLineNumbers = grep(reader, regexp, resultLines); + } catch (IOException e) { + e.printStackTrace(); + } + return resultLineNumbers; + } + + protected static List grep(Reader reader, String regexp, List resultLines) { + List resultLineNumbers = new ArrayList<>(); + try (BufferedReader fr = new BufferedReader(reader)) { + String line; + int currentLine = 0; + Pattern p = Pattern.compile(".*" + regexp + ".*"); + while ((line = fr.readLine()) != null) { + if (p.matcher(line).matches()) { + resultLines.add(line); + resultLineNumbers.add(currentLine); + } + currentLine++; + } + } catch (IOException e) { + e.printStackTrace(); + } + return resultLineNumbers; + } + + protected static List getSuites(String... suiteFiles) { + List suites = new ArrayList<>(); + for (String suiteFile : suiteFiles) { + try { + suites.addAll(new Parser(suiteFile).parseToList()); + } catch (IOException e) { + throw new TestNGException(e); + } + } + return suites; + } + + protected static String getFailedResultMessage(List testResultList) { + String methods = + testResultList.stream() + .map( + r -> + new AbstractMap.SimpleEntry<>( + r.getMethod().getQualifiedName(), r.getThrowable())) + .map(e -> String.format("%s: %s", e.getKey(), e.getValue())) + .collect(Collectors.joining("\n")); + return String.format("Failed methods should pass:\n %s\n", methods); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/StaticTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/StaticTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/StaticTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/StaticTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test; + +import org.testng.annotations.Test; + +/** This used to create a StackOverflowError. */ +public class StaticTest { + @Test + public void test() {} + + @Test + public static class InnerStaticClass extends StaticTest {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/Test1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/Test1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/Test1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/Test1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,147 @@ +package test; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.logging.Handler; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.testng.Assert; +import org.testng.ITestNGListener; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.sample.Sample1; + +public class Test1 extends SimpleBaseTest { + + /** + * This constructor is package protected on purpose, to test that TestNG can still instantiate the + * class. + */ + Test1() {} + + @Test(groups = {"current"}) + public void includedGroups() { + XmlSuite suite = createXmlSuite("Internal_suite"); + XmlTest test = createXmlTest(suite, "Internal_test_failures_are_expected", Sample1.class); + Assert.assertEquals(test.getXmlClasses().size(), 1); + test.addIncludedGroup("odd"); + TestNG tng = create(suite); + + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener((ITestNGListener) listener); + + tng.run(); + + assertThat(listener.getSucceedMethodNames()).containsExactly("method1", "method3"); + assertThat(listener.getFailedMethodNames()).isEmpty(); + } + + @Test + public void groupsOfGroupsSimple() { + XmlSuite suite = createXmlSuite("Internal_suite"); + XmlTest test = createXmlTest(suite, "Internal_test_failures_are_expected", Sample1.class); + Assert.assertEquals(test.getXmlClasses().size(), 1); + // should match all methods belonging to group "odd" and "even" + test.addIncludedGroup("evenodd"); + test.addMetaGroup("evenodd", "even", "odd"); + TestNG tng = create(suite); + + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener((ITestNGListener) listener); + + tng.run(); + + assertThat(listener.getSucceedMethodNames()).containsExactly("method1", "method2", "method3"); + assertThat(listener.getFailedMethodNames()).isEmpty(); + } + + @Test + public void groupsOfGroupsWithIndirections() { + XmlSuite suite = createXmlSuite("Internal_suite"); + XmlTest test = createXmlTest(suite, "Internal_test_failures_are_expected", Sample1.class); + test.addIncludedGroup("all"); + test.addMetaGroup("all", "methods", "broken"); + test.addMetaGroup("methods", "odd", "even"); + test.addMetaGroup("broken", "broken"); + TestNG tng = create(suite); + + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener((ITestNGListener) listener); + + tng.run(); + + assertThat(listener.getSucceedMethodNames()) + .containsExactly("method1", "broken", "method2", "method3"); + assertThat(listener.getFailedMethodNames()).isEmpty(); + } + + @Test + public void groupsOfGroupsWithCycle() { + XmlSuite suite = createXmlSuite("Internal_suite"); + XmlTest test = createXmlTest(suite, "Internal_test_failures_are_expected", Sample1.class); + test.addIncludedGroup("all"); + test.addMetaGroup("all", "all2"); + test.addMetaGroup("all2", "methods"); + test.addMetaGroup("methods", "all"); + TestNG tng = create(suite); + + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener((ITestNGListener) listener); + + tng.run(); + + assertThat(listener.getSucceedMethodNames()).isEmpty(); + assertThat(listener.getFailedMethodNames()).isEmpty(); + } + + @Test + public void excludedGroups() { + XmlSuite suite = createXmlSuite("Internal_suite"); + XmlTest test = createXmlTest(suite, "Internal_test_failures_are_expected", Sample1.class); + test.addExcludedGroup("odd"); + TestNG tng = create(suite); + + InvokedMethodNameListener listener = new InvokedMethodNameListener(true); + tng.addListener((ITestNGListener) listener); + + tng.run(); + + assertThat(listener.getSucceedMethodNames()) + .containsExactly( + "broken", + "method2", + "throwExpectedException1ShouldPass", + "throwExpectedException2ShouldPass"); + assertThat(listener.getFailedMethodNames()) + .containsExactly("throwExceptionShouldFail", "verifyLastNameShouldFail"); + } + + @Test + public void regexp() { + XmlSuite suite = createXmlSuite("Internal_suite"); + XmlTest test = createXmlTest(suite, "Internal_test_failures_are_expected", Sample1.class); + // should matches all methods belonging to group "odd" + test.addIncludedGroup("o.*"); + TestNG tng = create(suite); + + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener((ITestNGListener) listener); + + tng.run(); + + assertThat(listener.getSucceedMethodNames()).containsExactly("method1", "method3"); + assertThat(listener.getFailedMethodNames()).isEmpty(); + } + + @Test(groups = {"currentold"}) + public void logger() { + Logger logger = Logger.getLogger(""); + for (Handler handler : logger.getHandlers()) { + handler.setLevel(Level.WARNING); + handler.setFormatter(new org.testng.log.TextFormatter()); + } + logger.setLevel(Level.SEVERE); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/Test2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/Test2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/Test2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/Test2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,73 @@ +package test; + +import org.testng.Assert; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +/** @author Cedric Beust, May 5, 2004 */ +public class Test2 extends BaseTest { + private boolean m_initializedCorrectly = false; + + @BeforeMethod + public void correctSetup() { + m_initializedCorrectly = true; + } + + // Shouldn't be called + @BeforeMethod(groups = {"excludeThisGroup"}) + public void incorrectSetup() { + throw new RuntimeException("Should never be run"); + } + + @Test + public void noGroups() { + addClass("test.sample.Sample1"); + run(); + String[] passed = { + "method1", + "method2", + "method3", + "broken", + "throwExpectedException1ShouldPass", + "throwExpectedException2ShouldPass" + }; + String[] failed = {"throwExceptionShouldFail", "verifyLastNameShouldFail"}; + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Failed", failed, getFailedTests()); + } + + @Test + public void setUpWithGroups() { + run(); + Assert.assertTrue(m_initializedCorrectly, "Should have run the correctSetup method"); + } + + @Test + public void partialGroupsClass() { + addClass("test.sample.PartialGroupTest"); + addIncludedGroup("classGroup"); + run(); + String[] passed = {"testMethodGroup", "testClassGroup"}; + String[] failed = {"testMethodGroupShouldFail", "testClassGroupShouldFail"}; + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Failed", failed, getFailedTests()); + + // ppp("@@@@@@@@@@@@@@@@@@ PASSED TESTS"); + // for (Object o : getPassedTests().values()) { + // ppp("@@@@@@@@@@ PASSED:" + o); + // } + } + + @Test + public void partialGroupsMethod() { + addClass("test.sample.PartialGroupTest"); + addIncludedGroup("methodGroup"); + run(); + String[] passed = { + "testMethodGroup", + }; + String[] failed = {"testMethodGroupShouldFail"}; + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Failed", failed, getFailedTests()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/TestClassContainerForGitHubIssue1360.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/TestClassContainerForGitHubIssue1360.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/TestClassContainerForGitHubIssue1360.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/TestClassContainerForGitHubIssue1360.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,57 @@ +package test; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class TestClassContainerForGitHubIssue1360 { + public static class TestNG1 { + @Test(priority = 1) + public void test1TestNG1() { + Assert.assertTrue(true); + } + + @Test(priority = 2) + public void test2TestNG1() { + Assert.assertTrue(true); + } + + @Test(priority = 3) + public void test3TestNG1() { + Assert.assertTrue(true); + } + } + + public static class TestNG2 { + @Test(priority = 1) + public void test1TestNG2() { + Assert.assertTrue(true); + } + + @Test(priority = 2) + public void test2TestNG2() { + Assert.assertTrue(true); + } + + @Test(priority = 3) + public void test3TestNG2() { + Assert.assertTrue(true); + } + } + + public static class TestNG3 { + @Test(priority = 1) + public void test1TestNG3() { + Assert.assertTrue(true); + } + + @Test(priority = 2) + public void test2TestNG3() { + Assert.assertTrue(true); + } + + @Test(priority = 3) + public void test3TestNG3() { + Assert.assertTrue(true); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/TestHelper.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/TestHelper.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/TestHelper.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/TestHelper.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,56 @@ +package test; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Collections; +import org.testng.TestNG; +import org.testng.xml.XmlClass; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; + +public class TestHelper { + /* + * TestNG issues a warning if the XML misses DOCTYPE, so here's a common header for + * xml suites generated in the tests. + */ + public static final String SUITE_XML_HEADER = + "\n" + + "\n"; + + public static XmlSuite createSuite(String cls, String suiteName) { + XmlSuite result = new XmlSuite(); + result.setName(suiteName); + + XmlTest test = new XmlTest(result); + test.setName("TmpTest"); + test.setXmlClasses(Collections.singletonList(new XmlClass(cls))); + + return result; + } + + public static TestNG createTestNG() throws IOException { + return createTestNG(createRandomDirectory()); + } + + public static TestNG createTestNG(XmlSuite suite) throws IOException { + return createTestNG(suite, createRandomDirectory()); + } + + public static TestNG createTestNG(XmlSuite suite, Path outputDir) { + TestNG result = createTestNG(outputDir); + result.setXmlSuites(Collections.singletonList(suite)); + return result; + } + + private static TestNG createTestNG(Path outputDir) { + TestNG result = new TestNG(); + result.setOutputDirectory(outputDir.toAbsolutePath().toString()); + + return result; + } + + public static Path createRandomDirectory() throws IOException { + return Files.createTempDirectory("testng-tmp-"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/abstractconfmethod/B.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/abstractconfmethod/B.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/abstractconfmethod/B.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/abstractconfmethod/B.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.abstractconfmethod; + +import org.testng.annotations.BeforeMethod; +import test.abstractconfmethod.foo.A; + +public abstract class B extends A { + @BeforeMethod(dependsOnMethods = {"testSetup"}) + public void doSomethingInMiddle() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/abstractconfmethod/C.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/abstractconfmethod/C.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/abstractconfmethod/C.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/abstractconfmethod/C.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,13 @@ +package test.abstractconfmethod; + +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class C extends B { + @Override + @BeforeMethod + public void testSetup() {} + + @Test(description = "Test depends on a config method that has implements an abstract methods") + public void test1() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/abstractconfmethod/foo/A.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/abstractconfmethod/foo/A.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/abstractconfmethod/foo/A.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/abstractconfmethod/foo/A.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,5 @@ +package test.abstractconfmethod.foo; + +public abstract class A { + public abstract void testSetup(); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/abstractmethods/AbstractTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/abstractmethods/AbstractTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/abstractmethods/AbstractTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/abstractmethods/AbstractTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.abstractmethods; + +import org.testng.Assert; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class AbstractTest extends SimpleBaseTest { + + @Test(description = "Abstract methods defined in a superclass should be run") + public void abstractShouldRun() { + TestNG tng = create(CRUDTest2.class); + TestListenerAdapter tla = new TestListenerAdapter(); + tng.addListener(tla); + tng.run(); + + Assert.assertEquals(tla.getPassedTests().size(), 2); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/abstractmethods/CRUDTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/abstractmethods/CRUDTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/abstractmethods/CRUDTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/abstractmethods/CRUDTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.abstractmethods; + +import org.testng.annotations.Test; + +public abstract class CRUDTest { + + @Test + public abstract void create(); + + @Test(dependsOnMethods = "create") + public abstract void read(); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/abstractmethods/CRUDTest2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/abstractmethods/CRUDTest2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/abstractmethods/CRUDTest2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/abstractmethods/CRUDTest2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,10 @@ +package test.abstractmethods; + +public class CRUDTest2 extends CRUDTest { + + @Override + public void create() {} + + @Override + public void read() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/access/BasePrivateAccessConfigurationMethods.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/access/BasePrivateAccessConfigurationMethods.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/access/BasePrivateAccessConfigurationMethods.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/access/BasePrivateAccessConfigurationMethods.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,24 @@ +package test.access; + +import org.testng.annotations.BeforeMethod; + +public class BasePrivateAccessConfigurationMethods { + protected boolean m_baseProtected = false; + protected boolean m_baseDefault = false; + protected boolean m_basePrivate = true; + + @BeforeMethod + void baseDefaultConfBeforeMethod() { + m_baseDefault = true; + } + + @BeforeMethod + protected void baseProtectedConfBeforeMethod() { + m_baseProtected = true; + } + + @BeforeMethod + private void basePrivateConfBeforeMethod() { + m_basePrivate = false; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/access/PrivateAccessConfigurationMethods.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/access/PrivateAccessConfigurationMethods.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/access/PrivateAccessConfigurationMethods.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/access/PrivateAccessConfigurationMethods.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,49 @@ +package test.access; + +import org.testng.Assert; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +/** + * Test that private and protected @Configuration methods are run + * + * @author cbeust + */ +public class PrivateAccessConfigurationMethods extends BasePrivateAccessConfigurationMethods { + private boolean m_private = false; + private boolean m_default = false; + private boolean m_protected = false; + private boolean m_public = false; + + @BeforeMethod + private void privateConfBeforeMethod() { + m_private = true; + } + + @BeforeMethod + void defaultConfBeforeMethod() { + m_default = true; + } + + @BeforeMethod + protected void protectedConfBeforeMethod() { + m_protected = true; + } + + @BeforeMethod + public void publicConfBeforeMethod() { + m_public = true; + } + + @Test + public void allAccessModifiersConfiguration() { + Assert.assertTrue(m_private, "private @Configuration should have been run"); + Assert.assertTrue(m_default, "default @Configuration should have been run"); + Assert.assertTrue(m_protected, "protected @Configuration should have been run"); + Assert.assertTrue(m_public, "public @Configuration should have been run"); + + Assert.assertTrue(m_baseProtected, "protected base @Configuration should have been run"); + Assert.assertTrue(m_baseDefault, "default base @Configuration should have been run"); + Assert.assertTrue(m_basePrivate, "private base @Configuration should not have been run"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/aftergroups/AfterGroupsBehaviorTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/aftergroups/AfterGroupsBehaviorTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/aftergroups/AfterGroupsBehaviorTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/aftergroups/AfterGroupsBehaviorTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,49 @@ +package test.aftergroups; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.TestNG; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlSuite.FailurePolicy; +import test.SimpleBaseTest; +import test.aftergroups.issue165.TestclassSampleWithFailedMember; +import test.aftergroups.issue165.TestclassSampleWithSkippedMember; +import test.aftergroups.issue1880.LocalConfigListener; +import test.aftergroups.issue1880.TestClassSample; + +public class AfterGroupsBehaviorTest extends SimpleBaseTest { + + @Test(description = "GITHUB-1880") + public void ensureAfterGroupsAreInvokedWithAlwaysRunAttribute() { + runTest(TestClassSample.class, "123", true, "after"); + } + + @Test(dataProvider = "dp", description = "GITHUB-165") + public void ensureAfterGroupsInvoked(Class clazz, String expected) { + runTest(clazz, "A", false, expected); + } + + @DataProvider(name = "dp") + public Object[][] getData() { + return new Object[][] { + {TestclassSampleWithSkippedMember.class, "afterGroupsMethod"}, + {TestclassSampleWithFailedMember.class, "afterGroupsMethod"}, + }; + } + + private static void runTest( + Class clazz, String groups, boolean shouldContinue, String expected) { + XmlSuite xmlsuite = createXmlSuite("sample_suite", "sample_test", clazz); + xmlsuite.addIncludedGroup(groups); + TestNG testng = create(xmlsuite); + if (shouldContinue) { + testng.setConfigFailurePolicy(FailurePolicy.CONTINUE); + } + LocalConfigListener listener = new LocalConfigListener(); + testng.addListener(listener); + testng.run(); + assertThat(listener.getMessages()).containsExactly(expected); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/aftergroups/issue165/TestclassSampleWithFailedMember.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/aftergroups/issue165/TestclassSampleWithFailedMember.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/aftergroups/issue165/TestclassSampleWithFailedMember.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/aftergroups/issue165/TestclassSampleWithFailedMember.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ +package test.aftergroups.issue165; + +import org.testng.annotations.AfterGroups; +import org.testng.annotations.Test; + +public class TestclassSampleWithFailedMember { + + @Test(groups = "A") + public void a1() {} + + @Test(groups = "A", dependsOnMethods = "a1") + public void a2() { + throw new org.testng.SkipException("skip"); + } + + @AfterGroups(groups = "A") + public void afterGroupsMethod() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/aftergroups/issue165/TestclassSampleWithSkippedMember.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/aftergroups/issue165/TestclassSampleWithSkippedMember.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/aftergroups/issue165/TestclassSampleWithSkippedMember.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/aftergroups/issue165/TestclassSampleWithSkippedMember.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ +package test.aftergroups.issue165; + +import org.testng.annotations.AfterGroups; +import org.testng.annotations.Test; + +public class TestclassSampleWithSkippedMember { + + @Test(groups = "A") + public void a1() { + throw new org.testng.SkipException("skip"); + } + + @Test(groups = "A", dependsOnMethods = "a1") + public void a2() {} + + @AfterGroups(groups = "A") + public void afterGroupsMethod() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/aftergroups/issue1880/LocalConfigListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/aftergroups/issue1880/LocalConfigListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/aftergroups/issue1880/LocalConfigListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/aftergroups/issue1880/LocalConfigListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.aftergroups.issue1880; + +import java.util.List; +import org.testng.IConfigurationListener; +import org.testng.ITestResult; +import org.testng.collections.Lists; + +public class LocalConfigListener implements IConfigurationListener { + private List messages = Lists.newLinkedList(); + + @Override + public void onConfigurationSuccess(ITestResult itr) { + messages.add(itr.getMethod().getMethodName()); + } + + public List getMessages() { + return messages; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/aftergroups/issue1880/TestClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/aftergroups/issue1880/TestClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/aftergroups/issue1880/TestClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/aftergroups/issue1880/TestClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.aftergroups.issue1880; + +import org.testng.annotations.AfterGroups; +import org.testng.annotations.BeforeGroups; +import org.testng.annotations.Test; + +public class TestClassSample { + + @BeforeGroups(groups = "123") + public void before() throws Exception { + throw new Exception("forcing a failure"); + } + + @Test(groups = "123") + public void test() {} + + @AfterGroups(groups = "123", alwaysRun = true) + public void after() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/alwaysrun/AlwaysRunAfter1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/alwaysrun/AlwaysRunAfter1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/alwaysrun/AlwaysRunAfter1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/alwaysrun/AlwaysRunAfter1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +package test.alwaysrun; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +public class AlwaysRunAfter1 { + private static boolean m_success = false; + + @BeforeClass + public void setUpShouldFail() { + throw new RuntimeException("Failing in setUp"); + } + + @AfterClass(alwaysRun = true) + public void tearDown() { + m_success = true; + } + + // Adding this method or @Configuration will never be invoked + @Test + public void dummy() {} + + public static boolean success() { + return m_success; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/alwaysrun/AlwaysRunAfter2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/alwaysrun/AlwaysRunAfter2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/alwaysrun/AlwaysRunAfter2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/alwaysrun/AlwaysRunAfter2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,24 @@ +package test.alwaysrun; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; + +public class AlwaysRunAfter2 { + + private static boolean m_success = true; + + @BeforeClass + public void setUpShouldFail() { + throw new RuntimeException("Failing in setUp"); + } + + // Should not be run + @AfterClass + public void tearDown() { + m_success = false; + } + + public static boolean success() { + return m_success; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/alwaysrun/AlwaysRunAfter3.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/alwaysrun/AlwaysRunAfter3.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/alwaysrun/AlwaysRunAfter3.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/alwaysrun/AlwaysRunAfter3.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +package test.alwaysrun; + +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class AlwaysRunAfter3 { + + private static boolean m_success = false; + + @BeforeMethod + public void setUpShouldFail() { + throw new RuntimeException("Failing in setUp"); + } + + @AfterMethod(alwaysRun = true) + public void afterMethodShouldBeCalled() { + m_success = true; + } + + @Test + public void dummy() {} + + public static boolean success() { + return m_success; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/alwaysrun/AlwaysRunBefore1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/alwaysrun/AlwaysRunBefore1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/alwaysrun/AlwaysRunBefore1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/alwaysrun/AlwaysRunBefore1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,51 @@ +package test.alwaysrun; + +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.BeforeSuite; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.Test; + +/** Tests alwaysRun on a before Configuration method. Invoke this test by running group "A" */ +public class AlwaysRunBefore1 { + private static boolean m_beforeSuiteSuccess = false; + private static boolean m_beforeTestSuccess = false; + private static boolean m_beforeTestClassSuccess = false; + private static boolean m_beforeTestMethodSuccess = false; + + @BeforeSuite(alwaysRun = true) + public void initSuite() { + m_beforeSuiteSuccess = true; + } + + @BeforeTest(alwaysRun = true) + public void initTest() { + m_beforeTestSuccess = true; + } + + @BeforeClass(alwaysRun = true) + public void initTestClass() { + m_beforeTestClassSuccess = true; + } + + @BeforeMethod(alwaysRun = true) + public void initTestMethod() { + m_beforeTestMethodSuccess = true; + } + + @Test(groups = "A") + public void foo() { + Assert.assertTrue(m_beforeSuiteSuccess); + Assert.assertTrue(m_beforeTestSuccess); + Assert.assertTrue(m_beforeTestClassSuccess); + Assert.assertTrue(m_beforeTestMethodSuccess); + } + + public static boolean success() { + return m_beforeSuiteSuccess + && m_beforeTestSuccess + && m_beforeTestClassSuccess + && m_beforeTestMethodSuccess; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/alwaysrun/AlwaysRunTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/alwaysrun/AlwaysRunTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/alwaysrun/AlwaysRunTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/alwaysrun/AlwaysRunTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,57 @@ +package test.alwaysrun; + +import static org.testng.Assert.assertTrue; + +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; +import testhelper.OutputDirectoryPatch; + +public class AlwaysRunTest extends SimpleBaseTest { + + @Test + public void withAlwaysRunAfter() { + TestListenerAdapter tla = new TestListenerAdapter(); + TestNG testng = create(); + testng.setOutputDirectory(OutputDirectoryPatch.getOutputDirectory()); + testng.setTestClasses(new Class[] {AlwaysRunAfter1.class}); + testng.addListener(tla); + testng.run(); + assertTrue(AlwaysRunAfter1.success(), "afterTestMethod should have run"); + } + + @Test + public void withAlwaysRunAfterMethod() { + TestListenerAdapter tla = new TestListenerAdapter(); + TestNG testng = create(); + testng.setOutputDirectory(OutputDirectoryPatch.getOutputDirectory()); + testng.setTestClasses(new Class[] {AlwaysRunAfter3.class}); + testng.addListener(tla); + testng.run(); + assertTrue(AlwaysRunAfter3.success(), "afterMethod should have run"); + } + + @Test + public void withoutAlwaysRunAfter() { + TestListenerAdapter tla = new TestListenerAdapter(); + TestNG testng = create(); + testng.setOutputDirectory(OutputDirectoryPatch.getOutputDirectory()); + testng.setTestClasses(new Class[] {AlwaysRunAfter2.class}); + testng.addListener(tla); + testng.run(); + assertTrue(AlwaysRunAfter2.success(), "afterTestMethod should not have run"); + } + + @Test + public void withoutAlwaysRunBefore() { + TestListenerAdapter tla = new TestListenerAdapter(); + TestNG testng = create(); + testng.setOutputDirectory(OutputDirectoryPatch.getOutputDirectory()); + testng.setTestClasses(new Class[] {AlwaysRunBefore1.class}); + testng.setGroups("A"); + testng.addListener(tla); + testng.run(); + assertTrue(AlwaysRunBefore1.success(), "before alwaysRun methods should have been run"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/AnnotationTransformerClassInvocationSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/AnnotationTransformerClassInvocationSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/AnnotationTransformerClassInvocationSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/AnnotationTransformerClassInvocationSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.annotationtransformer; + +import org.testng.annotations.Test; + +@Test(invocationCount = 3) +public class AnnotationTransformerClassInvocationSampleTest { + + public void f1() {} + + public void f2() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/AnnotationTransformerClassSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/AnnotationTransformerClassSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/AnnotationTransformerClassSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/AnnotationTransformerClassSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,22 @@ +package test.annotationtransformer; + +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +/** + * This test will fail unless a time out transformer is applied to it. + * + * @author cbeust + */ +@Test(timeOut = 1000) +@Listeners(MySuiteListener.class) +public class AnnotationTransformerClassSampleTest { + + public void one() { + try { + Thread.sleep(2000); + } catch (InterruptedException handled) { + Thread.currentThread().interrupt(); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/AnnotationTransformerDataProviderSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/AnnotationTransformerDataProviderSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/AnnotationTransformerDataProviderSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/AnnotationTransformerDataProviderSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.annotationtransformer; + +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class AnnotationTransformerDataProviderSampleTest { + + @DataProvider + public Object[][] dp() { + return new Integer[][] { + new Integer[] {42}, + }; + } + + @Test(dataProvider = "dataProvider") + public void f(Integer n) { + Assert.assertEquals(n, Integer.valueOf(42)); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/AnnotationTransformerFactorySampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/AnnotationTransformerFactorySampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/AnnotationTransformerFactorySampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/AnnotationTransformerFactorySampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ +package test.annotationtransformer; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; + +public class AnnotationTransformerFactorySampleTest { + @DataProvider + public Object[][] dataProvider() { + return new Integer[][] { + new Integer[] {42}, + }; + } + + @Factory(dataProvider = "dp") + public Object[] init(int n) { + return new Object[] {new SimpleTest(n)}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/AnnotationTransformerInTestngXml.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/AnnotationTransformerInTestngXml.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/AnnotationTransformerInTestngXml.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/AnnotationTransformerInTestngXml.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.annotationtransformer; + +import java.lang.reflect.Constructor; +import java.lang.reflect.Method; +import org.testng.IAnnotationTransformer; +import org.testng.annotations.ITestAnnotation; +import org.testng.annotations.Test; + +public class AnnotationTransformerInTestngXml implements IAnnotationTransformer { + + @Test(enabled = false) + public void shouldRunAfterTransformation() {} + + @Override + public void transform( + ITestAnnotation annotation, Class testClass, Constructor testConstructor, Method testMethod) { + annotation.setEnabled(true); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/AnnotationTransformerInvocationCountTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/AnnotationTransformerInvocationCountTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/AnnotationTransformerInvocationCountTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/AnnotationTransformerInvocationCountTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,33 @@ +package test.annotationtransformer; + +import java.lang.reflect.Constructor; +import java.lang.reflect.Method; +import org.testng.IAnnotationTransformer; +import org.testng.annotations.ITestAnnotation; +import org.testng.annotations.Test; + +public class AnnotationTransformerInvocationCountTest { + + public static class InvocationCountTransformer implements IAnnotationTransformer { + + private final int invocationCount; + + public InvocationCountTransformer(int invocationCount) { + this.invocationCount = invocationCount; + } + + @Override + public void transform( + ITestAnnotation annotation, + Class testClass, + Constructor testConstructor, + Method testMethod) { + if ("concurrencyTest".equals(testMethod.getName())) { + annotation.setInvocationCount(invocationCount); + } + } + } + + @Test(invocationCount = 3) + public void concurrencyTest() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/AnnotationTransformerSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/AnnotationTransformerSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/AnnotationTransformerSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/AnnotationTransformerSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,40 @@ +package test.annotationtransformer; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class AnnotationTransformerSampleTest { + + private int m_two = 0; + private int m_five = 0; + private int m_three = 0; + private int m_four = 0; + + @Test(invocationCount = 2) + public void two() { + m_two++; + } + + @Test(invocationCount = 5) + public void four() { + m_four++; + } + + @Test(invocationCount = 5) + public void three() { + m_three++; + } + + @Test + public void five() { + m_five++; + } + + @Test(dependsOnMethods = {"two", "three", "four", "five"}) + public void verify() { + Assert.assertEquals(m_two, 2); + Assert.assertEquals(m_three, 3); + Assert.assertEquals(m_four, 4); + Assert.assertEquals(m_five, 5); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/AnnotationTransformerTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/AnnotationTransformerTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/AnnotationTransformerTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/AnnotationTransformerTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,326 @@ +package test.annotationtransformer; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.io.ByteArrayInputStream; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import org.assertj.core.api.iterable.Extractor; +import org.testng.Assert; +import org.testng.IAnnotationTransformer; +import org.testng.ITestResult; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import org.testng.xml.XmlPackage; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import org.testng.xml.internal.Parser; +import test.SimpleBaseTest; +import test.TestHelper; +import test.annotationtransformer.issue1790.TestClassSample1; +import test.annotationtransformer.issue1790.TestClassSample2; +import test.annotationtransformer.issue1790.TransformerImpl; +import test.annotationtransformer.issue2312.RetryListener; +import test.annotationtransformer.issue2312.SampleTestClass; +import test.annotationtransformer.issue2536.data.nested.ClassContainer; +import test.annotationtransformer.issue2536.data.nested.ClassContainer.NonGroupClass3; +import test.annotationtransformer.issue2536.listeners.ExternalGroupManager; + +public class AnnotationTransformerTest extends SimpleBaseTest { + + private static final Extractor NAME_EXTRACTOR = ITestResult::getName; + + /** + * Make sure that without a transformer in place, a class-level annotation invocationCount is + * correctly used. + */ + @Test + public void verifyAnnotationWithoutTransformer() { + TestNG tng = create(AnnotationTransformerSampleTest.class); + tng.setPreserveOrder(true); + + TestListenerAdapter tla = new TestListenerAdapter(); + tng.addListener(tla); + + tng.run(); + + assertThat(tla.getPassedTests()) + .extracting(NAME_EXTRACTOR) + .containsExactly( + "five", "four", "four", "four", "four", "four", "three", "three", "three", "three", + "three", "two", "two"); + assertThat(tla.getFailedTests()).extracting(NAME_EXTRACTOR).containsExactly("verify"); + } + + /** Test a transformer on a method-level @Test */ + @Test + public void verifyAnnotationTransformerMethod() { + TestNG tng = create(AnnotationTransformerSampleTest.class); + tng.setPreserveOrder(true); + + MyTransformer transformer = new MyTransformer(); + tng.addListener(transformer); + + TestListenerAdapter tla = new TestListenerAdapter(); + tng.addListener(tla); + + tng.run(); + + assertThat(transformer.getMethodNames()).contains("two", "three", "four", "five", "verify"); + + assertThat(tla.getPassedTests()) + .extracting(NAME_EXTRACTOR) + .containsExactly( + "five", "five", "five", "five", "five", "four", "four", "four", "four", "three", + "three", "three", "two", "two", "verify"); + assertThat(tla.getFailedTests()).isEmpty(); + } + + @Test + public void verifyAnnotationTransformerHasOnlyOneNonNullArgument() { + TestNG tng = create(AnnotationTransformerSampleTest.class); + + MyParamTransformer transformer = new MyParamTransformer(); + tng.addListener(transformer); + + tng.run(); + + assertThat(transformer.isSuccess()).isTrue(); + } + + @Test + public void verifyMyParamTransformerOnlyOneNonNull() { + assertThat(MyParamTransformer.onlyOneNonNull(null, null, null)).isFalse(); + assertThat( + MyParamTransformer.onlyOneNonNull( + MyParamTransformer.class, MyParamTransformer.class.getConstructors()[0], null)) + .isFalse(); + assertThat(MyParamTransformer.onlyOneNonNull(MyParamTransformer.class, null, null)).isTrue(); + } + + /** + * Without an annotation transformer, we should have zero passed tests and one failed test called + * "one". + */ + @Test + public void verifyAnnotationTransformerClass2() { + runTest(null, null, "one"); + } + + /** + * With an annotation transformer, we should have one passed test called "one" and zero failed + * tests. + */ + @Test + public void verifyAnnotationTransformerClass() { + runTest(new MyTimeOutTransformer(), "one", null); + } + + private void runTest(IAnnotationTransformer transformer, String passedName, String failedName) { + MySuiteListener.triggered = false; + MySuiteListener2.triggered = false; + TestNG tng = new TestNG(); + if (transformer != null) { + tng.addListener(transformer); + } + tng.setTestClasses(new Class[] {AnnotationTransformerClassSampleTest.class}); + TestListenerAdapter tla = new TestListenerAdapter(); + tng.addListener(tla); + + tng.run(); + + List results = passedName != null ? tla.getPassedTests() : tla.getFailedTests(); + String name = passedName != null ? passedName : failedName; + + Assert.assertEquals(results.size(), 1); + Assert.assertEquals(name, results.get(0).getMethod().getMethodName()); + Assert.assertTrue(MySuiteListener.triggered); + Assert.assertFalse(MySuiteListener2.triggered); + } + + @Test + public void verifyListenerAnnotationTransformerClass() { + MySuiteListener.triggered = false; + MySuiteListener2.triggered = false; + TestNG tng = new TestNG(); + tng.addListener(new MyListenerTransformer()); + tng.setTestClasses(new Class[] {AnnotationTransformerClassSampleTest.class}); + + tng.run(); + Assert.assertFalse(MySuiteListener.triggered); + Assert.assertTrue(MySuiteListener2.triggered); + } + + @Test + public void verifyConfigurationTransformer() { + TestNG tng = new TestNG(); + tng.addListener(new ConfigurationTransformer()); + tng.setTestClasses(new Class[] {ConfigurationSampleTest.class}); + TestListenerAdapter tla = new TestListenerAdapter(); + tng.addListener(tla); + + tng.run(); + + Assert.assertEquals(ConfigurationSampleTest.getBefore(), "correct"); + } + + @Test + public void verifyDataProviderTransformer() { + TestNG tng = create(); + tng.addListener(new DataProviderTransformer()); + tng.setTestClasses(new Class[] {AnnotationTransformerDataProviderSampleTest.class}); + TestListenerAdapter tla = new TestListenerAdapter(); + tng.addListener(tla); + + tng.run(); + + Assert.assertEquals(tla.getPassedTests().size(), 1); + } + + public static class CustomizedTestListenerAdaptor extends TestListenerAdapter {} + + @Test(description = "GITHUB-2138") + public void verifyAnnotationTransformerInvocationForAllApplicableEvents() { + TestNG tng = create(); + FactoryTransformer transformer = new FactoryTransformer(); + tng.addListener(transformer); + tng.setTestClasses(new Class[] {AnnotationTransformerFactorySampleTest.class}); + CustomizedTestListenerAdaptor tla = new CustomizedTestListenerAdaptor(); + tng.addListener(tla); + + tng.run(); + + Assert.assertEquals(tla.getPassedTests().size(), 1); + String[] expectedLogs = + new String[] { + "transform_data_provider", + "transform_factory", + "transform_test", + "transform_config", + "transform_listener" + }; + assertThat(transformer.getLogs()).containsExactly(expectedLogs); + } + + @Test(description = "Test for issue #605") + public void verifyInvocationCountTransformer() { + TestNG tng = create(); + tng.setTestClasses(new Class[] {AnnotationTransformerInvocationCountTest.class}); + TestListenerAdapter tla = new TestListenerAdapter(); + tng.addListener(tla); + + tng.run(); + + Assert.assertEquals(tla.getPassedTests().size(), 3); + + tng = create(); + tng.addListener(new AnnotationTransformerInvocationCountTest.InvocationCountTransformer(5)); + tng.setTestClasses(new Class[] {AnnotationTransformerInvocationCountTest.class}); + tla = new TestListenerAdapter(); + tng.addListener(tla); + + tng.run(); + + Assert.assertEquals(tla.getPassedTests().size(), 5); + } + + @Test + public void annotationTransformerInXmlShouldBeRun() throws Exception { + String xml = + TestHelper.SUITE_XML_HEADER + + "" + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + ""; + + ByteArrayInputStream is = new ByteArrayInputStream(xml.getBytes()); + Collection suites = new Parser(is).parse(); + + TestNG tng = create(); + tng.setXmlSuites(Arrays.asList(suites.toArray(new XmlSuite[0]))); + TestListenerAdapter tla = new TestListenerAdapter(); + tng.addListener(tla); + + tng.run(); + + Assert.assertEquals(tla.getPassedTests().size(), 1); + } + + @Test(description = "GITHUB-1790") + public void ensureAnnotationTransformerInvokedForClassLevelTestAnnotations() { + TestNG testng = create(TestClassSample1.class, TestClassSample2.class); + TransformerImpl transformer = new TransformerImpl(); + testng.addListener(transformer); + testng.run(); + assertThat(transformer.getClasses()).hasSize(2); + assertThat(transformer.getConstructors()).isEmpty(); + assertThat(transformer.getMethods()).hasSize(2); + } + + @Test(description = "GITHUB-2312") + public void ensureAnnotationTransformerIsNotInvokedMultipleTimes() { + XmlTest myTest = createXmlTest("sample_suite", "sample_test", SampleTestClass.class); + myTest.getSuite().addListener(RetryListener.class.getName()); + TestNG myTestNG = create(myTest.getSuite()); + myTestNG.run(); + int retried = RetryListener.getExecutionCount(); + assertThat(retried).isEqualTo(1); + } + + @Test(description = "GITHUB-2536", dataProvider = "getXmlPackages") + public void testNestedTestClass_packageIncludesNormalTestClasses(List xmlPackages) { + ExternalGroupManager groupManager = new ExternalGroupManager(); + String group = "run-me-dynamically"; + String container = ClassContainer.class.getName(); + String inner = NonGroupClass3.class.getSimpleName(); + + groupManager.addGroupDefinition(container + "$" + inner, group); + + TestListenerAdapter tla = new TestListenerAdapter(); + + XmlSuite xmlSuite = createXmlSuite("2536_suite"); + XmlTest myTest = createXmlTest(xmlSuite, "2536_test"); + myTest.addIncludedGroup(group); + TestNG testng = create(xmlSuite); + testng.addListener(tla); + testng.addListener(groupManager); + + myTest.setXmlPackages(xmlPackages); + + testng.run(); + assertThat(tla.getFailedTests()).withFailMessage("We should have no failed tests").isEmpty(); + + assertThat(tla.getPassedTests()).withFailMessage("We should have 2 passed tests").hasSize(2); + + long count = + tla.getPassedTests().stream() + .filter(m -> m.getInstance().getClass().equals(NonGroupClass3.class)) + .count(); + + assertThat(count) + .withFailMessage("We should have tests that only belong to " + NonGroupClass3.class) + .isEqualTo(2); + } + + @DataProvider + public Object[][] getXmlPackages() { + return new Object[][] { + {Collections.singletonList(new XmlPackage("test.annotationtransformer.issue2536.data.*"))}, + { + Arrays.asList( + new XmlPackage("test.annotationtransformer.issue2536.data.normal"), + new XmlPackage("test.annotationtransformer.issue2536.data.nested")) + } + }; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/ConfigurationSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/ConfigurationSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/ConfigurationSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/ConfigurationSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,32 @@ +package test.annotationtransformer; + +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class ConfigurationSampleTest { + private static String m_before = "uninitialized"; + + @BeforeClass + public void beforeClass() { + m_before = "correct"; + } + + @BeforeMethod(enabled = false) + public void testingEnabledOnConfiguration() { + m_before = "this method is not enabled, we should not be here"; + } + + // will be disabled by the configuration transformer + @BeforeMethod + public void beforeMethod() { + m_before = "incorrect"; + } + + @Test + public void f() {} + + public static String getBefore() { + return m_before; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/ConfigurationTransformer.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/ConfigurationTransformer.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/ConfigurationTransformer.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/ConfigurationTransformer.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,36 @@ +package test.annotationtransformer; + +import java.lang.reflect.Constructor; +import java.lang.reflect.Method; +import org.testng.IAnnotationTransformer; +import org.testng.annotations.IConfigurationAnnotation; +import org.testng.annotations.IDataProviderAnnotation; +import org.testng.annotations.IFactoryAnnotation; +import org.testng.annotations.ITestAnnotation; + +public class ConfigurationTransformer implements IAnnotationTransformer { + + @Override + public void transform( + ITestAnnotation annotation, + Class testClass, + Constructor testConstructor, + Method testMethod) {} + + @Override + public void transform( + IConfigurationAnnotation annotation, + Class testClass, + Constructor testConstructor, + Method testMethod) { + if (annotation.getBeforeTestMethod()) { + annotation.setEnabled(false); + } + } + + @Override + public void transform(IDataProviderAnnotation annotation, Method testMethod) {} + + @Override + public void transform(IFactoryAnnotation annotation, Method testMethod) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/DataProviderTransformer.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/DataProviderTransformer.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/DataProviderTransformer.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/DataProviderTransformer.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,34 @@ +package test.annotationtransformer; + +import java.lang.reflect.Constructor; +import java.lang.reflect.Method; +import org.testng.IAnnotationTransformer; +import org.testng.annotations.IConfigurationAnnotation; +import org.testng.annotations.IDataProviderAnnotation; +import org.testng.annotations.IFactoryAnnotation; +import org.testng.annotations.ITestAnnotation; + +public class DataProviderTransformer implements IAnnotationTransformer { + + @Override + public void transform( + IConfigurationAnnotation annotation, + Class testClass, + Constructor testConstructor, + Method testMethod) {} + + @Override + public void transform(IDataProviderAnnotation annotation, Method testMethod) { + annotation.setName("dataProvider"); + } + + @Override + public void transform( + ITestAnnotation annotation, + Class testClass, + Constructor testConstructor, + Method testMethod) {} + + @Override + public void transform(IFactoryAnnotation annotation, Method testMethod) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/FactoryTransformer.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/FactoryTransformer.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/FactoryTransformer.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/FactoryTransformer.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,51 @@ +package test.annotationtransformer; + +import java.lang.reflect.Constructor; +import java.lang.reflect.Method; +import java.util.Set; +import org.testng.IAnnotationTransformer; +import org.testng.annotations.IConfigurationAnnotation; +import org.testng.annotations.IDataProviderAnnotation; +import org.testng.annotations.IFactoryAnnotation; +import org.testng.annotations.IListenersAnnotation; +import org.testng.annotations.ITestAnnotation; +import org.testng.collections.Sets; + +public class FactoryTransformer implements IAnnotationTransformer { + private final Set logs = Sets.newLinkedHashSet(); + + public Set getLogs() { + return logs; + } + + @Override + public void transform( + IConfigurationAnnotation annotation, + Class testClass, + Constructor testConstructor, + Method testMethod) { + logs.add("transform_config"); + } + + @Override + public void transform(IDataProviderAnnotation annotation, Method testMethod) { + logs.add("transform_data_provider"); + } + + @Override + public void transform( + ITestAnnotation annotation, Class testClass, Constructor testConstructor, Method testMethod) { + logs.add("transform_test"); + } + + @Override + public void transform(IFactoryAnnotation annotation, Method testMethod) { + annotation.setDataProvider("dataProvider"); + logs.add("transform_factory"); + } + + @Override + public void transform(IListenersAnnotation annotation, Class testClass) { + logs.add("transform_listener"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/MyListenerTransformer.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/MyListenerTransformer.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/MyListenerTransformer.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/MyListenerTransformer.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,38 @@ +package test.annotationtransformer; + +import java.lang.reflect.Constructor; +import java.lang.reflect.Method; +import org.testng.IAnnotationTransformer; +import org.testng.annotations.IConfigurationAnnotation; +import org.testng.annotations.IDataProviderAnnotation; +import org.testng.annotations.IFactoryAnnotation; +import org.testng.annotations.IListenersAnnotation; +import org.testng.annotations.ITestAnnotation; + +public class MyListenerTransformer implements IAnnotationTransformer { + + @Override + public void transform(IListenersAnnotation annotation, Class testClass) { + annotation.setValue(new Class[] {MySuiteListener2.class}); + } + + @Override + public void transform( + IConfigurationAnnotation annotation, + Class testClass, + Constructor testConstructor, + Method testMethod) {} + + @Override + public void transform(IDataProviderAnnotation annotation, Method method) {} + + @Override + public void transform(IFactoryAnnotation annotation, Method method) {} + + @Override + public void transform( + ITestAnnotation annotation, + Class testClass, + Constructor testConstructor, + Method testMethod) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/MyParamTransformer.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/MyParamTransformer.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/MyParamTransformer.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/MyParamTransformer.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,30 @@ +package test.annotationtransformer; + +import java.lang.reflect.Constructor; +import java.lang.reflect.Method; +import org.testng.IAnnotationTransformer; +import org.testng.annotations.ITestAnnotation; + +public class MyParamTransformer implements IAnnotationTransformer { + + private boolean success = true; + + @Override + public void transform( + ITestAnnotation annotation, Class testClass, Constructor testConstructor, Method testMethod) { + if (!onlyOneNonNull(testClass, testConstructor, testMethod)) { + success = false; + } + } + + public static boolean onlyOneNonNull( + Class testClass, Constructor testConstructor, Method testMethod) { + return ((testClass != null && testConstructor == null && testMethod == null) + || (testClass == null && testConstructor != null && testMethod == null) + || (testClass == null && testConstructor == null && testMethod != null)); + } + + public boolean isSuccess() { + return success; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/MySuiteListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/MySuiteListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/MySuiteListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/MySuiteListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package test.annotationtransformer; + +import org.testng.ISuite; +import org.testng.ISuiteListener; + +public class MySuiteListener implements ISuiteListener { + + public static boolean triggered = false; + + @Override + public void onStart(ISuite suite) { + triggered = true; + } + + @Override + public void onFinish(ISuite suite) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/MySuiteListener2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/MySuiteListener2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/MySuiteListener2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/MySuiteListener2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package test.annotationtransformer; + +import org.testng.ISuite; +import org.testng.ISuiteListener; + +public class MySuiteListener2 implements ISuiteListener { + + public static boolean triggered = false; + + @Override + public void onStart(ISuite suite) { + triggered = true; + } + + @Override + public void onFinish(ISuite suite) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/MyTimeOutTransformer.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/MyTimeOutTransformer.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/MyTimeOutTransformer.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/MyTimeOutTransformer.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.annotationtransformer; + +import java.lang.reflect.Constructor; +import java.lang.reflect.Method; +import org.testng.IAnnotationTransformer; +import org.testng.annotations.ITestAnnotation; + +public class MyTimeOutTransformer implements IAnnotationTransformer { + + @Override + public void transform( + ITestAnnotation annotation, Class testClass, Constructor testConstructor, Method testMethod) { + annotation.setTimeOut(5000); // 5 seconds + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/MyTransformer.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/MyTransformer.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/MyTransformer.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/MyTransformer.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,39 @@ +package test.annotationtransformer; + +import java.lang.reflect.Constructor; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.List; +import org.testng.IAnnotationTransformer; +import org.testng.annotations.ITestAnnotation; + +public class MyTransformer implements IAnnotationTransformer { + + private final List methodNames = new ArrayList<>(); + + @Override + public void transform( + ITestAnnotation annotation, Class testClass, Constructor testConstructor, Method testMethod) { + annotation.setTimeOut(10000); + if (testMethod != null) { + switch (testMethod.getName()) { + case "three": + annotation.setInvocationCount(3); + break; + case "four": + annotation.setInvocationCount(4); + break; + case "five": + annotation.setInvocationCount(5); + break; + default: + break; + } + methodNames.add(testMethod.getName()); + } + } + + public List getMethodNames() { + return methodNames; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/SimpleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/SimpleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/SimpleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/SimpleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,24 @@ +package test.annotationtransformer; + +import org.testng.Assert; +import org.testng.TestListenerAdapter; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +@Listeners(TestListenerAdapter.class) +public class SimpleTest { + private int m_n; + + public SimpleTest(int n) { + m_n = n; + } + + @BeforeMethod + public void beforeMethod() {} + + @Test + public void run() { + Assert.assertEquals(m_n, 42); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/issue1790/TestClassSample1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/issue1790/TestClassSample1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/issue1790/TestClassSample1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/issue1790/TestClassSample1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.annotationtransformer.issue1790; + +import org.testng.annotations.Test; + +@Test +public class TestClassSample1 { + @Test + public void test11() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/issue1790/TestClassSample2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/issue1790/TestClassSample2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/issue1790/TestClassSample2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/issue1790/TestClassSample2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.annotationtransformer.issue1790; + +import org.testng.annotations.Test; + +@Test +public class TestClassSample2 { + @Test + public void test21() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/issue1790/TransformerImpl.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/issue1790/TransformerImpl.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/issue1790/TransformerImpl.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/issue1790/TransformerImpl.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,40 @@ +package test.annotationtransformer.issue1790; + +import java.lang.reflect.Constructor; +import java.lang.reflect.Method; +import java.util.Set; +import org.testng.IAnnotationTransformer; +import org.testng.annotations.ITestAnnotation; +import org.testng.collections.Sets; + +public class TransformerImpl implements IAnnotationTransformer { + private Set> classes = Sets.newHashSet(); + private Set> constructors = Sets.newHashSet(); + private Set methods = Sets.newHashSet(); + + @Override + public void transform( + ITestAnnotation iTestAnnotation, Class aClass, Constructor constructor, Method method) { + if (aClass != null) { + classes.add(aClass); + } + if (constructor != null) { + constructors.add(constructor); + } + if (method != null) { + methods.add(method); + } + } + + public Set> getClasses() { + return classes; + } + + public Set> getConstructors() { + return constructors; + } + + public Set getMethods() { + return methods; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/issue2312/RetryListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/issue2312/RetryListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/issue2312/RetryListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/issue2312/RetryListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.annotationtransformer.issue2312; + +import java.lang.reflect.Constructor; +import java.lang.reflect.Method; +import org.testng.IAnnotationTransformer; +import org.testng.annotations.ITestAnnotation; + +public class RetryListener implements IAnnotationTransformer { + + private static int executedNrOfTimes = 0; + + public void transform( + ITestAnnotation annotation, Class testClass, Constructor testConstructor, Method testMethod) { + executedNrOfTimes++; + } + + public static int getExecutionCount() { + return executedNrOfTimes; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/issue2312/SampleTestClass.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/issue2312/SampleTestClass.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/issue2312/SampleTestClass.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/issue2312/SampleTestClass.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.annotationtransformer.issue2312; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class SampleTestClass { + + @Test + public void testMethod() { + Assert.assertEquals(1, 1); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/issue2536/data/nested/ClassContainer.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/issue2536/data/nested/ClassContainer.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/issue2536/data/nested/ClassContainer.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/issue2536/data/nested/ClassContainer.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package test.annotationtransformer.issue2536.data.nested; + +import org.testng.annotations.Test; + +public class ClassContainer { + + @Test + public class NonGroupClass3 { + + public void step1() {} + + public void step2() {} + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/issue2536/data/normal/NonGroupClass1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/issue2536/data/normal/NonGroupClass1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/issue2536/data/normal/NonGroupClass1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/issue2536/data/normal/NonGroupClass1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.annotationtransformer.issue2536.data.normal; + +import org.testng.annotations.Test; + +public class NonGroupClass1 { + + @Test + public void step1() {} + + @Test + public void step2() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/issue2536/data/normal/NonGroupClass2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/issue2536/data/normal/NonGroupClass2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/issue2536/data/normal/NonGroupClass2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/issue2536/data/normal/NonGroupClass2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.annotationtransformer.issue2536.data.normal; + +import org.testng.annotations.Test; + +@Test +public class NonGroupClass2 { + + public void step1() {} + + public void step2() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/issue2536/listeners/ExternalGroupManager.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/issue2536/listeners/ExternalGroupManager.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/annotationtransformer/issue2536/listeners/ExternalGroupManager.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/annotationtransformer/issue2536/listeners/ExternalGroupManager.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,54 @@ +package test.annotationtransformer.issue2536.listeners; + +import java.lang.reflect.Constructor; +import java.lang.reflect.Method; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import org.testng.IAnnotationTransformer; +import org.testng.annotations.ITestAnnotation; + +public class ExternalGroupManager implements IAnnotationTransformer { + + private final Map> groupDefinitions = new HashMap<>(); + + public Map> getGroupDefinitions() { + return groupDefinitions; + } + + @Override + public void transform( + ITestAnnotation annotation, Class testClass, Constructor testConstructor, Method testMethod) { + + String fullName = null; + + if (testMethod != null) { + fullName = testMethod.getDeclaringClass().getTypeName() + "." + testMethod.getName(); + } else if (testClass != null) { + + fullName = testClass.getTypeName(); + } + + if (fullName != null) { + if (groupDefinitions.containsKey(fullName)) { + Set data = new HashSet<>(groupDefinitions.get(fullName)); + data.addAll(Arrays.asList(annotation.getGroups())); + String[] fullGroup = data.toArray(new String[0]); + annotation.setGroups(fullGroup); + } else { + Set data = new HashSet<>(Arrays.asList(annotation.getGroups())); + data.add("egm-notselected"); + String[] fullGroup = data.toArray(new String[0]); + annotation.setGroups(fullGroup); + } + } + } + + public void addGroupDefinition(String in_methodFullName, String in_groupName) { + getGroupDefinitions() + .computeIfAbsent(in_methodFullName, k -> new HashSet<>()) + .add(in_groupName); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ant/AntSystemPropertySet.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ant/AntSystemPropertySet.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ant/AntSystemPropertySet.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ant/AntSystemPropertySet.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +package test.ant; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertNotNull; + +import org.testng.annotations.Test; + +/** + * Test whether nested propertysets are passed passed from the ant task. Executed by the + * "run:antprop" target in test/build.xml. + * + * @author Todd Wells + */ +public class AntSystemPropertySet { + + @Test + public void outputTestProperties() { + assertNotNull(System.getProperty("syspropset1"), "syspropset1 not found"); + assertEquals(System.getProperty("syspropset1"), "value 1", "Wrong value for syspropset1"); + + assertNotNull(System.getProperty("syspropset2"), "syspropset2 not found"); + assertEquals(System.getProperty("syspropset2"), "value 2", "Wrong value for syspropset2"); + + assertNotNull(System.getProperty("sysprop1"), "sysprop1 not found"); + assertEquals(System.getProperty("sysprop1"), "value 3", "Wrong value for sysprop1"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ant/DontOverrideSuiteNameTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ant/DontOverrideSuiteNameTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ant/DontOverrideSuiteNameTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ant/DontOverrideSuiteNameTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,13 @@ +package test.ant; + +import org.testng.annotations.Test; + +@Test +public class DontOverrideSuiteNameTest { + private boolean m_run = false; + + @Test(groups = {"nopackage"}) + public void test() { + m_run = true; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ant/MultipleThreadTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ant/MultipleThreadTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ant/MultipleThreadTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ant/MultipleThreadTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,132 @@ +package test.ant; + +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; +import org.testng.Assert; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +/** + * Tests that more than one thread is used for running tests + * + * @author micheb10 2 Oct 2006 + */ +public class MultipleThreadTest { + public static Set _threads; + + @BeforeClass + public void prepareHashSet() { + _threads = Collections.synchronizedSet(new HashSet<>()); + } + + @Test + public void recordThread00() { + _threads.add(Thread.currentThread()); + } + + @Test + public void recordThread01() { + _threads.add(Thread.currentThread()); + } + + @Test + public void recordThread02() { + _threads.add(Thread.currentThread()); + } + + @Test + public void recordThread03() { + _threads.add(Thread.currentThread()); + } + + @Test + public void recordThread04() { + _threads.add(Thread.currentThread()); + } + + @Test + public void recordThread05() { + _threads.add(Thread.currentThread()); + } + + @Test + public void recordThread06() { + _threads.add(Thread.currentThread()); + } + + @Test + public void recordThread07() { + _threads.add(Thread.currentThread()); + } + + @Test + public void recordThread08() { + _threads.add(Thread.currentThread()); + } + + @Test + public void recordThread09() { + _threads.add(Thread.currentThread()); + } + + @Test + public void recordThread10() { + _threads.add(Thread.currentThread()); + } + + @Test + public void recordThread11() { + _threads.add(Thread.currentThread()); + } + + @Test + public void recordThread12() { + _threads.add(Thread.currentThread()); + } + + @Test + public void recordThread13() { + _threads.add(Thread.currentThread()); + } + + @Test + public void recordThread14() { + _threads.add(Thread.currentThread()); + } + + @Test + public void recordThread15() { + _threads.add(Thread.currentThread()); + } + + @Test + public void recordThread16() { + _threads.add(Thread.currentThread()); + } + + @Test + public void recordThread17() { + _threads.add(Thread.currentThread()); + } + + @Test + public void recordThread18() { + _threads.add(Thread.currentThread()); + } + + @Test + public void recordThread19() { + _threads.add(Thread.currentThread()); + } + + @AfterClass + public void confirmMultipleThreads() { + Assert.assertTrue( + _threads.size() > 1, + "More than one thread should have been used for running the tests - " + + _threads.size() + + " was used"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ant/NoPackageTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ant/NoPackageTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ant/NoPackageTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ant/NoPackageTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.ant; + +import org.testng.annotations.AfterMethod; +import org.testng.annotations.Test; + +/** @author Filippo Diotalevi */ +public class NoPackageTest { + private boolean m_run = false; + + @Test(groups = {"nopackage"}) + public void test() { + m_run = true; + } + + @AfterMethod(groups = {"nopackage"}) + public void after() { + assert m_run : "test method was not run"; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ant/TestCommandLineArgs.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ant/TestCommandLineArgs.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ant/TestCommandLineArgs.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ant/TestCommandLineArgs.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,40 @@ +package test.ant; + +import static org.testng.AssertJUnit.assertEquals; + +import java.io.File; +import org.testng.annotations.Test; + +public class TestCommandLineArgs { + + @Test + public void testUnixPathResolution() { + String path = "/wee/wom/flibble.txt"; + + String[] segments = path.split("[/\\\\]", -1); + + assertEquals(4, segments.length); + assertEquals("wee", segments[1]); + } + + @Test + public void testDOSPathResolution() { + String path = "c:\\\\com\\pants\\wibble.txt"; + + String[] segments = path.split("[/\\\\]", -1); + + assertEquals(5, segments.length); + assertEquals("com", segments[2]); // because c: is actually \\ which will be split twice + } + + @Test + public void testPathResolution() { + File file = new File("../CHANGES.txt"); + + assert file.exists(); + + String path = file.getAbsolutePath(); + + assert path.split("[/\\\\]", -1).length > 1; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/attributes/AttributeTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/attributes/AttributeTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/attributes/AttributeTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/attributes/AttributeTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,35 @@ +package test.attributes; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Set; +import org.testng.ITestContext; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +public class AttributeTest { + + @BeforeClass + public void bc(ITestContext ctx) { + ctx.setAttribute("test", "1"); + } + + @Test + public void f1(ITestContext ctx) { + Set names = ctx.getAttributeNames(); + assertThat(names).hasSize(1); + assertThat(names).contains("test"); + assertThat(ctx.getAttribute("test")).isEqualTo("1"); + Object v = ctx.removeAttribute("test"); + assertThat(v).isNotNull(); + ctx.setAttribute("test2", "2"); + } + + @Test(dependsOnMethods = "f1") + public void f2(ITestContext ctx) { + Set names = ctx.getAttributeNames(); + assertThat(names).hasSize(1); + assertThat(names).contains("test2"); + assertThat(ctx.getAttribute("test2")).isEqualTo("2"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/attributes/issue2346/BaseTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/attributes/issue2346/BaseTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/attributes/issue2346/BaseTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/attributes/issue2346/BaseTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package test.attributes.issue2346; + +import java.util.UUID; +import org.testng.ITestResult; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Listeners; + +@Listeners(LocalTestListener.class) +public class BaseTest { + + @BeforeMethod(alwaysRun = true) + public void setUp(ITestResult result) { + String session = UUID.randomUUID().toString(); + result.setAttribute("session", session); + } + + @AfterMethod(alwaysRun = true) + public void tearDown(ITestResult iTestResult) { + String key = "tearDown_" + iTestResult.getMethod().getQualifiedName(); + LocalTestListener.data.putIfAbsent(key, iTestResult.getAttributeNames().isEmpty()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/attributes/issue2346/IssueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/attributes/issue2346/IssueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/attributes/issue2346/IssueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/attributes/issue2346/IssueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,22 @@ +package test.attributes.issue2346; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Map; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class IssueTest extends SimpleBaseTest { + + @Test + public void ensureAttributesAreIntactForSkippedMethods() { + TestNG tng = createTests("sample_test", SingleTest.class); + String cls = SingleTest.class.getCanonicalName() + ".test"; + tng.run(); + Map actual = LocalTestListener.data; + assertThat(actual.get("onTestSkipped_" + cls)).isEqualTo(false); + assertThat(actual.get("onTestStart_" + cls)).isEqualTo(false); + assertThat(actual.get("tearDown_" + cls)).isEqualTo(false); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/attributes/issue2346/LocalTestListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/attributes/issue2346/LocalTestListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/attributes/issue2346/LocalTestListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/attributes/issue2346/LocalTestListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,30 @@ +package test.attributes.issue2346; + +import java.util.HashMap; +import java.util.Map; +import org.testng.ITestListener; +import org.testng.ITestResult; + +public class LocalTestListener implements ITestListener { + public static Map data = new HashMap<>(); + + public void onTestStart(ITestResult iTestResult) { + String key = "onTestStart_" + iTestResult.getMethod().getQualifiedName(); + data.putIfAbsent(key, iTestResult.getAttributeNames().isEmpty()); + } + + public void onTestSuccess(ITestResult iTestResult) { + String key = "onTestSuccess_" + iTestResult.getMethod().getQualifiedName(); + data.putIfAbsent(key, iTestResult.getAttributeNames().isEmpty()); + } + + public void onTestFailure(ITestResult iTestResult) { + String key = "onTestFailure_" + iTestResult.getMethod().getQualifiedName(); + data.putIfAbsent(key, iTestResult.getAttributeNames().isEmpty()); + } + + public void onTestSkipped(ITestResult iTestResult) { + String key = "onTestSkipped_" + iTestResult.getMethod().getQualifiedName(); + data.putIfAbsent(key, iTestResult.getAttributeNames().isEmpty()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/attributes/issue2346/SingleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/attributes/issue2346/SingleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/attributes/issue2346/SingleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/attributes/issue2346/SingleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.attributes.issue2346; + +import static org.testng.Assert.fail; + +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class SingleTest extends BaseTest { + @BeforeMethod + public void start() { + fail(); + } + + @Test + public void test() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/beforegroups/BeforeGroupsTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/beforegroups/BeforeGroupsTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/beforegroups/BeforeGroupsTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/beforegroups/BeforeGroupsTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,152 @@ +package test.beforegroups; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.collections.Lists; +import org.testng.internal.ClassHelper; +import org.testng.internal.PackageUtils; +import org.testng.xml.XmlClass; +import org.testng.xml.XmlGroups; +import org.testng.xml.XmlRun; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.InvokedMethodNameListener; +import test.SimpleBaseTest; +import test.beforegroups.issue118.TestclassSample; +import test.beforegroups.issue1694.BaseClassWithBeforeGroups; +import test.beforegroups.issue2229.AnotherTestClassSample; +import test.beforegroups.issue2229.TestClassSample; +import test.beforegroups.issue346.SampleTestClass; + +public class BeforeGroupsTest extends SimpleBaseTest { + @Test + public void testInSequentialMode() throws IOException { + runTest(XmlSuite.ParallelMode.NONE); + } + + @Test + public void testParallelMode() throws IOException { + runTest(XmlSuite.ParallelMode.CLASSES); + } + + @Test(description = "GITHUB-118") + public void ensureInheritedAttributeWorksForBeforeGroups() { + XmlSuite xmlSuite = createXmlSuite("suite", "test", TestclassSample.class); + xmlSuite.addIncludedGroup("group1"); + TestNG testng = create(xmlSuite); + TestListenerAdapter listener = new TestListenerAdapter(); + testng.addListener(listener); + testng.run(); + assertThat(listener.getFailedTests()).isEmpty(); + } + + @Test(description = "GITHUB-346") + public void ensureBeforeGroupsAreInvokedWhenCoupledWithAfterGroups() { + String TEST_1 = "A"; + String TEST_2 = "B"; + + XmlSuite xmlSuite = new XmlSuite(); + xmlSuite.setName("346_suite"); + createXmlTest(xmlSuite, TEST_1, "A"); + createXmlTest(xmlSuite, TEST_2, "B"); + TestNG testng = new TestNG(); + testng.setXmlSuites(Collections.singletonList(xmlSuite)); + testng.run(); + Map> expected = new HashMap<>(); + expected.put(TEST_1, Collections.singletonList("beforeGroups:" + TEST_1 + TEST_1)); + expected.put(TEST_2, Collections.singletonList("afterGroups:" + TEST_2 + TEST_2)); + assertThat(SampleTestClass.logs).isEqualTo(expected); + } + + @Test(description = "GITHUB-2229") + public void ensureBeforeGroupsAreInvokedByDefaultEvenWithoutGrouping() { + TestNG testng = create(TestClassSample.class, AnotherTestClassSample.class); + testng.run(); + assertThat(testng.getStatus()).isEqualTo(0); + List expectedLogs = + Arrays.asList( + "TestA", + "TestB", + "TestC", + "beforeGroupA", + "testGroupA1", + "testGroupA2", + "testGroupA3", + "afterGroupA", + "beforeGroupB", + "testGroupB", + "afterGroupB"); + assertThat(TestClassSample.logs).containsExactlyElementsOf(expectedLogs); + expectedLogs = + Arrays.asList( + "beforeGroups1", + "test1_testGroup1", + "beforeGroups2", + "test2_testGroup2", + "test3_testGroup1", + "afterGroups1", + "test4_testGroup2", + "afterGroups2"); + assertThat(AnotherTestClassSample.logs).containsExactlyElementsOf(expectedLogs); + } + + private static void createXmlTest(XmlSuite xmlSuite, String name, String group) { + XmlTest xmlTest = new XmlTest(xmlSuite); + xmlTest.setName(name); + xmlTest.setClasses(Collections.singletonList(new XmlClass(SampleTestClass.class))); + xmlTest.setGroups(groups(group)); + } + + private static XmlGroups groups(String group) { + XmlGroups xmlGroups = new XmlGroups(); + XmlRun xmlRun = new XmlRun(); + xmlRun.onInclude(group); + xmlGroups.setRun(xmlRun); + return xmlGroups; + } + + private static void runTest(XmlSuite.ParallelMode mode) throws IOException { + XmlSuite suite = createXmlSuite("sample_suite"); + String pkg = BaseClassWithBeforeGroups.class.getPackage().getName(); + Class[] classes = findClassesInPackage(pkg); + XmlTest xmlTest = createXmlTestWithPackages(suite, "sample_test", classes); + xmlTest.addIncludedGroup("regression"); + xmlTest.setParallel(mode); + TestNG tng = create(suite); + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener(listener); + tng.run(); + List beforeGroups = Lists.newArrayList(); + List afterGroups = Lists.newArrayList(); + for (String name : listener.getInvokedMethodNames()) { + if (name.equalsIgnoreCase(BaseClassWithBeforeGroups.BEFORE_GROUPS)) { + beforeGroups.add(name); + } + if (name.equalsIgnoreCase(BaseClassWithBeforeGroups.AFTER_GROUPS)) { + afterGroups.add(name); + } + } + assertThat(beforeGroups).containsOnly(BaseClassWithBeforeGroups.BEFORE_GROUPS); + assertThat(afterGroups).containsOnly(BaseClassWithBeforeGroups.AFTER_GROUPS); + } + + private static Class[] findClassesInPackage(String packageName) throws IOException { + String[] classes = + PackageUtils.findClassesInPackage(packageName, new ArrayList<>(), new ArrayList<>()); + List> loadedClasses = new ArrayList<>(); + for (String clazz : classes) { + loadedClasses.add(ClassHelper.forName(clazz)); + } + return loadedClasses.toArray(new Class[0]); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/beforegroups/issue118/TestclassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/beforegroups/issue118/TestclassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/beforegroups/issue118/TestclassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/beforegroups/issue118/TestclassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.beforegroups.issue118; + +import org.testng.Assert; +import org.testng.annotations.BeforeGroups; +import org.testng.annotations.Test; + +@Test(groups = "group1") +public class TestclassSample { + private Object testObject; + + @BeforeGroups(inheritGroups = true) + public void setUpGroup() { + testObject = new Object(); + } + + public void test1() { + Assert.assertNotNull(testObject, "@BeforeGroups not invoked if nothing explicitly specified"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/beforegroups/issue1694/BaseClassWithBeforeGroups.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/beforegroups/issue1694/BaseClassWithBeforeGroups.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/beforegroups/issue1694/BaseClassWithBeforeGroups.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/beforegroups/issue1694/BaseClassWithBeforeGroups.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.beforegroups.issue1694; + +import org.testng.annotations.AfterGroups; +import org.testng.annotations.BeforeGroups; + +public class BaseClassWithBeforeGroups { + public static final String BEFORE_GROUPS = "beforeGroups"; + public static final String AFTER_GROUPS = "afterGroups"; + + @BeforeGroups(value = "regression") + public void beforeGroups() {} + + @AfterGroups(value = "regression") + public void afterGroups() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/beforegroups/issue1694/ChildClassA.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/beforegroups/issue1694/ChildClassA.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/beforegroups/issue1694/ChildClassA.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/beforegroups/issue1694/ChildClassA.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ +package test.beforegroups.issue1694; + +import org.testng.annotations.Test; + +public class ChildClassA extends BaseClassWithBeforeGroups { + @Test(groups = "regression") + public void testMethodA() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/beforegroups/issue1694/ChildClassB.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/beforegroups/issue1694/ChildClassB.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/beforegroups/issue1694/ChildClassB.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/beforegroups/issue1694/ChildClassB.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ +package test.beforegroups.issue1694; + +import org.testng.annotations.Test; + +public class ChildClassB extends BaseClassWithBeforeGroups { + @Test(groups = "regression") + public void testMethodB() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/beforegroups/issue1694/ChildClassC.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/beforegroups/issue1694/ChildClassC.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/beforegroups/issue1694/ChildClassC.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/beforegroups/issue1694/ChildClassC.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ +package test.beforegroups.issue1694; + +import org.testng.annotations.Test; + +public class ChildClassC extends BaseClassWithBeforeGroups { + @Test(groups = "regression") + public void testMethodC() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/beforegroups/issue1694/ChildClassD.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/beforegroups/issue1694/ChildClassD.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/beforegroups/issue1694/ChildClassD.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/beforegroups/issue1694/ChildClassD.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ +package test.beforegroups.issue1694; + +import org.testng.annotations.Test; + +public class ChildClassD extends BaseClassWithBeforeGroups { + @Test(groups = "regression") + public void testMethodD() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/beforegroups/issue1694/ChildClassE.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/beforegroups/issue1694/ChildClassE.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/beforegroups/issue1694/ChildClassE.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/beforegroups/issue1694/ChildClassE.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ +package test.beforegroups.issue1694; + +import org.testng.annotations.Test; + +public class ChildClassE extends BaseClassWithBeforeGroups { + @Test(groups = "regression") + public void testMethodE() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/beforegroups/issue1694/ChildClassF.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/beforegroups/issue1694/ChildClassF.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/beforegroups/issue1694/ChildClassF.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/beforegroups/issue1694/ChildClassF.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ +package test.beforegroups.issue1694; + +import org.testng.annotations.Test; + +public class ChildClassF extends BaseClassWithBeforeGroups { + @Test(groups = "regression") + public void testMethodF() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/beforegroups/issue2229/AnotherTestClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/beforegroups/issue2229/AnotherTestClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/beforegroups/issue2229/AnotherTestClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/beforegroups/issue2229/AnotherTestClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,52 @@ +package test.beforegroups.issue2229; + +import java.util.ArrayList; +import java.util.List; +import org.testng.annotations.AfterGroups; +import org.testng.annotations.BeforeGroups; +import org.testng.annotations.Test; + +public class AnotherTestClassSample { + + public static List logs = new ArrayList<>(); + + @BeforeGroups(groups = "testGroup1") + public void beforeGroups1() { + logs.add("beforeGroups1"); + } + + @BeforeGroups(groups = "testGroup2") + public void beforeGroups2() { + logs.add("beforeGroups2"); + } + + @AfterGroups(groups = "testGroup1") + public void afterGroups1() { + logs.add("afterGroups1"); + } + + @AfterGroups(groups = "testGroup2") + public void afterGroups2() { + logs.add("afterGroups2"); + } + + @Test(groups = "testGroup1") + public void test1() { + logs.add("test1_testGroup1"); + } + + @Test(groups = "testGroup2") + public void test2() { + logs.add("test2_testGroup2"); + } + + @Test(groups = "testGroup1") + public void test3() { + logs.add("test3_testGroup1"); + } + + @Test(groups = "testGroup2") + public void test4() { + logs.add("test4_testGroup2"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/beforegroups/issue2229/TestClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/beforegroups/issue2229/TestClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/beforegroups/issue2229/TestClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/beforegroups/issue2229/TestClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,93 @@ +package test.beforegroups.issue2229; + +import static org.testng.Assert.assertFalse; +import static org.testng.Assert.assertTrue; + +import java.util.ArrayList; +import java.util.List; +import org.testng.annotations.AfterClass; +import org.testng.annotations.AfterGroups; +import org.testng.annotations.BeforeGroups; +import org.testng.annotations.Test; + +public class TestClassSample { + + public static List logs = new ArrayList<>(); + + boolean valueA = false; + boolean valueB = false; + + @BeforeGroups(groups = "groupA") + public void beforeGroupA() { + logs.add("beforeGroupA"); + valueA = true; + } + + @BeforeGroups(groups = "groupB") + public void beforeGroupB() { + valueB = true; + logs.add("beforeGroupB"); + } + + @BeforeGroups(groups = "groupC") + public void beforeGroupC() { + logs.add("beforeGroupC No Test exist, should not run."); + } + + @Test + public void testA() { + logs.add("TestA"); + } + + @Test + public void testB() { + logs.add("TestB"); + } + + @Test + public void testC() { + logs.add("TestC"); + } + + @Test(groups = "groupA") + public void testGroupA1() { + logs.add("testGroupA1"); + assertTrue(valueA, "BeforeGroupA was not executed"); + } + + @Test(groups = "groupA") + public void testGroupA2() { + logs.add("testGroupA2"); + assertTrue(valueA, "BeforeGroupA was not executed"); + } + + @Test(groups = "groupA") + public void testGroupA3() { + logs.add("testGroupA3"); + assertTrue(valueA, "BeforeGroupA was not executed"); + } + + @Test(groups = "groupB") + public void testGroupB() { + logs.add("testGroupB"); + assertTrue(valueB, "BeforeGroupB was not executed"); + } + + @AfterGroups(groups = "groupA") + public void afterGroupA() { + logs.add("afterGroupA"); + valueA = false; + } + + @AfterGroups(groups = "groupB") + public void afterGroupB() { + logs.add("afterGroupB"); + valueB = false; + } + + @AfterClass + public void afterClass() { + assertFalse(valueA, "AfterGroupsA was not executed"); + assertFalse(valueB, "AfterGroupsB was not executed"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/beforegroups/issue346/SampleTestClass.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/beforegroups/issue346/SampleTestClass.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/beforegroups/issue346/SampleTestClass.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/beforegroups/issue346/SampleTestClass.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,35 @@ +package test.beforegroups.issue346; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import org.testng.ITestResult; +import org.testng.Reporter; +import org.testng.annotations.AfterGroups; +import org.testng.annotations.BeforeGroups; +import org.testng.annotations.Test; + +public class SampleTestClass { + + public static Map> logs = new HashMap<>(); + + @BeforeGroups(groups = "A") + @AfterGroups(groups = "B") + public void setEnvironment() { + ITestResult itr = Reporter.getCurrentTestResult(); + String type = itr.getMethod().isBeforeGroupsConfiguration() ? "beforeGroups" : "afterGroups"; + String[] groups = itr.getTestContext().getIncludedGroups(); + String testName = itr.getTestContext().getName(); + List data = + Arrays.stream(groups).map(g -> type + ":" + testName + g).collect(Collectors.toList()); + logs.put(itr.getTestContext().getName(), data); + } + + @Test(groups = "A") + public void test1() {} + + @Test(groups = "B") + public void test2() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/bug90/Bug90Test.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/bug90/Bug90Test.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/bug90/Bug90Test.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/bug90/Bug90Test.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,28 @@ +package test.bug90; + +import java.util.Collections; +import org.testng.Assert; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlClass; +import org.testng.xml.XmlInclude; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.SimpleBaseTest; + +public class Bug90Test extends SimpleBaseTest { + + @Test(description = "Fix for https://github.com/cbeust/testng/issues/90") + public void afterClassShouldRun() { + XmlSuite s = createXmlSuite("Bug90"); + XmlTest t = createXmlTest(s, "Bug90 test", Sample.class.getName()); + XmlClass c = t.getClasses().get(0); + c.setIncludedMethods(Collections.singletonList(new XmlInclude("test1"))); + TestNG tng = create(); + tng.setXmlSuites(Collections.singletonList(s)); + Sample.m_afterClassWasRun = false; + tng.run(); + + Assert.assertTrue(Sample.m_afterClassWasRun); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/bug90/Sample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/bug90/Sample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/bug90/Sample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/bug90/Sample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.bug90; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.Test; + +public class Sample { + static boolean m_afterClassWasRun = false; + + @Test + public void test1() {} + + @Test + public void test2() {} + + @AfterClass + public void afterClass() { + m_afterClassWasRun = true; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/bug92/Bug92Test.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/bug92/Bug92Test.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/bug92/Bug92Test.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/bug92/Bug92Test.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +package test.bug92; + +import java.util.Collections; +import org.testng.Assert; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.SimpleBaseTest; + +public class Bug92Test extends SimpleBaseTest { + + @Test(description = "Fix for https://github.com/cbeust/testng/issues/92") + public void BeforeTestShouldRunOnce() { + XmlSuite s = createXmlSuite("Bug92"); + XmlTest t = + createXmlTest(s, "Bug92 test", TestAlpha.class.getName(), TestBravo.class.getName()); + s.setTests(Collections.singletonList(t)); + TestNG tng = create(); + tng.setXmlSuites(Collections.singletonList(s)); + TestBase.beforeTestCount = 0; + TestBase.beforeTestAlwaysCount = 0; + tng.run(); + Assert.assertEquals(TestBase.beforeTestCount, 1); + Assert.assertEquals(TestBase.beforeTestAlwaysCount, 1); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/bug92/TestAlpha.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/bug92/TestAlpha.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/bug92/TestAlpha.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/bug92/TestAlpha.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.bug92; + +import org.testng.annotations.Test; + +public class TestAlpha extends TestBase { + + @Test + public void test1() {} + + @Test + public void test2() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/bug92/TestBase.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/bug92/TestBase.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/bug92/TestBase.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/bug92/TestBase.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.bug92; + +import org.testng.annotations.BeforeTest; + +public class TestBase { + + static int beforeTestCount = 0; + static int beforeTestAlwaysCount = 0; + + @BeforeTest + public void baseTestBeforeTest() { + beforeTestCount++; + } + + @BeforeTest(alwaysRun = true) + public void baseTestBeforeTestAlways() { + beforeTestAlwaysCount++; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/bug92/TestBravo.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/bug92/TestBravo.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/bug92/TestBravo.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/bug92/TestBravo.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.bug92; + +import org.testng.annotations.Test; + +public class TestBravo extends TestBase { + + @Test + public void test1() {} + + @Test + public void test2() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/classgroup/First.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/classgroup/First.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/classgroup/First.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/classgroup/First.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package test.classgroup; + +import org.testng.annotations.Test; + +@Test(groups = {"first"}) +public class First { + private static boolean m_first1 = false; + private static boolean m_first2 = false; + + @Test + public void first1() { + m_first1 = true; + } + + @Test + public void first2() { + m_first2 = true; + } + + static boolean allRun() { + return m_first1 && m_first2; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/classgroup/Second.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/classgroup/Second.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/classgroup/Second.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/classgroup/Second.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.classgroup; + +import org.testng.annotations.Test; + +@Test(dependsOnGroups = {"first"}) +public class Second { + + @Test + public void verify() { + assert First.allRun() : "Methods for class First should have been invoked first."; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/cli/github1517/ExitCodeListenerBehaviorTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/cli/github1517/ExitCodeListenerBehaviorTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/cli/github1517/ExitCodeListenerBehaviorTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/cli/github1517/ExitCodeListenerBehaviorTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,26 @@ +package test.cli.github1517; + +import org.testng.Assert; +import org.testng.TestNG; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class ExitCodeListenerBehaviorTest extends SimpleBaseTest { + + @Test(dataProvider = "getData") + public void testMethod(Class clazz, int expectedStatus) { + TestNG testNG = create(clazz); + testNG.run(); + Assert.assertEquals(testNG.getStatus(), expectedStatus); + } + + @DataProvider + public Object[][] getData() { + return new Object[][] { + {TestClassWithConfigFailureSample.class, 3}, + {TestClassWithConfigSkipSample.class, 2}, + {TestClassWithConfigSkipAndFailureSample.class, 3} + }; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/cli/github1517/TestClassWithConfigFailureSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/cli/github1517/TestClassWithConfigFailureSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/cli/github1517/TestClassWithConfigFailureSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/cli/github1517/TestClassWithConfigFailureSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package test.cli.github1517; + +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +public class TestClassWithConfigFailureSample { + @BeforeClass + public void beforeClass() { + throw new RuntimeException("Simulating a configuration failure"); + } + + @Test + public void testMethod() { + Assert.assertTrue(true); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/cli/github1517/TestClassWithConfigSkipAndFailureSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/cli/github1517/TestClassWithConfigSkipAndFailureSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/cli/github1517/TestClassWithConfigSkipAndFailureSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/cli/github1517/TestClassWithConfigSkipAndFailureSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package test.cli.github1517; + +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class TestClassWithConfigSkipAndFailureSample { + @BeforeClass + public void beforeClass() { + throw new RuntimeException("Simulating a configuration failure"); + } + + @BeforeMethod + public void beforeMethod() { + // Intentionally left empty + } + + @Test + public void testMethod() { + Assert.assertTrue(true); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/cli/github1517/TestClassWithConfigSkipSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/cli/github1517/TestClassWithConfigSkipSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/cli/github1517/TestClassWithConfigSkipSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/cli/github1517/TestClassWithConfigSkipSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ +package test.cli.github1517; + +import org.testng.Assert; +import org.testng.SkipException; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +public class TestClassWithConfigSkipSample { + @BeforeClass + public void beforeClass() { + throw new SkipException("Simulating a configuration skip"); + } + + @Test + public void testMethod() { + Assert.assertTrue(true); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/commandline/CommandLineOverridesXml.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/commandline/CommandLineOverridesXml.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/commandline/CommandLineOverridesXml.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/commandline/CommandLineOverridesXml.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,108 @@ +package test.commandline; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Set; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.jarfileutils.JarCreator; +import org.testng.xml.XmlSuite; +import test.SimpleBaseTest; +import test.TestHelper; +import test.commandline.issue341.LocalLogAggregator; +import test.commandline.issue341.TestSampleA; +import test.commandline.issue341.TestSampleB; + +public class CommandLineOverridesXml extends SimpleBaseTest { + + @Test(description = "Specifying -groups on the command line should override testng.xml") + public void commandLineGroupsShouldOverrideXml() { + runTest("go", null, Collections.singletonList("f2")); + } + + @Test(description = "Specifying -excludegroups on the command line should override testng.xml") + public void commandLineExcludedGroupsShouldOverrideXml() { + runTest(null, "go", Collections.singletonList("f1")); + } + + @Test + public void shouldRunBothMethods() { + runTest(null, null, Arrays.asList("f1", "f2")); + } + + private void runTest(String group, String excludedGroups, List methods) { + XmlSuite s = createXmlSuite(getClass().getName()); + createXmlTest(s, "Test", OverrideSampleTest.class.getName()); + TestNG tng = create(); + if (group != null) tng.setGroups(group); + if (excludedGroups != null) tng.setExcludedGroups(excludedGroups); + tng.setXmlSuites(Collections.singletonList(s)); + TestListenerAdapter tla = new TestListenerAdapter(); + tng.addListener(tla); + tng.run(); + + assertTestResultsEqual(tla.getPassedTests(), methods); + } + + @Test + public void ensureThatParallelismAndThreadCountAreRallied() { + TestNG testng = create(); + testng.setTestSuites(Collections.singletonList("src/test/resources/987.xml")); + testng.setThreadCount(2); + testng.setParallel(XmlSuite.ParallelMode.METHODS); + testng.run(); + assertThat(Issue987TestSample.maps).hasSize(2); + assertThat(Issue987TestSample.maps.values()).contains("method2", "method1"); + } + + @Test(description = "GITHUB-341") + public void ensureParallelismIsHonoredWhenOnlyClassesSpecifiedInJar() throws IOException { + Class[] classes = new Class[] {TestSampleA.class, TestSampleB.class}; + File jarfile = JarCreator.generateJar(classes); + String[] args = + new String[] { + "-parallel", + "classes", + "-testjar", + jarfile.getAbsolutePath(), + "-listener", + LocalLogAggregator.class.getCanonicalName() + }; + TestNG.privateMain(args, null); + Set logs = LocalLogAggregator.getLogs(); + assertThat(logs).hasSize(2); + } + + @Test(description = "GITHUB-1810") + public void ensureNoNullPointerExceptionIsThrown() throws IOException { + TestNG testng = TestNG.privateMain(new String[] {createTemporarySuiteAndGetItsPath()}, null); + assertThat(testng.getStatus()).isEqualTo(8); + } + + private static String createTemporarySuiteAndGetItsPath() throws IOException { + Path file = Files.createTempFile("testng", ".xml"); + org.testng.reporters.Files.writeFile( + buildSuiteContentThatRefersToInvalidTestClass(), file.toFile()); + return file.toFile().getAbsolutePath(); + } + + private static String buildSuiteContentThatRefersToInvalidTestClass() { + return TestHelper.SUITE_XML_HEADER + + "\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "\n"; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/commandline/Issue987TestSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/commandline/Issue987TestSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/commandline/Issue987TestSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/commandline/Issue987TestSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.commandline; + +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import org.testng.annotations.Test; + +public class Issue987TestSample { + public static Map maps = new ConcurrentHashMap<>(); + + @Test + public void method1() { + maps.put(Thread.currentThread().getId(), "method1"); + } + + @Test + public void method2() { + maps.put(Thread.currentThread().getId(), "method2"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/commandline/OverrideSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/commandline/OverrideSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/commandline/OverrideSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/commandline/OverrideSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.commandline; + +import org.testng.annotations.Test; + +public class OverrideSampleTest { + + @Test + public void f1() {} + + @Test(groups = "go") + public void f2() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/commandline/issue341/LocalLogAggregator.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/commandline/issue341/LocalLogAggregator.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/commandline/issue341/LocalLogAggregator.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/commandline/issue341/LocalLogAggregator.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,22 @@ +package test.commandline.issue341; + +import java.util.Collections; +import java.util.Set; +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.ITestResult; +import org.testng.Reporter; +import org.testng.collections.Maps; + +public class LocalLogAggregator implements IInvokedMethodListener { + private static final Set logs = Collections.newSetFromMap(Maps.newConcurrentMap()); + + @Override + public void afterInvocation(IInvokedMethod method, ITestResult testResult) { + logs.addAll(Reporter.getOutput(testResult)); + } + + public static Set getLogs() { + return logs; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/commandline/issue341/TestSampleA.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/commandline/issue341/TestSampleA.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/commandline/issue341/TestSampleA.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/commandline/issue341/TestSampleA.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.commandline.issue341; + +import org.testng.Reporter; +import org.testng.annotations.Test; + +public class TestSampleA { + @Test + public void a() { + Reporter.log(Long.toString(Thread.currentThread().getId())); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/commandline/issue341/TestSampleB.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/commandline/issue341/TestSampleB.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/commandline/issue341/TestSampleB.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/commandline/issue341/TestSampleB.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.commandline.issue341; + +import org.testng.Reporter; +import org.testng.annotations.Test; + +public class TestSampleB { + @Test + public void aa() { + Reporter.log(Long.toString(Thread.currentThread().getId())); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/conffailure/ClassWithFailedBeforeSuite.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/conffailure/ClassWithFailedBeforeSuite.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/conffailure/ClassWithFailedBeforeSuite.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/conffailure/ClassWithFailedBeforeSuite.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.conffailure; + +import org.testng.annotations.BeforeSuite; + +public class ClassWithFailedBeforeSuite { + + @BeforeSuite + public void setUpShouldFail() { + throw new RuntimeException("Failing in setUp"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/conffailure/ClassWithFailedBeforeSuiteVerification.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/conffailure/ClassWithFailedBeforeSuiteVerification.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/conffailure/ClassWithFailedBeforeSuiteVerification.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/conffailure/ClassWithFailedBeforeSuiteVerification.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,26 @@ +package test.conffailure; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; + +public class ClassWithFailedBeforeSuiteVerification { + + private static boolean m_success1 = true; + private static boolean m_success2 = true; + + // Should not be run because beforeSuite failed on the other class + @BeforeClass + public void setUp() { + m_success1 = false; + } + + // Should not be run because beforeSuite failed on the other class + @AfterClass + public void tearDown() { + m_success2 = false; + } + + public static boolean success() { + return m_success1 && m_success2; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/conffailure/ClassWithFailedBeforeTestClass.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/conffailure/ClassWithFailedBeforeTestClass.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/conffailure/ClassWithFailedBeforeTestClass.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/conffailure/ClassWithFailedBeforeTestClass.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.conffailure; + +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +public class ClassWithFailedBeforeTestClass { + @BeforeClass + public void setUpShouldFail() { + throw new RuntimeException("Failing in setUp"); + } + + // Adding this method or @Configuration will never be invoked + @Test + public void dummy() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/conffailure/ClassWithFailedBeforeTestClassVerification.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/conffailure/ClassWithFailedBeforeTestClassVerification.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/conffailure/ClassWithFailedBeforeTestClassVerification.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/conffailure/ClassWithFailedBeforeTestClassVerification.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,31 @@ +package test.conffailure; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +public class ClassWithFailedBeforeTestClassVerification { + + private static boolean m_success1 = false; + private static boolean m_success2 = false; + + // Should be run even though ClassWithFailedBeforeTestClass failed in its configuration + @BeforeClass + public void setUpShouldPass() { + m_success1 = true; + } + + // Should be run even though ClassWithFailedBeforeTestClass failed in its configuration + @AfterClass + public void tearDown() { + m_success2 = true; + } + + // Adding this method or @Configuration will never be invoked + @Test + public void dummy() {} + + public static boolean success() { + return m_success1 && m_success2; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/conffailure/ConfigurationFailure.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/conffailure/ConfigurationFailure.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/conffailure/ConfigurationFailure.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/conffailure/ConfigurationFailure.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,55 @@ +package test.conffailure; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.testng.Assert.assertTrue; + +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import test.SimpleBaseTest; +import test.conffailure.github990.AbstractBaseSample; +import test.conffailure.github990.ChildClassSample; +import testhelper.OutputDirectoryPatch; + +/** + * Test various cases where the @Configuration methods fail + * + *

Created on Jul 20, 2005 + * + * @author cbeust + */ +public class ConfigurationFailure extends SimpleBaseTest { + + @Test + public void beforeTestClassFails() { + runTest(ClassWithFailedBeforeTestClass.class, ClassWithFailedBeforeTestClassVerification.class); + assertTrue( + ClassWithFailedBeforeTestClassVerification.success(), + "Not all the @Configuration methods of Run2 were run"); + } + + @Test + public void beforeTestSuiteFails() { + runTest(ClassWithFailedBeforeSuite.class, ClassWithFailedBeforeSuiteVerification.class); + assertTrue( + ClassWithFailedBeforeSuiteVerification.success(), + "No @Configuration methods should have run"); + } + + private static void runTest(Class... classes) { + TestListenerAdapter tla = new TestListenerAdapter(); + TestNG testng = create(classes); + testng.setOutputDirectory(OutputDirectoryPatch.getOutputDirectory()); + testng.addListener(tla); + testng.run(); + } + + @Test(description = "GITHUB-990") + public void ensureConfigurationRunsFromBaseClass() { + TestNG testng = create(ChildClassSample.class); + testng.setConfigFailurePolicy(XmlSuite.FailurePolicy.CONTINUE); + testng.run(); + assertThat(AbstractBaseSample.messages).containsExactly("cleanup"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/conffailure/github990/AbstractBaseSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/conffailure/github990/AbstractBaseSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/conffailure/github990/AbstractBaseSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/conffailure/github990/AbstractBaseSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,24 @@ +package test.conffailure.github990; + +import java.util.ArrayList; +import java.util.List; +import org.testng.annotations.AfterTest; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.Test; + +public abstract class AbstractBaseSample { + public static List messages = new ArrayList<>(); + + @BeforeTest + protected void setup() { + throw new RuntimeException("Fail the test."); + } + + @Test + protected abstract void execute(); + + @AfterTest(alwaysRun = true) + protected void cleanup() { + messages.add("cleanup"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/conffailure/github990/ChildClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/conffailure/github990/ChildClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/conffailure/github990/ChildClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/conffailure/github990/ChildClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,6 @@ +package test.conffailure.github990; + +public class ChildClassSample extends AbstractBaseSample { + @Override + protected void execute() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/AfterMethodWithGroupFiltersSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/AfterMethodWithGroupFiltersSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/AfterMethodWithGroupFiltersSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/AfterMethodWithGroupFiltersSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,40 @@ +package test.configuration; + +import org.testng.annotations.AfterMethod; +import org.testng.annotations.Test; + +public class AfterMethodWithGroupFiltersSampleTest { + static final String[] EXPECTED_INVOCATIONS = { + "g1m1", + "afterGroup1", + "g1m2", + "afterGroup1", + "g2m1", + "afterGroup2", + "g2m2", + "afterGroup2", + "g2m3", + "afterGroup2", + }; + + @AfterMethod(onlyForGroups = {"group1"}) + public void afterGroup1() {} + + @Test(groups = "group1") + public void g1m1() {} + + @Test(groups = "group1") + public void g1m2() {} + + @AfterMethod(onlyForGroups = {"group2"}) + public void afterGroup2() {} + + @Test(groups = "group2") + public void g2m1() {} + + @Test(groups = "group2") + public void g2m2() {} + + @Test(groups = "group2") + public void g2m3() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/AfterMethodWithGroupFiltersTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/AfterMethodWithGroupFiltersTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/AfterMethodWithGroupFiltersTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/AfterMethodWithGroupFiltersTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package test.configuration; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.annotations.Test; +import test.InvokedMethodNameListener; +import test.SimpleBaseTest; + +public class AfterMethodWithGroupFiltersTest extends SimpleBaseTest { + + @Test + public void beforeMethodWithBeforeGroupsShouldOnlyRunBeforeGroupMethods() { + InvokedMethodNameListener nameListener = run(AfterMethodWithGroupFiltersSampleTest.class); + assertThat(nameListener.getInvokedMethodNames()) + .containsExactly(AfterMethodWithGroupFiltersSampleTest.EXPECTED_INVOCATIONS); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/Base.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/Base.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/Base.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/Base.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.configuration; + +import org.testng.annotations.BeforeGroups; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.Test; + +@Test(groups = {"base"}) +public class Base { + static int m_count; + + @BeforeTest + public void init() { + m_count = 0; + } + + @BeforeGroups(groups = "foo") + public void beforeGroups() { + m_count++; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/Base3.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/Base3.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/Base3.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/Base3.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,21 @@ +package test.configuration; + +import org.testng.Assert; +import org.testng.annotations.BeforeGroups; + +public class Base3 { + + private static boolean m_before = false; + + /** @return the m_before */ + public static boolean getBefore() { + return m_before; + } + + @BeforeGroups("cg34-1") + public void anotherBefore1() { + Assert.assertFalse(m_before); + Assert.assertFalse(ConfigurationGroups3SampleTest.getF1()); + m_before = true; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/BaseBeforeTestOrdering.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/BaseBeforeTestOrdering.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/BaseBeforeTestOrdering.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/BaseBeforeTestOrdering.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ +package test.configuration; + +public class BaseBeforeTestOrdering { + + public void log(String s) { + BeforeTestOrderingTest.addTest(s); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/BaseGroupsASampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/BaseGroupsASampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/BaseGroupsASampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/BaseGroupsASampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,10 @@ +package test.configuration; + +import org.testng.annotations.Test; + +public class BaseGroupsASampleTest extends Base { + @Test(groups = "foo") + public void a() { + // System.out.println( "a" ); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/BaseGroupsBSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/BaseGroupsBSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/BaseGroupsBSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/BaseGroupsBSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ +package test.configuration; + +import org.testng.annotations.Test; + +public class BaseGroupsBSampleTest extends Base { + @Test(groups = "foo") + public void b() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/BaseGroupsTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/BaseGroupsTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/BaseGroupsTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/BaseGroupsTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,56 @@ +package test.configuration; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.InvokedMethodNameListener; +import test.SimpleBaseTest; +import test.configuration.github1338.FirstGitHub1338Sample; +import test.configuration.github1338.SecondGitHub1338Sample; +import test.configuration.github1338.ThirdGitHub1338Sample; + +public class BaseGroupsTest extends SimpleBaseTest { + + @Test( + description = + "Verify that a base class with a BeforeGroups method only gets invoked once, " + + "no matter how many subclasses it has") + public void verifySingleInvocation() { + TestNG tng = create(BaseGroupsASampleTest.class, BaseGroupsBSampleTest.class); + tng.setGroups("foo"); + + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener(listener); + + tng.run(); + + assertThat(listener.getSkippedMethodNames()).isEmpty(); + assertThat(listener.getFailedMethodNames()).isEmpty(); + assertThat(listener.getSucceedMethodNames()).containsOnlyOnce("beforeGroups"); + } + + @Test(description = "https://github.com/cbeust/testng/issues/1338") + public void verifyBeforeGroupUseAppropriateInstance() { + XmlSuite suite = createXmlSuite("Suite"); + XmlTest test = + createXmlTest( + suite, + "Test", + SecondGitHub1338Sample.class, + FirstGitHub1338Sample.class, + ThirdGitHub1338Sample.class); + createXmlGroups(test, "group1"); + TestNG tng = create(suite); + + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener(listener); + + tng.run(); + + assertThat(listener.getSkippedMethodNames()).isEmpty(); + assertThat(listener.getFailedMethodNames()).isEmpty(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/BeforeClassTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/BeforeClassTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/BeforeClassTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/BeforeClassTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,51 @@ +package test.configuration; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.ArrayList; +import java.util.List; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlSuite.ParallelMode; +import test.SimpleBaseTest; +import test.configuration.issue1035.InvocationTracker; +import test.configuration.issue1035.MyFactory; + +public class BeforeClassTest extends SimpleBaseTest { + + @Test + public void beforeClassMethodsShouldRunInParallel() { + TestNG tng = create(BeforeClassThreadA.class, BeforeClassThreadB.class); + tng.setParallel(XmlSuite.ParallelMode.METHODS); + tng.run(); + assertThat(Math.abs(BeforeClassThreadA.WHEN - BeforeClassThreadB.WHEN)).isLessThan(1000); + } + + @Test + public void afterClassShouldRunEvenWithDisabledMethods() { + TestNG tng = create(ConfigurationDisabledSampleTest.class); + assertThat(ConfigurationDisabledSampleTest.m_afterWasRun).isFalse(); + tng.run(); + assertThat(ConfigurationDisabledSampleTest.m_afterWasRun).isTrue(); + } + + @Test(description = "GITHUB-1035") + public void ensureBeforeClassGetsCalledConcurrentlyWhenWorkingWithFactories() { + TestNG testng = create(MyFactory.class); + testng.setParallel(ParallelMode.INSTANCES); + testng.setGroupByInstances(true); + testng.run(); + List sorted = new ArrayList<>(MyFactory.TRACKER); + assertThat(sorted).hasSize(5); + long previousTimestamp = sorted.get(0).getTime(); + long previousThreadId = sorted.get(0).getThreadId(); + for (int i = 1; i < sorted.size(); i++) { + InvocationTracker current = sorted.get(i); + assertThat(current.getTime() - previousTimestamp).isLessThanOrEqualTo(100); + previousTimestamp = current.getTime(); + assertThat(current.getThreadId()).isNotEqualTo(previousThreadId); + previousThreadId = current.getThreadId(); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/BeforeClassThreadA.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/BeforeClassThreadA.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/BeforeClassThreadA.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/BeforeClassThreadA.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package test.configuration; + +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +public class BeforeClassThreadA { + public static long WHEN; + + @BeforeClass(alwaysRun = true) + public void setup() throws InterruptedException { + WHEN = System.currentTimeMillis(); + Thread.sleep(2000); + } + + @Test + public void execute() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/BeforeClassThreadB.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/BeforeClassThreadB.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/BeforeClassThreadB.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/BeforeClassThreadB.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package test.configuration; + +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +public class BeforeClassThreadB { + public static long WHEN; + + @BeforeClass(alwaysRun = true) + public void setup() throws InterruptedException { + WHEN = System.currentTimeMillis(); + Thread.sleep(2000); + } + + @Test + public void execute() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/BeforeMethodTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/BeforeMethodTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/BeforeMethodTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/BeforeMethodTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +package test.configuration; + +import java.lang.reflect.Method; +import org.testng.Assert; +import org.testng.ITestContext; +import org.testng.ITestNGMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class BeforeMethodTest { + private Method m_method; + private ITestContext m_context; + + @BeforeMethod + public void before(Method m, ITestContext ctx) { + m_method = m; + m_context = ctx; + } + + @Test + public void mainTest() { + Assert.assertEquals(m_method.getName(), "mainTest"); + ITestNGMethod[] methods = m_context.getAllTestMethods(); + Assert.assertEquals(1, methods.length); + Assert.assertEquals(methods[0].getConstructorOrMethod().getName(), "mainTest"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/BeforeMethodWithGroupFiltersSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/BeforeMethodWithGroupFiltersSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/BeforeMethodWithGroupFiltersSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/BeforeMethodWithGroupFiltersSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,41 @@ +package test.configuration; + +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class BeforeMethodWithGroupFiltersSampleTest { + + static final String[] EXPECTED_INVOCATIONS = { + "beforeGroup1", + "g1m1", + "beforeGroup1", + "g1m2", + "beforeGroup2", + "g2m1", + "beforeGroup2", + "g2m2", + "beforeGroup2", + "g2m3" + }; + + @BeforeMethod(onlyForGroups = {"group1"}) + public void beforeGroup1() {} + + @Test(groups = "group1") + public void g1m1() {} + + @Test(groups = "group1") + public void g1m2() {} + + @BeforeMethod(onlyForGroups = {"group2"}) + public void beforeGroup2() {} + + @Test(groups = "group2") + public void g2m1() {} + + @Test(groups = "group2") + public void g2m2() {} + + @Test(groups = "group2") + public void g2m3() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/BeforeMethodWithGroupFiltersTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/BeforeMethodWithGroupFiltersTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/BeforeMethodWithGroupFiltersTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/BeforeMethodWithGroupFiltersTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package test.configuration; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.annotations.Test; +import test.InvokedMethodNameListener; +import test.SimpleBaseTest; + +public class BeforeMethodWithGroupFiltersTest extends SimpleBaseTest { + + @Test + public void beforeMethodWithBeforeGroupsShouldOnlyRunBeforeGroupMethods() { + InvokedMethodNameListener nameListener = run(BeforeMethodWithGroupFiltersSampleTest.class); + assertThat(nameListener.getInvokedMethodNames()) + .containsExactly(BeforeMethodWithGroupFiltersSampleTest.EXPECTED_INVOCATIONS); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/BeforeTestOrdering1Test.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/BeforeTestOrdering1Test.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/BeforeTestOrdering1Test.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/BeforeTestOrdering1Test.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package test.configuration; + +import org.testng.annotations.AfterTest; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.Test; + +public class BeforeTestOrdering1Test extends BaseBeforeTestOrdering { + + @BeforeTest + public void bt1() { + log("bt1"); + } + + @AfterTest + public void at1() { + log("at1"); + } + + @Test + public void f1() { + log("f1"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/BeforeTestOrdering2Test.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/BeforeTestOrdering2Test.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/BeforeTestOrdering2Test.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/BeforeTestOrdering2Test.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package test.configuration; + +import org.testng.annotations.AfterTest; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.Test; + +public class BeforeTestOrdering2Test extends BaseBeforeTestOrdering { + + @BeforeTest + public void bt2() { + log("bt2"); + } + + @AfterTest + public void at2() { + log("at2"); + } + + @Test + public void f2() { + log("f2"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/BeforeTestOrderingTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/BeforeTestOrderingTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/BeforeTestOrderingTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/BeforeTestOrderingTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,56 @@ +package test.configuration; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import org.testng.Assert; +import org.testng.Reporter; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.BeforeSuite; +import org.testng.annotations.Test; +import org.testng.xml.XmlClass; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.TestHelper; + +public class BeforeTestOrderingTest { + + private static final List m_testNames = new ArrayList<>(); + + @BeforeSuite + public void init() { + m_testNames.clear(); + } + + static void addTest(String testName) { + m_testNames.add(testName); + } + + private static final List expected = + Arrays.asList("bt1", "f1", "at1", "bt2", "f2", "at2"); + + @Test + public void verifyBeforeTestOrdering() throws IOException { + XmlSuite s = new XmlSuite(); + Reporter.log("BEFORE"); + + XmlTest t1 = new XmlTest(s); + XmlClass c1 = new XmlClass(BeforeTestOrdering1Test.class); + t1.getXmlClasses().add(c1); + + XmlTest t2 = new XmlTest(s); + XmlClass c2 = new XmlClass(BeforeTestOrdering2Test.class); + t2.getXmlClasses().add(c2); + + TestNG tng = TestHelper.createTestNG(); + TestListenerAdapter tl = new TestListenerAdapter(); + tng.addListener(tl); + tng.setXmlSuites(Collections.singletonList(s)); + tng.run(); + + Assert.assertEquals(m_testNames, expected); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/ConfigurationBaseTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationBaseTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/ConfigurationBaseTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationBaseTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +package test.configuration; + +import org.testng.Assert; +import org.testng.ITestNGListener; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import test.SimpleBaseTest; + +public abstract class ConfigurationBaseTest extends SimpleBaseTest { + protected void testConfiguration(Class... classes) { + TestNG tng = create(classes); + + TestListenerAdapter tla = new TestListenerAdapter(); + tng.addListener((ITestNGListener) tla); + tng.run(); + + Assert.assertEquals( + tla.getConfigurationFailures().size(), + 0, + getFailedResultMessage(tla.getConfigurationFailures())); + Assert.assertEquals( + tla.getFailedTests().size(), 0, getFailedResultMessage(tla.getFailedTests())); + Assert.assertEquals( + tla.getSkippedTests().size(), 0, getFailedResultMessage(tla.getSkippedTests())); + Assert.assertFalse(tla.getPassedTests().isEmpty(), "All tests should pass"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/ConfigurationDisabledSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationDisabledSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/ConfigurationDisabledSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationDisabledSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,26 @@ +package test.configuration; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +public class ConfigurationDisabledSampleTest { + + public static boolean m_afterWasRun; + + @BeforeClass(alwaysRun = true) + public void before() { + m_afterWasRun = false; + } + + @AfterClass(alwaysRun = true) + public void after() { + m_afterWasRun = true; + } + + @Test + public void f1() {} + + @Test(enabled = false) + public void f2() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/ConfigurationGroupBothSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationGroupBothSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/ConfigurationGroupBothSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationGroupBothSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,45 @@ +package test.configuration; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import org.testng.annotations.AfterGroups; +import org.testng.annotations.BeforeGroups; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class ConfigurationGroupBothSampleTest { + static List m_list = Collections.synchronizedList(new ArrayList<>()); + + private static synchronized void addToList(Integer n) { + m_list.add(n); + } + + @BeforeGroups( + groups = {"twice"}, + value = {"twice"}) + public void a() { + addToList(1); + } + + @Test( + groups = {"twice"}, + dataProvider = "MyData", + invocationCount = 2, + threadPoolSize = 2) + public void b(int a, int b) { + addToList(2); + } + + @AfterGroups( + groups = {"twice"}, + value = {"twice"}) + public void c() { + addToList(3); + } + + @DataProvider(name = "MyData") + public Object[][] input() { + return new Object[][] {{1, 1}, {2, 2}, {3, 3}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/ConfigurationGroupDataProviderSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationGroupDataProviderSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/ConfigurationGroupDataProviderSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationGroupDataProviderSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,38 @@ +package test.configuration; + +import java.util.ArrayList; +import java.util.List; +import org.testng.annotations.AfterGroups; +import org.testng.annotations.BeforeGroups; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class ConfigurationGroupDataProviderSampleTest { + static List m_list = new ArrayList<>(); + + @BeforeGroups( + groups = {"twice"}, + value = {"twice"}) + public void a() { + m_list.add(1); + } + + @Test( + groups = {"twice"}, + dataProvider = "MyData") + public void b(int a, int b) { + m_list.add(2); + } + + @AfterGroups( + groups = {"twice"}, + value = {"twice"}) + public void c() { + m_list.add(3); + } + + @DataProvider(name = "MyData") + public Object[][] input() { + return new Object[][] {{1, 1}, {2, 2}, {3, 3}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/ConfigurationGroupInvocationCountSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationGroupInvocationCountSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/ConfigurationGroupInvocationCountSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationGroupInvocationCountSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,32 @@ +package test.configuration; + +import java.util.ArrayList; +import java.util.List; +import org.testng.annotations.AfterGroups; +import org.testng.annotations.BeforeGroups; +import org.testng.annotations.Test; + +public class ConfigurationGroupInvocationCountSampleTest { + static List m_list = new ArrayList<>(); + + @BeforeGroups( + groups = {"twice"}, + value = {"twice"}) + public void a() { + m_list.add(1); + } + + @Test( + groups = {"twice"}, + invocationCount = 3) + public void b() { + m_list.add(2); + } + + @AfterGroups( + groups = {"twice"}, + value = {"twice"}) + public void c() { + m_list.add(3); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/ConfigurationGroupIteratorDataProviderSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationGroupIteratorDataProviderSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/ConfigurationGroupIteratorDataProviderSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationGroupIteratorDataProviderSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,40 @@ +package test.configuration; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import org.testng.annotations.AfterGroups; +import org.testng.annotations.BeforeGroups; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class ConfigurationGroupIteratorDataProviderSampleTest { + static List m_list = new ArrayList<>(); + + @BeforeGroups( + groups = {"twice"}, + value = {"twice"}) + public void a() { + m_list.add(1); + } + + @Test( + groups = {"twice"}, + dataProvider = "MyData") + public void b(int a, int b) { + m_list.add(2); + } + + @AfterGroups( + groups = {"twice"}, + value = {"twice"}) + public void c() { + m_list.add(3); + } + + @DataProvider(name = "MyData") + public Iterator input() { + return Arrays.asList(new Object[] {1, 1}, new Object[] {2, 2}, new Object[] {3, 3}).iterator(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/ConfigurationGroups1SampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationGroups1SampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/ConfigurationGroups1SampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationGroups1SampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,46 @@ +package test.configuration; + +import java.util.ArrayList; +import java.util.List; +import org.testng.Assert; +import org.testng.annotations.BeforeGroups; +import org.testng.annotations.Test; + +/** + * Simple beforeGroups test: 1 before method and 2 test method + * + * @author cbeust + * @date Mar 3, 2006 + */ +public class ConfigurationGroups1SampleTest { + private boolean m_before = false; + private boolean m_f1 = false; + + @BeforeGroups("cg1-1") + public void before1() { + Assert.assertFalse(m_before); + Assert.assertFalse(m_f1); + m_before = true; + } + + @Test(groups = "cg1-a") + public void fa() {} + + @Test(groups = "cg1-1") + public void f1() { + Assert.assertTrue(m_before); + m_f1 = true; + } + + private List m_list = new ArrayList<>(); + + @Test(dependsOnGroups = {"cg1-a", "cg1-1"}) + public void verify() { + Assert.assertTrue(m_before); + Assert.assertTrue(m_f1); + } + + private void log(String s) { + m_list.add(s); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/ConfigurationGroups2SampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationGroups2SampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/ConfigurationGroups2SampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationGroups2SampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,60 @@ +package test.configuration; + +import java.util.ArrayList; +import java.util.List; +import org.testng.Assert; +import org.testng.annotations.BeforeGroups; +import org.testng.annotations.Test; + +/** + * beforeGroups test: make sure that the beforeGroups method is invoked only once even if two test + * methods belong to the group + * + * @author cbeust + */ +public class ConfigurationGroups2SampleTest { + private boolean m_before = false; + private boolean m_f1 = false; + private boolean m_g1 = false; + + @BeforeGroups("cg2-1") + public void before1() { + Assert.assertFalse(m_before); + Assert.assertFalse(m_f1); + Assert.assertFalse(m_g1); + m_before = true; + log("before1"); + } + + @Test(groups = "cg2-a") + public void fa() { + log("fa"); + } + + @Test(groups = "cg2-1") + public void f1() { + Assert.assertTrue(m_before); + m_f1 = true; + log("f1"); + } + + @Test(groups = "cg2-1") + public void g1() { + Assert.assertTrue(m_before); + m_g1 = true; + log("g1"); + } + + private List m_list = new ArrayList<>(); + + @Test(dependsOnGroups = {"cg2-a", "cg2-1"}) + public void verify() { + Assert.assertTrue(m_before); + Assert.assertTrue(m_f1); + Assert.assertTrue(m_g1); + } + + private void log(String s) { + m_list.add(s); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/ConfigurationGroups3SampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationGroups3SampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/ConfigurationGroups3SampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationGroups3SampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,56 @@ +package test.configuration; + +import java.util.ArrayList; +import java.util.List; +import org.testng.Assert; +import org.testng.annotations.BeforeGroups; +import org.testng.annotations.Test; + +/** + * beforeGroups test: make sure that if before methods are scattered on more than one class, they + * are still taken into account + * + * @author cbeust + */ +public class ConfigurationGroups3SampleTest extends Base3 { + private boolean m_before = false; + private static boolean m_f1 = false; + + @BeforeGroups("cg34-1") + public void before1() { + Assert.assertFalse(m_before); + Assert.assertFalse(m_f1); + m_before = true; + log("before1"); + } + + @Test(groups = "cg34-a") + public void fa() { + log("fa"); + } + + @Test(groups = "cg34-1") + public void f1() { + Assert.assertTrue(m_before); + Assert.assertTrue(Base3.getBefore()); + m_f1 = true; + log("f1"); + } + + private List m_list = new ArrayList<>(); + + @Test(dependsOnGroups = {"cg34-a", "cg34-1"}) + public void verify() { + Assert.assertTrue(m_before); + Assert.assertTrue(Base3.getBefore()); + Assert.assertTrue(m_f1); + } + + private void log(String s) { + m_list.add(s); + } + + public static boolean getF1() { + return m_f1; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/ConfigurationGroups4SampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationGroups4SampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/ConfigurationGroups4SampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationGroups4SampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,39 @@ +package test.configuration; + +import org.testng.Assert; +import org.testng.annotations.AfterGroups; +import org.testng.annotations.Test; + +/** + * Simple afterGroups test + * + * @author cbeust + * @date Mar 7, 2006 + */ +public class ConfigurationGroups4SampleTest { + + private boolean m_after = false; + private boolean m_run = false; + + @Test + public void f() {} + + @Test(groups = "cg4-1") + public void run() { + Assert.assertFalse(m_after); + m_run = true; + } + + @AfterGroups("cg4-1") + public void after1() { + Assert.assertTrue(m_run); + Assert.assertFalse(m_after); + m_after = true; + } + + @Test(dependsOnGroups = "cg4-1") + public void verify() { + Assert.assertTrue(m_run, "run() wasn't run"); + Assert.assertTrue(m_after, "after1() wasn't run"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/ConfigurationGroups5SampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationGroups5SampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/ConfigurationGroups5SampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationGroups5SampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,55 @@ +package test.configuration; + +import org.testng.Assert; +import org.testng.annotations.AfterGroups; +import org.testng.annotations.Test; + +/** + * afterGroups test with more than one group + * + * @author cbeust + */ +public class ConfigurationGroups5SampleTest { + + private boolean m_after = false; + private boolean m_run1 = false; + private boolean m_run2 = false; + private int m_afterCount = 0; + + @Test + public void f() {} + + @Test(groups = "cg5-1") + public void run1() { + if (m_afterCount == 0) { + Assert.assertFalse(m_after); + } + m_run1 = true; + } + + @Test(groups = "cg5-2") + public void run2() { + if (m_afterCount == 0) { + Assert.assertFalse(m_after); + } + m_run2 = true; + } + + @AfterGroups({"cg5-1", "cg5-2"}) + public void after() { + m_afterCount++; + Assert.assertTrue(m_run1 || m_run2); + if (m_afterCount == 0) { + Assert.assertFalse(m_after); + } + m_after = true; + } + + @Test(dependsOnGroups = {"cg5-1", "cg5-2"}) + public void verify() { + Assert.assertTrue(m_run1, "run1() wasn't run"); + Assert.assertTrue(m_run2, "run2() wasn't run"); + Assert.assertTrue(m_after, "after1() wasn't run"); + Assert.assertEquals(2, m_afterCount); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/ConfigurationGroups6SampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationGroups6SampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/ConfigurationGroups6SampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationGroups6SampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,47 @@ +package test.configuration; + +import org.testng.Assert; +import org.testng.annotations.AfterGroups; +import org.testng.annotations.Test; + +/** + * afterGroups test when the group contains more than one method + * + * @author cbeust + */ +public class ConfigurationGroups6SampleTest { + + private boolean m_after = false; + private boolean m_run1 = false; + private boolean m_run2 = false; + + @Test + public void f() {} + + @Test(groups = "cg6-1") + public void run1() { + Assert.assertFalse(m_after); + m_run1 = true; + } + + @Test(groups = "cg6-1") + public void run2() { + Assert.assertFalse(m_after); + m_run2 = true; + } + + @AfterGroups("cg6-1") + public void after() { + Assert.assertTrue(m_run1); + Assert.assertTrue(m_run2); + Assert.assertFalse(m_after); + m_after = true; + } + + @Test(dependsOnGroups = {"cg6-1"}) + public void verify() { + Assert.assertTrue(m_run1, "run1() wasn't run"); + Assert.assertTrue(m_run2, "run2() wasn't run"); + Assert.assertTrue(m_after, "after1() wasn't run"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/ConfigurationGroups7SampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationGroups7SampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/ConfigurationGroups7SampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationGroups7SampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,38 @@ +package test.configuration; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.testng.Assert; +import org.testng.annotations.AfterGroups; +import org.testng.annotations.BeforeGroups; +import org.testng.annotations.Test; + +public class ConfigurationGroups7SampleTest { + private List m_log = new ArrayList<>(); + + @BeforeGroups({"A"}) + private void initA() { + m_log.add("1"); + } + + @Test(groups = {"A"}) + public void testSomething() { + m_log.add("2"); + } + + @Test(groups = {"A"}) + public void testSomethingMore() { + m_log.add("2"); + } + + @AfterGroups({"A"}) + private void cleanUpA() { + m_log.add("3"); + } + + @Test(dependsOnGroups = "A") + public void verify() { + Assert.assertEquals(Arrays.asList("1", "2", "2", "3"), m_log); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/ConfigurationGroups8SampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationGroups8SampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/ConfigurationGroups8SampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationGroups8SampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,49 @@ +package test.configuration; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.testng.Assert; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.Test; + +/** + * Run with group "A" and "B" Make sure that only methods and configurations belonging to that group + * get invoked. + * + * @author cbeust + * @date Mar 9, 2006 + */ +public class ConfigurationGroups8SampleTest { + private List m_log = new ArrayList<>(); + + @Test + public void dummy() { + m_log.add("should not be invoked"); + } + + @Test(groups = {"A"}) + public void testSomething() { + m_log.add("1"); + } + + @Test(groups = {"A"}) + public void testSomethingMore() { + m_log.add("1"); + } + + @AfterMethod + private void cleanUpDummy() { + m_log.add("should not be invoked"); + } + + @AfterMethod(groups = "A") + private void cleanUpA() { + m_log.add("a"); + } + + @Test(dependsOnGroups = "A", groups = "B") + public void verify() { + Assert.assertEquals(Arrays.asList("1", "a", "1", "a"), m_log); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/ConfigurationGroupsTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationGroupsTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/ConfigurationGroupsTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationGroupsTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,40 @@ +package test.configuration; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.TestNG; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class ConfigurationGroupsTest extends SimpleBaseTest { + + @Test + public void multipleBeforeGroupTest() { + TestNG testng = create(MultipleBeforeGroupTest.class); + testng.setGroups("foo"); + testng.run(); + assertThat(testng.getStatus()).isEqualTo(0); + } + + @Test(dataProvider = "getTestData") + public void runTest(Class testClass, String groupName) { + TestNG testng = create(testClass); + testng.setGroups(groupName); + testng.run(); + assertThat(testng.getStatus()).isEqualTo(0); + } + + @DataProvider + public Object[][] getTestData() { + return new Object[][] { + {ConfigurationGroups1SampleTest.class, "cg1-a, cg1-1"}, + {ConfigurationGroups2SampleTest.class, "cg2-a,cg2-1"}, + {ConfigurationGroups3SampleTest.class, "cg34-a, cg34-1"}, + {ConfigurationGroups4SampleTest.class, "cg4-1"}, + {ConfigurationGroups5SampleTest.class, "cg5-1, cg5-2"}, + {ConfigurationGroups6SampleTest.class, "cg6-1"}, + {ConfigurationGroups7SampleTest.class, "A"} + }; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/ConfigurationInheritGroupsSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationInheritGroupsSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/ConfigurationInheritGroupsSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationInheritGroupsSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.configuration; + +import org.testng.Assert; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +@Test(groups = {"group1"}) +public class ConfigurationInheritGroupsSampleTest { + private boolean m_ok = false; + + @BeforeMethod + public void setUp() { + m_ok = true; + } + + public void test1() { + Assert.assertTrue(m_ok); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/ConfigurationListenerSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationListenerSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/ConfigurationListenerSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationListenerSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,29 @@ +package test.configuration; + +import org.testng.ITestResult; +import org.testng.TestListenerAdapter; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; +import test.configuration.ConfigurationListenerSampleTest.MyTLA; + +@Listeners(MyTLA.class) +public class ConfigurationListenerSampleTest { + static boolean m_passed = false; + + public static class MyTLA extends TestListenerAdapter { + @Override + public void onConfigurationFailure(ITestResult itr) { + m_passed = true; + } + } + + @BeforeClass + public void bm() { + m_passed = false; + throw new RuntimeException(); + } + + @Test + public void f1() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/ConfigurationListenerTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationListenerTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/ConfigurationListenerTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationListenerTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package test.configuration; + +import org.testng.Assert; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class ConfigurationListenerTest extends SimpleBaseTest { + + @Test + public void listenerShouldBeCalled() { + TestNG tng = create(ConfigurationListenerSampleTest.class); + Assert.assertFalse(ConfigurationListenerSampleTest.m_passed); + tng.run(); + Assert.assertTrue(ConfigurationListenerSampleTest.m_passed); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/ConfigurationTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/ConfigurationTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,32 @@ +package test.configuration; + +import java.util.Arrays; +import org.testng.Assert; +import org.testng.annotations.Test; +import test.configuration.sample.ConfigurationTestSample; +import test.configuration.sample.ExternalConfigurationClassSample; +import test.configuration.sample.MethodCallOrderTestSample; +import test.configuration.sample.SuiteTestSample; + +/** + * Test @Configuration + * + * @author cbeust + */ +public class ConfigurationTest extends ConfigurationBaseTest { + @Test + public void testConfiguration() { + testConfiguration(ConfigurationTestSample.class); + } + + @Test + public void testMethodCallOrder() { + testConfiguration(MethodCallOrderTestSample.class, ExternalConfigurationClassSample.class); + } + + @Test + public void testSuite() { + testConfiguration(SuiteTestSample.class); + Assert.assertEquals(Arrays.asList(1, 2, 3, 4, 5), SuiteTestSample.m_order); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/ConfigurationWithParameters.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationWithParameters.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/ConfigurationWithParameters.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ConfigurationWithParameters.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,22 @@ +package test.configuration; + +import org.testng.Assert; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; + +public class ConfigurationWithParameters { + private String m_param; + + @Parameters({"param"}) + @BeforeTest + public void testInit(String param) { + m_param = param; + } + + @Parameters({"param"}) + @Test + public void testMethod(String param) { + Assert.assertEquals(m_param, param); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/GroupsTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/GroupsTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/GroupsTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/GroupsTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,57 @@ +package test.configuration; + +import java.util.Arrays; +import java.util.List; +import org.testng.Assert; +import org.testng.TestNG; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class GroupsTest { + + private TestNG m_testNg; + + @BeforeMethod + public void setUp() { + m_testNg = new TestNG(); + } + + @Test + public void verifyDataProviderAfterGroups() { + runTest( + ConfigurationGroupDataProviderSampleTest.class, + ConfigurationGroupDataProviderSampleTest.m_list, + Arrays.asList(1, 2, 2, 2, 3)); + } + + @Test + public void verifyIteratorDataProviderAfterGroups() { + runTest( + ConfigurationGroupIteratorDataProviderSampleTest.class, + ConfigurationGroupIteratorDataProviderSampleTest.m_list, + Arrays.asList(1, 2, 2, 2, 3)); + } + + @Test + public void verifyParametersAfterGroups() { + runTest( + ConfigurationGroupInvocationCountSampleTest.class, + ConfigurationGroupInvocationCountSampleTest.m_list, + Arrays.asList(1, 2, 2, 2, 3)); + } + + @Test + public void verifyBothAfterGroups() { + runTest( + ConfigurationGroupBothSampleTest.class, + ConfigurationGroupBothSampleTest.m_list, + Arrays.asList(1, 2, 2, 2, 2, 2, 2, 3)); + } + + private void runTest(Class cls, List list, List expected) { + m_testNg.setTestClasses(new Class[] {cls}); + m_testNg.setGroups("twice"); + m_testNg.run(); + Assert.assertEquals(list, expected); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/MultipleBeforeGroupTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/MultipleBeforeGroupTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/MultipleBeforeGroupTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/MultipleBeforeGroupTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package test.configuration; + +import org.testng.Assert; +import org.testng.annotations.BeforeGroups; +import org.testng.annotations.Test; + +@Test(groups = "foo") +public class MultipleBeforeGroupTest { + private int m_count = 0; + + @BeforeGroups("foo") + public void beforeGroups() { + m_count++; + } + + @Test() + public void test() {} + + @Test(dependsOnMethods = "test") + public void verify() { + Assert.assertEquals(1, m_count); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/ReflectMethodParametrizedConfigurationMethodTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ReflectMethodParametrizedConfigurationMethodTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/ReflectMethodParametrizedConfigurationMethodTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/ReflectMethodParametrizedConfigurationMethodTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,44 @@ +package test.configuration; + +import java.lang.reflect.Method; +import java.util.HashMap; +import java.util.Map; +import org.testng.Assert; +import org.testng.annotations.AfterClass; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +/** This class/interface */ +public class ReflectMethodParametrizedConfigurationMethodTest { + private Map m_before = new HashMap<>(); + private Map m_after = new HashMap<>(); + + @BeforeMethod + public void beforeMethod(Method tobeInvokedTestMethod) { + m_before.put(tobeInvokedTestMethod.getName(), tobeInvokedTestMethod.getName()); + } + + @Test + public void test1() {} + + @Test + public void test2() {} + + @AfterMethod + public void afterMethod(Method invokedTestMethod) { + m_after.put(invokedTestMethod.getName(), invokedTestMethod.getName()); + } + + @AfterClass + public void assertBeforeAfterMethodsInvocations() { + Assert.assertTrue( + m_before.containsKey("test1"), "@Test method should have been passed to @BeforeMethod"); + Assert.assertTrue( + m_before.containsKey("test2"), "@Test method should have been passed to @BeforeMethod"); + Assert.assertTrue( + m_after.containsKey("test1"), "@Test method should have been passed to @AfterMethod"); + Assert.assertTrue( + m_before.containsKey("test2"), "@Test method should have been passed to @AfterMethod"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/SingleConfigurationTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/SingleConfigurationTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/SingleConfigurationTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/SingleConfigurationTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,37 @@ +package test.configuration; + +import org.testng.Assert; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +/** + * Make sure that @BeforeTest is only called once if a factory is used + * + * @author Cedric Beust + */ +public class SingleConfigurationTest { + + private static int m_before; + + @Factory(dataProvider = "dp") + public SingleConfigurationTest(int n) {} + + @DataProvider + public static Object[][] dp() { + return new Object[][] { + new Object[] {42}, new Object[] {43}, + }; + } + + @BeforeTest + public void bt() { + m_before++; + } + + @Test + public void verify() { + Assert.assertEquals(m_before, 1); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/SuiteFactoryOnceSample1Test.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/SuiteFactoryOnceSample1Test.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/SuiteFactoryOnceSample1Test.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/SuiteFactoryOnceSample1Test.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package test.configuration; + +import org.testng.annotations.AfterSuite; +import org.testng.annotations.BeforeSuite; +import org.testng.annotations.Test; + +public class SuiteFactoryOnceSample1Test { + public static int m_before = 0; + public static int m_after = 0; + + @BeforeSuite + public void bs() { + m_before++; + } + + @AfterSuite + public void as() { + m_after++; + } + + @Test + public void g1() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/SuiteFactoryOnceSample2Test.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/SuiteFactoryOnceSample2Test.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/SuiteFactoryOnceSample2Test.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/SuiteFactoryOnceSample2Test.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.configuration; + +import org.testng.annotations.Factory; + +public class SuiteFactoryOnceSample2Test { + + @Factory + public Object[] factory() { + return new Object[] {new SuiteFactoryOnceSample1Test(), new SuiteFactoryOnceSample1Test()}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/SuiteFactoryOnceTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/SuiteFactoryOnceTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/SuiteFactoryOnceTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/SuiteFactoryOnceTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,21 @@ +package test.configuration; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class SuiteFactoryOnceTest extends SimpleBaseTest { + + @Test + public void suiteMethodsShouldOnlyRunOnce() { + TestNG tng = create(SuiteFactoryOnceSample2Test.class); + SuiteFactoryOnceSample1Test.m_before = 0; + SuiteFactoryOnceSample1Test.m_after = 0; + tng.run(); + + assertThat(SuiteFactoryOnceSample1Test.m_before).isEqualTo(1); + assertThat(SuiteFactoryOnceSample1Test.m_after).isEqualTo(1); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/github1338/BaseGitHub1338Sample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/github1338/BaseGitHub1338Sample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/github1338/BaseGitHub1338Sample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/github1338/BaseGitHub1338Sample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package test.configuration.github1338; + +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeGroups; + +public class BaseGitHub1338Sample { + + private String someObject = null; + + @BeforeClass(alwaysRun = true) + public void classSetUp() { + someObject = "not null"; + } + + @BeforeGroups( + groups = {"group1"}, + alwaysRun = true) + public void groupSetUp() { + if (someObject == null) { + throw new NullPointerException("someObject is null"); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/github1338/FirstGitHub1338Sample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/github1338/FirstGitHub1338Sample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/github1338/FirstGitHub1338Sample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/github1338/FirstGitHub1338Sample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.configuration.github1338; + +import org.testng.annotations.Test; + +public class FirstGitHub1338Sample extends BaseGitHub1338Sample { + + @Test(groups = {"group1"}) + public void firstTest() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/github1338/SecondGitHub1338Sample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/github1338/SecondGitHub1338Sample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/github1338/SecondGitHub1338Sample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/github1338/SecondGitHub1338Sample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.configuration.github1338; + +import org.testng.annotations.Test; + +public class SecondGitHub1338Sample extends BaseGitHub1338Sample { + + @Test(groups = {"group2"}) + public void secondTest() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/github1338/ThirdGitHub1338Sample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/github1338/ThirdGitHub1338Sample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/github1338/ThirdGitHub1338Sample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/github1338/ThirdGitHub1338Sample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.configuration.github1338; + +import org.testng.annotations.Test; + +public class ThirdGitHub1338Sample extends BaseGitHub1338Sample { + + @Test(groups = {"group1"}) + public void thirdTest() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/github1625/TestRunnerIssue1625.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/github1625/TestRunnerIssue1625.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/github1625/TestRunnerIssue1625.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/github1625/TestRunnerIssue1625.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +package test.configuration.github1625; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.TestNG; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import test.SimpleBaseTest; + +public class TestRunnerIssue1625 extends SimpleBaseTest { + + @Test(dataProvider = "dp") + public void testMethod(Class clazz) { + TestNG testNG = create(clazz); + testNG.setParallel(XmlSuite.ParallelMode.METHODS); + testNG.run(); + assertThat(testNG.getStatus()).isEqualTo(0); + } + + @DataProvider(name = "dp") + public Object[][] getData() { + return new Object[][] { + {TestclassSampleUsingMocks.class}, {TestclassSampleWithoutUsingMocks.class} + }; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/github1625/TestclassSampleUsingMocks.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/github1625/TestclassSampleUsingMocks.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/github1625/TestclassSampleUsingMocks.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/github1625/TestclassSampleUsingMocks.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,35 @@ +package test.configuration.github1625; + +import java.util.List; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; +import org.testng.Assert; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +public class TestclassSampleUsingMocks { + @Mock List list; + + AutoCloseable mocks; + + @BeforeClass + public void beforeClass() { + mocks = MockitoAnnotations.openMocks(this); + } + + @AfterClass + public void closeMocks() throws Exception { + mocks.close(); + } + + @Test + public void first() { + Assert.assertNotNull(list); + } + + @Test + public void second() { + Assert.assertNotNull(list); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/github1625/TestclassSampleWithoutUsingMocks.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/github1625/TestclassSampleWithoutUsingMocks.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/github1625/TestclassSampleWithoutUsingMocks.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/github1625/TestclassSampleWithoutUsingMocks.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +package test.configuration.github1625; + +import java.util.ArrayList; +import java.util.List; +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +public class TestclassSampleWithoutUsingMocks { + + private List list; + + @BeforeClass + public void beforeClass() { + list = new ArrayList<>(); + } + + @Test + public void first() { + Assert.assertNotNull(list); + } + + @Test + public void second() { + Assert.assertNotNull(list); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/github1700/BaseClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/github1700/BaseClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/github1700/BaseClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/github1700/BaseClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.configuration.github1700; + +import java.lang.reflect.Method; +import java.util.List; +import org.testng.Assert; +import org.testng.annotations.BeforeMethod; +import org.testng.collections.Lists; + +public class BaseClassSample { + + public static List messages = Lists.newArrayList(); + + @BeforeMethod(alwaysRun = true) + public void setUp(Method method) { + if (method.getName().endsWith("test1")) { + Assert.assertEquals(2, 1); + } + messages.add(getClass().getCanonicalName() + ".setup()"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/github1700/ChildClassTestSample1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/github1700/ChildClassTestSample1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/github1700/ChildClassTestSample1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/github1700/ChildClassTestSample1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,10 @@ +package test.configuration.github1700; + +import org.testng.annotations.Test; + +public class ChildClassTestSample1 extends BaseClassSample { + @Test + public void test1() { + messages.add(getClass().getCanonicalName() + ".test1()"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/github1700/ChildClassTestSample2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/github1700/ChildClassTestSample2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/github1700/ChildClassTestSample2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/github1700/ChildClassTestSample2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,10 @@ +package test.configuration.github1700; + +import org.testng.annotations.Test; + +public class ChildClassTestSample2 extends BaseClassSample { + @Test + public void test2() { + messages.add(getClass().getCanonicalName() + ".test2()"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/github1700/RunTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/github1700/RunTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/github1700/RunTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/github1700/RunTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,21 @@ +package test.configuration.github1700; + +import static org.assertj.core.api.Java6Assertions.assertThat; + +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class RunTest extends SimpleBaseTest { + + @Test(description = "GITHUB-1700") + public void testMethod() { + TestNG tng = create(); + tng.setTestClasses(new Class[] {ChildClassTestSample1.class, ChildClassTestSample2.class}); + tng.run(); + assertThat(BaseClassSample.messages) + .containsOnly( + ChildClassTestSample2.class.getCanonicalName() + ".setup()", + ChildClassTestSample2.class.getCanonicalName() + ".test2()"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/issue1035/InvocationTracker.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue1035/InvocationTracker.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/issue1035/InvocationTracker.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue1035/InvocationTracker.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,45 @@ +package test.configuration.issue1035; + +import java.util.Objects; + +public class InvocationTracker { + + private final long time; + private final long threadId; + private final Object testInstance; + + public InvocationTracker(long time, long threadId, Object testInstance) { + this.time = time; + this.threadId = threadId; + this.testInstance = testInstance; + } + + public long getThreadId() { + return threadId; + } + + public long getTime() { + return time; + } + + public Object getTestInstance() { + return testInstance; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvocationTracker tracker = (InvocationTracker) o; + return testInstance == tracker.testInstance; + } + + @Override + public int hashCode() { + return Objects.hashCode(testInstance); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/issue1035/MyFactory.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue1035/MyFactory.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/issue1035/MyFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue1035/MyFactory.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,24 @@ +package test.configuration.issue1035; + +import static java.util.Collections.newSetFromMap; +import static java.util.Collections.synchronizedSet; + +import java.util.IdentityHashMap; +import java.util.Set; +import org.testng.annotations.Factory; + +public class MyFactory { + public static final Set TRACKER = + synchronizedSet(newSetFromMap(new IdentityHashMap<>())); + + @Factory + public Object[] instances() { + return new Object[] { + new TestclassExample(), + new TestclassExample(), + new TestclassExample(), + new TestclassExample(), + new TestclassExample() + }; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/issue1035/TestclassExample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue1035/TestclassExample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/issue1035/TestclassExample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue1035/TestclassExample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +package test.configuration.issue1035; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +public class TestclassExample { + + @BeforeClass + public void beforeClass() throws InterruptedException { + printer(); + Thread.sleep(2000); + } + + @Test + public void test() {} + + @AfterClass + public void afterClass() {} + + private void printer() { + long threadId = Thread.currentThread().getId(); + long time = System.currentTimeMillis(); + InvocationTracker tracker = new InvocationTracker(time, threadId, this); + MyFactory.TRACKER.add(tracker); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/issue1753/ChildClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue1753/ChildClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/issue1753/ChildClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue1753/ChildClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +package test.configuration.issue1753; + +import java.lang.reflect.Method; +import org.testng.ITestResult; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class ChildClassSample extends ParentClassSample { + @BeforeMethod(alwaysRun = true) + public void childClassBeforeMethod(Method method, ITestResult result) { + result.setAttribute( + getClass().getSimpleName() + "-childClassBeforeMethod", + getClass().getName() + ".childClassBeforeMethod()"); + throw new RuntimeException("Forcing a failure"); + } + + @Test + public void testMethod() {} + + @AfterMethod(alwaysRun = true) + public void childClassAfterMethod(Method method, ITestResult result) { + result.setAttribute( + getClass().getSimpleName() + "-childClassAfterMethod", + getClass().getName() + ".childClassAfterMethod()"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/issue1753/IssueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue1753/IssueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/issue1753/IssueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue1753/IssueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,32 @@ +package test.configuration.issue1753; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Map; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.collections.Maps; +import test.SimpleBaseTest; + +public class IssueTest extends SimpleBaseTest { + @Test + public void testToEnsureProperTestResultIsReferredInNativeInjection() { + + TestNG testng = create(ChildClassSample.class); + LocalReporter reporter = new LocalReporter(); + testng.addListener(reporter); + testng.run(); + assertThat(reporter.getAttributes()).containsAllEntriesOf(expected()); + } + + private static Map expected() { + Map expected = Maps.newHashMap(); + expected.put( + ChildClassSample.class.getSimpleName() + "-childClassBeforeMethod", + ChildClassSample.class.getName() + ".childClassBeforeMethod()"); + expected.put( + ChildClassSample.class.getSimpleName() + "-parentClassBeforeMethod", + ChildClassSample.class.getName() + ".parentClassBeforeMethod()"); + return expected; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/issue1753/LocalReporter.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue1753/LocalReporter.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/issue1753/LocalReporter.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue1753/LocalReporter.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,37 @@ +package test.configuration.issue1753; + +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.function.Consumer; +import org.testng.*; +import org.testng.collections.Maps; +import org.testng.xml.XmlSuite; + +public class LocalReporter implements IReporter { + + private Map attributes = Maps.newHashMap(); + + @Override + public void generateReport( + List xmlSuites, List suites, String outputDirectory) { + suites.forEach( + suite -> + suite.getResults().values().stream() + .flatMap(iSuiteResult -> extractSkippedResults(iSuiteResult).stream()) + .forEach(this::extractAttributes)); + } + + private void extractAttributes(ITestResult result) { + Consumer attribute = each -> attributes.put(each, result.getAttribute(each).toString()); + result.getAttributeNames().forEach(attribute); + } + + private static Set extractSkippedResults(ISuiteResult suiteResult) { + return suiteResult.getTestContext().getSkippedTests().getAllResults(); + } + + Map getAttributes() { + return attributes; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/issue1753/ParentClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue1753/ParentClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/issue1753/ParentClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue1753/ParentClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,24 @@ +package test.configuration.issue1753; + +import java.lang.reflect.Method; +import org.testng.ITestResult; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; + +public class ParentClassSample { + @BeforeMethod(alwaysRun = true) + public void parentClassBeforeMethod(Method method, ITestResult result) { + result.setAttribute( + getClass().getSimpleName() + "-parentClassBeforeMethod", + getClass().getName() + ".parentClassBeforeMethod()"); + throw new RuntimeException("Forcing a failure"); + } + + @AfterMethod(alwaysRun = true) + public void parentClassAfterMethod(Method method, ITestResult result) { + result.setAttribute( + getClass().getSimpleName() + "-parentClassAfterMethod", + getClass().getName() + ".parentClassAfterMethod()"); + throw new RuntimeException("Forcing a failure"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/issue2209/IssueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue2209/IssueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/issue2209/IssueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue2209/IssueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,59 @@ +package test.configuration.issue2209; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.TestNG; +import org.testng.annotations.AfterClass; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; +import test.InvokedMethodNameListener; +import test.SimpleBaseTest; + +public class IssueTest extends SimpleBaseTest { + + @Test + public void testGithub2209() { + TestNG tng = create(Sample.class); + tng.setGroups("groupM"); + + InvokedMethodNameListener listener = new InvokedMethodNameListener(false); + tng.addListener(listener); + + tng.run(); + + assertThat(listener.getInvokedMethodNames()) + .containsExactly( + "beforeClass", + "beforeMethod", + "test1", + "afterMethod", + "beforeMethod", + "test2", + "afterMethod", + "afterClass"); + } + + @Test(groups = {"groupM"}) + public static class Sample { + + @BeforeClass + public void beforeClass() {} + + @BeforeMethod + public void beforeMethod() {} + + @Test(groups = {"groupK"}) + public void test1() {} + + @Test(groups = {"groupL"}) + public void test2() {} + + @AfterMethod + public void afterMethod() {} + + @AfterClass + public void afterClass() {} + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/issue2254/IssueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue2254/IssueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/issue2254/IssueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue2254/IssueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,63 @@ +package test.configuration.issue2254; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import org.testng.Assert; +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.ITestResult; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlPackage; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.SimpleBaseTest; + +public class IssueTest extends SimpleBaseTest { + + @Test(description = "GITHUB-2254") + public void ensureConfigurationsAreInvokedOnce() { + + List packages = new ArrayList<>(); + XmlPackage xmlPackage = new XmlPackage("test.configuration.issue2254.samples"); + packages.add(xmlPackage); + + XmlTest test = new XmlTest(); + test.setName("MyTest"); + test.setXmlPackages(packages); + + XmlSuite xmlSuite = new XmlSuite(); + xmlSuite.setName("MySuite"); + xmlSuite.setTests(Collections.singletonList(test)); + + test.addIncludedGroup("A"); + + test.setXmlSuite(xmlSuite); + + MyInvokedMethodListener listener = new MyInvokedMethodListener(); + TestNG tng = new TestNG(); + tng.addListener(listener); + tng.setXmlSuites(Collections.singletonList(xmlSuite)); + tng.run(); + + Assert.assertEquals(listener.beforeCount, 9); + Assert.assertEquals(listener.afterCount, 9); + } + + public static class MyInvokedMethodListener implements IInvokedMethodListener { + + int beforeCount = 0; + int afterCount = 0; + + @Override + public void beforeInvocation(IInvokedMethod method, ITestResult testResult) { + beforeCount++; + } + + @Override + public void afterInvocation(IInvokedMethod method, ITestResult testResult) { + afterCount++; + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/issue2254/samples/SampleTestCase.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue2254/samples/SampleTestCase.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/issue2254/samples/SampleTestCase.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue2254/samples/SampleTestCase.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,42 @@ +package test.configuration.issue2254.samples; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.AfterSuite; +import org.testng.annotations.AfterTest; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.BeforeSuite; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.Test; + +@Test(groups = "A") +public class SampleTestCase { + + @BeforeSuite + public void beforeSuite() {} + + @BeforeTest + public void beforeTest() {} + + @BeforeClass + public void beforeClass() {} + + @BeforeMethod + public void beforeMethod() {} + + @Test + public void testMethod() {} + + @AfterMethod + public void afterMethod() {} + + @AfterClass + public void afterClass() {} + + @AfterTest + public void afterTest() {} + + @AfterSuite + public void afterSuite() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/issue2400/DataStore.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue2400/DataStore.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/issue2400/DataStore.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue2400/DataStore.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.configuration.issue2400; + +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.atomic.AtomicInteger; + +public enum DataStore { + INSTANCE; + + private Map tracker = new HashMap<>(); + + public void increment(String key) { + tracker.computeIfAbsent(key, k -> new AtomicInteger(0)).incrementAndGet(); + } + + public Map getTracker() { + return tracker; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/issue2400/IssueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue2400/IssueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/issue2400/IssueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue2400/IssueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package test.configuration.issue2400; + +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.asserts.SoftAssert; +import test.SimpleBaseTest; + +public class IssueTest extends SimpleBaseTest { + + @Test(description = "GITHUB-2400") + public void ensureDefaultConfigurationsAreSkipped() { + TestNG testng = create(TestNGTestClass.class); + testng.run(); + SoftAssert softAssert = new SoftAssert(); + DataStore.INSTANCE + .getTracker() + .forEach( + (key, value) -> + softAssert.assertEquals( + value.get(), 1, "Ensuring " + key + " got invoked only once")); + softAssert.assertAll(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/issue2400/TestNGTestClass.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue2400/TestNGTestClass.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/issue2400/TestNGTestClass.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue2400/TestNGTestClass.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,65 @@ +package test.configuration.issue2400; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.AfterSuite; +import org.testng.annotations.AfterTest; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.BeforeSuite; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.Test; + +public class TestNGTestClass implements TestRunnerCapabilities { + + @BeforeSuite + @Override + public void beforeSuite() { + DataStore.INSTANCE.increment("beforeSuite"); + } + + @BeforeTest + @Override + public void beforeTest() { + DataStore.INSTANCE.increment("beforeTest"); + } + + @BeforeClass + @Override + public void beforeClass() { + DataStore.INSTANCE.increment("beforeClass"); + } + + @BeforeMethod + @Override + public void beforeMethod() { + DataStore.INSTANCE.increment("beforeMethod"); + } + + @Test + public void testMethod() {} + + @AfterMethod + @Override + public void afterMethod() { + DataStore.INSTANCE.increment("afterMethod"); + } + + @AfterClass + @Override + public void afterClass() { + DataStore.INSTANCE.increment("afterClass"); + } + + @AfterTest + @Override + public void afterTest() { + DataStore.INSTANCE.increment("afterTest"); + } + + @AfterSuite + @Override + public void afterSuite() { + DataStore.INSTANCE.increment("afterSuite"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/issue2400/TestRunnerCapabilities.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue2400/TestRunnerCapabilities.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/issue2400/TestRunnerCapabilities.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue2400/TestRunnerCapabilities.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,53 @@ +package test.configuration.issue2400; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.AfterSuite; +import org.testng.annotations.AfterTest; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.BeforeSuite; +import org.testng.annotations.BeforeTest; + +public interface TestRunnerCapabilities { + + @BeforeSuite + default void beforeSuite() { + DataStore.INSTANCE.increment("beforeSuite"); + } + + @BeforeTest + default void beforeTest() { + DataStore.INSTANCE.increment("beforeTest"); + } + + @BeforeClass + default void beforeClass() { + DataStore.INSTANCE.increment("beforeClass"); + } + + @BeforeMethod + default void beforeMethod() { + DataStore.INSTANCE.increment("beforeMethod"); + } + + @AfterMethod + default void afterMethod() { + DataStore.INSTANCE.increment("afterMethod"); + } + + @AfterClass + default void afterClass() { + DataStore.INSTANCE.increment("afterClass"); + } + + @AfterTest + default void afterTest() { + DataStore.INSTANCE.increment("afterTest"); + } + + @AfterSuite + default void afterSuite() { + DataStore.INSTANCE.increment("afterSuite"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/issue2426/IssueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue2426/IssueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/issue2426/IssueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue2426/IssueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,22 @@ +package test.configuration.issue2426; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Map; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class IssueTest extends SimpleBaseTest { + + @Test + public void testIfConfigMethodsHaveAccessToFactoryParams() { + TestNG testng = create(SampleTestCase.class); + MyMethodListener listener = new MyMethodListener(); + testng.addListener(listener); + testng.run(); + Map, Object[]> data = listener.getContents(); + assertThat(data).hasSize(8); + data.values().forEach(each -> assertThat(each).hasSize(2)); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/issue2426/MyMethodListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue2426/MyMethodListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/issue2426/MyMethodListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue2426/MyMethodListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,45 @@ +package test.configuration.issue2426; + +import java.util.HashMap; +import java.util.Map; +import org.testng.IConfigurationListener; +import org.testng.ITestResult; +import org.testng.annotations.*; + +public class MyMethodListener implements IConfigurationListener { + + private final Map, Object[]> contents = new HashMap<>(); + + @Override + public void onConfigurationSuccess(ITestResult tr) { + Object[] values = tr.getMethod().getFactoryMethodParamsInfo().getParameters(); + if (tr.getMethod().isBeforeSuiteConfiguration()) { + contents.put(BeforeSuite.class, values); + } + if (tr.getMethod().isAfterSuiteConfiguration()) { + contents.put(AfterSuite.class, values); + } + if (tr.getMethod().isBeforeTestConfiguration()) { + contents.put(BeforeTest.class, values); + } + if (tr.getMethod().isAfterTestConfiguration()) { + contents.put(AfterTest.class, values); + } + if (tr.getMethod().isBeforeClassConfiguration()) { + contents.put(BeforeClass.class, values); + } + if (tr.getMethod().isAfterClassConfiguration()) { + contents.put(AfterClass.class, values); + } + if (tr.getMethod().isBeforeMethodConfiguration()) { + contents.put(BeforeMethod.class, values); + } + if (tr.getMethod().isAfterMethodConfiguration()) { + contents.put(AfterMethod.class, values); + } + } + + public Map, Object[]> getContents() { + return contents; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/issue2426/SampleTestCase.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue2426/SampleTestCase.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/issue2426/SampleTestCase.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue2426/SampleTestCase.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,54 @@ +package test.configuration.issue2426; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.AfterSuite; +import org.testng.annotations.AfterTest; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.BeforeSuite; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +public class SampleTestCase { + + @DataProvider(name = "constructorArguments") + public static Object[][] constructorArguments() { + return new Object[][] { + {1, false}, + {2, true} + }; + } + + @Factory(dataProvider = "constructorArguments") + public SampleTestCase(int number, final boolean bool) {} + + @BeforeSuite + public void beforeSuite() {} + + @BeforeTest + public void beforeTest() {} + + @BeforeClass + public void beforeClass() {} + + @BeforeMethod + public void beforeMethod() {} + + @Test + public void test() {} + + @AfterMethod + public void afterMethod() {} + + @AfterClass + public void afterClass() {} + + @AfterTest + public void afterTest() {} + + @AfterSuite + public void afterSuite() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/issue2432/Base.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue2432/Base.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/issue2432/Base.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue2432/Base.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.configuration.issue2432; + +import org.testng.annotations.BeforeSuite; + +public class Base { + @BeforeSuite(groups = "prepareConfig") + public void prepareConfig() {} + + @BeforeSuite(groups = "uploadConfigToDatabase", dependsOnGroups = "prepareConfig") + public void uploadConfigToDatabase() {} + + @BeforeSuite( + groups = "verifyConfigurationAfterInstall", + dependsOnGroups = "uploadConfigToDatabase") + public void verifyConfigurationAfterInstall() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/issue2432/IssueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue2432/IssueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/issue2432/IssueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue2432/IssueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,43 @@ +package test.configuration.issue2432; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlClass; +import org.testng.xml.XmlInclude; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlSuite.ParallelMode; +import org.testng.xml.XmlTest; +import test.InvokedMethodNameListener; +import test.SimpleBaseTest; + +public class IssueTest extends SimpleBaseTest { + + @Test(description = "GITHUB-2432") + public void ensureNoImplicitDependencyIsAddedWhenGroupsAreInvolved() { + XmlClass xmlClass = new XmlClass(Test1.class); + XmlInclude xmlInclude = new XmlInclude("test1"); + xmlClass.setIncludedMethods(Collections.singletonList(xmlInclude)); + XmlSuite xmlsuite = createXmlSuite("2432_suite"); + xmlsuite.setParallel(ParallelMode.NONE); + XmlTest xmlTest = new XmlTest(xmlsuite); + xmlTest.setName("2432_test"); + xmlTest.setXmlClasses(Collections.singletonList(xmlClass)); + TestNG testng = create(xmlsuite); + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + testng.addListener(listener); + testng.run(); + List expected = + Arrays.asList( + "prepareConfig", + "uploadConfigToDatabase", + "verifyConfigurationAfterInstall", + "prepareConfigForTest1", + "test1"); + assertThat(listener.getInvokedMethodNames()).containsExactlyElementsOf(expected); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/issue2432/Test1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue2432/Test1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/issue2432/Test1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/issue2432/Test1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.configuration.issue2432; + +import org.testng.annotations.BeforeSuite; +import org.testng.annotations.Test; + +public class Test1 extends Base { + @BeforeSuite(groups = "prepareConfig") + public void prepareConfigForTest1() {} + + @Test(groups = "test") + public void test1() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/sample/BaseSuiteTestSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/sample/BaseSuiteTestSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/sample/BaseSuiteTestSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/sample/BaseSuiteTestSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,21 @@ +package test.configuration.sample; + +import java.util.ArrayList; +import java.util.List; +import org.testng.annotations.AfterSuite; +import org.testng.annotations.BeforeSuite; + +public class BaseSuiteTestSample { + public static List m_order; + + @BeforeSuite + public void beforeSuiteParent() { + m_order = new ArrayList<>(); + m_order.add(1); + } + + @AfterSuite + public void afterSuiteParent() { + m_order.add(4); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/sample/ConfigurationTestSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/sample/ConfigurationTestSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/sample/ConfigurationTestSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/sample/ConfigurationTestSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,96 @@ +package test.configuration.sample; + +import static org.testng.Assert.assertFalse; +import static org.testng.Assert.assertTrue; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.AfterSuite; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.BeforeSuite; +import org.testng.annotations.Test; + +public class ConfigurationTestSample { + private boolean m_beforeSuite = false; + private boolean m_afterSuite = false; + private boolean m_beforeClass = false; + private boolean m_afterClass = false; + private boolean m_beforeMethod = false; + private boolean m_afterMethod = false; + + @BeforeSuite + public void beforeSuite() { + assertFalse(m_afterSuite, "afterSuite shouldn't have run"); + assertFalse(m_beforeClass, "beforeClass shouldn't have run"); + assertFalse(m_afterClass, "afterClass shouldn't have run"); + assertFalse(m_beforeMethod, "beforeMethod shouldn't have run"); + assertFalse(m_afterMethod, "afterMethod shouldn't have run"); + m_beforeSuite = true; + } + + @BeforeClass + public void beforeClass() { + assertTrue(m_beforeSuite, "beforeSuite should have run"); + assertFalse(m_afterSuite, "afterSuite shouldn't have run"); + assertFalse(m_beforeClass, "beforeClass shouldn't have run"); + assertFalse(m_afterClass, "afterClass shouldn't have run"); + assertFalse(m_beforeMethod, "beforeMethod shouldn't have run"); + assertFalse(m_afterMethod, "afterMethod shouldn't have run"); + m_beforeClass = true; + } + + @BeforeMethod + public void beforeMethod() { + assertTrue(m_beforeSuite, "beforeSuite should have run"); + assertTrue(m_beforeClass, "beforeClass have run"); + assertFalse(m_afterSuite, "afterSuite shouldn't have run"); + assertFalse(m_afterClass, "afterClass shouldn't have run"); + assertFalse(m_beforeMethod, "beforeMethod shouldn't have run"); + assertFalse(m_afterMethod, "afterMethod shouldn't have run"); + m_beforeMethod = true; + } + + @AfterMethod + public void afterMethod() { + assertTrue(m_beforeSuite, "beforeSuite should have run"); + assertTrue(m_beforeClass, "beforeClass have run"); + assertTrue(m_beforeMethod, "beforeMethod should have run"); + assertFalse(m_afterSuite, "afterSuite shouldn't have run"); + assertFalse(m_afterClass, "afterClass shouldn't have run"); + assertFalse(m_afterMethod, "afterMethod shouldn't have run"); + m_afterMethod = true; + } + + @AfterClass + public void afterClass() { + assertTrue(m_beforeSuite, "beforeSuite should have run"); + assertTrue(m_beforeClass, "beforeClass have run"); + assertTrue(m_beforeMethod, "beforeMethod should have run"); + assertTrue(m_afterMethod, "afterMethod should have run"); + assertFalse(m_afterClass, "afterClass shouldn't have run"); + assertFalse(m_afterSuite, "afterSuite shouldn't have run"); + m_afterClass = true; + } + + @AfterSuite + public void afterSuite() { + assertTrue(m_beforeSuite, "beforeSuite should have run"); + assertTrue(m_beforeClass, "beforeClass have run"); + assertTrue(m_beforeMethod, "beforeMethod should have run"); + assertTrue(m_afterMethod, "afterMethod should have run"); + assertTrue(m_afterClass, "afterClass should have run"); + assertFalse(m_afterSuite, "afterSuite shouldn't have run"); + m_afterSuite = true; + } + + @Test + public void verify() { + assertTrue(m_beforeSuite, "beforeSuite should have run"); + assertTrue(m_beforeClass, "beforeClass have run"); + assertTrue(m_beforeMethod, "beforeMethod should have run"); + assertFalse(m_afterSuite, "afterSuite shouldn't have run"); + assertFalse(m_afterClass, "afterClass shouldn't have run"); + assertFalse(m_afterMethod, "afterMethod shouldn't have run"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/sample/ExternalConfigurationClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/sample/ExternalConfigurationClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/sample/ExternalConfigurationClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/sample/ExternalConfigurationClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,52 @@ +package test.configuration.sample; + +import static org.testng.Assert.assertFalse; +import static org.testng.Assert.assertTrue; + +import org.testng.annotations.AfterSuite; +import org.testng.annotations.AfterTest; +import org.testng.annotations.BeforeSuite; +import org.testng.annotations.BeforeTest; + +public class ExternalConfigurationClassSample { + public static boolean s_afterMethod; + public static boolean s_afterClass; + public static boolean s_afterTest; + + @BeforeSuite + public void beforeSuite() { + MethodCallOrderTestSample.s_beforeSuite = true; + } + + @AfterSuite + public void cleanUp() { + s_afterMethod = false; + s_afterClass = false; + s_afterTest = false; + } + + @BeforeTest + public void beforeTest() { + assertTrue(MethodCallOrderTestSample.s_beforeSuite); + assertFalse(MethodCallOrderTestSample.s_beforeTest); + assertFalse(MethodCallOrderTestSample.s_beforeClass); + assertFalse(MethodCallOrderTestSample.s_beforeMethod); + + MethodCallOrderTestSample.s_beforeTest = true; + } + + @AfterTest + public void afterTest() { + assertTrue(s_afterMethod, "afterTestMethod should have been run"); + assertTrue(s_afterClass, "afterTestClass should have been run"); + assertFalse(s_afterTest, "afterTest should haven't been run"); + s_afterTest = true; + } + + @AfterSuite + public void afterSuite() { + assertTrue(s_afterMethod, "afterTestMethod should have been run"); + assertTrue(s_afterClass, "afterTestClass should have been run"); + assertTrue(s_afterTest, "afterTest should have been run"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/sample/MethodCallOrderTestSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/sample/MethodCallOrderTestSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/sample/MethodCallOrderTestSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/sample/MethodCallOrderTestSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,74 @@ +package test.configuration.sample; + +import static org.testng.Assert.assertFalse; +import static org.testng.Assert.assertTrue; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.AfterSuite; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class MethodCallOrderTestSample { + public static boolean s_beforeSuite; + public static boolean s_beforeTest; + public static boolean s_beforeClass; + public static boolean s_beforeMethod; + + @BeforeClass + public void beforeClass() { + assertTrue(s_beforeSuite); + assertTrue(s_beforeTest); + assertFalse(s_beforeClass); + assertFalse(s_beforeMethod); + + s_beforeClass = true; + } + + @AfterSuite + public void cleanUp() { + s_beforeSuite = false; + s_beforeTest = false; + s_beforeClass = false; + s_beforeMethod = false; + } + + @BeforeMethod + public void beforeMethod() { + assertTrue(s_beforeSuite); + assertTrue(s_beforeTest); + assertTrue(s_beforeClass); + assertFalse(s_beforeMethod); + s_beforeMethod = true; + } + + @Test + public void realTest() { + assertTrue(s_beforeSuite); + assertTrue(s_beforeTest); + assertTrue(s_beforeClass); + assertTrue(s_beforeMethod); + } + + @AfterMethod + public void afterMethod() { + assertFalse( + ExternalConfigurationClassSample.s_afterMethod, "afterTestMethod shouldn't have been run"); + assertFalse( + ExternalConfigurationClassSample.s_afterClass, "afterTestClass shouldn't have been run"); + assertFalse(ExternalConfigurationClassSample.s_afterTest, "afterTest should haven't been run"); + + ExternalConfigurationClassSample.s_afterMethod = true; + } + + @AfterClass + public void afterClass() { + assertTrue( + ExternalConfigurationClassSample.s_afterMethod, "afterTestMethod should have been run"); + assertFalse( + ExternalConfigurationClassSample.s_afterClass, "afterTestClass shouldn't have been run"); + assertFalse(ExternalConfigurationClassSample.s_afterTest, "afterTest should haven't been run"); + ExternalConfigurationClassSample.s_afterClass = true; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/sample/SuiteTestSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/sample/SuiteTestSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configuration/sample/SuiteTestSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configuration/sample/SuiteTestSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,22 @@ +package test.configuration.sample; + +import org.testng.annotations.AfterSuite; +import org.testng.annotations.BeforeSuite; +import org.testng.annotations.Test; + +public class SuiteTestSample extends BaseSuiteTestSample { + @BeforeSuite(dependsOnMethods = {"beforeSuiteParent"}) + public void beforeSuiteChild() { + m_order.add(2); + } + + @AfterSuite(dependsOnMethods = {"afterSuiteParent"}) + public void afterSuiteChild() { + m_order.add(5); + } + + @Test + public void test1() { + m_order.add(3); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configurationfailurepolicy/ClassWithFailedBeforeClassMethod.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configurationfailurepolicy/ClassWithFailedBeforeClassMethod.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configurationfailurepolicy/ClassWithFailedBeforeClassMethod.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configurationfailurepolicy/ClassWithFailedBeforeClassMethod.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.configurationfailurepolicy; + +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class ClassWithFailedBeforeClassMethod { + + @BeforeClass + public void setupClassFails() { + throw new RuntimeException("setup class fail"); + } + + @BeforeMethod + public void setupMethod() {} + + @Test + public void test1() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configurationfailurepolicy/ClassWithFailedBeforeClassMethodAndAfterClass.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configurationfailurepolicy/ClassWithFailedBeforeClassMethodAndAfterClass.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configurationfailurepolicy/ClassWithFailedBeforeClassMethodAndAfterClass.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configurationfailurepolicy/ClassWithFailedBeforeClassMethodAndAfterClass.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.configurationfailurepolicy; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +public class ClassWithFailedBeforeClassMethodAndAfterClass { + + @BeforeClass + public void setupClassFails() { + throw new RuntimeException("setup class fail"); + } + + @Test + public void test1() {} + + @AfterClass + public void tearDownClass() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configurationfailurepolicy/ClassWithFailedBeforeClassMethodAndBeforeGroupsAfterClassAfterGroups.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configurationfailurepolicy/ClassWithFailedBeforeClassMethodAndBeforeGroupsAfterClassAfterGroups.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configurationfailurepolicy/ClassWithFailedBeforeClassMethodAndBeforeGroupsAfterClassAfterGroups.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configurationfailurepolicy/ClassWithFailedBeforeClassMethodAndBeforeGroupsAfterClassAfterGroups.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +package test.configurationfailurepolicy; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.AfterGroups; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeGroups; +import org.testng.annotations.Test; + +public class ClassWithFailedBeforeClassMethodAndBeforeGroupsAfterClassAfterGroups { + + @BeforeClass(groups = "group1") + public void setupClassFails() { + throw new RuntimeException("setup class fail"); + } + + @BeforeGroups(groups = "group1") + public void beforeGroup() {} + + @Test(groups = "group1") + public void test1() {} + + @AfterClass(groups = "group1") + public void tearDownClass() {} + + @AfterGroups(groups = "group1") + public void afterGroup() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configurationfailurepolicy/ClassWithFailedBeforeClassMethodAndBeforeMethodAfterMethodAfterClass.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configurationfailurepolicy/ClassWithFailedBeforeClassMethodAndBeforeMethodAfterMethodAfterClass.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configurationfailurepolicy/ClassWithFailedBeforeClassMethodAndBeforeMethodAfterMethodAfterClass.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configurationfailurepolicy/ClassWithFailedBeforeClassMethodAndBeforeMethodAfterMethodAfterClass.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +package test.configurationfailurepolicy; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class ClassWithFailedBeforeClassMethodAndBeforeMethodAfterMethodAfterClass { + + @BeforeClass + public void setupClassFails() { + throw new RuntimeException("setup class fail"); + } + + @BeforeMethod + public void setupMethod() {} + + @Test + public void test1() {} + + @AfterMethod + public void tearDownMethod() {} + + @AfterClass + public void tearDownClass() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configurationfailurepolicy/ClassWithFailedBeforeMethod.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configurationfailurepolicy/ClassWithFailedBeforeMethod.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configurationfailurepolicy/ClassWithFailedBeforeMethod.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configurationfailurepolicy/ClassWithFailedBeforeMethod.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.configurationfailurepolicy; + +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class ClassWithFailedBeforeMethod { + + @BeforeMethod + public void setupShouldFail() { + throw new RuntimeException("Failing in setUp"); + } + + @Test + public void test1() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configurationfailurepolicy/ClassWithFailedBeforeMethodAndMultipleInvocations.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configurationfailurepolicy/ClassWithFailedBeforeMethodAndMultipleInvocations.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configurationfailurepolicy/ClassWithFailedBeforeMethodAndMultipleInvocations.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configurationfailurepolicy/ClassWithFailedBeforeMethodAndMultipleInvocations.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,24 @@ +package test.configurationfailurepolicy; + +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class ClassWithFailedBeforeMethodAndMultipleInvocations { + + @BeforeMethod + public void setupShouldFail() { + throw new RuntimeException("Failing in setUp"); + } + + @DataProvider(name = "data.provider") + public Object[][] dataProvider() { + return new Object[][] {new Object[] {"data1"}, new Object[] {"data2"}}; + } + + @Test(dataProvider = "data.provider") + public void test1(String s) {} + + @Test(invocationCount = 2) + public void test2() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configurationfailurepolicy/ClassWithFailedBeforeMethodAndMultipleTests.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configurationfailurepolicy/ClassWithFailedBeforeMethodAndMultipleTests.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configurationfailurepolicy/ClassWithFailedBeforeMethodAndMultipleTests.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configurationfailurepolicy/ClassWithFailedBeforeMethodAndMultipleTests.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ +package test.configurationfailurepolicy; + +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class ClassWithFailedBeforeMethodAndMultipleTests { + + @BeforeMethod + public void setupShouldFail() { + throw new RuntimeException("Failing in setUp"); + } + + @Test + public void test1() {} + + @Test + public void test2() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configurationfailurepolicy/ClassWithSkippingBeforeMethod.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configurationfailurepolicy/ClassWithSkippingBeforeMethod.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configurationfailurepolicy/ClassWithSkippingBeforeMethod.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configurationfailurepolicy/ClassWithSkippingBeforeMethod.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,24 @@ +package test.configurationfailurepolicy; + +import org.testng.SkipException; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class ClassWithSkippingBeforeMethod { + + private int invocations = 0; + + @BeforeMethod + public void beforeMethod() { + invocations++; + if (invocations == 2) { + throw new SkipException("skipping"); + } + } + + @Test + public void test1() {} + + @Test + public void test2() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configurationfailurepolicy/ExtendsClassWithFailedBeforeClassMethod.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configurationfailurepolicy/ExtendsClassWithFailedBeforeClassMethod.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configurationfailurepolicy/ExtendsClassWithFailedBeforeClassMethod.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configurationfailurepolicy/ExtendsClassWithFailedBeforeClassMethod.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.configurationfailurepolicy; + +import org.testng.annotations.Test; + +public class ExtendsClassWithFailedBeforeClassMethod extends ClassWithFailedBeforeClassMethod { + + @Test + public void test2() { + // should be skipped, but BeforeClass method attempted again + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configurationfailurepolicy/ExtendsClassWithFailedBeforeMethod.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configurationfailurepolicy/ExtendsClassWithFailedBeforeMethod.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configurationfailurepolicy/ExtendsClassWithFailedBeforeMethod.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configurationfailurepolicy/ExtendsClassWithFailedBeforeMethod.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,13 @@ +package test.configurationfailurepolicy; + +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class ExtendsClassWithFailedBeforeMethod extends ClassWithFailedBeforeMethod { + + @BeforeMethod + public void setupExtension() {} + + @Test + public void test2() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configurationfailurepolicy/FactoryClassWithFailedBeforeClassMethod.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configurationfailurepolicy/FactoryClassWithFailedBeforeClassMethod.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configurationfailurepolicy/FactoryClassWithFailedBeforeClassMethod.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configurationfailurepolicy/FactoryClassWithFailedBeforeClassMethod.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,13 @@ +package test.configurationfailurepolicy; + +import org.testng.annotations.Factory; + +public class FactoryClassWithFailedBeforeClassMethod extends ClassWithFailedBeforeClassMethod { + @Factory + public Object[] createTests() { + Object[] instances = new Object[2]; + instances[0] = new FactoryClassWithFailedBeforeClassMethod(); + instances[1] = new FactoryClassWithFailedBeforeClassMethod(); + return instances; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configurationfailurepolicy/FactoryClassWithFailedBeforeMethod.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configurationfailurepolicy/FactoryClassWithFailedBeforeMethod.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configurationfailurepolicy/FactoryClassWithFailedBeforeMethod.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configurationfailurepolicy/FactoryClassWithFailedBeforeMethod.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,13 @@ +package test.configurationfailurepolicy; + +import org.testng.annotations.Factory; + +public class FactoryClassWithFailedBeforeMethod extends ClassWithFailedBeforeMethod { + @Factory + public Object[] createTests() { + Object[] instances = new Object[2]; + instances[0] = new FactoryClassWithFailedBeforeMethod(); + instances[1] = new FactoryClassWithFailedBeforeMethod(); + return instances; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configurationfailurepolicy/FactoryClassWithFailedBeforeMethodAndMultipleInvocations.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configurationfailurepolicy/FactoryClassWithFailedBeforeMethodAndMultipleInvocations.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configurationfailurepolicy/FactoryClassWithFailedBeforeMethodAndMultipleInvocations.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configurationfailurepolicy/FactoryClassWithFailedBeforeMethodAndMultipleInvocations.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package test.configurationfailurepolicy; + +import org.testng.annotations.Factory; + +public class FactoryClassWithFailedBeforeMethodAndMultipleInvocations + extends ClassWithFailedBeforeMethodAndMultipleInvocations { + @Factory + public Object[] createTests() { + Object[] instances = new Object[2]; + instances[0] = new FactoryClassWithFailedBeforeMethodAndMultipleInvocations(); + instances[1] = new FactoryClassWithFailedBeforeMethodAndMultipleInvocations(); + return instances; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configurationfailurepolicy/FailurePolicyTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configurationfailurepolicy/FailurePolicyTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/configurationfailurepolicy/FailurePolicyTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/configurationfailurepolicy/FailurePolicyTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,181 @@ +package test.configurationfailurepolicy; + +import static org.testng.Assert.assertEquals; +import static test.SimpleBaseTest.getPathToResource; + +import org.testng.ITestContext; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import testhelper.OutputDirectoryPatch; + +public class FailurePolicyTest { + + // only if this is run from an xml file that sets this on the suite + @BeforeClass(enabled = false) + public void setupClass(ITestContext testContext) { + assertEquals( + testContext.getSuite().getXmlSuite().getConfigFailurePolicy(), + XmlSuite.FailurePolicy.CONTINUE); + } + + @DataProvider(name = "dp") + public Object[][] getData() { + return new Object[][] { + // params - confFail, confSkip, skippedTests + new Object[] {new Class[] {ClassWithFailedBeforeClassMethod.class}, 1, 1, 1}, + new Object[] {new Class[] {ClassWithFailedBeforeClassMethodAndAfterClass.class}, 1, 1, 1}, + new Object[] {new Class[] {ClassWithFailedBeforeMethodAndMultipleTests.class}, 2, 0, 2}, + new Object[] { + new Class[] {ClassWithFailedBeforeClassMethodAndBeforeMethodAfterMethodAfterClass.class}, + 1, + 3, + 1 + }, + new Object[] {new Class[] {ClassWithFailedBeforeMethodAndMultipleInvocations.class}, 4, 0, 4}, + new Object[] {new Class[] {ExtendsClassWithFailedBeforeMethod.class}, 2, 2, 2}, + new Object[] {new Class[] {ExtendsClassWithFailedBeforeClassMethod.class}, 1, 2, 2}, + new Object[] { + new Class[] { + ClassWithFailedBeforeClassMethod.class, ExtendsClassWithFailedBeforeClassMethod.class + }, + 2, + 3, + 3 + }, + new Object[] {new Class[] {ClassWithSkippingBeforeMethod.class}, 0, 1, 1}, + new Object[] {new Class[] {FactoryClassWithFailedBeforeMethod.class}, 2, 0, 2}, + new Object[] { + new Class[] {FactoryClassWithFailedBeforeMethodAndMultipleInvocations.class}, 8, 0, 8 + }, + new Object[] {new Class[] {FactoryClassWithFailedBeforeClassMethod.class}, 2, 2, 2}, + }; + } + + @Test(dataProvider = "dp") + public void confFailureTest( + Class[] classesUnderTest, + int configurationFailures, + int configurationSkips, + int skippedTests) { + + TestListenerAdapter tla = new TestListenerAdapter(); + TestNG testng = new TestNG(); + testng.setOutputDirectory(OutputDirectoryPatch.getOutputDirectory()); + testng.setTestClasses(classesUnderTest); + testng.addListener(tla); + testng.setConfigFailurePolicy(XmlSuite.FailurePolicy.CONTINUE); + testng.run(); + + verify(tla, configurationFailures, configurationSkips, skippedTests); + } + + @Test + public void confFailureTestInvolvingGroups() { + Class[] classesUnderTest = + new Class[] {ClassWithFailedBeforeClassMethodAndBeforeGroupsAfterClassAfterGroups.class}; + + TestListenerAdapter tla = new TestListenerAdapter(); + TestNG testng = new TestNG(); + testng.setOutputDirectory(OutputDirectoryPatch.getOutputDirectory()); + testng.setTestClasses(classesUnderTest); + testng.addListener(tla); + testng.setConfigFailurePolicy(XmlSuite.FailurePolicy.CONTINUE); + testng.setGroups("group1"); + testng.run(); + verify(tla, 1, 3, 1); + } + + @Test + public void commandLineTest_policyAsSkip() { + String[] argv = + new String[] { + "-log", + "0", + "-d", + OutputDirectoryPatch.getOutputDirectory(), + "-configfailurepolicy", + "skip", + "-testclass", + ClassWithFailedBeforeMethodAndMultipleTests.class.getCanonicalName() + }; + TestListenerAdapter tla = new TestListenerAdapter(); + TestNG.privateMain(argv, tla); + + verify(tla, 1, 1, 2); + } + + @Test + public void commandLineTest_policyAsContinue() { + String[] argv = + new String[] { + "-log", + "0", + "-d", + OutputDirectoryPatch.getOutputDirectory(), + "-configfailurepolicy", + "continue", + "-testclass", + ClassWithFailedBeforeMethodAndMultipleTests.class.getCanonicalName() + }; + TestListenerAdapter tla = new TestListenerAdapter(); + TestNG.privateMain(argv, tla); + + verify(tla, 2, 0, 2); + } + + @Test + public void commandLineTestWithXMLFile_policyAsSkip() { + String[] argv = + new String[] { + "-log", + "0", + "-d", + OutputDirectoryPatch.getOutputDirectory(), + "-configfailurepolicy", + "skip", + getPathToResource("testng-configfailure.xml") + }; + TestListenerAdapter tla = new TestListenerAdapter(); + TestNG.privateMain(argv, tla); + + verify(tla, 1, 1, 2); + } + + @Test + public void commandLineTestWithXMLFile_policyAsContinue() { + String[] argv = + new String[] { + "-log", + "0", + "-d", + OutputDirectoryPatch.getOutputDirectory(), + "-configfailurepolicy", + "continue", + getPathToResource("testng-configfailure.xml") + }; + TestListenerAdapter tla = new TestListenerAdapter(); + TestNG.privateMain(argv, tla); + + verify(tla, 2, 0, 2); + } + + private void verify( + TestListenerAdapter tla, + int configurationFailures, + int configurationSkips, + int skippedTests) { + assertEquals( + tla.getConfigurationFailures().size(), + configurationFailures, + "wrong number of configuration failures"); + assertEquals( + tla.getConfigurationSkips().size(), + configurationSkips, + "wrong number of configuration skips"); + assertEquals(tla.getSkippedTests().size(), skippedTests, "wrong number of skipped tests"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/converter/ConverterSample1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/converter/ConverterSample1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/converter/ConverterSample1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/converter/ConverterSample1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,21 @@ +package test.converter; + +import junit.framework.TestCase; + +public class ConverterSample1 extends TestCase { + @Override + protected void setUp() throws Exception { + super.setUp(); + } + + @Override + protected void tearDown() throws Exception { + super.tearDown(); + } + + public final void testClassJunit() {} + + public final void testSetClassId() {} + + public final void testSetClassName() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/custom/CustomAttributeTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/custom/CustomAttributeTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/custom/CustomAttributeTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/custom/CustomAttributeTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,39 @@ +package test.custom; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Arrays; +import java.util.List; +import org.testng.IAnnotationTransformer; +import org.testng.TestNG; +import org.testng.annotations.CustomAttribute; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class CustomAttributeTest extends SimpleBaseTest { + + @Test + public void ensureCustomAttributesAreAvailable() { + runTest(null, "joy", Arrays.asList("KingFisher", "Bira")); + } + + @Test + public void ensureCustomAttributesCanBeAlteredViaAnnotationTransformer() { + runTest(new CustomAttributesTransformer(), "sorrow", Arrays.asList("Coffee", "Tea")); + } + + private static void runTest(IAnnotationTransformer transformer, String key, List values) { + TestNG testng = create(TestClassSample.class); + CustomAttributesListener listener = new CustomAttributesListener(); + testng.addListener(listener); + if (transformer != null) { + testng.addListener(transformer); + } + testng.run(); + List attributes = listener.getAttributes(); + assertThat(attributes).hasSize(1); + CustomAttribute attribute = attributes.get(0); + assertThat(attribute.name()).isEqualTo(key); + assertThat(attribute.values()).containsAll(values); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/custom/CustomAttributesListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/custom/CustomAttributesListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/custom/CustomAttributesListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/custom/CustomAttributesListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,24 @@ +package test.custom; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.ITestResult; +import org.testng.annotations.CustomAttribute; +import org.testng.collections.Lists; + +public class CustomAttributesListener implements IInvokedMethodListener { + + private final List attributes = Lists.newArrayList(); + + @Override + public void afterInvocation(IInvokedMethod method, ITestResult testResult) { + this.attributes.addAll(Arrays.asList(method.getTestMethod().getAttributes())); + } + + public List getAttributes() { + return Collections.unmodifiableList(attributes); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/custom/CustomAttributesTransformer.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/custom/CustomAttributesTransformer.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/custom/CustomAttributesTransformer.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/custom/CustomAttributesTransformer.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,45 @@ +package test.custom; + +import java.lang.annotation.Annotation; +import java.lang.reflect.Constructor; +import java.lang.reflect.Method; +import org.testng.IAnnotationTransformer; +import org.testng.annotations.CustomAttribute; +import org.testng.annotations.ITestAnnotation; + +public class CustomAttributesTransformer implements IAnnotationTransformer { + + @Override + public void transform( + ITestAnnotation annotation, Class testClass, Constructor testConstructor, Method testMethod) { + CustomAttribute[] attributes = + new CustomAttribute[] {new MoreAttribute("sorrow", new String[] {"Coffee", "Tea"})}; + annotation.setAttributes(attributes); + } + + public static class MoreAttribute implements CustomAttribute { + + private final String key; + private final String[] values; + + public MoreAttribute(String key, String... values) { + this.key = key; + this.values = values; + } + + @Override + public String name() { + return key; + } + + @Override + public String[] values() { + return values; + } + + @Override + public Class annotationType() { + return CustomAttribute.class; + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/custom/TestClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/custom/TestClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/custom/TestClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/custom/TestClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.custom; + +import org.testng.annotations.CustomAttribute; +import org.testng.annotations.Test; + +public class TestClassSample { + + @Test( + attributes = { + @CustomAttribute( + name = "joy", + values = {"KingFisher", "Bira"}) + }) + public void testMethod() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/cyclic/AbstractGenericTests.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/cyclic/AbstractGenericTests.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/cyclic/AbstractGenericTests.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/cyclic/AbstractGenericTests.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.cyclic; + +import org.testng.annotations.Test; + +public abstract class AbstractGenericTests extends BaseIntegrationTest { + + @Test(groups = "integration") + public final void testSomething() { + // ... + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/cyclic/BaseIntegrationTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/cyclic/BaseIntegrationTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/cyclic/BaseIntegrationTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/cyclic/BaseIntegrationTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.cyclic; + +import org.testng.annotations.BeforeClass; + +public abstract class BaseIntegrationTest { + + @BeforeClass(groups = "integration") + protected void initIntegrationTesting() { + // ... + } + + @BeforeClass(groups = "integration") + void executeBeforeClassDbOperations() { + // ... + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/cyclic/HibernateConcreteTests.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/cyclic/HibernateConcreteTests.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/cyclic/HibernateConcreteTests.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/cyclic/HibernateConcreteTests.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.cyclic; + +import org.testng.annotations.Test; + +public class HibernateConcreteTests extends AbstractGenericTests { + + @Test(groups = "integration") + public void testSomethingElse() { + // ... + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/cyclic/SomeConcreteTests.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/cyclic/SomeConcreteTests.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/cyclic/SomeConcreteTests.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/cyclic/SomeConcreteTests.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.cyclic; + +import org.testng.annotations.Test; + +public class SomeConcreteTests extends AbstractGenericTests { + + @Test(groups = "integration") + public void testSomethingElse() { + // ... + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/AnnotatedInheritedDataProviderBaseSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/AnnotatedInheritedDataProviderBaseSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/AnnotatedInheritedDataProviderBaseSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/AnnotatedInheritedDataProviderBaseSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,6 @@ +package test.dataprovider; + +import org.testng.annotations.Test; + +@Test(dataProviderClass = InheritedDataProvider.class) +public class AnnotatedInheritedDataProviderBaseSample {} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/AnnotatedInheritedDataProviderSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/AnnotatedInheritedDataProviderSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/AnnotatedInheritedDataProviderSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/AnnotatedInheritedDataProviderSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.dataprovider; + +import org.testng.annotations.Test; + +public class AnnotatedInheritedDataProviderSample extends AnnotatedInheritedDataProviderBaseSample { + + @Test(dataProvider = "dp") + public void f(String a) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/BooleanDataProviderSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/BooleanDataProviderSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/BooleanDataProviderSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/BooleanDataProviderSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.dataprovider; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class BooleanDataProviderSample { + + @Test(dataProvider = "allBooleans") + public void doStuff(boolean t) {} + + @DataProvider(name = "allBooleans") + public Object[][] createData() { + return new Object[][] {new Object[] {true}, new Object[] {false}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/ClassDataProviderSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/ClassDataProviderSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/ClassDataProviderSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/ClassDataProviderSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package test.dataprovider; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +@Test(dataProvider = "dp") +public class ClassDataProviderSample { + + @DataProvider + public Object[][] dp() { + return new Object[][] {new Object[] {"a"}, new Object[] {"b"}}; + } + + public void f(String a) {} + + public void g(String a) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/ClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/ClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/ClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/ClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,34 @@ +package test.dataprovider; + +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +public class ClassSample { + + String s; + + @Factory(dataProvider = "dp1") + public ClassSample(String s) { + this.s = s; + } + + @DataProvider(name = "dp1") + public static Object[][] createData1(Class clazz) { + Assert.assertEquals(clazz, ClassSample.class); + return new Object[][] {{"0"}, {"1"}}; + } + + @Test + public void test1() {} + + @DataProvider(name = "dp2") + public Object[][] createData2(Class clazz) { + Assert.assertEquals(clazz, ClassSample.class); + return new Object[][] {{"Cedric" + s}, {"Alois" + s}}; + } + + @Test(dataProvider = "dp2") + public void test2(String s) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/ConfigurationAndDataProvidersSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/ConfigurationAndDataProvidersSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/ConfigurationAndDataProvidersSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/ConfigurationAndDataProvidersSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,53 @@ +package test.dataprovider; + +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.BeforeSuite; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +/** Make sure that all before methods except beforeTestMethod are invoked before DataProvider. */ +public class ConfigurationAndDataProvidersSample { + + private boolean m_beforeSuite = false; + private boolean m_beforeTest = false; + private boolean m_beforeClass = false; + private boolean m_beforeTestMethod = false; + + @DataProvider(name = "test1") + public Object[][] createData() { + Assert.assertTrue(m_beforeSuite, "beforeSuite should have been invoked"); + Assert.assertTrue(m_beforeTest, "beforeTest should have been invoked"); + Assert.assertTrue(m_beforeClass, "beforeClass should have been invoked"); + Assert.assertFalse(m_beforeTestMethod, "beforeMethod should not have been invoked"); + + return new Object[][] {{"Test"}}; + } + + @Test(dataProvider = "test1") + public void verifyNames(Object p) { + // do nothing + } + + @BeforeSuite + public void setUpSuite() { + m_beforeSuite = true; + } + + @BeforeTest + public void setUpTest() { + m_beforeTest = true; + } + + @BeforeClass + public void setUpClass() { + m_beforeClass = true; + } + + @BeforeMethod + public void setUp() { + m_beforeTestMethod = true; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/ConstructorInjectionProvider.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/ConstructorInjectionProvider.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/ConstructorInjectionProvider.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/ConstructorInjectionProvider.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.dataprovider; + +import com.google.inject.Inject; +import com.google.inject.name.Named; +import org.testng.annotations.DataProvider; + +public class ConstructorInjectionProvider { + + private final String value; + + @Inject + public ConstructorInjectionProvider(@Named("test") String value) { + this.value = value; + } + + @DataProvider(name = "injection") + public Object[][] create() { + return new Object[][] {{value}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/ConstructorOrMethodSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/ConstructorOrMethodSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/ConstructorOrMethodSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/ConstructorOrMethodSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,51 @@ +package test.dataprovider; + +import java.lang.reflect.Constructor; +import java.lang.reflect.Method; +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; +import org.testng.internal.ConstructorOrMethod; + +public class ConstructorOrMethodSample { + + String s; + + @Factory(dataProvider = "dp1") + public ConstructorOrMethodSample(String s) { + this.s = s; + } + + @DataProvider(name = "dp1") + public static Object[][] createData1(ConstructorOrMethod cOrM) { + Assert.assertEquals(cOrM.getDeclaringClass(), ConstructorOrMethodSample.class); + Assert.assertNull(cOrM.getMethod()); + Assert.assertNotNull(cOrM.getConstructor()); + + Constructor c = cOrM.getConstructor(); + Assert.assertNotNull(c.getAnnotation(Factory.class)); + Assert.assertEquals(c.getParameterTypes().length, 1); + Assert.assertEquals(c.getParameterTypes()[0], String.class); + + return new Object[][] {{"0"}, {"1"}}; + } + + @Test + public void test1() {} + + @DataProvider(name = "dp2") + public Object[][] createData2(ConstructorOrMethod cOrM) { + Assert.assertEquals(cOrM.getDeclaringClass(), ConstructorOrMethodSample.class); + Assert.assertNotNull(cOrM.getMethod()); + Assert.assertNull(cOrM.getConstructor()); + + Method m = cOrM.getMethod(); + Assert.assertEquals(m.getName(), "test2"); + + return new Object[][] {{"Cedric" + s}, {"Alois" + s}}; + } + + @Test(dataProvider = "dp2") + public void test2(String s) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/ConstructorSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/ConstructorSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/ConstructorSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/ConstructorSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,36 @@ +package test.dataprovider; + +import java.lang.reflect.Constructor; +import java.util.ArrayList; +import java.util.List; +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +public class ConstructorSample { + + public static List all = new ArrayList<>(2); + + private final String s; + + @Factory(dataProvider = "dp") + public ConstructorSample(String s) { + this.s = s; + } + + @DataProvider(name = "dp") + public static Object[][] createData(Constructor c) { + Assert.assertEquals(c.getDeclaringClass(), ConstructorSample.class); + Assert.assertNotNull(c.getAnnotation(Factory.class)); + Assert.assertEquals(c.getParameterTypes().length, 1); + Assert.assertEquals(c.getParameterTypes()[0], String.class); + + return new Object[][] {{"Cedric"}, {"Alois"}}; + } + + @Test + public void test() { + all.add(s); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/CreateDataTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/CreateDataTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/CreateDataTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/CreateDataTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,25 @@ +package test.dataprovider; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class CreateDataTest { + + @DataProvider(name = "create-data") + public Object[][] create() { + return new Object[][] {{new MyObject()}}; + } + + @Test(dataProvider = "create-data") + public void testMyTest(MyObject o) { + // do something with o + } +} + +class MyObject { + + @Override + public String toString() { + return "MyObject{}"; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/DataProviderAsTestSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/DataProviderAsTestSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/DataProviderAsTestSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/DataProviderAsTestSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.dataprovider; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +/** Test that if a class @Test is used, the @DataProvider method won't be considered as a test. */ +@Test +public class DataProviderAsTestSample { + + public void f() {} + + @DataProvider + public Object[][] dataProvider() { + throw new RuntimeException(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/DataProviderIntegrationSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/DataProviderIntegrationSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/DataProviderIntegrationSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/DataProviderIntegrationSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package test.dataprovider; + +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class DataProviderIntegrationSample { + @DataProvider + public Object[][] testInts() { + return new Object[][] {new Object[] {4}, new Object[] {8}, new Object[] {12}}; + } + + @Test(dataProvider = "testInts", expectedExceptions = IllegalArgumentException.class) + public void theTest(String aString) { + Assert.assertNotNull(aString); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/DataProviderRetryAnalyzer.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/DataProviderRetryAnalyzer.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/DataProviderRetryAnalyzer.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/DataProviderRetryAnalyzer.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.dataprovider; + +import org.testng.IRetryAnalyzer; +import org.testng.ITestResult; + +public class DataProviderRetryAnalyzer implements IRetryAnalyzer { + private int currentTry = 0; + private int maxreruntimes = 1; + + @Override + public boolean retry(ITestResult result) { + if (currentTry < maxreruntimes) { + ++currentTry; + + return true; + } + return false; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/DataProviderRetryTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/DataProviderRetryTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/DataProviderRetryTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/DataProviderRetryTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,26 @@ +package test.dataprovider; + +import org.testng.Assert; +import org.testng.SkipException; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class DataProviderRetryTest { + @Test(dataProvider = "getVerdic", retryAnalyzer = DataProviderRetryAnalyzer.class) + public void test(String verdict) { + switch (verdict) { + case "FAIL": + Assert.fail("This time test FAIL!"); + break; + case "SKIP": + throw new SkipException("This time test SKIPPED!"); + default: + break; + } + } + + @DataProvider(name = "getVerdic") + public Object[][] getVerdicNames() { + return new Object[][] {{"FAIL"}, {"SKIP"}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/DataProviderTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/DataProviderTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/DataProviderTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/DataProviderTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,409 @@ +package test.dataprovider; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import org.assertj.core.api.Condition; +import org.testng.Assert; +import org.testng.ITestResult; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import org.testng.internal.reflect.MethodMatcherException; +import test.InvokedMethodNameListener; +import test.SimpleBaseTest; +import test.dataprovider.issue1691.DataProviderDefinitionAtClassLevelAndNoTestMethodUsage; +import test.dataprovider.issue1691.DataProviderDefinitionCompletelyProvidedAtClassLevel; +import test.dataprovider.issue1691.DataProviderDefinitionCompletelyProvidedAtClassLevelAndPartiallyAtMethodLevel; +import test.dataprovider.issue1691.DataProviderDefinitionProvidedPartiallyAtClassLevel; +import test.dataprovider.issue1691.withinheritance.ChildClassHasFullDefinitionOfDataProviderAtClassLevel; +import test.dataprovider.issue1691.withinheritance.ChildClassHasPartialDefinitionOfDataProviderAtClassLevel; +import test.dataprovider.issue1691.withinheritance.ChildClassWithNoDataProviderInformationInTestMethod; +import test.dataprovider.issue2565.Data; +import test.dataprovider.issue2565.SampleTestUsingConsumer; +import test.dataprovider.issue2565.SampleTestUsingFunction; +import test.dataprovider.issue2565.SampleTestUsingPredicate; +import test.dataprovider.issue2565.SampleTestUsingSupplier; + +public class DataProviderTest extends SimpleBaseTest { + + @Test(description = "GITHUB-1691") + public void testDataProviderInfoIgnored() { + InvokedMethodNameListener listener = + run(DataProviderDefinitionAtClassLevelAndNoTestMethodUsage.class); + assertThat(listener.getSucceedMethodNames()) + .containsExactly( + "verifyHangoutPlaces(Hakuna Matata,Bangalore)", "verifyHangoutPlaces(Gem Inn,Chennai)"); + Throwable throwable = listener.getResult("regularTestMethod").getThrowable(); + assertThat(throwable).isInstanceOf(MethodMatcherException.class); + } + + @Test(description = "GITHUB-1691", dataProvider = "getClasses") + public void testDataProviderWhenProvidedAtClassLevel(Class cls) { + InvokedMethodNameListener listener = run(cls); + assertThat(listener.getSucceedMethodNames()) + .containsExactly( + "verifyHangoutPlaces(Hakuna Matata,Bangalore)", "verifyHangoutPlaces(Gem Inn,Chennai)"); + } + + @DataProvider + public Object[][] getClasses() { + return new Object[][] { + // No inheritance involved + {DataProviderDefinitionProvidedPartiallyAtClassLevel.class}, + {DataProviderDefinitionCompletelyProvidedAtClassLevel.class}, + {DataProviderDefinitionCompletelyProvidedAtClassLevelAndPartiallyAtMethodLevel.class}, + + // Involves Inheritance + {ChildClassHasPartialDefinitionOfDataProviderAtClassLevel.class}, + {ChildClassHasFullDefinitionOfDataProviderAtClassLevel.class}, + {ChildClassWithNoDataProviderInformationInTestMethod.class}, + }; + } + + @Test(description = "GITHUB-1139") + public void oneDimDataProviderShouldWork() { + InvokedMethodNameListener listener = run(OneDimDataProviderSample.class); + + assertThat(listener.getSucceedMethodNames()) + .containsExactly( + "testArray(foo)", "testArray(bar)", + "testIterator(foo)", "testIterator(bar)", + "testStaticArray(foo)", "testStaticArray(bar)", + "testStaticIterator(foo)", "testStaticIterator(bar)"); + } + + @Test + public void booleanTest() { + InvokedMethodNameListener listener = run(BooleanDataProviderSample.class); + + assertThat(listener.getSucceedMethodNames()).containsExactly("doStuff(true)", "doStuff(false)"); + } + + @Test + public void classTest() { + InvokedMethodNameListener listener = run(ClassDataProviderSample.class); + + assertThat(listener.getSucceedMethodNames()).containsExactly("f(a)", "f(b)", "g(a)", "g(b)"); + } + + @Test + public void configurationAndDataProvidersTest() { + InvokedMethodNameListener listener = run(ConfigurationAndDataProvidersSample.class); + + assertThat(listener.getSucceedMethodNames()) + .containsExactly("setUpSuite", "setUpTest", "setUpClass", "setUp", "verifyNames(Test)"); + } + + @Test + public void dataProviderAsTest() { + InvokedMethodNameListener listener = run(DataProviderAsTestSample.class); + + assertThat(listener.getSucceedMethodNames()).containsExactly("f"); + } + + @Test + public void emptyDataProviderTest() { + InvokedMethodNameListener listener = run(EmptyDataProviderSample.class); + + assertThat(listener.getFailedMethodNames()).isEmpty(); + assertThat(listener.getSkippedMethodNames()).isEmpty(); + assertThat(listener.getSucceedMethodNames()).isEmpty(); + } + + @Test(description = "TESTNG-576: Prefer DataProvider explicit name") + public void should_prefer_dataProvider_explicit_name() { + InvokedMethodNameListener listener = run(ExplicitDataProviderNameSample.class); + + assertThat(listener.getSucceedMethodNames()) + .containsExactly("should_find_exactly_one_data_provider(true)"); + } + + /** + * Make sure that if a test method fails in the middle of a data provider, the rest of the data + * set is still run. + */ + @Test + public void allMethodsShouldBeInvoked() { + InvokedMethodNameListener listener = run(FailedDataProviderSample.class); + + assertThat(listener.getSucceedMethodNames()).containsExactly("f(1)", "f(3)"); + assertThat(listener.getFailedMethodNames()).containsExactly("f(2)"); + } + + @Test + public void failedDataProviderShouldCauseSkip() { + InvokedMethodNameListener listener = run(DependentSample.class); + + assertThat(listener.getSucceedMethodNames()).containsExactly("method1(ok)"); + assertThat(listener.getSkippedMethodNames()).containsExactly("method2"); + assertThat(listener.getFailedMethodNames()).containsExactly("method1(not ok)"); + } + + @Test + public void inheritedDataProviderTest() { + InvokedMethodNameListener listener = run(AnnotatedInheritedDataProviderSample.class); + + assertThat(listener.getSucceedMethodNames()).containsExactly("f(a)"); + } + + @Test + public void instanceDataProviderTest() { + InvokedMethodNameListener listener = run(InstanceDataProviderSampleFactory.class); + + assertThat(listener.getSucceedMethodNames()) + .hasSize(2) + .are(new RegexCondition("f\\(-?\\d+\\)")); + } + + @Test(enabled = false, description = "java 1.4 tests no more supported") + public void jdk4IteratorTest() { + TestNG tng = create(Jdk14IteratorSample.class); + // tng.setAnnotationFinder(new JDK14AnnotationFinder()); + + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener(listener); + + tng.run(); + + assertThat(listener.getSucceedMethodNames()) + .containsExactly("verifyNames(Cedric,36)", "verifyNames(Anne Marie,37)"); + } + + @Test + public void methodTest() { + MethodSample.m_test2 = 0; + MethodSample.m_test3 = 0; + + InvokedMethodNameListener listener = run(MethodSample.class); + + assertThat(listener.getSucceedMethodNames()) + .containsExactly("test1(Cedric)", "test1(Alois)", "test2(Cedric)", "test3(Cedric)"); + Assert.assertEquals(MethodSample.m_test2, 1); + Assert.assertEquals(MethodSample.m_test3, 1); + } + + @Test + public void constructorTest() { + ConstructorSample.all = new ArrayList<>(2); + + InvokedMethodNameListener listener = run(ConstructorSample.class); + + assertThat(listener.getSucceedMethodNames()).containsExactly("test", "test"); + assertThat(ConstructorSample.all).containsExactlyInAnyOrder("Cedric", "Alois"); + } + + @Test + public void constructorOrMethodTest() { + InvokedMethodNameListener listener = run(ConstructorOrMethodSample.class); + + assertThat(listener.getSucceedMethodNames()) + .containsExactlyInAnyOrder( + "test1", "test1", + "test2(Cedric1)", "test2(Alois1)", + "test2(Cedric0)", "test2(Alois0)"); + } + + @Test + public void classInjectionTest() { + InvokedMethodNameListener listener = run(ClassSample.class); + + assertThat(listener.getSucceedMethodNames()) + .containsExactlyInAnyOrder( + "test1", "test1", + "test2(Cedric1)", "test2(Alois1)", + "test2(Cedric0)", "test2(Alois0)"); + } + + @Test + public void iTestNGMethodTest() { + InvokedMethodNameListener listener = run(ITestNGMethodSample.class); + + assertThat(listener.getSucceedMethodNames()).containsExactly("test1(Cedric)", "test1(Alois)"); + } + + @Test + public void shouldNotThrowConcurrentModificationException() { + InvokedMethodNameListener listener = run(ParallelDataProvider2Sample.class); + + assertThat(listener.getFailedMethodNames()).isEmpty(); + assertThat(listener.getSucceedMethodNames()) + .are(new RegexCondition("checkCME\\(\\d+\\)|null", true)); + // TODO null is not an expected value + // .hasSize(2_000); TODO it is supposed to work + } + + @Test(description = "GITHUB-2565", dataProvider = "2565") + public void testForFunctionalInterfacesInLazyLoadingDataProviders( + Class cls, List expected) { + Data.INSTANCE.clear(); + run(cls); + List actualList = Data.INSTANCE.getData(); + assertThat(actualList).isEqualTo(expected); + } + + @DataProvider(name = "2565") + public Object[][] getTestDataFor2565() { + return new Object[][] { + {SampleTestUsingSupplier.class, Arrays.asList("Optimus_Prime", "Megatron")}, + {SampleTestUsingPredicate.class, Collections.singletonList("IronHide")}, + {SampleTestUsingFunction.class, Collections.singletonList("Bumble_Bee")}, + {SampleTestUsingConsumer.class, Collections.singletonList("StarScream")} + }; + } + + public static class RegexCondition extends Condition { + + private final String regex; + private final boolean acceptNull; + + public RegexCondition(String regex) { + this(regex, false); + } + + public RegexCondition(String regex, boolean acceptNull) { + this.regex = regex; + this.acceptNull = acceptNull; + } + + @Override + public boolean matches(String value) { + if (value == null) { + if (acceptNull) { + value = "null"; + } else { + return false; + } + } + return value.matches(regex); + } + } + + @Test + public void parallelDataProviderSample() { + InvokedMethodNameListener listener = run(ParallelDataProviderSample.class); + + assertThat(listener.getSucceedMethodNames()) + .hasSize(4) + .are( + new RegexCondition( + "verifyData1\\(org\\.testng\\.TestRunner@\\p{XDigit}+,(" + + "Cedric,36" + + "|" + + "Anne,37" + + "|" + + "A,36" + + "|" + + "B,37" + + ")\\)")); + } + + @Test + public void staticDataProviderTest() { + InvokedMethodNameListener listener = run(StaticDataProviderSampleSample.class); + + assertThat(listener.getSucceedMethodNames()) + .containsExactly( + "verifyConstructorInjection(Cedric)", + "verifyExternal(Cedric)", + "verifyFieldInjection(Cedric)", + "verifyStatic(Cedric)"); + } + + @Test + public void staticDataProviderSampleWithoutGuiceTest() { + InvokedMethodNameListener listener = run(StaticDataProviderSampleWithoutGuiceSample.class); + + assertThat(listener.getSucceedMethodNames()) + .containsExactly("verifyExternal(Cedric)", "verifyStatic(Cedric)"); + } + + @Test + public void testInstanceFactoryTest() { + TestInstanceSample.m_instanceCount = 0; + InvokedMethodNameListener listener = run(TestInstanceFactory.class); + + assertThat(TestInstanceSample.m_instanceCount).isEqualTo(2); + assertThat(listener.getSucceedMethodNames()) + .containsExactly( + "f(42)", "f(43)", + "f(42)", "f(43)"); + } + + @Test + public void testNG411Test() { + InvokedMethodNameListener listener = run(TestNG411Sample.class); + + assertThat(listener.getSucceedMethodNames()) + .hasSize(1) + .are( + new RegexCondition( + "checkMinTest_injection\\(1,2,org\\.testng\\.TestRunner@\\p{XDigit}+\\)")); + assertThat(listener.getFailedBeforeInvocationMethodNames()) + .containsExactly("checkMaxTest", "checkMinTest"); + } + + @Test + public void unnamedDataProviderTest() { + InvokedMethodNameListener listener = run(UnnamedDataProviderSample.class); + + assertThat(listener.getSucceedMethodNames()).containsExactly("doStuff(true)", "doStuff(false)"); + } + + @Test + public void varArgsDataProviderTest() { + InvokedMethodNameListener listener = run(VarArgsDataProviderSample.class); + + assertThat(listener.getSucceedMethodNames()) + .containsExactly("testWithTwoEntriesInTestToolWindow([a,b,c])"); + } + + @Test + public void createDataTest() { + InvokedMethodNameListener listener = run(CreateDataTest.class); + + assertThat(listener.getSucceedMethodNames()).containsExactly("testMyTest(MyObject{})"); + } + + @Test + public void testExceptions() { + InvokedMethodNameListener listener = run(DataProviderIntegrationSample.class); + Throwable exception = listener.getResult("theTest").getThrowable(); + assertThat(exception).isInstanceOf(MethodMatcherException.class); + } + + @Test + public void mixedVarArgsDataProviderTest() { + InvokedMethodNameListener listener = run(GitHub513Sample.class); + + assertThat(listener.getSucceedMethodNames()).containsExactly("test(a,b,[c,d])"); + } + + @Test(description = "GITHUB1509") + public void testDataProvidersThatReturnNull() { + TestListenerAdapter tla = new TestListenerAdapter(); + TestNG tng = create(Github1509TestClassSample.class); + tng.addListener(tla); + tng.run(); + assertThat(tla.getFailedTests()).size().isEqualTo(1); + ITestResult result = tla.getFailedTests().get(0); + String className = Github1509TestClassSample.class.getName() + ".getData()"; + String msg = + "Data Provider public java.lang.Object[][] " + className + " returned a null value"; + assertThat(result.getThrowable().getMessage()).contains(msg); + } + + @Test + public void retryWithDataProvider() { + TestNG testng = create(DataProviderRetryTest.class); + TestListenerAdapter tla = new TestListenerAdapter(); + testng.addListener(tla); + testng.run(); + assertThat(tla.getFailedTests()).size().isEqualTo(1); + assertThat(tla.getSkippedTests()).size().isEqualTo(2); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/DataProviderWithErrorSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/DataProviderWithErrorSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/DataProviderWithErrorSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/DataProviderWithErrorSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package test.dataprovider; + +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class DataProviderWithErrorSample { + + @Test(dataProvider = "Data", invocationCount = 2) + public void testShouldSkip() { + Assert.fail(); + } + + @Test(dataProvider = "Data", invocationCount = 2, successPercentage = 10) + public void testShouldSkipEvenIfSuccessPercentage() { + Assert.fail(); + } + + @DataProvider(name = "Data") + public static Object[][] Data() { + throw new RuntimeException("Fail"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/DependentSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/DependentSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/DependentSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/DependentSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,26 @@ +package test.dataprovider; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class DependentSample { + + @DataProvider(name = "data") + public Object[][] dp() { + return new Object[][] {{"ok"}, {"not ok"}}; + } + + @Test( + groups = {"a"}, + dataProvider = "data") + public void method1(String s) { + if (!"ok".equals(s)) { + throw new RuntimeException("error " + s); + } + } + + @Test( + groups = {"b"}, + dependsOnGroups = {"a"}) + public void method2() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/DuplicateDataProviderSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/DuplicateDataProviderSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/DuplicateDataProviderSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/DuplicateDataProviderSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.dataprovider; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class DuplicateDataProviderSample { + + @Test(dataProvider = "duplicate") + public void f() {} + + @DataProvider(name = "duplicate") + public Object[][] dp1() { + return new Object[0][]; + } + + @DataProvider(name = "duplicate") + public Object[][] dp2() { + return new Object[0][]; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/EmptyDataProviderSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/EmptyDataProviderSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/EmptyDataProviderSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/EmptyDataProviderSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,30 @@ +package test.dataprovider; + +import java.util.Collections; +import java.util.Iterator; +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class EmptyDataProviderSample { + + @DataProvider + public Object[][] dp1() { + return new Object[0][]; + } + + @Test(dataProvider = "dp1") + public void test1() { + Assert.fail(); + } + + @DataProvider(indices = {2}) + public Iterator dp2() { + return Collections.emptyIterator(); + } + + @Test(dataProvider = "dp2") + public void test2() { + Assert.fail(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/ExplicitDataProviderNameSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/ExplicitDataProviderNameSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/ExplicitDataProviderNameSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/ExplicitDataProviderNameSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.dataprovider; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class ExplicitDataProviderNameSample { + + @Test(dataProvider = "dp_name") + public void should_find_exactly_one_data_provider(boolean b) {} + + @DataProvider(name = "dp_name") + Object[][] whatever_implicit_name() { + return new Object[][] {{true}}; + } + + @DataProvider(name = "whatever_explicit_name") + Object[][] dp_name() { + return new Object[][] {{false}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/FailedDataProviderSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/FailedDataProviderSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/FailedDataProviderSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/FailedDataProviderSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.dataprovider; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class FailedDataProviderSample { + + @DataProvider + public Object[][] dp() { + return new Integer[][] {{1}, {2}, {3}}; + } + + @Test(dataProvider = "dp") + public void f(int n) { + if (n == 2) { + throw new RuntimeException("Failed"); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/FailingDataProviderSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/FailingDataProviderSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/FailingDataProviderSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/FailingDataProviderSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ +package test.dataprovider; + +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class FailingDataProviderSample { + + @DataProvider + public Object[][] throwsExpectedException() { + throw new RuntimeException("expected exception from @DP"); + } + + @Test(dataProvider = "throwsExpectedException") + public void dpThrowingException() { + Assert.fail("Method should never get invoked"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/FailingDataProviderTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/FailingDataProviderTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/FailingDataProviderTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/FailingDataProviderTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,48 @@ +package test.dataprovider; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.DataProviderInvocationException; +import org.testng.ITestResult; +import org.testng.annotations.Test; +import test.InvokedMethodNameListener; +import test.SimpleBaseTest; +import test.dataprovider.issue2157.TestClassWithDataProviderThatThrowsExceptions; + +public class FailingDataProviderTest extends SimpleBaseTest { + + @Test(description = "TESTNG-142: Exceptions in DataProvider are not reported as failed test") + public void failingDataProvider() { + InvokedMethodNameListener listener = run(FailingDataProviderSample.class); + + assertThat(listener.getSkippedMethodNames()).containsExactly("dpThrowingException"); + } + + @Test(description = "TESTNG-447: Abort when two data providers have the same name") + public void duplicateDataProviders() { + InvokedMethodNameListener listener = run(DuplicateDataProviderSample.class); + + assertThat(listener.getFailedBeforeInvocationMethodNames()).containsExactly("f"); + } + + @Test + public void failingDataProviderAndInvocationCount() { + InvokedMethodNameListener listener = run(DataProviderWithErrorSample.class); + + assertThat(listener.getSkippedMethodNames()) + .containsExactly( + "testShouldSkip", + "testShouldSkip", + "testShouldSkipEvenIfSuccessPercentage", + "testShouldSkipEvenIfSuccessPercentage"); + } + + @Test(description = "GITHUB-2157") + public void abortWhenDataProviderThrowsException() { + InvokedMethodNameListener listener = run(TestClassWithDataProviderThatThrowsExceptions.class); + ITestResult result = listener.getResult("testMethod"); + Throwable cause = result.getThrowable(); + assertThat(cause).isInstanceOf(DataProviderInvocationException.class); + assertThat(result.getStatus()).isEqualTo(ITestResult.FAILURE); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/FailingIterableDataProvider.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/FailingIterableDataProvider.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/FailingIterableDataProvider.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/FailingIterableDataProvider.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,38 @@ +package test.dataprovider; + +import java.util.Iterator; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class FailingIterableDataProvider { + + @DataProvider(name = "dp") + public Iterator createData() { + return new Iterator() { + int count = 0; + + @Override + public boolean hasNext() { + return count < 10; + } + + @Override + public Object[] next() { + if (++count == 6) { + throw new RuntimeException(); + } + return new Object[] {count}; + } + + @Override + public void remove() { + throw new UnsupportedOperationException("remove"); + } + }; + } + + @Test(dataProvider = "dp") + public void happyTest(int count) { + // pass + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/FailingIterableDataProviderTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/FailingIterableDataProviderTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/FailingIterableDataProviderTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/FailingIterableDataProviderTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,47 @@ +package test.dataprovider; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlClass; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.InvokedMethodNameListener; +import test.SimpleBaseTest; + +/** + * TESTNG-291: Exceptions thrown by Iterable DataProviders are not caught, no failed test reported + */ +public class FailingIterableDataProviderTest extends SimpleBaseTest { + + @Test + public void failingDataProvider() { + InvokedMethodNameListener listener = run(FailingIterableDataProvider.class); + + assertThat(listener.getFailedBeforeInvocationMethodNames()).containsExactly("happyTest"); + assertThat(listener.getSucceedMethodNames()) + .containsExactly( + "happyTest(1)", "happyTest(2)", "happyTest(3)", "happyTest(4)", "happyTest(5)"); + } + + @Test + public void failingDataProviderWithInvocationNumber() { + XmlSuite xmlSuite = createXmlSuite("Suite"); + XmlTest xmlTest = createXmlTest(xmlSuite, "Test"); + XmlClass xmlClass = createXmlClass(xmlTest, FailingIterableDataProvider.class); + createXmlInclude(xmlClass, "happyTest", /* index */ 0, /* list */ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9); + + TestNG tng = create(xmlSuite); + + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener(listener); + + tng.run(); + + assertThat(listener.getFailedBeforeInvocationMethodNames()).containsExactly("happyTest"); + assertThat(listener.getSucceedMethodNames()) + .containsExactly( + "happyTest(1)", "happyTest(2)", "happyTest(3)", "happyTest(4)", "happyTest(5)"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/FieldInjectionProvider.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/FieldInjectionProvider.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/FieldInjectionProvider.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/FieldInjectionProvider.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package test.dataprovider; + +import com.google.inject.Inject; +import com.google.inject.name.Named; +import org.testng.annotations.DataProvider; + +public class FieldInjectionProvider { + + @Inject + @Named("test") + private String value; + + @DataProvider(name = "injection") + public Object[][] create() { + return new Object[][] {{value}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/GitHub513Sample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/GitHub513Sample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/GitHub513Sample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/GitHub513Sample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,22 @@ +package test.dataprovider; + +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class GitHub513Sample { + + @DataProvider + public static Object[][] testData() { + return new Object[][] {new Object[] {"a", "b", "c", "d"}}; + } + + @Test(dataProvider = "testData") + public void test(String fixedArg1, Object fixedArg2, String... args) { + Assert.assertEquals(fixedArg1, "a"); + Assert.assertEquals(fixedArg2, "b"); + Assert.assertEquals(args.length, 2); + Assert.assertEquals(args[0], "c"); + Assert.assertEquals(args[1], "d"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/Github1509TestClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/Github1509TestClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/Github1509TestClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/Github1509TestClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package test.dataprovider; + +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class Github1509TestClassSample { + @Test(dataProvider = "dp") + public void demo(int i) { + Assert.assertTrue(i > 0); + } + + @DataProvider(name = "dp") + public Object[][] getData() { + return null; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/ITestNGMethodSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/ITestNGMethodSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/ITestNGMethodSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/ITestNGMethodSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,21 @@ +package test.dataprovider; + +import org.testng.Assert; +import org.testng.ITestNGMethod; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class ITestNGMethodSample { + + @DataProvider(name = "dp1") + public Object[][] createData(ITestNGMethod m) { + Assert.assertEquals(m.getMethodName(), "test1"); + Assert.assertEquals(m.getConstructorOrMethod().getMethod().getName(), "test1"); + Assert.assertEquals(m.getRealClass(), ITestNGMethodSample.class); + + return new Object[][] {{"Cedric"}, {"Alois"}}; + } + + @Test(dataProvider = "dp1") + public void test1(String s) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/IndicesFactorySample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/IndicesFactorySample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/IndicesFactorySample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/IndicesFactorySample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,39 @@ +package test.dataprovider; + +import java.lang.reflect.Method; +import org.testng.ITest; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +@Test +public class IndicesFactorySample implements ITest { + + private final int value; + private String testName; + + @Factory(dataProvider = "dp", indices = 1) + public IndicesFactorySample(int value) { + this.value = value; + } + + @DataProvider(indices = {1, 2}) + public static Object[][] dp() { + return new Object[][] {new Object[] {1}, new Object[] {2}, new Object[] {3}, new Object[] {4}}; + } + + @BeforeMethod + public void setUp(Method method) { + testName = method.getName().replace("test", "testName"); + } + + public void testA() {} + + public void testB() {} + + @Override + public String getTestName() { + return testName + "(" + value + ")"; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/IndicesSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/IndicesSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/IndicesSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/IndicesSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,33 @@ +package test.dataprovider; + +import java.util.Arrays; +import java.util.Iterator; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class IndicesSample { + + @DataProvider(indices = {2}) + public Object[][] dp1() { + return new Object[][] {{1}, {2}, {3}}; + } + + @Test(dataProvider = "dp1") + public void indicesShouldWork(int n) { + if (n == 2) { + throw new RuntimeException("This method should not have received a 2"); + } + } + + @DataProvider(indices = {2}) + public Iterator dp2() { + return Arrays.asList(new Object[] {1}, new Object[] {2}, new Object[] {3}).iterator(); + } + + @Test(dataProvider = "dp2") + public void indicesShouldWorkWithIterator(int n) { + if (n == 2) { + throw new RuntimeException("This method should not have received a 2"); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/IndicesTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/IndicesTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/IndicesTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/IndicesTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,72 @@ +package test.dataprovider; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlClass; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.InvokedMethodNameListener; +import test.SimpleBaseTest; + +public class IndicesTest extends SimpleBaseTest { + + @Test + public void test() { + InvokedMethodNameListener listener = run(IndicesSample.class); + + assertThat(listener.getFailedMethodNames()).isEmpty(); + assertThat(listener.getSucceedMethodNames()) + .containsExactly("indicesShouldWork(3)", "indicesShouldWorkWithIterator(3)"); + } + + @Test + public void test2() { + XmlSuite xmlSuite = createXmlSuite("Suite"); + XmlTest xmlTest = createXmlTest(xmlSuite, "Test"); + XmlClass xmlClass = createXmlClass(xmlTest, IndicesSample.class); + createXmlInclude(xmlClass, "indicesShouldWork", /* index*/ 0, /* list */ 0); + createXmlInclude(xmlClass, "indicesShouldWorkWithIterator", /* index*/ 0, /* list */ 0); + + TestNG tng = create(xmlSuite); + + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener(listener); + + tng.run(); + + assertThat(listener.getFailedMethodNames()).isEmpty(); + assertThat(listener.getSucceedMethodNames()) + .containsExactly( + "indicesShouldWork(1)", "indicesShouldWork(3)", + "indicesShouldWorkWithIterator(1)", "indicesShouldWorkWithIterator(3)"); + } + + @Test + public void testIndicesFactory() { + InvokedMethodNameListener listener = run(true, IndicesFactorySample.class); + + assertThat(listener.getFailedMethodNames()).isEmpty(); + assertThat(listener.getSucceedMethodNames()) + .containsExactly("testNameA(3)#testA", "testNameB(3)#testB"); + } + + @Test(enabled = false, description = "KO https://github.com/cbeust/testng/issues/1253") + public void testIndicesFactory2() { + XmlSuite xmlSuite = createXmlSuite("Suite"); + XmlTest xmlTest = createXmlTest(xmlSuite, "Test"); + XmlClass xmlClass = createXmlClass(xmlTest, IndicesFactorySample.class); + createXmlInclude(xmlClass, "testNameA", 0, 0); + + TestNG tng = create(xmlSuite); + + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener(listener); + + tng.run(); + + assertThat(listener.getFailedMethodNames()).isEmpty(); + assertThat(listener.getSucceedMethodNames()).containsExactly("testNameA(3)#testA"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/InheritedDataProvider.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/InheritedDataProvider.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/InheritedDataProvider.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/InheritedDataProvider.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.dataprovider; + +import org.testng.annotations.DataProvider; + +public class InheritedDataProvider { + + @DataProvider + public static Object[][] dp() { + return new Object[][] {{"a"}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/InheritedDataProviderSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/InheritedDataProviderSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/InheritedDataProviderSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/InheritedDataProviderSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.dataprovider; + +import org.testng.annotations.Test; + +public class InheritedDataProviderSample extends InheritedDataProvider { + + @Test(dataProvider = "dp") + public void f(String s) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/InnexistentDataProviderSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/InnexistentDataProviderSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/InnexistentDataProviderSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/InnexistentDataProviderSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.dataprovider; + +import org.testng.annotations.Test; + +public class InnexistentDataProviderSample { + + @Test(dataProvider = "doesnotexist") + public void testMethod(String s) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/InstanceDataProviderSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/InstanceDataProviderSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/InstanceDataProviderSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/InstanceDataProviderSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ +package test.dataprovider; + +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class InstanceDataProviderSample { + + @DataProvider + public Object[][] dp() { + return new Object[][] {{hashCode()}}; + } + + @Test(dataProvider = "dp") + public void f(Integer n) { + Assert.assertEquals(n, Integer.valueOf(hashCode())); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/InstanceDataProviderSampleFactory.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/InstanceDataProviderSampleFactory.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/InstanceDataProviderSampleFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/InstanceDataProviderSampleFactory.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.dataprovider; + +import org.testng.annotations.Factory; + +public class InstanceDataProviderSampleFactory { + + @Factory + public Object[] create() { + return new Object[] {new InstanceDataProviderSample(), new InstanceDataProviderSample()}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/InterceptorTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/InterceptorTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/InterceptorTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/InterceptorTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,79 @@ +package test.dataprovider; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.io.File; +import java.io.IOException; +import java.util.Collections; +import org.testng.IDataProviderInterceptor; +import org.testng.TestNG; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import org.testng.reporters.Files; +import test.SimpleBaseTest; +import test.TestHelper; +import test.dataprovider.issue2111.CountingListener; +import test.dataprovider.issue2111.LocalDataProviderInterceptor; +import test.dataprovider.issue2111.TestClassExample; +import test.dataprovider.issue2111.TestClassExamplePoweredByFactory; +import test.dataprovider.issue2111.TestClassExamplePoweredByFactoryUsingListener; +import test.dataprovider.issue2111.TestClassSampleUsingListener; + +public class InterceptorTest extends SimpleBaseTest { + + @Test(dataProvider = "dp") + public void ensureInterceptorIsInvokedForDataDriverPoweredTests( + Class testclass, IDataProviderInterceptor interceptor) { + TestNG testng = create(testclass); + if (interceptor != null) { + testng.addListener(interceptor); + } + CountingListener counter = new CountingListener(); + testng.addListener(counter); + testng.run(); + assertThat(counter.getResults()).hasSize(1); + } + + @DataProvider(name = "dp") + public Object[][] getTestData() { + return new Object[][] { + {TestClassExample.class, new LocalDataProviderInterceptor()}, + {TestClassSampleUsingListener.class, null}, + {TestClassExamplePoweredByFactory.class, new LocalDataProviderInterceptor()}, + {TestClassExamplePoweredByFactoryUsingListener.class, null} + }; + } + + @Test(dataProvider = "dp1") + public void ensureInterceptorIsInvokedViaListenersTag(Class testClass) throws IOException { + String xml = + TestHelper.SUITE_XML_HEADER + + "\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + ""; + xml = String.format(xml, testClass.getName()); + File suiteFile = File.createTempFile("testng", ".xml"); + Files.writeFile(xml, suiteFile); + TestNG testng = create(); + testng.setTestSuites(Collections.singletonList(suiteFile.getAbsolutePath())); + CountingListener counter = new CountingListener(); + testng.addListener(counter); + testng.run(); + assertThat(counter.getResults()).hasSize(1); + } + + @DataProvider(name = "dp1") + public Object[][] getTestClasses() { + return new Object[][] { + {TestClassExample.class}, {TestClassExamplePoweredByFactory.class}, + }; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/Jdk14IteratorSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/Jdk14IteratorSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/Jdk14IteratorSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/Jdk14IteratorSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,13 @@ +package test.dataprovider; + +import java.util.Arrays; +import java.util.Iterator; + +public class Jdk14IteratorSample { + + public Iterator createData() { + return Arrays.asList(new Object[] {"Cedric", 36}, new Object[] {"Anne Marie", 37}).iterator(); + } + + public void verifyNames(String firstName, Integer age) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/MethodSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/MethodSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/MethodSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/MethodSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,46 @@ +package test.dataprovider; + +import java.lang.reflect.Method; +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class MethodSample { + + @DataProvider(name = "dp1") + public Object[][] createData(Method m) { + Assert.assertEquals(m.getName(), "test1"); + Assert.assertEquals(m.getDeclaringClass(), MethodSample.class); + + return new Object[][] {{"Cedric"}, {"Alois"}}; + } + + @Test(dataProvider = "dp1") + public void test1(String s) {} + + public static int m_test2 = 0; + public static int m_test3 = 0; + + @DataProvider(name = "dp2") + public Object[][] createData2(Method m) { + switch (m.getName()) { + case "test2": + m_test2++; + break; + case "test3": + m_test3++; + break; + default: + throw new RuntimeException("Received method " + m + ", expected test2 or test3"); + } + Assert.assertEquals(m.getDeclaringClass(), MethodSample.class); + + return new Object[][] {{"Cedric"}}; + } + + @Test(dataProvider = "dp2") + public void test2(String s) {} + + @Test(dataProvider = "dp2") + public void test3(String s) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/NonStaticProvider.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/NonStaticProvider.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/NonStaticProvider.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/NonStaticProvider.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.dataprovider; + +import org.testng.annotations.DataProvider; + +public class NonStaticProvider { + + @DataProvider(name = "external") + public Object[][] create() { + return new Object[][] {{"Cedric"}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/OneDimDataProviderSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/OneDimDataProviderSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/OneDimDataProviderSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/OneDimDataProviderSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,50 @@ +package test.dataprovider; + +import java.util.Arrays; +import java.util.Iterator; +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class OneDimDataProviderSample { + + @DataProvider + public static Object[] staticArray() { + return new Object[] {"foo", "bar"}; + } + + @Test(dataProvider = "staticArray") + public void testStaticArray(String s) { + Assert.assertNotNull(s); + } + + @DataProvider + public Object[] array() { + return new Object[] {"foo", "bar"}; + } + + @Test(dataProvider = "array") + public void testArray(String s) { + Assert.assertNotNull(s); + } + + @DataProvider + public static Iterator staticIterator() { + return Arrays.asList("foo", "bar").iterator(); + } + + @Test(dataProvider = "staticIterator") + public void testStaticIterator(String s) { + Assert.assertNotNull(s); + } + + @DataProvider + public Iterator iterator() { + return Arrays.asList("foo", "bar").iterator(); + } + + @Test(dataProvider = "iterator") + public void testIterator(String s) { + Assert.assertNotNull(s); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/ParallelDataProvider2Sample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/ParallelDataProvider2Sample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/ParallelDataProvider2Sample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/ParallelDataProvider2Sample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,26 @@ +package test.dataprovider; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +/** Make sure this class can run without causing a ConcurrentModificationException. */ +public class ParallelDataProvider2Sample { + + @DataProvider(parallel = true) + Iterator provide() { + List ret = new ArrayList<>(); + for (int i = 0; i < 1000; i++) { + ret.add(new Integer[] {i}); + } + return ret.iterator(); + } + + @Test(dataProvider = "provide", invocationCount = 2, threadPoolSize = 2) + public void checkCME(Integer i) { + Assert.assertNotNull(i); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/ParallelDataProviderSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/ParallelDataProviderSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/ParallelDataProviderSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/ParallelDataProviderSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,22 @@ +package test.dataprovider; + +import org.testng.ITestContext; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +/** Data providers were not working properly with parallel=true */ +public class ParallelDataProviderSample { + + @DataProvider(name = "test1", parallel = true) + public Object[][] createData1() { + return new Object[][] { + {"Cedric", 36}, + {"Anne", 37}, + {"A", 36}, + {"B", 37} + }; + } + + @Test(dataProvider = "test1", threadPoolSize = 5) + public void verifyData1(ITestContext testContext, String n1, Integer n2) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/RawIteratorDataProviderSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/RawIteratorDataProviderSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/RawIteratorDataProviderSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/RawIteratorDataProviderSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,30 @@ +package test.dataprovider; + +import java.util.Arrays; +import java.util.Iterator; +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class RawIteratorDataProviderSample { + + @DataProvider + public static Iterator staticIterator() { + return Arrays.asList(new Object[] {"foo"}, new Object[] {"bar"}).iterator(); + } + + @Test(dataProvider = "staticIterator") + public void testStaticIterator(String s) { + Assert.assertNotNull(s); + } + + @DataProvider + public Iterator iterator() { + return Arrays.asList(new Object[] {"foo"}, new Object[] {"bar"}).iterator(); + } + + @Test(dataProvider = "iterator") + public void testIterator(String s) { + Assert.assertNotNull(s); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/StaticDataProviderSampleSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/StaticDataProviderSampleSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/StaticDataProviderSampleSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/StaticDataProviderSampleSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,30 @@ +package test.dataprovider; + +import com.google.inject.AbstractModule; +import com.google.inject.name.Names; +import org.testng.annotations.Guice; +import org.testng.annotations.Test; + +@Guice(modules = StaticDataProviderSampleSample.InjectionProviderModule.class) +public class StaticDataProviderSampleSample { + + @Test(dataProvider = "static", dataProviderClass = StaticProvider.class) + public void verifyStatic(String s) {} + + @Test(dataProvider = "external", dataProviderClass = NonStaticProvider.class) + public void verifyExternal(String s) {} + + @Test(dataProvider = "injection", dataProviderClass = FieldInjectionProvider.class) + public void verifyFieldInjection(String s) {} + + @Test(dataProvider = "injection", dataProviderClass = ConstructorInjectionProvider.class) + public void verifyConstructorInjection(String s) {} + + public static class InjectionProviderModule extends AbstractModule { + + @Override + protected void configure() { + bind(String.class).annotatedWith(Names.named("test")).toInstance("Cedric"); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/StaticDataProviderSampleWithoutGuiceSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/StaticDataProviderSampleWithoutGuiceSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/StaticDataProviderSampleWithoutGuiceSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/StaticDataProviderSampleWithoutGuiceSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.dataprovider; + +import org.testng.annotations.Test; + +public class StaticDataProviderSampleWithoutGuiceSample { + + @Test(dataProvider = "static", dataProviderClass = StaticProvider.class) + public void verifyStatic(String s) {} + + @Test(dataProvider = "external", dataProviderClass = NonStaticProvider.class) + public void verifyExternal(String s) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/StaticProvider.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/StaticProvider.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/StaticProvider.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/StaticProvider.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.dataprovider; + +import org.testng.annotations.DataProvider; + +public class StaticProvider { + + @DataProvider(name = "static") + public static Object[][] create() { + return new Object[][] {{"Cedric"}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/TestContextSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/TestContextSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/TestContextSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/TestContextSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,37 @@ +package test.dataprovider; + +import org.testng.Assert; +import org.testng.ITestContext; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +/** + * Tests that when a DataProvider is declared with an ITestContext, this parameter is correctly + * passed. + */ +public class TestContextSample { + + /** @return As many parameters as the name of the included group */ + @DataProvider(name = "testContext") + public Object[] createContext(ITestContext ctx) { + String[] groups = ctx.getIncludedGroups(); + + int n = groups.length > 0 ? Integer.parseInt(groups[0]) : 0; + Object[] result = new Object[n]; + for (int i = 0; i < n; i++) { + result[i] = "foo"; + } + + return new Object[] {result}; + } + + @Test(dataProvider = "testContext", groups = "10") + public void verifyTen(Object[] objects) { + Assert.assertEquals(objects.length, 10); + } + + @Test(dataProvider = "testContext", groups = "5") + public void verifyFive(Object[] objects) { + Assert.assertEquals(objects.length, 5); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/TestContextTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/TestContextTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/TestContextTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/TestContextTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,46 @@ +package test.dataprovider; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.TestNG; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import test.InvokedMethodNameListener; +import test.SimpleBaseTest; + +public class TestContextTest extends SimpleBaseTest { + + @Test + public void verifySix() { + // Not including any group, so the two test methods should fail + TestNG tng = create(TestContextSample.class); + + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener(listener); + + tng.run(); + + assertThat(listener.getFailedMethodNames()).hasSize(2); + } + + @DataProvider + public static Object[][] dp() { + return new Object[][] {{10, "verifyTen"}, {5, "verifyFive"}}; + } + + @Test(dataProvider = "dp") + public void verify(int number, String passed) { + TestNG tng = create(TestContextSample.class); + tng.setGroups(String.valueOf(number)); + + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener(listener); + + tng.run(); + + assertThat(listener.getSucceedMethodNames()).hasSize(1); + assertThat(listener.getSucceedMethodNames().get(0)) + .matches(passed + "\\(\\[foo(,foo){" + (number - 1) + "}?\\]\\)"); + assertThat(listener.getFailedMethodNames()).isEmpty(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/TestInstanceFactory.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/TestInstanceFactory.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/TestInstanceFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/TestInstanceFactory.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.dataprovider; + +import org.testng.annotations.Factory; + +public class TestInstanceFactory { + + @Factory + public Object[] init() { + return new Object[] {new TestInstanceSample(1), new TestInstanceSample(2)}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/TestInstanceSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/TestInstanceSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/TestInstanceSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/TestInstanceSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,39 @@ +package test.dataprovider; + +import java.lang.reflect.Method; +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import org.testng.annotations.TestInstance; + +public class TestInstanceSample { + + public static int m_instanceCount = 0; + + private final int m_n; + + public TestInstanceSample() { + this(0); + } + + public TestInstanceSample(int n) { + this.m_n = n; + } + + @DataProvider + public Object[][] dp(Method m, @TestInstance Object instance) { + TestInstanceSample o0 = (TestInstanceSample) instance; + Assert.assertTrue(o0.m_n == 1 || o0.m_n == 2); + m_instanceCount++; + + return new Object[][] {{42}, {43}}; + } + + @Test(dataProvider = "dp") + public void f(int o) {} + + @Override + public String toString() { + return "[A n:" + m_n + "]"; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/TestNG411Sample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/TestNG411Sample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/TestNG411Sample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/TestNG411Sample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,49 @@ +package test.dataprovider; + +import org.testng.Assert; +import org.testng.ITestContext; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class TestNG411Sample { + + private static final String CHECK_MAX_DATA = "checkMaxData"; + private static final String CHECK_MIN_DATA = "checkMinData"; + + @DataProvider(name = CHECK_MAX_DATA) + public Object[][] dataProviderCheckMax() { + return new Object[][] {{1, 2, 3, 3}}; + } + + @Test( + description = + "Number of parameters to this test don't match the ones passed by data provider", + dataProvider = CHECK_MAX_DATA) + public void checkMaxTest(int nr1, int nr2, int expected) { + Assert.fail("This code shouldn't be executed"); + } + + @DataProvider(name = CHECK_MIN_DATA) + public Object[][] dataProviderCheckMin() { + return new Object[][] {{1, 2}}; + } + + @Test( + description = + "Number of parameters to this test don't match the ones passed by data provider", + dataProvider = CHECK_MIN_DATA) + public void checkMinTest(int nr1, int nr2, int expected) { + Assert.fail("This code shouldn't be executed"); + } + + @Test( + description = + "Number of parameters to this test don't match the " + + "ones passed by data provider. But an object will be injected", + dataProvider = CHECK_MIN_DATA) + public void checkMinTest_injection(int nr1, int nr2, ITestContext ctx) { + int result = Math.min(nr1, nr2); + Assert.assertEquals(result, nr1); + Assert.assertNotNull(ctx); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/UnnamedDataProviderSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/UnnamedDataProviderSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/UnnamedDataProviderSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/UnnamedDataProviderSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.dataprovider; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class UnnamedDataProviderSample { + + @Test(dataProvider = "unnamedDataProvider") + public void doStuff(boolean t) {} + + @DataProvider + public Object[][] unnamedDataProvider() { + return new Object[][] {{Boolean.TRUE}, {Boolean.FALSE}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/VarArgsDataProviderSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/VarArgsDataProviderSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/VarArgsDataProviderSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/VarArgsDataProviderSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.dataprovider; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class VarArgsDataProviderSample { + + @DataProvider + public Object[][] data() { + return new Object[][] {new String[] {"a", "b", "c"}}; + } + + @Test(dataProvider = "data") + public void testWithTwoEntriesInTestToolWindow(String... o) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue128/DataProviderParametersMismatchTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue128/DataProviderParametersMismatchTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue128/DataProviderParametersMismatchTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue128/DataProviderParametersMismatchTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,52 @@ +package test.dataprovider.issue128; + +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; +import java.nio.charset.StandardCharsets; +import org.testng.Assert; +import org.testng.ITestResult; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.internal.reflect.MethodMatcherException; +import test.SimpleBaseTest; + +public class DataProviderParametersMismatchTest extends SimpleBaseTest { + + @Test + public void testIfWarningsAreServed() { + PrintStream currentErr = System.err; + try { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + PrintStream stream = new PrintStream(out); + System.setErr(stream); + TestNG tng = create(GitHub128Sample.class); + tng.run(); + String msg = new String(out.toByteArray(), StandardCharsets.UTF_8); + boolean contains = + msg.contains( + "Missing one or more parameters that are being injected by the data provider. Please add the below arguments to the method."); + Assert.assertTrue(contains, "Missing parameters warning should have triggered"); + } finally { + System.setErr(currentErr); + System.setProperty("strictParameterMatch", "false"); + } + } + + @Test(dependsOnMethods = "testIfWarningsAreServed") + public void testIfExceptionIsRaised() { + try { + System.setProperty("strictParameterMatch", "true"); + TestNG tng = create(GitHub128Sample.class); + TestListenerAdapter listener = new TestListenerAdapter(); + tng.addListener(listener); + tng.run(); + for (ITestResult each : listener.getFailedTests()) { + Assert.assertTrue(each.getThrowable() instanceof MethodMatcherException); + } + Assert.assertEquals(listener.getFailedTests().size(), 2); + } finally { + System.setProperty("strictParameterMatch", "false"); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue128/GitHub128Sample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue128/GitHub128Sample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue128/GitHub128Sample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue128/GitHub128Sample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,63 @@ +package test.dataprovider.issue128; + +import java.lang.reflect.Method; +import org.testng.Assert; +import org.testng.ITestContext; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.DataProvider; +import org.testng.annotations.NoInjection; +import org.testng.annotations.Test; + +public class GitHub128Sample { + + @BeforeClass + public void beforeClass(ITestContext ctx) { + Assert.assertNotNull(ctx); + } + + @BeforeMethod + public void beforeMethod() { + // Ensuring that a no-arg configuration method doesn't trigger any errors. + } + + @Test + public void testMethod(ITestContext ctx) { + Assert.assertNotNull(ctx); + } + + @DataProvider(name = "methods") + public Object[][] getMethods() throws NoSuchMethodException { + return new Object[][] {new Object[] {String.class.getMethod("toString"), new Object[0]}}; + } + + @Test(dataProvider = "methods") + public void testInvokeRemote(Method param1, Object[] param2) { + Assert.fail("The test is supposed to fail because the method param is not defined"); + ; + } + + @Test(dataProvider = "methods") + public void testInvokeRemote2(@NoInjection Method param1, Object[] param2) { + Assert.assertEquals(param1.getName(), "toString"); + Assert.assertEquals(param2.length, 0); + } + + @DataProvider(name = "methods2") + public Object[][] getMethods2() throws NoSuchMethodException { + return new Object[][] {new Object[] {new Object[0], String.class.getMethod("toString")}}; + } + + @Test(dataProvider = "methods2") + public void testInvokeRemoteReversed(Object[] param1, Method param2) { + Assert.fail("The test is supposed to fail because the method param is not defined"); + } + + @Test(dataProvider = "methods2") + public void testInvokeRemoteReversed2(Object[] param1, @NoInjection Method param2) { + Assert.assertEquals(param1.length, 0); + Assert.assertEquals(param2.getName(), "toString"); + } + + // TODO Add similar test for Before/AfterMethod +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue1691/DataProviderDefinitionAtClassLevelAndNoTestMethodUsage.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1691/DataProviderDefinitionAtClassLevelAndNoTestMethodUsage.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue1691/DataProviderDefinitionAtClassLevelAndNoTestMethodUsage.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1691/DataProviderDefinitionAtClassLevelAndNoTestMethodUsage.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.dataprovider.issue1691; + +import org.testng.Assert; +import org.testng.annotations.Test; + +@Test(dataProviderClass = SampleDataProvider.class, dataProvider = "hangoutPlaces") +public class DataProviderDefinitionAtClassLevelAndNoTestMethodUsage { + + public void regularTestMethod() {} + + public void verifyHangoutPlaces(String place, String city) { + Assert.assertNotNull(place); + Assert.assertNotNull(city); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue1691/DataProviderDefinitionCompletelyProvidedAtClassLevel.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1691/DataProviderDefinitionCompletelyProvidedAtClassLevel.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue1691/DataProviderDefinitionCompletelyProvidedAtClassLevel.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1691/DataProviderDefinitionCompletelyProvidedAtClassLevel.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package test.dataprovider.issue1691; + +import org.testng.Assert; +import org.testng.annotations.Test; + +@Test(dataProviderClass = SampleDataProvider.class, dataProvider = "hangoutPlaces") +public class DataProviderDefinitionCompletelyProvidedAtClassLevel { + + @Test + public void verifyHangoutPlaces(String place, String city) { + Assert.assertNotNull(place); + Assert.assertNotNull(city); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue1691/DataProviderDefinitionCompletelyProvidedAtClassLevelAndPartiallyAtMethodLevel.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1691/DataProviderDefinitionCompletelyProvidedAtClassLevelAndPartiallyAtMethodLevel.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue1691/DataProviderDefinitionCompletelyProvidedAtClassLevelAndPartiallyAtMethodLevel.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1691/DataProviderDefinitionCompletelyProvidedAtClassLevelAndPartiallyAtMethodLevel.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package test.dataprovider.issue1691; + +import org.testng.Assert; +import org.testng.annotations.Test; + +@Test(dataProviderClass = SampleDataProvider.class, dataProvider = "busyMalls") +public class DataProviderDefinitionCompletelyProvidedAtClassLevelAndPartiallyAtMethodLevel { + + @Test(dataProvider = "hangoutPlaces") + public void verifyHangoutPlaces(String place, String city) { + Assert.assertNotNull(place); + Assert.assertNotNull(city); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue1691/DataProviderDefinitionProvidedPartiallyAtClassLevel.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1691/DataProviderDefinitionProvidedPartiallyAtClassLevel.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue1691/DataProviderDefinitionProvidedPartiallyAtClassLevel.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1691/DataProviderDefinitionProvidedPartiallyAtClassLevel.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package test.dataprovider.issue1691; + +import org.testng.Assert; +import org.testng.annotations.Test; + +@Test(dataProviderClass = SampleDataProvider.class, dataProvider = "hangoutPlaces") +public class DataProviderDefinitionProvidedPartiallyAtClassLevel { + + @Test + public void verifyHangoutPlaces(String place, String city) { + Assert.assertNotNull(place); + Assert.assertNotNull(city); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue1691/SampleDataProvider.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1691/SampleDataProvider.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue1691/SampleDataProvider.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1691/SampleDataProvider.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,22 @@ +package test.dataprovider.issue1691; + +import org.testng.annotations.DataProvider; + +public class SampleDataProvider { + + @DataProvider + public Object[][] hangoutPlaces() { + return new Object[][] { + {"Hakuna Matata", "Bangalore"}, + {"Gem Inn", "Chennai"} + }; + } + + @DataProvider + public Object[][] busyMalls() { + return new Object[][] { + {"Orion Mall", "Bangalore"}, + {"Phoenix Mall", "Chennai"} + }; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue1691/withinheritance/BaseClassWithFullDefinitionOfDataProviderInClassLevel.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1691/withinheritance/BaseClassWithFullDefinitionOfDataProviderInClassLevel.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue1691/withinheritance/BaseClassWithFullDefinitionOfDataProviderInClassLevel.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1691/withinheritance/BaseClassWithFullDefinitionOfDataProviderInClassLevel.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,7 @@ +package test.dataprovider.issue1691.withinheritance; + +import org.testng.annotations.Test; +import test.dataprovider.issue1691.SampleDataProvider; + +@Test(dataProviderClass = SampleDataProvider.class, dataProvider = "hangoutPlaces") +public class BaseClassWithFullDefinitionOfDataProviderInClassLevel {} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue1691/withinheritance/BaseClassWithFullDefinitionOfDataProviderInTestMethod.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1691/withinheritance/BaseClassWithFullDefinitionOfDataProviderInTestMethod.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue1691/withinheritance/BaseClassWithFullDefinitionOfDataProviderInTestMethod.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1691/withinheritance/BaseClassWithFullDefinitionOfDataProviderInTestMethod.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package test.dataprovider.issue1691.withinheritance; + +import org.testng.Assert; +import org.testng.annotations.Test; +import test.dataprovider.issue1691.SampleDataProvider; + +public class BaseClassWithFullDefinitionOfDataProviderInTestMethod { + + @Test(dataProviderClass = SampleDataProvider.class, dataProvider = "hangoutPlaces") + public void verifyHangoutPlaces(String place, String city) { + Assert.assertNotNull(place); + Assert.assertNotNull(city); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue1691/withinheritance/BaseClassWithPartialDefinitionOfDataProviderInTestMethod.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1691/withinheritance/BaseClassWithPartialDefinitionOfDataProviderInTestMethod.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue1691/withinheritance/BaseClassWithPartialDefinitionOfDataProviderInTestMethod.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1691/withinheritance/BaseClassWithPartialDefinitionOfDataProviderInTestMethod.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,13 @@ +package test.dataprovider.issue1691.withinheritance; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class BaseClassWithPartialDefinitionOfDataProviderInTestMethod { + + @Test(dataProvider = "hangoutPlaces") + public void verifyHangoutPlaces(String place, String city) { + Assert.assertNotNull(place); + Assert.assertNotNull(city); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue1691/withinheritance/ChildClassHasFullDefinitionOfDataProviderAtClassLevel.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1691/withinheritance/ChildClassHasFullDefinitionOfDataProviderAtClassLevel.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue1691/withinheritance/ChildClassHasFullDefinitionOfDataProviderAtClassLevel.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1691/withinheritance/ChildClassHasFullDefinitionOfDataProviderAtClassLevel.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ +package test.dataprovider.issue1691.withinheritance; + +import org.testng.annotations.Test; +import test.dataprovider.issue1691.SampleDataProvider; + +@Test(dataProviderClass = SampleDataProvider.class, dataProvider = "busyMalls") +public class ChildClassHasFullDefinitionOfDataProviderAtClassLevel + extends BaseClassWithFullDefinitionOfDataProviderInTestMethod {} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue1691/withinheritance/ChildClassHasPartialDefinitionOfDataProviderAtClassLevel.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1691/withinheritance/ChildClassHasPartialDefinitionOfDataProviderAtClassLevel.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue1691/withinheritance/ChildClassHasPartialDefinitionOfDataProviderAtClassLevel.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1691/withinheritance/ChildClassHasPartialDefinitionOfDataProviderAtClassLevel.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ +package test.dataprovider.issue1691.withinheritance; + +import org.testng.annotations.Test; +import test.dataprovider.issue1691.SampleDataProvider; + +@Test(dataProviderClass = SampleDataProvider.class) +public class ChildClassHasPartialDefinitionOfDataProviderAtClassLevel + extends BaseClassWithPartialDefinitionOfDataProviderInTestMethod {} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue1691/withinheritance/ChildClassWithNoDataProviderInformationInTestMethod.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1691/withinheritance/ChildClassWithNoDataProviderInformationInTestMethod.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue1691/withinheritance/ChildClassWithNoDataProviderInformationInTestMethod.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1691/withinheritance/ChildClassWithNoDataProviderInformationInTestMethod.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.dataprovider.issue1691.withinheritance; + +import org.testng.Assert; + +public class ChildClassWithNoDataProviderInformationInTestMethod + extends BaseClassWithFullDefinitionOfDataProviderInClassLevel { + + public void verifyHangoutPlaces(String place, String city) { + Assert.assertNotNull(place); + Assert.assertNotNull(city); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue1987/BaseClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1987/BaseClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue1987/BaseClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1987/BaseClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.dataprovider.issue1987; + +import org.testng.annotations.DataProvider; + +public class BaseClassSample { + + @DataProvider(name = "dp") + public Object[][] getData() { + return new Object[][] {{1}, {2}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue1987/DataProviderInBaseClass.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1987/DataProviderInBaseClass.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue1987/DataProviderInBaseClass.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1987/DataProviderInBaseClass.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.dataprovider.issue1987; + +import org.testng.annotations.Test; + +public class DataProviderInBaseClass extends BaseClassSample { + + @Test(dataProvider = "dp") + public void testMethod(int i) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue1987/DataProviderInDifferentClass.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1987/DataProviderInDifferentClass.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue1987/DataProviderInDifferentClass.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1987/DataProviderInDifferentClass.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.dataprovider.issue1987; + +import org.testng.annotations.Test; + +public class DataProviderInDifferentClass { + + @Test(dataProvider = "dp", dataProviderClass = BaseClassSample.class) + public void testMethod(int i) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue1987/DataProviderInSameClass.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1987/DataProviderInSameClass.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue1987/DataProviderInSameClass.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1987/DataProviderInSameClass.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.dataprovider.issue1987; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class DataProviderInSameClass { + + @Test(dataProvider = "dp") + public void testMethod(int i) {} + + @DataProvider(name = "dp") + public Object[][] getData() { + return new Object[][] {{1}, {2}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue1987/DataProviderTrackingListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1987/DataProviderTrackingListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue1987/DataProviderTrackingListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1987/DataProviderTrackingListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package test.dataprovider.issue1987; + +import org.testng.ITestListener; +import org.testng.ITestResult; + +public class DataProviderTrackingListener implements ITestListener { + private ITestResult result; + + @Override + public void onTestStart(ITestResult result) { + this.result = result; + } + + public ITestResult getResult() { + return result; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue1987/IssueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1987/IssueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue1987/IssueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue1987/IssueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,39 @@ +package test.dataprovider.issue1987; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.IDataProviderMethod; +import org.testng.ITestNGMethod; +import org.testng.TestNG; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class IssueTest extends SimpleBaseTest { + + @Test(dataProvider = "testData", description = "GITHUB-1987") + public void extractDataProviderInfoWhenDpResidesInSameClass( + Class clazz, boolean performInstanceCheck, Class dataProviderClass) { + TestNG testng = create(clazz); + DataProviderTrackingListener listener = new DataProviderTrackingListener(); + testng.addListener(listener); + testng.run(); + ITestNGMethod method = listener.getResult().getMethod(); + IDataProviderMethod dpm = method.getDataProviderMethod(); + assertThat(dpm).isNotNull(); + if (performInstanceCheck) { + assertThat(dpm.getInstance()).isEqualTo(method.getInstance()); + } + assertThat(dpm.getMethod().getName()).isEqualTo("getData"); + assertThat(dpm.getInstance().getClass()).isEqualTo(dataProviderClass); + } + + @DataProvider(name = "testData") + public Object[][] getTestData() { + return new Object[][] { + {DataProviderInSameClass.class, true, DataProviderInSameClass.class}, + {DataProviderInBaseClass.class, true, DataProviderInBaseClass.class}, + {DataProviderInDifferentClass.class, false, BaseClassSample.class} + }; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue2111/CountingListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2111/CountingListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue2111/CountingListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2111/CountingListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.dataprovider.issue2111; + +import java.util.List; +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.ITestResult; +import org.testng.collections.Lists; + +public class CountingListener implements IInvokedMethodListener { + private List results = Lists.newArrayList(); + + @Override + public void afterInvocation(IInvokedMethod method, ITestResult testResult) { + results.add(testResult); + } + + public List getResults() { + return results; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue2111/DataProviderHouse.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2111/DataProviderHouse.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue2111/DataProviderHouse.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2111/DataProviderHouse.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.dataprovider.issue2111; + +import org.testng.annotations.DataProvider; + +public class DataProviderHouse { + + @DataProvider + public static Object[][] getData() { + return new Object[][] {{1}, {2}, {3}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue2111/LocalDataProviderInterceptor.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2111/LocalDataProviderInterceptor.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue2111/LocalDataProviderInterceptor.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2111/LocalDataProviderInterceptor.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +package test.dataprovider.issue2111; + +import java.util.Iterator; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.StreamSupport; +import org.testng.IDataProviderInterceptor; +import org.testng.IDataProviderMethod; +import org.testng.ITestContext; +import org.testng.ITestNGMethod; + +public class LocalDataProviderInterceptor implements IDataProviderInterceptor { + + @Override + public Iterator intercept( + Iterator original, + IDataProviderMethod dataProviderMethod, + ITestNGMethod method, + ITestContext iTestContext) { + Iterable iterable = () -> original; + List list = + StreamSupport.stream(iterable.spliterator(), false).collect(Collectors.toList()); + list.remove(0); + list.remove(1); + return list.iterator(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue2111/TestClassExample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2111/TestClassExample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue2111/TestClassExample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2111/TestClassExample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.dataprovider.issue2111; + +import org.testng.annotations.Test; + +public class TestClassExample { + + @Test(dataProvider = "getData", dataProviderClass = DataProviderHouse.class) + public void test(int i) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue2111/TestClassExamplePoweredByFactory.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2111/TestClassExamplePoweredByFactory.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue2111/TestClassExamplePoweredByFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2111/TestClassExamplePoweredByFactory.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,13 @@ +package test.dataprovider.issue2111; + +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +public class TestClassExamplePoweredByFactory { + + @Factory(dataProvider = "getData", dataProviderClass = DataProviderHouse.class) + public TestClassExamplePoweredByFactory(int i) {} + + @Test + public void test() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue2111/TestClassExamplePoweredByFactoryUsingListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2111/TestClassExamplePoweredByFactoryUsingListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue2111/TestClassExamplePoweredByFactoryUsingListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2111/TestClassExamplePoweredByFactoryUsingListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.dataprovider.issue2111; + +import org.testng.annotations.Factory; +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +@Listeners({LocalDataProviderInterceptor.class}) +public class TestClassExamplePoweredByFactoryUsingListener { + + @Factory(dataProvider = "getData", dataProviderClass = DataProviderHouse.class) + public TestClassExamplePoweredByFactoryUsingListener(int i) {} + + @Test + public void test() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue2111/TestClassSampleUsingListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2111/TestClassSampleUsingListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue2111/TestClassSampleUsingListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2111/TestClassSampleUsingListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.dataprovider.issue2111; + +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +@Listeners({LocalDataProviderInterceptor.class}) +public class TestClassSampleUsingListener { + + @Test(dataProvider = "getData", dataProviderClass = DataProviderHouse.class) + public void test(int i) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue2157/TestClassWithDataProviderThatThrowsExceptions.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2157/TestClassWithDataProviderThatThrowsExceptions.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue2157/TestClassWithDataProviderThatThrowsExceptions.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2157/TestClassWithDataProviderThatThrowsExceptions.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,49 @@ +package test.dataprovider.issue2157; + +import java.util.concurrent.atomic.AtomicInteger; +import org.testng.Assert; +import org.testng.IRetryAnalyzer; +import org.testng.ITestResult; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class TestClassWithDataProviderThatThrowsExceptions { + + @Test(dataProvider = "dp", retryAnalyzer = SimplyRetry.class) + public void testMethod(String i) { + if ("First".equalsIgnoreCase(i) || "Second".equalsIgnoreCase(i)) { + Assert.fail(); + } + } + + private static AtomicInteger counter = new AtomicInteger(); + + @DataProvider(name = "dp") + public static Object[][] dpWithException() { + return new Object[][] { + {foo()}, + }; + } + + private static String foo() { + counter.getAndIncrement(); + + if (counter.get() == 1) { + return "First"; + } + if (counter.get() == 2) { + return "Second"; + } + throw new RuntimeException("TestNG doesn't handle an exception"); + } + + public static class SimplyRetry implements IRetryAnalyzer { + + private static int attempts = 1; + + @Override + public boolean retry(ITestResult result) { + return attempts++ != 3; + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue217/IssueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue217/IssueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue217/IssueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue217/IssueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.dataprovider.issue217; + +import org.testng.TestNG; +import org.testng.TestNGException; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class IssueTest extends SimpleBaseTest { + + @Test(description = "GITHUB-217", expectedExceptions = TestNGException.class) + public void ensureTestNGThrowsExceptionWhenAllTestsAreSkipped() { + TestNG testng = create(SampleTestCase.class); + testng.toggleFailureIfAllTestsWereSkipped(true); + testng.run(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue217/SampleTestCase.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue217/SampleTestCase.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue217/SampleTestCase.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue217/SampleTestCase.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.dataprovider.issue217; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class SampleTestCase { + public static final String DP_NAME = "dataProvider"; + + @DataProvider(name = DP_NAME) + public static Object[][] getData() { + throw new IllegalStateException("guess me!"); + } + + @Test(dataProvider = DP_NAME) + public void test() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue2255/IssueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2255/IssueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue2255/IssueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2255/IssueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package test.dataprovider.issue2255; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class IssueTest extends SimpleBaseTest { + + @Test(description = "GITHUB-2255") + public void runTest() { + TestNG testNG = create(SampleTestCase.class); + testNG.run(); + assertThat(SampleTestCase.data).containsExactly(100, 200); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue2255/SampleTestCase.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2255/SampleTestCase.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue2255/SampleTestCase.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2255/SampleTestCase.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,41 @@ +package test.dataprovider.issue2255; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; +import org.testng.ITestResult; +import org.testng.Reporter; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class SampleTestCase extends SimpleBaseTest { + + static final List data = new ArrayList<>(); + private static final AtomicInteger counter = new AtomicInteger(0); + + @BeforeMethod + public void beforeMethod(ITestResult result) { + Object[] parameters = result.getParameters(); + if (parameters == null || parameters.length == 0) { + throw new IllegalStateException("parameters aren't visible"); + } + data.add((Integer) parameters[0]); + } + + @Test(dataProvider = "dp") + public void testMethod(int i) { + int index = counter.getAndIncrement(); + assertThat(i).isEqualTo(data.get(index)); + Integer value = (Integer) Reporter.getCurrentTestResult().getParameters()[0]; + assertThat(value).isEqualTo(data.get(index)); + } + + @DataProvider(name = "dp") + public Object[][] getData() { + return new Object[][] {{100}, {200}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue2267/CustomListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2267/CustomListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue2267/CustomListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2267/CustomListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,25 @@ +package test.dataprovider.issue2267; + +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.IRetryAnalyzer; +import org.testng.ITestResult; +import org.testng.internal.annotations.DisabledRetryAnalyzer; +import test.dataprovider.DataProviderRetryAnalyzer; + +public class CustomListener implements IInvokedMethodListener { + + @Override + public void beforeInvocation(IInvokedMethod method, ITestResult testResult) { + + if (method.isTestMethod()) { + + final IRetryAnalyzer currentRetryAnalyzer = + method.getTestMethod().getRetryAnalyzer(testResult); + + if (currentRetryAnalyzer == null || currentRetryAnalyzer instanceof DisabledRetryAnalyzer) { + method.getTestMethod().setRetryAnalyzerClass(DataProviderRetryAnalyzer.class); + } + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue2267/IssueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2267/IssueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue2267/IssueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2267/IssueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,21 @@ +package test.dataprovider.issue2267; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class IssueTest extends SimpleBaseTest { + + @Test(description = "GITHUB-2267") + public void runTest() { + TestNG testng = create(SampleTestCase.class); + TestListenerAdapter tla = new TestListenerAdapter(); + testng.addListener(tla); + testng.run(); + assertThat(tla.getFailedTests()).size().isEqualTo(1); + assertThat(tla.getSkippedTests()).size().isEqualTo(1); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue2267/SampleTestCase.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2267/SampleTestCase.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue2267/SampleTestCase.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2267/SampleTestCase.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package test.dataprovider.issue2267; + +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +@Listeners(CustomListener.class) +public class SampleTestCase extends SimpleBaseTest { + + @DataProvider(name = "dp") + public Object[][] dp() { + return new Object[][] { + {1}, + }; + } + + @Test(dataProvider = "dp") + public void testWithRetryAndDataProvider(int testNumber) { + Assert.fail("This time test FAIL! with testNumber: " + testNumber); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue2327/IssueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2327/IssueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue2327/IssueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2327/IssueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,26 @@ +package test.dataprovider.issue2327; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.ITestResult; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class IssueTest extends SimpleBaseTest { + + @Test(description = "GITHUB-2327") + public void runTest() { + TestNG testng = create(SampleTestCase.class); + TestListenerAdapter tla = new TestListenerAdapter(); + testng.addListener(tla); + testng.run(); + + assertThat(tla.getSkippedTests().size()).isEqualTo(2); + + for (ITestResult skippedTest : tla.getSkippedTests()) { + assertThat(skippedTest.getParameters()).isNotEmpty(); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue2327/SampleTestCase.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2327/SampleTestCase.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue2327/SampleTestCase.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2327/SampleTestCase.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +package test.dataprovider.issue2327; + +import java.lang.reflect.Method; +import java.util.Iterator; +import java.util.LinkedList; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class SampleTestCase { + + @BeforeMethod(alwaysRun = true) + public void setup(Method method, Object[] params) { + throw new RuntimeException("setup fail."); + } + + @DataProvider(name = "dp", parallel = true) + public Iterator dp() { + LinkedList objects = new LinkedList<>(); + objects.add("Dataset1"); + objects.add("Dataset2"); + return objects.iterator(); + } + + @Test(dataProvider = "dp") + public void test(String dataset) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue2504/IssueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2504/IssueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue2504/IssueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2504/IssueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,25 @@ +package test.dataprovider.issue2504; + +import java.util.Arrays; +import java.util.Collections; +import org.assertj.core.api.Assertions; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlClass; +import org.testng.xml.XmlTest; +import test.SimpleBaseTest; + +public class IssueTest extends SimpleBaseTest { + + @Test(description = "GITHUB-2504") + public void ensureParametersCopiedOnConfigFailures() { + XmlTest xmltest = createXmlTest("2504_suite", "2504_test"); + xmltest.setXmlClasses(Collections.singletonList(new XmlClass(SampleTestCase.class))); + TestNG testNG = create(Collections.singletonList(xmltest.getSuite())); + SampleTestCaseListener listener = new SampleTestCaseListener(); + testNG.addListener(listener); + testNG.run(); + Assertions.assertThat(listener.getParameters()) + .containsExactlyElementsOf(Arrays.asList(1, 2, 3, 4, 5)); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue2504/SampleTestCase.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2504/SampleTestCase.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue2504/SampleTestCase.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2504/SampleTestCase.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,26 @@ +package test.dataprovider.issue2504; + +import org.testng.Assert; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class SampleTestCase { + + @DataProvider + public Object[][] data() { + return new Object[][] { + new Object[] {1}, new Object[] {2}, new Object[] {3}, new Object[] {4}, new Object[] {5} + }; + } + + @BeforeMethod + public void myBeforeMethod() { + throw new RuntimeException("my exception"); + } + + @Test(dataProvider = "data") + void testSuccess(int i) { + Assert.assertTrue(true); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue2504/SampleTestCaseListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2504/SampleTestCaseListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue2504/SampleTestCaseListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2504/SampleTestCaseListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,24 @@ +package test.dataprovider.issue2504; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.testng.ITestListener; +import org.testng.ITestResult; + +public class SampleTestCaseListener implements ITestListener { + + private final List parameters = new ArrayList<>(); + + @Override + public void onTestStart(ITestResult result) { + parameters.addAll( + Arrays.stream(result.getParameters()) + .mapToInt(each -> (int) each) + .collect(ArrayList::new, ArrayList::add, ArrayList::addAll)); + } + + public List getParameters() { + return parameters; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue2565/Data.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2565/Data.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue2565/Data.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2565/Data.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,22 @@ +package test.dataprovider.issue2565; + +import java.util.ArrayList; +import java.util.List; + +public enum Data { + INSTANCE; + + private final List data = new ArrayList<>(); + + public void addDatum(String datum) { + data.add(datum); + } + + public List getData() { + return data; + } + + public void clear() { + data.clear(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue2565/SampleTestUsingConsumer.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2565/SampleTestUsingConsumer.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue2565/SampleTestUsingConsumer.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2565/SampleTestUsingConsumer.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package test.dataprovider.issue2565; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.function.Consumer; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class SampleTestUsingConsumer { + + @Test(dataProvider = "dp") + public void testMethod(Consumer data) { + data.accept("StarScream"); + } + + @DataProvider(name = "dp") + public Iterator> data() { + List> obj = new ArrayList<>(); + obj.add(Data.INSTANCE::addDatum); + return obj.iterator(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue2565/SampleTestUsingFunction.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2565/SampleTestUsingFunction.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue2565/SampleTestUsingFunction.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2565/SampleTestUsingFunction.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,28 @@ +package test.dataprovider.issue2565; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Locale; +import java.util.function.Function; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class SampleTestUsingFunction { + + @Test(dataProvider = "dp") + public void testMethod(Function data) { + data.apply("Bumble_Bee"); + } + + @DataProvider(name = "dp") + public Iterator> data() { + List> obj = new ArrayList<>(); + obj.add( + text -> { + Data.INSTANCE.addDatum(text); + return text.toUpperCase(Locale.ROOT); + }); + return obj.iterator(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue2565/SampleTestUsingPredicate.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2565/SampleTestUsingPredicate.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue2565/SampleTestUsingPredicate.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2565/SampleTestUsingPredicate.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +package test.dataprovider.issue2565; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.function.Predicate; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class SampleTestUsingPredicate { + + @Test(dataProvider = "dp") + public void testMethod(Predicate data) { + data.test("IronHide"); + } + + @DataProvider(name = "dp") + public Iterator> data() { + List> obj = new ArrayList<>(); + obj.add( + text -> { + Data.INSTANCE.addDatum(text); + return true; + }); + return obj.iterator(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue2565/SampleTestUsingSupplier.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2565/SampleTestUsingSupplier.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dataprovider/issue2565/SampleTestUsingSupplier.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dataprovider/issue2565/SampleTestUsingSupplier.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,24 @@ +package test.dataprovider.issue2565; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.function.Supplier; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class SampleTestUsingSupplier { + + @Test(dataProvider = "dp") + public void testMethod(Supplier data) { + Data.INSTANCE.addDatum(data.get()); + } + + @DataProvider(name = "dp") + public Iterator> data() { + List> obj = new ArrayList<>(); + obj.add(() -> "Optimus_Prime"); + obj.add(() -> "Megatron"); + return obj.iterator(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/defaultmethods/DefaultMethodTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/defaultmethods/DefaultMethodTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/defaultmethods/DefaultMethodTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/defaultmethods/DefaultMethodTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,93 @@ +package test.defaultmethods; + +import org.testng.Assert; +import org.testng.ITestClass; +import org.testng.ITestNGMethod; +import org.testng.TestNG; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import test.SimpleBaseTest; +import test.listeners.TestAndClassListener; + +public class DefaultMethodTest extends SimpleBaseTest { + + @DataProvider + public Object[][] classes() { + return new Object[][] { + new Object[] {TestA.class}, new Object[] {TestB.class}, new Object[] {TestC.class} + }; + } + + @Test( + description = "Test default methods defined in an interface should be run", + dataProvider = "classes") + public void testDefaultShouldRun(Class clazz) { + ITestClass testClass = runTestWithDefaultMethods(clazz); + + ITestNGMethod[] testMethods = testClass.getTestMethods(); + Assert.assertEquals(testMethods.length, 1); + Assert.assertEquals(testMethods[0].getMethodName(), "defaultMethodTest"); + } + + @Test( + description = "Before class default methods defined in an interface should be run", + dataProvider = "classes") + public void beforeClassDefaultShouldRun(Class clazz) { + ITestClass testClass = runTestWithDefaultMethods(clazz); + + ITestNGMethod[] beforeClassMethods = testClass.getBeforeClassMethods(); + Assert.assertEquals(beforeClassMethods.length, 1); + Assert.assertEquals(beforeClassMethods[0].getMethodName(), "beforeClassRun"); + } + + @Test( + description = "After class default methods defined in an interface should be run", + dataProvider = "classes") + public void afterClassDefaultShouldRun(Class clazz) { + ITestClass testClass = runTestWithDefaultMethods(clazz); + + ITestNGMethod[] afterClassMethods = testClass.getAfterClassMethods(); + Assert.assertEquals(afterClassMethods.length, 1); + Assert.assertEquals(afterClassMethods[0].getMethodName(), "afterClassRun"); + } + + @Test( + description = "Before method default methods defined in an interface should be run", + dataProvider = "classes") + public void beforeMethodDefaultShouldRun(Class clazz) { + final ITestClass testClass = runTestWithDefaultMethods(clazz); + + ITestNGMethod[] beforeMethods = testClass.getBeforeTestMethods(); + Assert.assertEquals(beforeMethods.length, 1); + Assert.assertEquals(beforeMethods[0].getMethodName(), "beforeMethodRun"); + } + + @Test( + description = "After method default methods defined in an interface should be run", + dataProvider = "classes") + public void afterMethodDefaultShouldRun(Class clazz) { + final ITestClass testClass = runTestWithDefaultMethods(clazz); + + ITestNGMethod[] afterMethods = testClass.getAfterTestMethods(); + Assert.assertEquals(afterMethods.length, 1); + Assert.assertEquals(afterMethods[0].getMethodName(), "afterMethodRun"); + } + + private ITestClass runTestWithDefaultMethods(Class clazz) { + TestNG tng = create(clazz); + TestClassListener listener = new TestClassListener(); + tng.addListener(listener); + tng.run(); + return listener.testClass; + } + + public static class TestClassListener extends TestAndClassListener { + + private ITestClass testClass; + + @Override + public void onBeforeClass(ITestClass testClass) { + this.testClass = testClass; + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/defaultmethods/InterfaceA.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/defaultmethods/InterfaceA.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/defaultmethods/InterfaceA.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/defaultmethods/InterfaceA.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,25 @@ +package test.defaultmethods; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public interface InterfaceA { + + @Test + default void defaultMethodTest() {} + + @BeforeClass + default void beforeClassRun() {} + + @AfterClass + default void afterClassRun() {} + + @BeforeMethod + default void beforeMethodRun() {} + + @AfterMethod + default void afterMethodRun() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/defaultmethods/TestA.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/defaultmethods/TestA.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/defaultmethods/TestA.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/defaultmethods/TestA.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,3 @@ +package test.defaultmethods; + +public class TestA implements InterfaceA {} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/defaultmethods/TestB.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/defaultmethods/TestB.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/defaultmethods/TestB.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/defaultmethods/TestB.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,3 @@ +package test.defaultmethods; + +public class TestB extends TestA {} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/defaultmethods/TestC.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/defaultmethods/TestC.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/defaultmethods/TestC.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/defaultmethods/TestC.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,3 @@ +package test.defaultmethods; + +public class TestC extends TestA implements InterfaceA {} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/BaseOrderMethodTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/BaseOrderMethodTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/BaseOrderMethodTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/BaseOrderMethodTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,42 @@ +package test.dependent; + +import org.testng.annotations.Test; + +/** + * This class + * + * @author Cedric Beust, Aug 20, 2004 + */ +public class BaseOrderMethodTest { + protected boolean[] m_group1 = {false, false}; + protected boolean[] m_group2 = {false, false}; + protected boolean[] m_group3 = {false}; + + @Test( + groups = {"2.0"}, + dependsOnGroups = {"1.0", "1.1"}) + public void a_second0() { + verifyGroup(2, m_group1); + m_group2[0] = true; + } + + @Test( + groups = {"3"}, + dependsOnGroups = {"2.0", "2.1"}) + public void third0() { + verifyGroup(3, m_group2); + m_group3[0] = true; + } + + protected void verifyGroup(int groupNumber, boolean[] group) { + for (int i = 0; i < group.length; i++) { + assert group[i] + : "Error while running group " + + groupNumber + + ": " + + " index " + + i + + " of previous group should have been run before."; + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/C1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/C1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/C1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/C1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,13 @@ +package test.dependent; + +import static org.testng.Assert.fail; + +import org.testng.annotations.Test; + +@Test(groups = "group1") +public class C1 { + + public void failingTest() { + fail("always fails"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/C2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/C2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/C2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/C2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package test.dependent; + +import org.testng.annotations.Test; + +@Test( + groups = {"group2"}, + dependsOnGroups = {"group1"}) +public class C2 { + + public void shouldBeSkipped() { + // the expectation is that this test will be SKIPPED because + // a test in group1 failed and we have a dependsOnGroups={"group1"} + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/ClassDependsOnGroups.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/ClassDependsOnGroups.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/ClassDependsOnGroups.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/ClassDependsOnGroups.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,30 @@ +package test.dependent; + +import org.testng.annotations.Test; +import test.BaseTest; + +public class ClassDependsOnGroups extends BaseTest { + @Test + public void verifyDependsOnGroups() { + addClass(test.dependent.DifferentClassDependsOnGroupsTest1.class.getName()); + addClass(test.dependent.DifferentClassDependsOnGroupsTest2.class.getName()); + + run(); + String[] failed = {"test0"}; + String[] skipped = {"test1", "test2"}; + verifyTests("Failed", failed, getFailedTests()); + verifyTests("Skipped", skipped, getSkippedTests()); + } + + @Test + public void verifyGroupsAcrossClasses() { + addClass(test.dependent.C1.class.getName()); + addClass(test.dependent.C2.class.getName()); + + run(); + String[] failed = {"failingTest"}; + String[] skipped = {"shouldBeSkipped"}; + verifyTests("Failed", failed, getFailedTests()); + verifyTests("Skipped", skipped, getSkippedTests()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/ClassWide1Test.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/ClassWide1Test.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/ClassWide1Test.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/ClassWide1Test.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,22 @@ +package test.dependent; + +import org.testng.annotations.BeforeTest; +import org.testng.annotations.Test; + +public class ClassWide1Test { + private static boolean m_ok = false; + + @BeforeTest + public void init() { + m_ok = false; + } + + @Test + public void m1() { + m_ok = true; + } + + public static boolean m1WasRun() { + return m_ok; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/ClassWide2Test.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/ClassWide2Test.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/ClassWide2Test.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/ClassWide2Test.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.dependent; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class ClassWide2Test { + + @Test(dependsOnMethods = {"test.dependent.ClassWide1Test.m1"}) + public void m2() { + Assert.assertTrue(ClassWide1Test.m1WasRun()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/DepBugSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/DepBugSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/DepBugSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/DepBugSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,39 @@ +package test.dependent; + +import java.util.ArrayList; +import java.util.List; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +@Test +public class DepBugSampleTest { + private static final List m_log = new ArrayList<>(); + + private static void log(String s) { + m_log.add(s); + } + + public static List getLog() { + return m_log; + } + + @BeforeClass + public void setup() { + log("setup"); + } + + @AfterClass + public void destroy() { + log("destroy"); + } + + @Test(dependsOnMethods = "send") + public void get() { + log("get"); + } + + public void send() { + log("send"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/DepBugVerifyTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/DepBugVerifyTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/DepBugVerifyTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/DepBugVerifyTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package test.dependent; + +import java.util.List; +import org.testng.Assert; +import org.testng.annotations.Test; + +public class DepBugVerifyTest { + + @Test + public void verify() { + List log = DepBugSampleTest.getLog(); + String[] expected = new String[] {"setup", "send", "get", "destroy"}; + for (int i = 0; i < log.size(); i++) { + Assert.assertEquals(expected[i], log.get(i)); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/DependencyFixTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/DependencyFixTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/DependencyFixTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/DependencyFixTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,25 @@ +package test.dependent; + +import static org.testng.Assert.assertTrue; + +import org.testng.annotations.Test; + +public class DependencyFixTest { + @Test(dependsOnMethods = "helloWorld", ignoreMissingDependencies = true) + public void dependentOnNonExistingMethod() { + assertTrue(true); + } + + @Test(dependsOnMethods = "dependentOnNonExistingMethod") + public void dependentOnExistingMethod() { + assertTrue(true); + } + + @Test( + groups = "selfSufficient", + dependsOnGroups = "nonExistingGroup", + ignoreMissingDependencies = true) + public void dependentOnNonExistingGroup() { + assertTrue(true); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/DependentAlwaysRunTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/DependentAlwaysRunTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/DependentAlwaysRunTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/DependentAlwaysRunTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,45 @@ +package test.dependent; + +import org.testng.annotations.Test; +import test.BaseTest; + +public class DependentAlwaysRunTest extends BaseTest { + @Test + public void verifyDependsOnMethodsAlwaysRun() { + addClass("test.dependent.DependentOnMethod1AlwaysRunSampleTest"); + + run(); + String[] passed = {"b", "verify"}; + String[] failed = {"a"}; + String[] skipped = {}; + verifyTests("Failed", failed, getFailedTests()); + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Skipped", skipped, getSkippedTests()); + } + + @Test + public void verifyDependsOnGroups1AlwaysRun() { + addClass("test.dependent.DependentOnGroup1AlwaysRunSampleTest"); + + run(); + String[] passed = {"b", "verify"}; + String[] failed = {"a"}; + String[] skipped = {}; + verifyTests("Failed", failed, getFailedTests()); + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Skipped", skipped, getSkippedTests()); + } + + @Test + public void verifyDependsOnGroups2AlwaysRun() { + addClass("test.dependent.DependentOnGroup2AlwaysRunSampleTest"); + + run(); + String[] passed = {"a2", "b", "verify"}; + String[] failed = {"a"}; + String[] skipped = {}; + verifyTests("Failed", failed, getFailedTests()); + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Skipped", skipped, getSkippedTests()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/DependentOnGroup1AlwaysRunSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/DependentOnGroup1AlwaysRunSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/DependentOnGroup1AlwaysRunSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/DependentOnGroup1AlwaysRunSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,31 @@ +package test.dependent; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/** + * a will fail but b should run anyway because of alwaysRun=true + * + * @author cbeust + */ +public class DependentOnGroup1AlwaysRunSampleTest { + + private boolean m_ok = false; + + @Test(groups = {"group-a"}) + public void a() { + throw new RuntimeException("Voluntary failure"); + } + + @Test( + dependsOnGroups = {"group-a"}, + alwaysRun = true) + public void b() { + m_ok = true; + } + + @Test(dependsOnMethods = {"b"}) + public void verify() { + Assert.assertTrue(m_ok, "method b() should have been invoked"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/DependentOnGroup2AlwaysRunSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/DependentOnGroup2AlwaysRunSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/DependentOnGroup2AlwaysRunSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/DependentOnGroup2AlwaysRunSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,34 @@ +package test.dependent; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/** + * a will fail but b should run anyway because of alwaysRun=true + * + * @author cbeust + */ +public class DependentOnGroup2AlwaysRunSampleTest { + + private boolean m_ok = false; + + @Test(groups = {"group-a"}) + public void a() { + throw new RuntimeException("Voluntary failure"); + } + + @Test(groups = {"group-a"}) + public void a2() {} + + @Test( + dependsOnGroups = {"group-a"}, + alwaysRun = true) + public void b() { + m_ok = true; + } + + @Test(dependsOnMethods = {"b"}) + public void verify() { + Assert.assertTrue(m_ok, "method b() should have been invoked"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/DependentOnMethod1AlwaysRunSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/DependentOnMethod1AlwaysRunSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/DependentOnMethod1AlwaysRunSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/DependentOnMethod1AlwaysRunSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,31 @@ +package test.dependent; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/** + * a will fail but b should run anyway because of alwaysRun=true + * + * @author cbeust + */ +public class DependentOnMethod1AlwaysRunSampleTest { + + private boolean m_ok = false; + + @Test + public void a() { + throw new RuntimeException("Voluntary failure"); + } + + @Test( + dependsOnMethods = {"a"}, + alwaysRun = true) + public void b() { + m_ok = true; + } + + @Test(dependsOnMethods = {"b"}) + public void verify() { + Assert.assertTrue(m_ok, "method b() should have been invoked"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/DependentTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/DependentTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/DependentTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/DependentTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,230 @@ +package test.dependent; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Arrays; +import java.util.List; +import org.testng.Assert; +import org.testng.TestNG; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite.ParallelMode; +import test.BaseTest; +import test.InvokedMethodNameListener; +import test.SimpleBaseTest; +import test.dependent.github1156.ASample; +import test.dependent.github1156.BSample; +import test.dependent.github1380.GitHub1380Sample; +import test.dependent.github1380.GitHub1380Sample2; +import test.dependent.github1380.GitHub1380Sample3; +import test.dependent.github1380.GitHub1380Sample4; + +public class DependentTest extends BaseTest { + + @Test + public void simpleSkip() { + addClass(SampleDependent1.class.getName()); + run(); + String[] passed = {}; + String[] failed = {"fail"}; + String[] skipped = {"shouldBeSkipped"}; + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Failed", failed, getFailedTests()); + verifyTests("Skipped", skipped, getSkippedTests()); + } + + @Test + public void dependentMethods() { + addClass(SampleDependentMethods.class.getName()); + run(); + String[] passed = {"oneA", "oneB", "secondA", "thirdA", "canBeRunAnytime"}; + String[] failed = {}; + String[] skipped = {}; + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Failed", failed, getFailedTests()); + verifyTests("Skipped", skipped, getSkippedTests()); + } + + @Test + public void dependentMethodsWithSkip() { + addClass(SampleDependentMethods4.class.getName()); + run(); + String[] passed = { + "step1", + }; + String[] failed = { + "step2", + }; + String[] skipped = {"step3"}; + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Failed", failed, getFailedTests()); + verifyTests("Skipped", skipped, getSkippedTests()); + } + + @Test(expectedExceptions = {org.testng.TestNGException.class}) + public void dependentMethodsWithNonExistentMethod() { + addClass(SampleDependentMethods5.class.getName()); + run(); + String[] passed = {"step1", "step2"}; + String[] failed = {}; + String[] skipped = {}; + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Failed", failed, getFailedTests()); + verifyTests("Skipped", skipped, getSkippedTests()); + } + + @Test(expectedExceptions = org.testng.TestNGException.class) + public void dependentMethodsWithCycle() { + addClass(SampleDependentMethods6.class.getName()); + run(); + } + + @Test(expectedExceptions = org.testng.TestNGException.class) + public void dependentGroupsWithCycle() { + addClass("test.dependent.SampleDependentMethods7"); + run(); + } + + @Test + public void multipleSkips() { + addClass(MultipleDependentSampleTest.class.getName()); + run(); + String[] passed = { + "init", + }; + String[] failed = { + "fail", + }; + String[] skipped = {"skip1", "skip2"}; + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Failed", failed, getFailedTests()); + verifyTests("Skipped", skipped, getSkippedTests()); + } + + @Test + public void instanceDependencies() { + addClass(InstanceSkipSampleTest.class.getName()); + run(); + verifyInstanceNames(getPassedTests(), new String[] {"f#1", "f#3", "g#1", "g#3"}); + verifyInstanceNames(getFailedTests(), new String[] {"f#2"}); + verifyInstanceNames(getSkippedTests(), new String[] {"g#2"}); + } + + @Test + public void dependentWithDataProvider() { + TestNG tng = SimpleBaseTest.create(DependentWithDataProviderSampleTest.class); + tng.setGroupByInstances(true); + List log = DependentWithDataProviderSampleTest.m_log; + log.clear(); + tng.run(); + for (int i = 0; i < 12; i += 4) { + String[] s = log.get(i).split("#"); + String instance = s[1]; + Assert.assertEquals(log.get(i), "prepare#" + instance); + Assert.assertEquals(log.get(i + 1), "test1#" + instance); + Assert.assertEquals(log.get(i + 2), "test2#" + instance); + Assert.assertEquals(log.get(i + 3), "clean#" + instance); + } + } + + @DataProvider + public static Object[][] dp() { + return new Object[][] { + {new Class[] {ASample.class, BSample.class}, true}, + {new Class[] {ASample.class, BSample.class}, false}, + {new Class[] {BSample.class, ASample.class}, true}, + {new Class[] {BSample.class, ASample.class}, false} + }; + } + + @Test(dataProvider = "dp", description = "GITHUB-1156") + public void methodDependencyBetweenClassesShouldWork(Class[] classes, boolean preserveOrder) { + TestNG tng = SimpleBaseTest.create(classes); + tng.setPreserveOrder(preserveOrder); + + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener(listener); + + tng.run(); + + assertThat(listener.getSucceedMethodNames()).containsExactly("testB", "testA"); + } + + @DataProvider + public static Object[][] dp1380() { + return new Object[][] { + {GitHub1380Sample.class, new String[] {"testMethodA", "testMethodB", "testMethodC"}}, + {GitHub1380Sample2.class, new String[] {"testMethodC", "testMethodB", "testMethodA"}}, + {GitHub1380Sample3.class, new String[] {"testMethodA", "testMethodB", "testMethodC"}}, + {GitHub1380Sample4.class, new String[] {"testMethodB", "testMethodA", "testMethodC"}}, + }; + } + + @Test(dataProvider = "dp1380", description = "GITHUB-1380") + public void simpleCyclingDependencyShouldWorkWithoutParallelism( + Class testClass, String[] runMethods) { + TestNG tng = SimpleBaseTest.create(testClass); + + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener(listener); + + tng.run(); + + // When not running parallel, invoke order and succeed order are the same. + assertThat(listener.getInvokedMethodNames()).containsExactly(runMethods); + assertThat(listener.getSucceedMethodNames()).containsExactly(runMethods); + } + + @DataProvider + public static Object[][] dp1380Parallel() { + return new Object[][] { + {GitHub1380Sample.class, new String[] {"testMethodA", "testMethodB", "testMethodC"}}, + { + GitHub1380Sample2.class, + // A dependsOn B; C can be anywhere even though B has "sleep 5 sec" + // C is the first + new String[] {"testMethodC", "testMethodB", "testMethodA"}, + // C is the second + new String[] {"testMethodB", "testMethodC", "testMethodA"}, + // C is the third + new String[] {"testMethodB", "testMethodA", "testMethodC"}, + }, + {GitHub1380Sample3.class, new String[] {"testMethodA", "testMethodB", "testMethodC"}}, + { + GitHub1380Sample4.class, + // A dependsOn B; C can be anywhere + // C is the first + new String[] {"testMethodC", "testMethodB", "testMethodA"}, + // C is the second + new String[] {"testMethodB", "testMethodC", "testMethodA"}, + // C is the third + new String[] {"testMethodB", "testMethodA", "testMethodC"}, + }, + }; + } + + @Test(dataProvider = "dp1380Parallel", description = "GITHUB-1380") + public void simpleCyclingDependencyShouldWorkWitParallelism( + Class testClass, String[]... runMethods) { + TestNG tng = SimpleBaseTest.create(testClass); + tng.setParallel(ParallelMode.METHODS); + + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener(listener); + + tng.run(); + + assertThat(listener.getInvokedMethodNames()) + .matches( + strings -> { + boolean result = false; + for (String[] runMethod : runMethods) { + result = result || Arrays.asList(runMethod).equals(strings); + } + return result; + }, + "When running parallel, invoke order is consistent, but succeed order isn't " + + Arrays.deepToString(runMethods)); + assertThat(listener.getSucceedMethodNames()).containsExactlyInAnyOrder(runMethods[0]); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/DependentWithDataProviderSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/DependentWithDataProviderSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/DependentWithDataProviderSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/DependentWithDataProviderSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,55 @@ +package test.dependent; + +import java.util.List; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; +import org.testng.collections.Lists; + +public class DependentWithDataProviderSampleTest { + public static List m_log = Lists.newArrayList(); + private String param; + + @Factory(dataProvider = "prov") + public DependentWithDataProviderSampleTest(String param) { + this.param = param; + } + + @DataProvider(name = "prov") + public static Object[][] dataProvider() { + return new Object[][] { + {"One"}, {"Two"}, {"Three"}, + }; + } + + private void log(String s) { + m_log.add(s + "#" + param); + } + + @BeforeClass + public void prepare() { + log("prepare"); + } + + @Test + public void test1() { + log("test1"); + } + + @Test(dependsOnMethods = "test1") + public void test2() { + log("test2"); + } + + @AfterClass + public void clean() { + log("clean"); + } + + @Override + public String toString() { + return "[" + param + "]"; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/DependsOnProtectedMethodTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/DependsOnProtectedMethodTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/DependsOnProtectedMethodTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/DependsOnProtectedMethodTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +package test.dependent; + +import org.testng.Assert; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +/** This class/interface */ +public class DependsOnProtectedMethodTest { + private boolean m_before1 = false; + private boolean m_before2 = false; + + @BeforeMethod(dependsOnMethods = {"before2"}) + protected void before() { + m_before1 = true; + } + + @BeforeMethod + protected void before2() { + m_before2 = true; + } + + @Test + public void verifyBeforeInvocations() { + Assert.assertTrue( + m_before1 && m_before2, "Protected dependent @BeforeMethods should have been invoked"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/DepthDependencyTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/DepthDependencyTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/DepthDependencyTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/DepthDependencyTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,21 @@ +package test.dependent; + +import org.testng.annotations.Test; + +public class DepthDependencyTest { + + @Test(groups = {"1"}) + public void f1() { + throw new RuntimeException(); + } + + @Test( + groups = {"2"}, + dependsOnGroups = {"1"}) + public void f2() {} + + @Test( + groups = {"3"}, + dependsOnGroups = {"2"}) + public void f3() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/DifferentClassDependsOnGroupsTest1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/DifferentClassDependsOnGroupsTest1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/DifferentClassDependsOnGroupsTest1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/DifferentClassDependsOnGroupsTest1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.dependent; + +import static org.testng.Assert.assertTrue; + +import org.testng.annotations.Test; + +public class DifferentClassDependsOnGroupsTest1 { + @Test(groups = {"mainGroup"}) + public void test0() { + assertTrue(1 == 0); // Force a failure + } + + @Test(dependsOnGroups = {"mainGroup"}) + public void test2() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/DifferentClassDependsOnGroupsTest2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/DifferentClassDependsOnGroupsTest2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/DifferentClassDependsOnGroupsTest2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/DifferentClassDependsOnGroupsTest2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ +package test.dependent; + +import org.testng.annotations.Test; + +public class DifferentClassDependsOnGroupsTest2 { + @Test(dependsOnGroups = {"mainGroup"}) + public void test1() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/GitHub261AlphaSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/GitHub261AlphaSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/GitHub261AlphaSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/GitHub261AlphaSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.dependent; + +import org.testng.annotations.Test; + +public class GitHub261AlphaSample { + + @Test + public void testAlpha1() {} + + @Test(dependsOnMethods = "testAlpha1") + public void testAlpha2() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/GitHub261BetaSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/GitHub261BetaSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/GitHub261BetaSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/GitHub261BetaSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.dependent; + +import org.testng.annotations.Test; + +public class GitHub261BetaSample { + + @Test(dependsOnMethods = "testBeta2") + public void testBeta1() {} + + @Test + public void testBeta2() {} + + @Test(dependsOnMethods = "testBeta2") + public void testBeta3() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/GitHub261Test.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/GitHub261Test.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/GitHub261Test.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/GitHub261Test.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package test.dependent; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.InvokedMethodNameListener; +import test.SimpleBaseTest; + +public class GitHub261Test extends SimpleBaseTest { + + @Test + public void testGitHub261() { + TestNG tng = create(GitHub261AlphaSample.class, GitHub261BetaSample.class); + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener(listener); + tng.setGroupByInstances(true); + tng.run(); + + assertThat(listener.getInvokedMethodNames()) + .containsExactly("testAlpha1", "testAlpha2", "testBeta2", "testBeta1", "testBeta3"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/GroupByInstancesSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/GroupByInstancesSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/GroupByInstancesSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/GroupByInstancesSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,45 @@ +package test.dependent; + +import java.util.List; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; +import org.testng.collections.Lists; + +public class GroupByInstancesSampleTest { + private String m_country; + public static List m_log = Lists.newArrayList(); + + private static void log(String method, String country) { + // System.out.println("LOG:" + method + "#" + country + " " + + // Thread.currentThread().getId()); + m_log.add(method + "#" + country); + } + + @DataProvider + public static Object[][] dp() { + return new Object[][] { + new Object[] {"usa"}, new Object[] {"uk"}, + }; + } + + @Factory(dataProvider = "dp") + public GroupByInstancesSampleTest(String country) { + m_country = country; + } + + @Test + public void signIn() { + log("signIn", m_country); + } + + @Test(dependsOnMethods = "signIn") + public void signOut() { + log("signOut", m_country); + } + + @Override + public String toString() { + return "[GroupByInstancesSampleTest: " + m_country + "]"; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/GroupByInstancesTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/GroupByInstancesTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/GroupByInstancesTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/GroupByInstancesTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,42 @@ +package test.dependent; + +import java.util.List; +import org.testng.Assert; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.collections.Lists; +import test.SimpleBaseTest; + +public class GroupByInstancesTest extends SimpleBaseTest { + + @Test + public void dontGroupByInstances() { + runTest(false); + } + + @Test + public void groupByInstances() { + runTest(true); + } + + private void runTest(boolean group) { + TestNG tng = create(GroupByInstancesSampleTest.class); + GroupByInstancesSampleTest.m_log = Lists.newArrayList(); + tng.setGroupByInstances(group); + tng.run(); + + List log = GroupByInstancesSampleTest.m_log; + int i = 0; + if (group) { + Assert.assertTrue(log.get(i++).startsWith("signIn")); + Assert.assertTrue(log.get(i++).startsWith("signOut")); + Assert.assertTrue(log.get(i++).startsWith("signIn")); + Assert.assertTrue(log.get(i++).startsWith("signOut")); + } else { + Assert.assertTrue(log.get(i++).startsWith("signIn")); + Assert.assertTrue(log.get(i++).startsWith("signIn")); + Assert.assertTrue(log.get(i++).startsWith("signOut")); + Assert.assertTrue(log.get(i++).startsWith("signOut")); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/ImplicitGroupInclusion2SampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/ImplicitGroupInclusion2SampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/ImplicitGroupInclusion2SampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/ImplicitGroupInclusion2SampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,39 @@ +package test.dependent; + +import org.testng.Assert; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +public class ImplicitGroupInclusion2SampleTest { + private boolean m_m1, m_m2, m_m3; + + @BeforeClass(groups = {"g2"}) + public void init() { + m_m1 = m_m2 = m_m3 = false; + } + + @Test(groups = {"g1"}) + public void m1() { + m_m1 = true; + } + + @Test( + groups = {"g1"}, + dependsOnMethods = "m1") + public void m2() { + m_m2 = true; + } + + @Test(groups = {"g2"}) + public void m3() { + m_m3 = true; + } + + @AfterClass(groups = {"g2"}) + public void verify() { + Assert.assertFalse(m_m1, "Shouldn't have invoked m1()"); + Assert.assertFalse(m_m2); + Assert.assertTrue(m_m3); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/ImplicitGroupInclusion3SampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/ImplicitGroupInclusion3SampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/ImplicitGroupInclusion3SampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/ImplicitGroupInclusion3SampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.dependent; + +import org.testng.annotations.Test; + +public class ImplicitGroupInclusion3SampleTest { + @Test(groups = {"inc"}) + public void test1() {} + + @Test(groups = {"exc"}) + public void test2() { + throw new RuntimeException("exclude me"); + } + + @Test( + groups = {"exc"}, + dependsOnMethods = {"test2"}) + public void test3() { + throw new RuntimeException("exclude me"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/ImplicitGroupInclusion4SampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/ImplicitGroupInclusion4SampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/ImplicitGroupInclusion4SampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/ImplicitGroupInclusion4SampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,47 @@ +package test.dependent; + +import org.testng.Assert; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +public class ImplicitGroupInclusion4SampleTest { + private boolean m_m1, m_m2, m_m3, m_m4; + + @BeforeClass(groups = {"g2"}) + public void init() { + m_m1 = m_m2 = m_m3 = m_m4 = false; + } + + @Test(groups = {"g1"}) + public void m1() { + m_m1 = true; + } + + @Test( + groups = {"g1"}, + dependsOnMethods = "m1") + public void m2() { + m_m2 = true; + } + + @Test(groups = {"g2"}) + public void m3() { + m_m3 = true; + } + + @Test( + groups = {"g2"}, + dependsOnMethods = "m3") + public void m4() { + m_m4 = true; + } + + @AfterClass(groups = {"g2"}) + public void verify() { + Assert.assertFalse(m_m1, "Shouldn't have invoked m1()"); + Assert.assertFalse(m_m2); + Assert.assertTrue(m_m3); + Assert.assertTrue(m_m4); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/ImplicitGroupInclusionSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/ImplicitGroupInclusionSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/ImplicitGroupInclusionSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/ImplicitGroupInclusionSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.dependent; + +import org.testng.annotations.Test; + +public class ImplicitGroupInclusionSampleTest { + + @Test(groups = "z") + public void z() {} + + @Test( + groups = "a", + dependsOnGroups = {"z"}) + public void a() {} + + @Test( + groups = "b", + dependsOnGroups = {"a"}) + public void b() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/ImplicitGroupInclusionTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/ImplicitGroupInclusionTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/ImplicitGroupInclusionTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/ImplicitGroupInclusionTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,78 @@ +package test.dependent; + +import org.testng.annotations.Test; +import test.BaseTest; + +public class ImplicitGroupInclusionTest extends BaseTest { + + @Test + public void verifyImplicitGroupInclusion() { + addClass("test.dependent.ImplicitGroupInclusionSampleTest"); + addIncludedGroup("b"); + + run(); + String[] passed = {"a", "b", "z"}; + String[] failed = {}; + String[] skipped = {}; + verifyTests("Failed", failed, getFailedTests()); + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Skipped", skipped, getSkippedTests()); + } + + @Test + public void verifyImplicitGroupInclusion2() { + addClass("test.dependent.ImplicitGroupInclusion2SampleTest"); + addIncludedGroup("g2"); + + run(); + String[] passed = {"m3"}; + String[] failed = {}; + String[] skipped = {}; + verifyTests("Failed", failed, getFailedTests()); + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Skipped", skipped, getSkippedTests()); + } + + @Test + public void verifyImplicitGroupInclusion4() { + addClass("test.dependent.ImplicitGroupInclusion4SampleTest"); + addIncludedGroup("g2"); + + run(); + String[] passed = {"m3", "m4"}; + String[] failed = {}; + String[] skipped = {}; + verifyTests("Failed", failed, getFailedTests()); + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Skipped", skipped, getSkippedTests()); + } + + @Test + public void verifyImplicitGroupInclusion3() { + addClass("test.dependent.ImplicitGroupInclusion3SampleTest"); + addIncludedGroup("inc"); + addExcludedGroup("exc"); + + run(); + String[] passed = {"test1"}; + String[] failed = {}; + String[] skipped = {}; + verifyTests("Failed", failed, getFailedTests()); + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Skipped", skipped, getSkippedTests()); + } + + @Test + public void verifyImplicitMethodInclusion() { + addClass("test.dependent.ImplicitMethodInclusionSampleTest"); + addIncludedGroup("windows"); + + run(); + String[] passed = {"a", "b"}; + String[] failed = {}; + String[] skipped = {}; + verifyTests("Failed", failed, getFailedTests()); + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Skipped", skipped, getSkippedTests()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/ImplicitMethodInclusionSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/ImplicitMethodInclusionSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/ImplicitMethodInclusionSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/ImplicitMethodInclusionSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,13 @@ +package test.dependent; + +import org.testng.annotations.Test; + +public class ImplicitMethodInclusionSampleTest { + @Test(groups = {"linux"}) + public void a() {} + + @Test( + groups = {"linux", "windows"}, + dependsOnMethods = {"a"}) + public void b() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/InstanceSkipSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/InstanceSkipSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/InstanceSkipSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/InstanceSkipSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,51 @@ +package test.dependent; + +import java.util.List; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; +import org.testng.collections.Lists; + +/** + * Verify that only instances that fail cause dependency failures. In other words, when run, this + * test should show: passed = [f#1 f#3 g#1 g#3], failed = [f#2], skipped = [g#2] + * + * @author Cedric Beust + */ +public class InstanceSkipSampleTest { + + private int m_n; + public static List m_list = Lists.newArrayList(); + + @Factory(dataProvider = "dp") + public InstanceSkipSampleTest(int n) { + m_n = n; + } + + @DataProvider + public static Object[][] dp() { + return new Object[][] { + new Object[] {1}, new Object[] {2}, new Object[] {3}, + }; + } + + @Test + public void f() { + if (m_n == 2) throw new RuntimeException(); + log("f"); + } + + @Test(dependsOnMethods = "f") + public void g() { + log("g"); + } + + private void log(String s) { + m_list.add(s + "#" + m_n); + } + + @Override + public String toString() { + return "" + m_n; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/MissingGroupSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/MissingGroupSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/MissingGroupSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/MissingGroupSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,33 @@ +package test.dependent; + +import java.io.ByteArrayInputStream; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.internal.Parser; +import test.TestHelper; + +public class MissingGroupSampleTest { + + @Test(dependsOnGroups = {"missing-group"}) + public void shouldBeSkipped() {} + + @Test( + dependsOnGroups = {"missing-group"}, + ignoreMissingDependencies = true) + public void shouldNotBeSkipped() {} + + public static void main(String[] args) throws Exception { + TestNG tng = new TestNG(); + String xml = + TestHelper.SUITE_XML_HEADER + + "" + + "" + + "" + + "" + + ""; + System.out.println(xml); + ByteArrayInputStream is = new ByteArrayInputStream(xml.getBytes()); + tng.setXmlSuites(new Parser(is).parseToList()); + tng.run(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/MissingGroupTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/MissingGroupTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/MissingGroupTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/MissingGroupTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.dependent; + +import org.testng.annotations.Test; +import test.BaseTest; + +public class MissingGroupTest extends BaseTest { + + @Test + public void verifyThatExceptionIsThrownIfMissingGroup() { + addClass("test.dependent.MissingGroupSampleTest"); + + run(); + String[] passed = {"shouldNotBeSkipped"}; + String[] failed = {}; + String[] skipped = {"shouldBeSkipped"}; + verifyTests("Failed", failed, getFailedTests()); + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Skipped", skipped, getSkippedTests()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/MissingMethodSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/MissingMethodSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/MissingMethodSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/MissingMethodSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,29 @@ +package test.dependent; + +import java.io.ByteArrayInputStream; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.internal.Parser; +import test.TestHelper; + +public class MissingMethodSampleTest { + + @Test(dependsOnMethods = "missingMethod", ignoreMissingDependencies = true) + public void explicitlyIgnoreMissingMethod() {} + + @Test(dependsOnMethods = "missingMethod", alwaysRun = true) + public void alwaysRunDespiteMissingMethod() {} + + public static void main(String[] args) throws Exception { + TestNG tng = new TestNG(); + String xml = + TestHelper.SUITE_XML_HEADER + + "" + + "" + + ""; + System.out.println(xml); + ByteArrayInputStream is = new ByteArrayInputStream(xml.getBytes()); + tng.setXmlSuites(new Parser(is).parseToList()); + tng.run(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/MissingMethodTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/MissingMethodTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/MissingMethodTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/MissingMethodTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.dependent; + +import org.testng.annotations.Test; +import test.BaseTest; + +public class MissingMethodTest extends BaseTest { + + @Test + public void verifyThatExceptionIsThrownIfMissingMethod() { + addClass("test.dependent.MissingMethodSampleTest"); + + run(); + String[] passed = {"explicitlyIgnoreMissingMethod", "alwaysRunDespiteMissingMethod"}; + String[] failed = {}; + String[] skipped = {}; + verifyTests("Failed", failed, getFailedTests()); + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Skipped", skipped, getSkippedTests()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/MultiGroup1SampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/MultiGroup1SampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/MultiGroup1SampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/MultiGroup1SampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package test.dependent; + +import org.testng.annotations.Test; + +@Test(groups = {"checkin"}) +public class MultiGroup1SampleTest { + + @Test(groups = {"a"}) + public void testA() {} + + public void test1() throws Exception { + throw new Exception("fail"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/MultiGroup2SampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/MultiGroup2SampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/MultiGroup2SampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/MultiGroup2SampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.dependent; + +import org.testng.annotations.Test; + +@Test( + groups = {"integration"}, + dependsOnGroups = {"checkin", "a"}) +public class MultiGroup2SampleTest { + + public void test2() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/MultiGroupTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/MultiGroupTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/MultiGroupTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/MultiGroupTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,22 @@ +package test.dependent; + +import org.testng.annotations.Test; +import test.BaseTest; + +public class MultiGroupTest extends BaseTest { + @Test + public void verifyDependsOnMultiGroups() { + addClass(MultiGroup1SampleTest.class.getName()); + addClass(MultiGroup2SampleTest.class.getName()); + + run(); + String[] passed = { + "testA", + }; + String[] failed = {"test1"}; + String[] skipped = {"test2"}; + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Failed", failed, getFailedTests()); + verifyTests("Skipped", skipped, getSkippedTests()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/MultipleDependentSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/MultipleDependentSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/MultipleDependentSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/MultipleDependentSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,21 @@ +package test.dependent; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class MultipleDependentSampleTest { + + @Test + public void init() {} + + @Test(dependsOnMethods = "init") + public void fail() { + Assert.fail(); + } + + @Test(dependsOnMethods = "fail") + public void skip1() {} + + @Test(dependsOnMethods = "skip1") + public void skip2() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/OrderMethodTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/OrderMethodTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/OrderMethodTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/OrderMethodTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,28 @@ +package test.dependent; + +import org.testng.annotations.Test; + +/** + * This class verifies that when methods have dependents, they are run in the correct order. + * + * @author Cedric Beust, Aug 19, 2004 + */ +public class OrderMethodTest extends BaseOrderMethodTest { + @Test(groups = {"1.0"}) + public void z_first0() { + m_group1[0] = true; + } + + @Test( + groups = {"2.1"}, + dependsOnGroups = {"1.0", "1.1"}) + public void a_second1() { + verifyGroup(2, m_group1); + m_group2[1] = true; + } + + @Test(groups = {"1.1"}) + public void z_premiere1() { + m_group1[1] = true; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/SD2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/SD2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/SD2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/SD2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,34 @@ +package test.dependent; + +import java.util.ArrayList; +import java.util.List; +import org.testng.annotations.Test; + +public class SD2 { + public static List m_log = new ArrayList<>(); + + @Test(groups = {"one"}) + public void oneA() { + m_log.add("oneA"); + } + + @Test + public void canBeRunAnytime() { + m_log.add("canBeRunAnytime"); + } + + @Test(dependsOnGroups = {"one"}) + public void secondA() { + m_log.add("secondA"); + } + + @Test(dependsOnMethods = {"secondA"}) + public void thirdA() { + m_log.add("thirdA"); + } + + @Test(groups = {"one"}) + public void oneB() { + m_log.add("oneB"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/SampleDependent1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/SampleDependent1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/SampleDependent1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/SampleDependent1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.dependent; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/** + * This class exercises dependent groups + * + * @author Cedric Beust, Aug 19, 2004 + */ +public class SampleDependent1 { + + @Test(groups = {"fail"}) + public void fail() { + Assert.assertTrue(false); + } + + @Test(dependsOnGroups = {"fail"}) + public void shouldBeSkipped() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/SampleDependentConfigurationMethods.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/SampleDependentConfigurationMethods.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/SampleDependentConfigurationMethods.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/SampleDependentConfigurationMethods.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,26 @@ +package test.dependent; + +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class SampleDependentConfigurationMethods { + private boolean m_create = false; + private boolean m_first = false; + + @BeforeMethod + public void createInstance() { + m_create = true; + } + + @BeforeMethod(dependsOnMethods = {"createInstance"}) + public void firstInvocation() { + assert m_create : "createInstance() was never called"; + m_first = true; + } + + @Test + public void verifyDependents() { + assert m_create : "createInstance() was never called"; + assert m_first : "firstInvocation() was never called"; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/SampleDependentMethods.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/SampleDependentMethods.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/SampleDependentMethods.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/SampleDependentMethods.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,56 @@ +package test.dependent; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.Test; + +/** + * This class exercises dependent methods + * + * @author Cedric Beust, Aug 19, 2004 + */ +public class SampleDependentMethods { + private boolean m_oneA = false; + private boolean m_oneB = false; + private boolean m_secondA = false; + private boolean m_thirdA = false; + + @Test + public void oneA() { + assert !m_secondA : "secondA shouldn't have been run yet"; + m_oneA = true; + } + + @Test + public void canBeRunAnytime() {} + + @Test(dependsOnMethods = {"oneA", "oneB"}) + public void secondA() { + assert m_oneA : "oneA wasn't run"; + assert m_oneB : "oneB wasn't run"; + assert !m_secondA : "secondA shouldn't have been run yet"; + m_secondA = true; + } + + @Test(dependsOnMethods = {"secondA"}) + public void thirdA() { + assert m_oneA : "oneA wasn't run"; + assert m_oneB : "oneB wasn't run"; + assert m_secondA : "secondA wasn't run"; + assert !m_thirdA : "thirdA shouldn't have been run yet"; + m_thirdA = true; + } + + @Test + public void oneB() { + assert !m_secondA : "secondA shouldn't have been run yet"; + m_oneB = true; + } + + @AfterClass + public void tearDown() { + assert m_oneA : "oneA wasn't run"; + assert m_oneB : "oneB wasn't run"; + assert m_secondA : "secondA wasn't run"; + assert m_thirdA : "thirdA wasn't run"; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/SampleDependentMethods2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/SampleDependentMethods2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/SampleDependentMethods2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/SampleDependentMethods2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,56 @@ +package test.dependent; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.Test; + +/** + * This class exercises dependent methods + * + * @author Cedric Beust, Aug 19, 2004 + */ +public class SampleDependentMethods2 { + private boolean m_oneA = false; + private boolean m_oneB = false; + private boolean m_secondA = false; + private boolean m_thirdA = false; + + @Test(groups = {"one"}) + public void oneA() { + assert !m_secondA : "secondA shouldn't have been run yet"; + m_oneA = true; + } + + @Test + public void canBeRunAnytime() {} + + @Test(dependsOnGroups = {"one"}) + public void secondA() { + assert m_oneA : "oneA wasn't run"; + assert m_oneB : "oneB wasn't run"; + assert !m_secondA : "secondA shouldn't have been run yet"; + m_secondA = true; + } + + @Test(dependsOnMethods = {"secondA"}) + public void thirdA() { + assert m_oneA : "oneA wasn't run"; + assert m_oneB : "oneB wasn't run"; + assert m_secondA : "secondA wasn't run"; + assert !m_thirdA : "thirdA shouldn't have been run yet"; + m_thirdA = true; + } + + @Test(groups = {"one"}) + public void oneB() { + assert !m_secondA : "secondA shouldn't have been run yet"; + m_oneB = true; + } + + @AfterClass + public void tearDown() { + assert m_oneA : "oneA wasn't run"; + assert m_oneB : "oneB wasn't run"; + assert m_secondA : "secondA wasn't run"; + assert m_thirdA : "thirdA wasn't run"; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/SampleDependentMethods3.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/SampleDependentMethods3.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/SampleDependentMethods3.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/SampleDependentMethods3.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,45 @@ +package test.dependent; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; + +/** + * This class tests overloaded dependent methods + * + * @author Cedric Beust, Aug 19, 2004 + */ +public class SampleDependentMethods3 { + private boolean m_oneA = false; + private boolean m_oneB = false; + private boolean m_secondA = false; + + @Test + public void one() { + assert !m_secondA : "secondA shouldn't have been run yet"; + m_oneA = true; + } + + @Parameters({"foo"}) + @Test + public void one(String s) { + assert !m_secondA : "secondA shouldn't have been run yet"; + assert "Cedric".equals(s) : "Expected parameter value Cedric but got " + s; + m_oneB = true; + } + + @Test(dependsOnMethods = {"one"}) + public void secondA() { + assert m_oneA : "oneA wasn't run"; + assert m_oneB : "oneB wasn't run"; + assert !m_secondA : "secondA shouldn't have been run yet"; + m_secondA = true; + } + + @AfterClass + public void tearDown() { + assert m_oneA : "oneA wasn't run"; + assert m_oneB : "oneB wasn't run"; + assert m_secondA : "secondA wasn't run"; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/SampleDependentMethods4.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/SampleDependentMethods4.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/SampleDependentMethods4.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/SampleDependentMethods4.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ +package test.dependent; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class SampleDependentMethods4 { + + @Test + public void step1() {} + + @Test(dependsOnMethods = {"step1"}) + public void step2() { + Assert.assertTrue(false, "Problem in step2"); + } + + @Test(dependsOnMethods = {"step2"}) + public void step3() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/SampleDependentMethods5.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/SampleDependentMethods5.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/SampleDependentMethods5.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/SampleDependentMethods5.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.dependent; + +import org.testng.annotations.Test; + +public class SampleDependentMethods5 { + + @Test + public void step1() {} + + @Test(dependsOnMethods = {"step1", "blablabla"}) + public void step2() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/SampleDependentMethods6.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/SampleDependentMethods6.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/SampleDependentMethods6.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/SampleDependentMethods6.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.dependent; + +import org.testng.annotations.Test; + +public class SampleDependentMethods6 { + @Test(dependsOnMethods = {"step2"}) + public void step1() {} + + @Test(dependsOnMethods = {"step1"}) + public void step2() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/SampleDependentTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/SampleDependentTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/SampleDependentTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/SampleDependentTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,39 @@ +package test.dependent; + +import org.testng.Assert; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class SampleDependentTest extends SimpleBaseTest { + + @Test + public void test2() { + TestNG tng = create(SD2.class); + SD2.m_log.clear(); + tng.run(); + + boolean oneA = false; + boolean oneB = false; + boolean secondA = false; + + for (String s : SD2.m_log) { + if ("oneA".equals(s)) { + oneA = true; + } + if ("oneB".equals(s)) { + oneB = true; + } + if ("secondA".equals(s)) { + Assert.assertTrue(oneA); + Assert.assertTrue(oneB); + secondA = true; + } + if ("thirdA".equals(s)) { + Assert.assertTrue(oneA); + Assert.assertTrue(oneB); + Assert.assertTrue(secondA); + } + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/Test1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/Test1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/Test1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/Test1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,3 @@ +package test.dependent; + +public class Test1 {} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/functionality1/Config.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/functionality1/Config.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/functionality1/Config.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/functionality1/Config.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.dependent.functionality1; + +import org.testng.annotations.BeforeSuite; + +public class Config { + + @BeforeSuite(groups = "other") + public void beforeSuite() { + System.out.println("BeforeSuite group 'other'"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/functionality1/Test1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/functionality1/Test1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/functionality1/Test1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/functionality1/Test1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.dependent.functionality1; + +import org.testng.annotations.Test; + +@Test(groups = "tests.functional.package") +public class Test1 { + + public void test1_1() { + System.out.println("Test 1_1"); + } + + public void test1_2() { + System.out.println("Test 1_2"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/functionality1/Test2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/functionality1/Test2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/functionality1/Test2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/functionality1/Test2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.dependent.functionality1; + +import org.testng.annotations.Test; + +@Test(groups = "tests.functional.upload", dependsOnGroups = "tests.functional.package") +public class Test2 { + + public void test2_1() { + System.out.println("Test 2_1"); + } + + public void test2_2() { + System.out.println("Test 2_2"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/github1156/ASample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/github1156/ASample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/github1156/ASample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/github1156/ASample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.dependent.github1156; + +import org.testng.annotations.Test; + +public class ASample { + + @Test(dependsOnMethods = "test.dependent.github1156.BSample.testB") + public void testA() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/github1156/BSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/github1156/BSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/github1156/BSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/github1156/BSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.dependent.github1156; + +import org.testng.annotations.Test; + +public class BSample { + + @Test + public void testB() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/github1380/GitHub1380Sample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/github1380/GitHub1380Sample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/github1380/GitHub1380Sample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/github1380/GitHub1380Sample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ +package test.dependent.github1380; + +import java.util.concurrent.TimeUnit; +import org.testng.annotations.Test; + +public class GitHub1380Sample { + + @Test(priority = 1) + public void testMethodA() {} + + @Test(dependsOnMethods = "testMethodA", priority = 2) + public void testMethodB() throws InterruptedException { + TimeUnit.SECONDS.sleep(1); + } + + @Test(dependsOnMethods = "testMethodB", priority = 1) + public void testMethodC() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/github1380/GitHub1380Sample2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/github1380/GitHub1380Sample2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/github1380/GitHub1380Sample2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/github1380/GitHub1380Sample2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ +package test.dependent.github1380; + +import java.util.concurrent.TimeUnit; +import org.testng.annotations.Test; + +public class GitHub1380Sample2 { + + @Test(dependsOnMethods = "testMethodB", priority = 3) + public void testMethodA() {} + + @Test(priority = 2) + public void testMethodB() throws InterruptedException { + TimeUnit.SECONDS.sleep(5); + } + + @Test(priority = 1) + public void testMethodC() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/github1380/GitHub1380Sample3.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/github1380/GitHub1380Sample3.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/github1380/GitHub1380Sample3.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/github1380/GitHub1380Sample3.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ +package test.dependent.github1380; + +import java.util.concurrent.TimeUnit; +import org.testng.annotations.Test; + +public class GitHub1380Sample3 { + + @Test(priority = 2) + public void testMethodA() {} + + @Test(dependsOnMethods = "testMethodA", priority = 1) + public void testMethodB() throws InterruptedException { + TimeUnit.SECONDS.sleep(1); + } + + @Test(dependsOnMethods = "testMethodB", priority = 2) + public void testMethodC() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/github1380/GitHub1380Sample4.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/github1380/GitHub1380Sample4.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/github1380/GitHub1380Sample4.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/github1380/GitHub1380Sample4.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ +package test.dependent.github1380; + +import java.util.concurrent.TimeUnit; +import org.testng.annotations.Test; + +public class GitHub1380Sample4 { + + @Test(dependsOnMethods = "testMethodB", priority = 1) + public void testMethodA() throws InterruptedException { + TimeUnit.SECONDS.sleep(1); + } + + @Test(priority = 2) + public void testMethodB() {} + + @Test(priority = 3) + public void testMethodC() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/issue1648/ClassASample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/issue1648/ClassASample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/issue1648/ClassASample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/issue1648/ClassASample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,28 @@ +package test.dependent.issue1648; + +import java.util.List; +import org.testng.annotations.Test; +import org.testng.collections.Lists; + +public class ClassASample implements LogExtractor { + private final List logs = Lists.newArrayList(); + + @Test + protected void test1() { + addLog("A TestOne 1"); + } + + @Test(dependsOnMethods = {"test1"}) + protected void test2() { + addLog("A test Two"); + } + + @Override + public List getLogs() { + return logs; + } + + protected void addLog(String log) { + logs.add(log); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/issue1648/ClassBSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/issue1648/ClassBSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/issue1648/ClassBSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/issue1648/ClassBSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.dependent.issue1648; + +import org.testng.annotations.Test; + +public class ClassBSample extends ClassASample { + @Test(dependsOnMethods = {"test2"}) + protected void test3() { + addLog("B test 1"); + } + + @Test(dependsOnMethods = {"test3"}) + protected void test4() { + addLog("B test 2"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/issue1648/LogExtractor.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/issue1648/LogExtractor.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/issue1648/LogExtractor.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/issue1648/LogExtractor.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,7 @@ +package test.dependent.issue1648; + +import java.util.List; + +public interface LogExtractor { + List getLogs(); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/issue1648/TestOneSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/issue1648/TestOneSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/issue1648/TestOneSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/issue1648/TestOneSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,3 @@ +package test.dependent.issue1648; + +public class TestOneSample extends ClassBSample {} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/issue1648/TestRunner.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/issue1648/TestRunner.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/issue1648/TestRunner.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/issue1648/TestRunner.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,39 @@ +package test.dependent.issue1648; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Arrays; +import java.util.List; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.collections.Lists; +import test.InvokedMethodNameListener; +import test.SimpleBaseTest; + +public class TestRunner extends SimpleBaseTest { + @Test(description = "GITHUB-1648") + public void testMethod() { + List expected = + Arrays.asList( + "A TestOne 1", + "A test Two", + "B test 1", + "B test 2", + "A TestOne 1", + "A test Two", + "B test 1", + "B test 2"); + TestNG tng = create(TestOneSample.class, TestTwoSample.class); + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener(listener); + + tng.run(); + List actual = Lists.newArrayList(); + for (Object instance : listener.getTestInstances()) { + if (instance instanceof LogExtractor) { + actual.addAll(((LogExtractor) instance).getLogs()); + } + } + assertThat(actual).containsExactlyElementsOf(expected); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/issue1648/TestTwoSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/issue1648/TestTwoSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/issue1648/TestTwoSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/issue1648/TestTwoSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,3 @@ +package test.dependent.issue1648; + +public class TestTwoSample extends ClassBSample {} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/xml/GroupDependencySampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/xml/GroupDependencySampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/xml/GroupDependencySampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/xml/GroupDependencySampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.dependent.xml; + +import org.testng.annotations.Test; + +public class GroupDependencySampleTest { + + @Test(groups = "a") + public void a1() {} + + @Test(groups = "b") + public void b1() {} + + @Test(groups = "c") + public void c1() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/xml/GroupDependencyTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/xml/GroupDependencyTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependent/xml/GroupDependencyTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependent/xml/GroupDependencyTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,66 @@ +package test.dependent.xml; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import org.testng.Assert; +import org.testng.ITestResult; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.SimpleBaseTest; + +public class GroupDependencyTest extends SimpleBaseTest { + @DataProvider + public Object[][] dp() { + return new Object[][] { + new Object[] {new String[] {"a", "b", "c", "a1", "b1", "c1"}}, + new Object[] {new String[] {"a", "c", "b", "a1", "c1", "b1"}}, + new Object[] {new String[] {"b", "a", "c", "b1", "a1", "c1"}}, + new Object[] {new String[] {"b", "c", "a", "b1", "c1", "a1"}}, + new Object[] {new String[] {"c", "b", "a", "c1", "b1", "a1"}}, + new Object[] {new String[] {"c", "a", "b", "c1", "a1", "b1"}}, + }; + } + + @Test(dataProvider = "dp") + public void verifyGroupSingle(String[] a) { + configureGroup(a, false /* single */); + } + + @Test(dataProvider = "dp") + public void verifyGroupMulti(String[] a) { + configureGroup(a, true /* multi */); + } + + private void configureGroup(String[] a, boolean multi) { + XmlSuite suite = createXmlSuite("Dependencies"); + XmlTest test = + createXmlTest(suite, "DependencyTest", GroupDependencySampleTest.class.getName()); + if (multi) { + test.addXmlDependencyGroup(a[2], a[1] + " " + a[0]); + } else { + test.addXmlDependencyGroup(a[2], a[1]); + test.addXmlDependencyGroup(a[1], a[0]); + } + + TestNG tng = create(); + tng.setXmlSuites(Collections.singletonList(suite)); + TestListenerAdapter tla = new TestListenerAdapter(); + tng.addListener(tla); + tng.run(); + + List t = tla.getPassedTests(); + String method2 = t.get(2).getMethod().getMethodName(); + if (multi) { + // When we have "a depends on groups b and c", the only certainty is that "a" + // will be run last + Assert.assertEquals(method2, a[5]); + } else { + assertTestResultsEqual(tla.getPassedTests(), Arrays.asList(a[3], a[4], a[5])); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependsongroup/DependsOnGroupsTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependsongroup/DependsOnGroupsTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependsongroup/DependsOnGroupsTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependsongroup/DependsOnGroupsTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,30 @@ +package test.dependsongroup; + +import org.testng.Assert; +import org.testng.ITestResult; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class DependsOnGroupsTest extends SimpleBaseTest { + + @Test + public void methodsShouldBeGroupedByClasses() { + TestNG tng = create(ZeroSampleTest.class, FirstSampleTest.class, SecondSampleTest.class); + + TestListenerAdapter tla = new TestListenerAdapter(); + tng.addListener(tla); + tng.run(); + String[] expected = + new String[] { + "zeroA", "zeroB", + "firstA", "firstB", + "secondA", "secondB" + }; + for (int i = 0; i < expected.length; i++) { + ITestResult testResult = tla.getPassedTests().get(i); + Assert.assertEquals(testResult.getMethod().getMethodName(), expected[i]); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependsongroup/FirstSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependsongroup/FirstSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependsongroup/FirstSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependsongroup/FirstSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.dependsongroup; + +import org.testng.annotations.Test; + +@Test( + groups = {"first"}, + dependsOnGroups = {"zero"}) +public class FirstSampleTest { + + @Test + public void firstA() {} + + @Test + public void firstB() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependsongroup/SecondSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependsongroup/SecondSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependsongroup/SecondSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependsongroup/SecondSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.dependsongroup; + +import org.testng.annotations.Test; + +@Test( + groups = {"second"}, + dependsOnGroups = {"zero"}) +public class SecondSampleTest { + + @Test + public void secondA() {} + + @Test + public void secondB() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependsongroup/TestFixture1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependsongroup/TestFixture1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependsongroup/TestFixture1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependsongroup/TestFixture1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ +package test.dependsongroup; + +import org.testng.annotations.BeforeTest; + +public class TestFixture1 { + @BeforeTest(groups = {"test", "testgroup"}) + public void setup() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependsongroup/TestFixture2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependsongroup/TestFixture2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependsongroup/TestFixture2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependsongroup/TestFixture2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package test.dependsongroup; + +import org.testng.annotations.BeforeTest; +import org.testng.annotations.Test; + +public class TestFixture2 { + @BeforeTest( + groups = {"test"}, + dependsOnGroups = {"testgroup"}) + public void setup() {} + + @Test(groups = {"test"}) + public void testMethod() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependsongroup/ZeroSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependsongroup/ZeroSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependsongroup/ZeroSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependsongroup/ZeroSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,13 @@ +package test.dependsongroup; + +import org.testng.annotations.Test; + +@Test(groups = {"zero"}) +public class ZeroSampleTest { + + @Test + public void zeroA() {} + + @Test + public void zeroB() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependsongroup/suite.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependsongroup/suite.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/dependsongroup/suite.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/dependsongroup/suite.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/enable/A.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/enable/A.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/enable/A.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/enable/A.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,73 @@ +package test.enable; + +import org.testng.annotations.AfterSuite; +import org.testng.annotations.BeforeSuite; +import org.testng.annotations.Test; + +public class A { + + public void testA() {} + + @Test + public void testA2() {} + + @Test(enabled = true) + public void testA3() {} + + @Test(enabled = false) + public void disabledA() {} + + @BeforeSuite + public void beforeSuiteA() {} + + @BeforeSuite(enabled = true) + public void beforeSuiteA2() {} + + @BeforeSuite(enabled = false) + public void disabledBeforeSuiteA() {} + + @BeforeSuite(alwaysRun = false) + public void beforeSuiteNoRunA() {} + + @BeforeSuite(enabled = true, alwaysRun = false) + public void beforeSuiteNoRunA2() {} + + @BeforeSuite(enabled = false, alwaysRun = false) + public void disabledBeforeSuiteNoRunA() {} + + @BeforeSuite(alwaysRun = true) + public void beforeSuiteRunA() {} + + @BeforeSuite(enabled = true, alwaysRun = true) + public void beforeSuiteRunA2() {} + + @BeforeSuite(enabled = false, alwaysRun = true) + public void disabledBeforeSuiteRunA() {} + + @AfterSuite + public void afterSuiteA() {} + + @AfterSuite(enabled = true) + public void afterSuiteA2() {} + + @AfterSuite(enabled = false) + public void disabledAfterSuiteA() {} + + @AfterSuite(alwaysRun = false) + public void afterSuiteNoRunA() {} + + @AfterSuite(enabled = true, alwaysRun = false) + public void afterSuiteNoRunA2() {} + + @AfterSuite(enabled = false, alwaysRun = false) + public void disabledAfterSuiteNoRunA() {} + + @AfterSuite(alwaysRun = true) + public void afterSuiteRunA() {} + + @AfterSuite(enabled = true, alwaysRun = true) + public void afterSuiteRunA2() {} + + @AfterSuite(enabled = false, alwaysRun = true) + public void disabledAfterSuiteRunA() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/enable/B.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/enable/B.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/enable/B.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/enable/B.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,74 @@ +package test.enable; + +import org.testng.annotations.AfterSuite; +import org.testng.annotations.BeforeSuite; +import org.testng.annotations.Test; + +@Test(enabled = false) +public class B { + + public void testB() {} + + @Test + public void testB2() {} + + @Test(enabled = true) + public void testB3() {} + + @Test(enabled = false) + public void disabledB() {} + + @BeforeSuite(enabled = true) + public void disabledBeforeSuiteB() {} + + @BeforeSuite + public void disabledBeforeSuiteB2() {} + + @BeforeSuite(enabled = false) + public void disabledBeforeSuiteB3() {} + + @BeforeSuite(alwaysRun = false) + public void beforeSuiteNoRunB() {} + + @BeforeSuite(enabled = true, alwaysRun = false) + public void beforeSuiteNoRunB2() {} + + @BeforeSuite(enabled = false, alwaysRun = false) + public void disabledBeforeSuiteNoRunB() {} + + @BeforeSuite(alwaysRun = true) + public void beforeSuiteRunB() {} + + @BeforeSuite(enabled = true, alwaysRun = true) + public void beforeSuiteRunB2() {} + + @BeforeSuite(enabled = false, alwaysRun = true) + public void disabledBeforeSuiteRunB() {} + + @AfterSuite + public void afterSuiteB() {} + + @AfterSuite(enabled = true) + public void afterSuiteB2() {} + + @AfterSuite(enabled = false) + public void disabledAfterSuiteB() {} + + @AfterSuite(alwaysRun = false) + public void afterSuiteNoRunB() {} + + @AfterSuite(enabled = true, alwaysRun = false) + public void afterSuiteNoRunB2() {} + + @AfterSuite(enabled = false, alwaysRun = false) + public void disabledAfterSuiteNoRunB() {} + + @AfterSuite(alwaysRun = true) + public void afterSuiteRunB() {} + + @AfterSuite(enabled = true, alwaysRun = true) + public void afterSuiteRunB2() {} + + @AfterSuite(enabled = false, alwaysRun = true) + public void disabledAfterSuiteRunB() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/enable/C.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/enable/C.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/enable/C.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/enable/C.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,74 @@ +package test.enable; + +import org.testng.annotations.AfterSuite; +import org.testng.annotations.BeforeSuite; +import org.testng.annotations.Test; + +@Test +public class C { + + public void testC() {} + + @Test + public void testC2() {} + + @Test(enabled = true) + public void testC3() {} + + @Test(enabled = false) + public void disabledC() {} + + @BeforeSuite + public void beforeSuiteC() {} + + @BeforeSuite(enabled = true) + public void beforeSuiteC2() {} + + @BeforeSuite(enabled = false) + public void disabledBeforeSuiteC() {} + + @BeforeSuite(alwaysRun = false) + public void beforeSuiteNoRunC() {} + + @BeforeSuite(enabled = true, alwaysRun = false) + public void beforeSuiteNoRunC2() {} + + @BeforeSuite(enabled = false, alwaysRun = false) + public void disabledBeforeSuiteNoRunC() {} + + @BeforeSuite(alwaysRun = true) + public void beforeSuiteRunC() {} + + @BeforeSuite(enabled = true, alwaysRun = true) + public void beforeSuiteRunC2() {} + + @BeforeSuite(enabled = false, alwaysRun = true) + public void disabledBeforeSuiteRunC() {} + + @AfterSuite + public void afterSuiteC() {} + + @AfterSuite(enabled = true) + public void afterSuiteC2() {} + + @AfterSuite(enabled = false) + public void disabledAfterSuiteC() {} + + @AfterSuite(alwaysRun = false) + public void afterSuiteNoRunC() {} + + @AfterSuite(enabled = true, alwaysRun = false) + public void afterSuiteNoRunC2() {} + + @AfterSuite(enabled = false, alwaysRun = false) + public void disabledAfterSuiteNoRunC() {} + + @AfterSuite(alwaysRun = true) + public void afterSuiteRunC() {} + + @AfterSuite(enabled = true, alwaysRun = true) + public void afterSuiteRunC2() {} + + @AfterSuite(enabled = false, alwaysRun = true) + public void disabledAfterSuiteRunC() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/enable/EnableTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/enable/EnableTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/enable/EnableTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/enable/EnableTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,72 @@ +package test.enable; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.InvokedMethodListener; +import test.SimpleBaseTest; + +public class EnableTest extends SimpleBaseTest { + + @Test + public void disabled_methods_should_not_be_run() { + TestNG tng = create(A.class, B.class, C.class); + InvokedMethodListener listener = new InvokedMethodListener(); + tng.addListener(listener); + tng.setPreserveOrder(true); + tng.run(); + + assertThat(listener.getInvokedMethods()) + .containsExactly( + "beforeSuiteA", + "beforeSuiteA2", + "beforeSuiteNoRunA", + "beforeSuiteNoRunA2", + "beforeSuiteRunA", + "beforeSuiteRunA2", + "beforeSuiteRunB", + "beforeSuiteRunB2", + "beforeSuiteC", + "beforeSuiteC2", + "beforeSuiteNoRunC", + "beforeSuiteNoRunC2", + "beforeSuiteRunC", + "beforeSuiteRunC2", + "testA2", + "testA3", + "testB2", + "testB3", + "testC", + "testC2", + "testC3", + "afterSuiteA", + "afterSuiteA2", + "afterSuiteNoRunA", + "afterSuiteNoRunA2", + "afterSuiteRunA", + "afterSuiteRunA2", + "afterSuiteRunB", + "afterSuiteRunB2", + "afterSuiteC", + "afterSuiteC2", + "afterSuiteNoRunC", + "afterSuiteNoRunC2", + "afterSuiteRunC", + "afterSuiteRunC2"); + } + + @Test(description = "https://github.com/cbeust/testng/issues/420") + public void issue420() { + TestNG tng = create(Issue420FirstSample.class, Issue420SecondSample.class); + InvokedMethodListener listener = new InvokedMethodListener(); + tng.addListener(listener); + tng.run(); + + assertThat(listener.getInvokedMethods()) + .containsExactly( + "alwaysBeforeSuite", "beforeSuite", + "verifySomethingFirstSample", "verifySomethingSecondSample", + "afterSuite", "alwaysAfterSuite"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/enable/Issue420BaseTestCase.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/enable/Issue420BaseTestCase.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/enable/Issue420BaseTestCase.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/enable/Issue420BaseTestCase.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.enable; + +import org.testng.annotations.AfterSuite; +import org.testng.annotations.BeforeSuite; + +public abstract class Issue420BaseTestCase { + + @BeforeSuite(alwaysRun = true) + public static void alwaysBeforeSuite() {} + + @BeforeSuite(alwaysRun = false) + public static void beforeSuite() {} + + @AfterSuite(alwaysRun = false) + public static void afterSuite() {} + + @AfterSuite(alwaysRun = true) + public static void alwaysAfterSuite() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/enable/Issue420FirstSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/enable/Issue420FirstSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/enable/Issue420FirstSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/enable/Issue420FirstSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,10 @@ +package test.enable; + +import org.testng.annotations.Test; + +@Test(enabled = false) +public class Issue420FirstSample extends Issue420BaseTestCase { + + @Test + public void verifySomethingFirstSample() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/enable/Issue420SecondSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/enable/Issue420SecondSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/enable/Issue420SecondSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/enable/Issue420SecondSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,10 @@ +package test.enable; + +import org.testng.annotations.Test; + +@Test +public class Issue420SecondSample extends Issue420BaseTestCase { + + @Test + public void verifySomethingSecondSample() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/expectedexceptions/ExpectedExceptionsTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/expectedexceptions/ExpectedExceptionsTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/expectedexceptions/ExpectedExceptionsTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/expectedexceptions/ExpectedExceptionsTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,44 @@ +package test.expectedexceptions; + +import java.util.Collection; +import java.util.List; +import org.testng.Assert; +import org.testng.ITestResult; +import org.testng.annotations.Test; +import test.BaseTest; +import test.expectedexceptions.github1409.TestClassSample; + +public class ExpectedExceptionsTest extends BaseTest { + + @Test + public void expectedExceptionsDeprecatedSyntax() { + runTest( + "test.expectedexceptions.SampleExceptions", + new String[] {"shouldPass"}, + new String[] {"shouldFail1", "shouldFail2", "shouldFail3"}, + new String[] {}); + } + + @Test + public void expectedExceptions() { + runTest( + "test.expectedexceptions.SampleExceptions2", + new String[] {"shouldPass", "shouldPass2", "shouldPass3", "shouldPass4"}, + new String[] {"shouldFail1", "shouldFail2", "shouldFail3", "shouldFail4"}, + new String[] {}); + } + + @Test + public void expectedExceptionsMessage() { + getFailedTests().clear(); + addClass(TestClassSample.class); + run(); + Collection> failedTests = getFailedTests().values(); + Assert.assertFalse(failedTests.isEmpty()); + ITestResult result = failedTests.iterator().next().get(0); + String actual = result.getThrowable().getMessage().replaceAll("\\n", ""); + String expected = + "The exception was thrown with the wrong message: expected \"expected\" but got \"actual\""; + Assert.assertEquals(actual, expected); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/expectedexceptions/ParametersExceptionTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/expectedexceptions/ParametersExceptionTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/expectedexceptions/ParametersExceptionTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/expectedexceptions/ParametersExceptionTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +package test.expectedexceptions; + +import java.io.IOException; +import java.lang.reflect.Method; +import org.testng.Assert; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import org.xml.sax.SAXException; + +/** This class/interface */ +public class ParametersExceptionTest { + @Test(dataProvider = "A") + public void testA(Exception err) { + System.out.println("testA"); + } + + @DataProvider(name = "A") + protected Object[][] dp() { + return new Object[][] {{new IOException(), new SAXException()}}; + } + + @AfterMethod + protected void verify(Method method) { + Assert.assertTrue(false, "forced failure"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/expectedexceptions/SampleExceptions.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/expectedexceptions/SampleExceptions.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/expectedexceptions/SampleExceptions.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/expectedexceptions/SampleExceptions.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +package test.expectedexceptions; + +import org.testng.annotations.Test; + +/** + * This class tests @ExpectedExceptions + * + * @author cbeust + */ +public class SampleExceptions { + + @Test(expectedExceptions = {NumberFormatException.class}) + public void shouldPass() { + throw new NumberFormatException(); + } + + @Test(expectedExceptions = {NumberFormatException.class}) + public void shouldFail1() { + throw new RuntimeException(); + } + + @Test(expectedExceptions = {NumberFormatException.class}) + public void shouldFail2() {} + + @Test(expectedExceptions = RuntimeException.class) + public void shouldFail3() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/expectedexceptions/SampleExceptions2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/expectedexceptions/SampleExceptions2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/expectedexceptions/SampleExceptions2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/expectedexceptions/SampleExceptions2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,53 @@ +package test.expectedexceptions; + +import org.testng.annotations.Test; + +/** + * This class tests @ExpectedExceptions + * + * @author cbeust + */ +public class SampleExceptions2 { + + @Test(expectedExceptions = NumberFormatException.class) + public void shouldPass() { + throw new NumberFormatException(); + } + + @Test(expectedExceptions = NumberFormatException.class) + public void shouldFail1() { + throw new RuntimeException(); + } + + @Test(expectedExceptions = NumberFormatException.class) + public void shouldFail2() {} + + @Test( + expectedExceptions = NumberFormatException.class, + expectedExceptionsMessageRegExp = ".*bomb.*") + public void shouldPass2() { + throw new NumberFormatException("This should not bomb at all"); + } + + @Test( + expectedExceptions = NumberFormatException.class, + expectedExceptionsMessageRegExp = ".*bombc.*") + public void shouldFail3() { + throw new NumberFormatException("This should bomb for good"); + } + + @Test(expectedExceptions = NumberFormatException.class, expectedExceptionsMessageRegExp = ".*") + public void shouldPass3() { + throw new NumberFormatException(null); + } + + @Test( + expectedExceptions = NumberFormatException.class, + expectedExceptionsMessageRegExp = "Multiline.*") + public void shouldPass4() { + throw new NumberFormatException("Multiline\nException"); + } + + @Test(expectedExceptions = RuntimeException.class) + public void shouldFail4() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/expectedexceptions/WrappedExpectedExceptionTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/expectedexceptions/WrappedExpectedExceptionTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/expectedexceptions/WrappedExpectedExceptionTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/expectedexceptions/WrappedExpectedExceptionTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.expectedexceptions; + +import org.testng.annotations.Test; + +public class WrappedExpectedExceptionTest { + @Test( + timeOut = 1000L, + expectedExceptions = {IllegalStateException.class}) + public void testTimeout() { + throw new IllegalStateException("expected failure"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/expectedexceptions/github1409/TestClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/expectedexceptions/github1409/TestClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/expectedexceptions/github1409/TestClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/expectedexceptions/github1409/TestClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,10 @@ +package test.expectedexceptions.github1409; + +import org.testng.annotations.Test; + +public class TestClassSample { + @Test(expectedExceptions = RuntimeException.class, expectedExceptionsMessageRegExp = "expected") + public void test() { + throw new RuntimeException("actual"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/expectedexceptions/issue2074/FailingInterruptTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/expectedexceptions/issue2074/FailingInterruptTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/expectedexceptions/issue2074/FailingInterruptTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/expectedexceptions/issue2074/FailingInterruptTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,21 @@ +package test.expectedexceptions.issue2074; + +import static org.testng.Assert.fail; + +import org.testng.annotations.AfterMethod; +import org.testng.annotations.Test; + +public class FailingInterruptTest { + + @Test(expectedExceptions = RuntimeException.class, timeOut = 1000) + public void shouldntInterruptTheThreadButDoesTest() { + throw new RuntimeException("unit test exception"); + } + + @AfterMethod + public void checkForInterrupts() { + if (Thread.interrupted()) { // check for interrupts and clear the flag + fail("Thread was interrupted but shouldn't have been"); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/expectedexceptions/issue2074/IssueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/expectedexceptions/issue2074/IssueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/expectedexceptions/issue2074/IssueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/expectedexceptions/issue2074/IssueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,25 @@ +package test.expectedexceptions.issue2074; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlSuite.ParallelMode; +import test.SimpleBaseTest; + +public class IssueTest extends SimpleBaseTest { + + @Test(description = "GITHUB-2074") + public void testIfInterruptsAreCleared() { + XmlSuite xmlSuite = createXmlSuite("my_suite", "my_test", FailingInterruptTest.class); + xmlSuite.setParallel(ParallelMode.METHODS); + TestNG tng = create(xmlSuite); + TestListenerAdapter listener = new TestListenerAdapter(); + tng.addListener(listener); + tng.run(); + assertThat(listener.getFailedTests()).isEmpty(); + assertThat(listener.getConfigurationFailures()).isEmpty(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/expectedexceptions/issue2235/ExampleTestCase.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/expectedexceptions/issue2235/ExampleTestCase.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/expectedexceptions/issue2235/ExampleTestCase.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/expectedexceptions/issue2235/ExampleTestCase.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.expectedexceptions.issue2235; + +import org.testng.annotations.Test; + +public class ExampleTestCase { + + @Test(timeOut = 1000, expectedExceptions = IllegalArgumentException.class) + public void testMethod() { + throw new IllegalArgumentException("foo"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/expectedexceptions/issue2235/IssueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/expectedexceptions/issue2235/IssueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/expectedexceptions/issue2235/IssueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/expectedexceptions/issue2235/IssueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,25 @@ +package test.expectedexceptions.issue2235; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlSuite.ParallelMode; +import test.SimpleBaseTest; + +public class IssueTest extends SimpleBaseTest { + + @Test(description = "GITHUB-2235") + public void testExpectedExceptions() { + XmlSuite xmlSuite = createXmlSuite("main_suite", "main_test", ExampleTestCase.class); + xmlSuite.setParallel(ParallelMode.METHODS); + TestNG testng = create(xmlSuite); + TestListenerAdapter listener = new TestListenerAdapter(); + testng.addListener(listener); + testng.run(); + assertThat(listener.getPassedTests()).isNotEmpty(); + assertThat(listener.getFailedTests()).isEmpty(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/ArrayEmptyFactorySample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/ArrayEmptyFactorySample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/ArrayEmptyFactorySample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/ArrayEmptyFactorySample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,22 @@ +package test.factory; + +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +public class ArrayEmptyFactorySample { + + @DataProvider(name = "values") + public static Object[][] values() { + return new Object[][] {}; + } + + @Factory(dataProvider = "values") + public ArrayEmptyFactorySample(int value) {} + + @Test + public void test() { + Assert.fail(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/BadMethodReturnTypeFactory.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/BadMethodReturnTypeFactory.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/BadMethodReturnTypeFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/BadMethodReturnTypeFactory.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.factory; + +import org.testng.annotations.Factory; + +public class BadMethodReturnTypeFactory { + + @Factory + private Object createInstances() { + return new Object[] {new BaseFactorySample(42), new BaseFactorySample(43)}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/BaseFactory.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/BaseFactory.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/BaseFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/BaseFactory.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.factory; + +import org.testng.annotations.Factory; + +public class BaseFactory { + + @Factory + public Object[] create() { + return new Object[] {new FactoryBaseSample()}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/BaseFactorySample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/BaseFactorySample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/BaseFactorySample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/BaseFactorySample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,29 @@ +package test.factory; + +import org.testng.annotations.Test; + +public class BaseFactorySample { + + private final int n; + + public BaseFactorySample(int n) { + this.n = n; + } + + public int getN() { + return n; + } + + @Test + public void f() {} + + /** + * @@@ for some reason, the test results get added in the wrong order if I don't define a + * toString() method. Need to investigate. https://github.com/cbeust/testng/issues/799 TODO Remove + * the method when issue will be fixed + */ + @Override + public String toString() { + return "[" + getClass().getName() + " " + getN() + "]"; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/ChildFactory.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/ChildFactory.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/ChildFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/ChildFactory.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,3 @@ +package test.factory; + +public class ChildFactory extends BaseFactory {} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/DisabledFactory.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/DisabledFactory.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/DisabledFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/DisabledFactory.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.factory; + +import org.testng.annotations.Factory; + +public class DisabledFactory { + + @Factory(enabled = false) + public Object[] factory() { + return new Object[] {new MySample()}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/DisabledFactoryTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/DisabledFactoryTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/DisabledFactoryTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/DisabledFactoryTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,24 @@ +package test.factory; + +import org.testng.Assert; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class DisabledFactoryTest extends SimpleBaseTest { + + @Test + public void disabledFactoryShouldNotRun() { + TestNG tng = create(DisabledFactory.class); + + TestListenerAdapter tla = new TestListenerAdapter(); + tng.addListener(tla); + + tng.run(); + + Assert.assertEquals(tla.getPassedTests().size(), 0); + Assert.assertEquals(tla.getSkippedTests().size(), 0); + Assert.assertEquals(tla.getFailedTests().size(), 0); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/DoubleFactory.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/DoubleFactory.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/DoubleFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/DoubleFactory.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.factory; + +import org.testng.annotations.Factory; + +public class DoubleFactory { + + @Factory + public Object[] factory1() { + return new Object[] {new FactoryBaseSample(1), new FactoryBaseSample(2)}; + } + + @Factory + public Object[] factory2() { + return new Object[] {new FactoryBaseSample(3), new FactoryBaseSample(4)}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/EmptyFactoryDataProviderTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/EmptyFactoryDataProviderTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/EmptyFactoryDataProviderTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/EmptyFactoryDataProviderTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,25 @@ +package test.factory; + +import org.testng.Assert; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class EmptyFactoryDataProviderTest extends SimpleBaseTest { + + @Test + public void test() { + TestNG testng = create(ArrayEmptyFactorySample.class, IteratorEmptyFactorySample.class); + + TestListenerAdapter tla = new TestListenerAdapter(); + testng.addListener(tla); + // Used to check the warning message + + testng.run(); + + Assert.assertTrue(tla.getFailedTests().isEmpty()); + Assert.assertTrue(tla.getSkippedTests().isEmpty()); + Assert.assertTrue(tla.getPassedTests().isEmpty()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/Factory2Test.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/Factory2Test.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/Factory2Test.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/Factory2Test.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.factory; + +import org.testng.annotations.Test; +import test.configuration.ConfigurationBaseTest; +import test.factory.sample.Factory2TestSample; + +public class Factory2Test extends ConfigurationBaseTest { + @Test + public void testFactoryCorrectlyInterleaved() { + testConfiguration(Factory2TestSample.class); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/FactoryAndTestMethodTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryAndTestMethodTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/FactoryAndTestMethodTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryAndTestMethodTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,37 @@ +package test.factory; + +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +@Test(groups = {"x"}) +public class FactoryAndTestMethodTest { + + @Factory(dataProvider = "data") + public Object[] ohNo(String s) { + return makeNullArgTests(s); + } + + public static class NullArgsTest { + public final String s; + + public NullArgsTest(String s) { + this.s = s; + } + + @Test + public void test() { + Assert.assertNotNull(s); + } + } + + private Object[] makeNullArgTests(String s) { + return new Object[0]; + } + + @DataProvider(name = "data") + public Object[][] makeData() { + return new Object[][] {{"foo"}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/FactoryBaseSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryBaseSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/FactoryBaseSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryBaseSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,25 @@ +package test.factory; + +import org.testng.ITest; +import org.testng.annotations.Test; + +public class FactoryBaseSample implements ITest { + + private final int value; + + public FactoryBaseSample() { + this(0); + } + + public FactoryBaseSample(int value) { + this.value = value; + } + + @Test + public void f() {} + + @Override + public String getTestName() { + return "FactoryBaseSample{" + value + "}"; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/FactoryDataProviderNotStaticSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryDataProviderNotStaticSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/FactoryDataProviderNotStaticSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryDataProviderNotStaticSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.factory; + +import org.testng.annotations.Factory; + +public class FactoryDataProviderNotStaticSample extends BaseFactorySample { + + @Factory(dataProvider = "dp", dataProviderClass = NotStaticDataProvider.class) + public FactoryDataProviderNotStaticSample(int n) { + super(n); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/FactoryDataProviderSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryDataProviderSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/FactoryDataProviderSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryDataProviderSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package test.factory; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +public class FactoryDataProviderSample extends BaseFactorySample { + + @Factory(dataProvider = "dp") + public FactoryDataProviderSample(int n) { + super(n); + } + + @DataProvider + public static Object[][] dp() { + return new Object[][] { + new Object[] {41}, new Object[] {42}, + }; + } + + @Test + public void f() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/FactoryDataProviderStaticErrorSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryDataProviderStaticErrorSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/FactoryDataProviderStaticErrorSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryDataProviderStaticErrorSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.factory; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; + +public class FactoryDataProviderStaticErrorSample extends BaseFactorySample { + + @Factory(dataProvider = "dp") + public FactoryDataProviderStaticErrorSample(int n) { + super(n); + } + + @DataProvider + public Object[][] dp() { + return new Object[][] { + new Object[] {41}, new Object[] {42}, + }; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/FactoryDataProviderStaticSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryDataProviderStaticSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/FactoryDataProviderStaticSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryDataProviderStaticSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.factory; + +import org.testng.annotations.Factory; + +public class FactoryDataProviderStaticSample extends BaseFactorySample { + + @Factory(dataProvider = "dp", dataProviderClass = StaticDataProvider.class) + public FactoryDataProviderStaticSample(int n) { + super(n); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/FactoryDataProviderTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryDataProviderTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/FactoryDataProviderTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryDataProviderTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,53 @@ +package test.factory; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Arrays; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.TestNGException; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class FactoryDataProviderTest extends SimpleBaseTest { + + @Test(description = "Test @Factory(dataProvider) on a local static data provider") + public void factoryWithLocalDataProvider() { + runTest(FactoryDataProviderSample.class, 41, 42); + } + + @Test(description = "Test @Factory(dataProvider) on a data provider in another class (static)") + public void factoryWithStaticDataProvider() { + runTest(FactoryDataProviderStaticSample.class, 43, 44); + } + + @Test( + description = "Test @Factory(dataProvider) on a data provider in another class (not static)") + public void factoryWithNotStaticDataProvider() { + runTest(FactoryDataProviderNotStaticSample.class, 43, 44); + } + + @Test(description = "Test @Factory(dataProvider) on a non static data provider with no arg ctor") + public void factoryWithNonStaticDataProvider() { + runTest(FactoryDataProviderWithNoArgCtorErrorSample.class, 45, 46); + } + + @Test( + expectedExceptions = TestNGException.class, + description = "Should fail because the data provider is not static") + public void factoryWithNonStaticDataProviderShouldFail() { + runTest(FactoryDataProviderStaticErrorSample.class, 43, 44); + } + + private static void runTest(Class cls, int n1, int n2) { + TestNG tng = create(cls); + TestListenerAdapter tla = new TestListenerAdapter(); + tng.addListener(tla); + tng.run(); + + assertThat(tla.getPassedTests()) + .describedAs("arguments of passed tests: getPassedTests()") + .extracting(x -> ((BaseFactorySample) x.getInstance()).getN()) + .isEqualTo(Arrays.asList(n1, n2)); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/FactoryDataProviderWithNoArgCtorErrorSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryDataProviderWithNoArgCtorErrorSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/FactoryDataProviderWithNoArgCtorErrorSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryDataProviderWithNoArgCtorErrorSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package test.factory; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; + +public class FactoryDataProviderWithNoArgCtorErrorSample extends BaseFactorySample { + + public FactoryDataProviderWithNoArgCtorErrorSample() { + super(0); + } + + @Factory(dataProvider = "dp") + public FactoryDataProviderWithNoArgCtorErrorSample(int n) { + super(n); + } + + @DataProvider + public Object[][] dp() { + return new Object[][] { + new Object[] {45}, new Object[] {46}, + }; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/FactoryFailureNoInstancesSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryFailureNoInstancesSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/FactoryFailureNoInstancesSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryFailureNoInstancesSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.factory; + +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +public class FactoryFailureNoInstancesSample { + + public static final String METHOD_NAME = + FactoryFailureNoInstancesSample.class.getName() + ".factory()"; + + public FactoryFailureNoInstancesSample(int i) {} + + @Factory + public static Object[] factory() { + return new Object[] {}; + } + + @Test + public void f() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/FactoryFailureSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryFailureSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/FactoryFailureSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryFailureSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.factory; + +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +public class FactoryFailureSample { + + @Factory + public Object[] factory() { + throw new NullPointerException(); + } + + @Test + public void f() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/FactoryFailureTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryFailureTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/FactoryFailureTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryFailureTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,38 @@ +package test.factory; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class FactoryFailureTest extends SimpleBaseTest { + + @Test + public void factoryThrowingShouldNotRunTests() { + TestNG tng = create(FactoryFailureSample.class); + Throwable actual = new Throwable(); + try { + tng.run(); + } catch (Exception ex) { + actual = ex; + } + assertThat(actual.getCause()).hasCauseInstanceOf(NullPointerException.class); + } + + @Test(description = "GITHUB-1953") + public void factoryProducesNoInstancesTest() { + TestNG tng = create(FactoryFailureNoInstancesSample.class); + String actualErr = ""; + String expected = + String.format( + "The Factory method %s should have produced at-least one instance.", + FactoryFailureNoInstancesSample.METHOD_NAME); + try { + tng.run(); + } catch (Exception ex) { + actualErr = ex.getMessage(); + } + assertThat(actualErr).contains(expected); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/FactoryInSeparateClassTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryInSeparateClassTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/FactoryInSeparateClassTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryInSeparateClassTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,45 @@ +package test.factory; + +import org.testng.annotations.BeforeTest; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +/** + * this is like the FactoryTest, except it creates test instances in a separate class from the test + * class + */ +public class FactoryInSeparateClassTest { + private static boolean m_wasRun = false; + private static int m_checkSum = 0; + + public static void addToSum(int i) { + m_checkSum += i; + } + + @BeforeTest + public void beforeTest() { + m_wasRun = false; + m_checkSum = 0; + } + + @Factory + public Object[] createObjects() { + return new Object[] { + new MySample(1), new MySample(2), new MySample(3), + }; + } + + @Test( + groups = "testMethodOnFactoryClass", + dependsOnGroups = {"MySample"}) + public void checkSum() { + m_wasRun = true; + assert (m_checkSum == 6) + : "Test instances made by factory did not invoke their test methods correctly. expected 6 but got " + + m_checkSum; + } + + public static boolean wasRun() { + return m_wasRun; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/FactoryInSuperClassTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryInSuperClassTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/FactoryInSuperClassTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryInSuperClassTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.factory; + +import org.testng.Assert; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class FactoryInSuperClassTest extends SimpleBaseTest { + + @Test + public void factoryInSuperClassShouldWork() { + TestNG tng = create(ChildFactory.class); + TestListenerAdapter tla = new TestListenerAdapter(); + tng.addListener(tla); + tng.run(); + + Assert.assertEquals(tla.getPassedTests().size(), 1); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/FactoryIntegrationTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryIntegrationTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/FactoryIntegrationTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryIntegrationTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,68 @@ +package test.factory; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.failBecauseExceptionWasNotThrown; + +import org.testng.Assert; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.TestNGException; +import org.testng.annotations.Test; +import test.InvokedMethodNameListener; +import test.SimpleBaseTest; + +public class FactoryIntegrationTest extends SimpleBaseTest { + + @Test(description = "https://github.com/cbeust/testng/issues/876") + public void testExceptionWithNonStaticFactoryMethod() { + TestNG tng = create(GitHub876Sample.class); + try { + tng.run(); + failBecauseExceptionWasNotThrown(TestNGException.class); + } catch (TestNGException e) { + assertThat(e) + .hasMessage( + "\nCan't invoke public java.lang.Object[] test.factory.GitHub876Sample.createInstances(): either make it static or add a no-args constructor to your class"); + } + } + + @Test + public void testNonPublicFactoryMethodShouldWork() { + TestNG tng = create(NonPublicFactory.class); + TestListenerAdapter tla = new TestListenerAdapter(); + tng.addListener(tla); + + tng.run(); + + Assert.assertEquals(tla.getPassedTests().size(), 2); + } + + @Test + public void testExceptionWithBadFactoryMethodReturnType() { + TestNG tng = create(BadMethodReturnTypeFactory.class); + try { + tng.run(); + failBecauseExceptionWasNotThrown(TestNGException.class); + } catch (TestNGException e) { + assertThat(e) + .hasMessage( + "\ntest.factory.BadMethodReturnTypeFactory.createInstances MUST return [ java.lang.Object[] or org.testng.IInstanceInfo[] ] but returns java.lang.Object"); + } + } + + @Test + public void doubleFactoryMethodShouldWork() { + TestNG tng = create(DoubleFactory.class); + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener(listener); + + tng.run(); + + // TODO containsExactly is not used here because the order is not consistent. Check if we should + // fix it. + assertThat(listener.getSucceedMethodNames()) + .contains( + "FactoryBaseSample{1}#f", + "FactoryBaseSample{2}#f", "FactoryBaseSample{3}#f", "FactoryBaseSample{4}#f"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/FactoryInterleavingTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryInterleavingTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/FactoryInterleavingTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryInterleavingTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,35 @@ +package test.factory; + +import java.util.List; +import org.testng.Assert; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.collections.Lists; +import test.SimpleBaseTest; + +public class FactoryInterleavingTest extends SimpleBaseTest { + + public static List LOG = Lists.newArrayList(); + + @Test + public void methodsShouldBeInterleaved() { + TestNG tng = create(InterleavingFactorySample.class); + tng.setPreserveOrder(false); + tng.run(); + Integer[] valid1 = { + 10, 11, 12, 13, + 20, 21, 22, 23, + }; + + Integer[] valid2 = { + 20, 21, 22, 23, + 10, 11, 12, 13, + }; + Integer[] logArray = LOG.toArray(new Integer[0]); + if (!logArray.equals(valid1)) { + Assert.assertEquals(logArray, valid1); + } else if (!logArray.equals(valid2)) { + Assert.assertEquals(logArray, valid2); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/FactoryOrderMainTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryOrderMainTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/FactoryOrderMainTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryOrderMainTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,25 @@ +package test.factory; + +import java.util.List; +import org.testng.Assert; +import org.testng.ITestResult; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class FactoryOrderMainTest extends SimpleBaseTest { + + @Test + public void factoriesShouldBeInvokedInTheOrderOfCreation() { + TestNG tng = create(OrderFactory.class); + TestListenerAdapter tla = new TestListenerAdapter(); + tng.addListener(tla); + tng.run(); + + List passed = tla.getPassedTests(); + for (int i = 0; i < passed.size(); i++) { + Assert.assertEquals(((OrderSample) passed.get(i).getInstance()).getValue(), i); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/FactoryTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/FactoryTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,28 @@ +package test.factory; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertFalse; + +import org.testng.annotations.AfterSuite; +import org.testng.annotations.Factory; +import org.testng.annotations.Parameters; + +public class FactoryTest { + + static boolean isInvoked = false; + + @Parameters({"factory-param"}) + @Factory + public Object[] createObjects(String param) { + assertEquals(param, "FactoryParam"); + assertFalse(isInvoked, "Should only be invoked once"); + isInvoked = true; + + return new Object[] {new FactoryTest2(42), new FactoryTest2(43)}; + } + + @AfterSuite + public void afterSuite() { + isInvoked = false; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/FactoryTest2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryTest2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/FactoryTest2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryTest2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,33 @@ +package test.factory; + +import java.util.ArrayList; +import java.util.List; +import org.testng.annotations.Test; + +public class FactoryTest2 { + private static List numbers = new ArrayList<>(); + private int number; + + public FactoryTest2() { + throw new RuntimeException("Shouldn't be invoked"); + } + + public static List getNumbers() { + return numbers; + } + + public FactoryTest2(int n) { + number = n; + } + + @Test(groups = {"first"}) + public void testInt() { + Integer n = number; + numbers.add(n); + } + + @Override + public String toString() { + return "[FactoryTest2 " + number + "]"; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/FactoryWithDataProvider.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryWithDataProvider.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/FactoryWithDataProvider.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryWithDataProvider.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +package test.factory; + +import java.util.ArrayList; +import java.util.List; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; + +public class FactoryWithDataProvider { + + @DataProvider + public Object[][] dp() { + return new Object[][] { + new Object[] {new int[] {3, 5}}, + new Object[] {new int[] {7, 9}}, + }; + } + + @Factory(dataProvider = "dp") + public Object[] factory(int[] array) { + List result = new ArrayList<>(); + for (int n : array) { + result.add(new OddSample(n)); + } + + return result.toArray(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/FactoryWithDataProviderTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryWithDataProviderTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/FactoryWithDataProviderTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryWithDataProviderTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,45 @@ +package test.factory; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Collections; +import java.util.Map; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.collections.Maps; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.InvokedMethodNameListener; +import test.SimpleBaseTest; +import test.factory.issue1770.SampleTestFour; + +public class FactoryWithDataProviderTest extends SimpleBaseTest { + + /** Verify that a factory can receive a data provider */ + @Test + public void verifyDataProvider() { + TestNG tng = create(FactoryWithDataProvider.class); + TestListenerAdapter tla = new TestListenerAdapter(); + tng.addListener(tla); + tng.run(); + assertThat(tla.getPassedTests()).hasSize(4); + } + + private static final String RANDOM_VALUE = "random_value"; + + @Test(description = "GITHUB-1770") + public void verifyDataProvider2() { + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + XmlSuite xmlSuite = createXmlSuite("xml_suite"); + XmlTest xmlTest = createXmlTest(xmlSuite, "xml_test", SampleTestFour.class); + Map parameters = Maps.newHashMap(); + parameters.put("isCustom", RANDOM_VALUE); + xmlTest.setParameters(parameters); + TestNG testng = create(xmlSuite); + testng.addListener(listener); + testng.run(); + assertThat(listener.getLogs("test")) + .containsExactlyElementsOf(Collections.singletonList(RANDOM_VALUE)); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/FactoryWithInstanceInfo2Sample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryWithInstanceInfo2Sample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/FactoryWithInstanceInfo2Sample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryWithInstanceInfo2Sample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,29 @@ +package test.factory; + +import java.util.ArrayList; +import java.util.List; +import org.testng.annotations.Test; + +/** This class is created by FactoryWithInstanceInfo2Sample */ +public class FactoryWithInstanceInfo2Sample { + + private static List numbers = new ArrayList<>(); + private int number; + + public FactoryWithInstanceInfo2Sample() { + throw new RuntimeException("Shouldn't be invoked"); + } + + public static List getNumbers() { + return numbers; + } + + public FactoryWithInstanceInfo2Sample(int n) { + number = n; + } + + @Test(groups = {"first"}) + public void testInt() { + numbers.add(number); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/FactoryWithInstanceInfoTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryWithInstanceInfoTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/FactoryWithInstanceInfoTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/FactoryWithInstanceInfoTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,34 @@ +package test.factory; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertFalse; + +import org.testng.IInstanceInfo; +import org.testng.annotations.BeforeSuite; +import org.testng.annotations.Factory; +import org.testng.annotations.Parameters; +import org.testng.internal.InstanceInfo; + +public class FactoryWithInstanceInfoTest { + static boolean isInvoked = false; + + @Parameters({"factory-param"}) + @Factory + public IInstanceInfo[] createObjectsWithInstanceInfo(String param) { + assertEquals(param, "FactoryParam", "Incorrect param: " + param); + assertFalse(isInvoked, "Should only be invoked once"); + isInvoked = true; + + return new IInstanceInfo[] { + new InstanceInfo<>( + FactoryWithInstanceInfo2Sample.class, new FactoryWithInstanceInfo2Sample(42)), + new InstanceInfo<>( + FactoryWithInstanceInfo2Sample.class, new FactoryWithInstanceInfo2Sample(43)), + }; + } + + @BeforeSuite + public void beforeSuite() { + isInvoked = false; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/GitHub876Sample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/GitHub876Sample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/GitHub876Sample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/GitHub876Sample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,47 @@ +package test.factory; + +import org.testng.Assert; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +public class GitHub876Sample { + + @Factory + public Object[] createInstances() { + return new Object[] { + new GitHub876Sample(new DataTest("foo", true)), + new GitHub876Sample(new DataTest("FOO", false)) + }; + } + + private final DataTest dataTest; + + public GitHub876Sample(DataTest dataTest) { + this.dataTest = dataTest; + } + + @Test + public void test() { + switch (dataTest.s) { + case "FOO": + Assert.assertFalse(dataTest.b); + break; + case "foo": + Assert.assertTrue(dataTest.b); + break; + default: + Assert.fail("Unknown value"); + } + } + + public static class DataTest { + + private final String s; + private final boolean b; + + public DataTest(String s, boolean b) { + this.s = s; + this.b = b; + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/InterleavingFactorySample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/InterleavingFactorySample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/InterleavingFactorySample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/InterleavingFactorySample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package test.factory; + +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Factory; + +public class InterleavingFactorySample { + @Factory + public Object[] factory() { + return new Object[] {new InterleavingSample(1), new InterleavingSample(2)}; + } + + @BeforeClass + public void beforeB() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/InterleavingSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/InterleavingSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/InterleavingSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/InterleavingSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,42 @@ +package test.factory; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +public class InterleavingSample { + public final int n; + + public InterleavingSample(int n) { + this.n = n; + } + + private void log(Integer s) { + FactoryInterleavingTest.LOG.add(n * 10 + s); + } + + @Override + public String toString() { + return "[A n:" + n + "]"; + } + + @BeforeClass + public void bc() { + log(0); + } + + @AfterClass + public void ac() { + log(3); + } + + @Test + public void f1() { + log(1); + } + + @Test + public void f2() { + log(2); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/IteratorEmptyFactorySample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/IteratorEmptyFactorySample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/IteratorEmptyFactorySample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/IteratorEmptyFactorySample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,24 @@ +package test.factory; + +import java.util.Collections; +import java.util.Iterator; +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +public class IteratorEmptyFactorySample { + + @DataProvider(name = "values") + public static Iterator values() { + return Collections.emptyIterator(); + } + + @Factory(dataProvider = "values") + public IteratorEmptyFactorySample(int value) {} + + @Test + public void test() { + Assert.fail(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/MySample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/MySample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/MySample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/MySample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,32 @@ +package test.factory; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class MySample { + + private final int i; + + // in this test, our default constructor sets s to a value that will cause a failure + // the valid test instances should come from the factory + public MySample() { + i = 0; + } + + public MySample(int i) { + this.i = i; + } + + @Test(groups = "MySample") + public void testMethod() { + FactoryInSeparateClassTest.addToSum(i); + // assert i > 0 : "MySample was not constructed with correct params"; + Assert.assertNotEquals(i, 0, "My test was not created by the factory"); + } + + @Test(dependsOnGroups = "testMethodOnFactoryClass") + public void verifyThatTestMethodOnFactoryClassWasRun() { + Assert.assertTrue( + FactoryInSeparateClassTest.wasRun(), "Test method on factory class wasn't run"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/NestedFactorySample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/NestedFactorySample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/NestedFactorySample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/NestedFactorySample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,43 @@ +package test.factory; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertTrue; + +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +public class NestedFactorySample { + + private final int m_capacity; + private final float m_loadFactor; + + public class NestedFactory { + @Factory + public Object[] createInstances() { + return new NestedFactorySample[] { + new NestedFactorySample(1, 0.1f), new NestedFactorySample(10, 0.5f), + }; + } + } + + private static int m_instanceCount = 0; + + public NestedFactorySample() { + this(2, 0.4f); + } + + public NestedFactorySample(int capacity, float loadFactor) { + m_instanceCount++; + this.m_capacity = capacity; + this.m_loadFactor = loadFactor; + } + + @Test + public void verify() { + // Should have three instances: the default one created by TestNG + // and two created by the factory + assertEquals(m_instanceCount, 3); + assertTrue( + (m_capacity == 1 && m_loadFactor == 0.1f) || m_capacity == 10 && m_loadFactor == 0.5f); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/NestedStaticFactorySample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/NestedStaticFactorySample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/NestedStaticFactorySample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/NestedStaticFactorySample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,44 @@ +package test.factory; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertTrue; + +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +public class NestedStaticFactorySample { + + private final int m_capacity; + private final float m_loadFactor; + + public static class NestedStaticFactory { + + @Factory + public Object[] createInstances() { + return new NestedStaticFactorySample[] { + new NestedStaticFactorySample(1, 0.1f), new NestedStaticFactorySample(10, 0.5f), + }; + } + } + + private static int m_instanceCount = 0; + + public NestedStaticFactorySample() { + this(2, 0.4f); + } + + public NestedStaticFactorySample(int capacity, float loadFactor) { + m_instanceCount++; + this.m_capacity = capacity; + this.m_loadFactor = loadFactor; + } + + @Test + public void verify() { + // Should have three instances: the default one created by TestNG + // and two created by the factory + assertEquals(m_instanceCount, 2); + assertTrue( + (m_capacity == 1 && m_loadFactor == 0.1f) || m_capacity == 10 && m_loadFactor == 0.5f); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/NonPublicFactory.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/NonPublicFactory.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/NonPublicFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/NonPublicFactory.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.factory; + +import org.testng.annotations.Factory; + +public class NonPublicFactory { + + @Factory + private Object[] createInstances() { + return new Object[] {new BaseFactorySample(42), new BaseFactorySample(43)}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/NotStaticDataProvider.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/NotStaticDataProvider.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/NotStaticDataProvider.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/NotStaticDataProvider.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,13 @@ +package test.factory; + +import org.testng.annotations.DataProvider; + +public class NotStaticDataProvider { + + @DataProvider + public Object[][] dp() { + return new Object[][] { + new Object[] {43}, new Object[] {44}, + }; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/OddSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/OddSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/OddSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/OddSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ +package test.factory; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class OddSample { + + private final int n; + + public OddSample(int n) { + this.n = n; + } + + @Test + public void verify() { + Assert.assertNotEquals(n % 2, 0); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/OrderFactory.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/OrderFactory.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/OrderFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/OrderFactory.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package test.factory; + +import java.util.ArrayList; +import java.util.List; +import org.testng.annotations.Factory; + +public class OrderFactory { + + @Factory + public static Object[] testF() { + List result = new ArrayList<>(); + for (int i = 0; i < 5; i++) { + result.add(new OrderSample(i)); + } + return result.toArray(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/OrderSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/OrderSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/OrderSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/OrderSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,32 @@ +package test.factory; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +public class OrderSample { + + final int value; + + public OrderSample(int j) { + value = j; + } + + @BeforeClass(groups = {"s1ds"}) + public void setup() {} + + @Test(groups = {"s1ds"}) + public void methodC1() {} + + @AfterClass(groups = {"s1ds"}) + public void cleanup() {} + + @Override + public String toString() { + return "[OrderSample " + value + "]"; + } + + public int getValue() { + return value; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/StaticDataProvider.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/StaticDataProvider.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/StaticDataProvider.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/StaticDataProvider.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,13 @@ +package test.factory; + +import org.testng.annotations.DataProvider; + +public class StaticDataProvider { + + @DataProvider + public static Object[][] dp() { + return new Object[][] { + new Object[] {43}, new Object[] {44}, + }; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/TestClassAnnotationTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/TestClassAnnotationTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/TestClassAnnotationTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/TestClassAnnotationTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,31 @@ +package test.factory; + +import org.testng.Assert; +import org.testng.annotations.AfterClass; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +/** + * Make sure that @Factory methods are not counted as @Test in the presence of a class-scoped @Test + * annotation. + */ +@Test +public class TestClassAnnotationTest { + + private int count; + + @Factory + public Object[] createFixture() { + count++; + return new Object[] {new Object[] {new Object()}}; + } + + public void testOne() { + count++; + } + + @AfterClass + public void verify() { + Assert.assertEquals(count, 2); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/VerifyFactoryTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/VerifyFactoryTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/VerifyFactoryTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/VerifyFactoryTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.factory; + +import java.util.List; +import org.testng.Assert; +import org.testng.annotations.Test; + +public class VerifyFactoryTest { + + @Test(dependsOnGroups = {"first"}) + public void mainCheck() { + List numbers = FactoryTest2.getNumbers(); + Assert.assertTrue(numbers.contains(42), "Didn't find 42"); + Assert.assertTrue(numbers.contains(43), "Didn't find 43"); + Assert.assertEquals(numbers.size(), 2); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/VerifyFactoryWithInstanceInfoTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/VerifyFactoryWithInstanceInfoTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/VerifyFactoryWithInstanceInfoTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/VerifyFactoryWithInstanceInfoTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.factory; + +import java.util.List; +import org.testng.Assert; +import org.testng.annotations.Test; + +public class VerifyFactoryWithInstanceInfoTest { + + @Test(dependsOnGroups = {"first"}) + public void mainCheck() { + List numbers = FactoryWithInstanceInfo2Sample.getNumbers(); + Assert.assertTrue(numbers.contains(42), "Didn't find 42"); + Assert.assertTrue(numbers.contains(43), "Didn't find 43"); + Assert.assertEquals(numbers.size(), 2); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/classconf/XClassOrderWithFactory.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/classconf/XClassOrderWithFactory.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/classconf/XClassOrderWithFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/classconf/XClassOrderWithFactory.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,31 @@ +package test.factory.classconf; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +public class XClassOrderWithFactory { + public static final String EXPECTED_LOG = "BTABTABTA"; + public static final StringBuffer LOG = new StringBuffer(); + + @Factory + public Object[] createInstances() { + return new Object[] {new XClassOrderTest(), new XClassOrderTest(), new XClassOrderTest()}; + } + + public static class XClassOrderTest { + @BeforeClass + public void beforeClass() { + LOG.append("B"); + } + + public @Test void test() { + LOG.append("T"); + } + + public @AfterClass void afterClass() { + LOG.append("A"); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/classconf/XClassOrderWithFactoryTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/classconf/XClassOrderWithFactoryTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/classconf/XClassOrderWithFactoryTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/classconf/XClassOrderWithFactoryTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ +package test.factory.classconf; + +import org.testng.Assert; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; + +public class XClassOrderWithFactoryTest { + @Test + public void testBeforeAfterClassInvocationsWithFactory() { + TestNG testng = new TestNG(); + testng.setTestClasses(new Class[] {XClassOrderWithFactory.class}); + TestListenerAdapter tla = new TestListenerAdapter(); + testng.addListener(tla); + testng.run(); + Assert.assertEquals(XClassOrderWithFactory.LOG.toString(), XClassOrderWithFactory.EXPECTED_LOG); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/github1083/ArrayFactorySample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github1083/ArrayFactorySample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/github1083/ArrayFactorySample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github1083/ArrayFactorySample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +package test.factory.github1083; + +import java.util.ArrayList; +import java.util.List; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +public class ArrayFactorySample { + + public static final List parameters = new ArrayList<>(); + + private final String parameter; + + private ArrayFactorySample(String parameter) { + this.parameter = parameter; + } + + @Test + public void test() { + parameters.add(parameter); + } + + @Factory(indices = 1) + public static Object[] arrayFactory() { + return new Object[] {new ArrayFactorySample("foo"), new ArrayFactorySample("bar")}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/github1083/ConstructorFactorySample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github1083/ConstructorFactorySample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/github1083/ConstructorFactorySample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github1083/ConstructorFactorySample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,29 @@ +package test.factory.github1083; + +import java.util.ArrayList; +import java.util.List; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +public class ConstructorFactorySample { + + public static final List parameters = new ArrayList<>(); + + private final String parameter; + + @Factory(indices = 1, dataProvider = "dp") + public ConstructorFactorySample(String parameter) { + this.parameter = parameter; + } + + @Test + public void test() { + parameters.add(parameter); + } + + @DataProvider + public static Object[][] dp() { + return new Object[][] {new Object[] {"foo"}, new Object[] {"bar"}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/github1083/DataProviderArrayFactorySample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github1083/DataProviderArrayFactorySample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/github1083/DataProviderArrayFactorySample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github1083/DataProviderArrayFactorySample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,33 @@ +package test.factory.github1083; + +import java.util.ArrayList; +import java.util.List; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +public class DataProviderArrayFactorySample { + + public static final List parameters = new ArrayList<>(); + + private final String parameter; + + private DataProviderArrayFactorySample(String parameter) { + this.parameter = parameter; + } + + @Test + public void test() { + parameters.add(parameter); + } + + @Factory(indices = 1, dataProvider = "dp") + public static Object[] arrayFactory(String s) { + return new Object[] {new DataProviderArrayFactorySample(s)}; + } + + @DataProvider + public static Object[][] dp() { + return new Object[][] {new Object[] {"foo"}, new Object[] {"bar"}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/github1083/DataProviderInstanceInfoFactorySample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github1083/DataProviderInstanceInfoFactorySample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/github1083/DataProviderInstanceInfoFactorySample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github1083/DataProviderInstanceInfoFactorySample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,38 @@ +package test.factory.github1083; + +import java.util.ArrayList; +import java.util.List; +import org.testng.IInstanceInfo; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; +import org.testng.internal.InstanceInfo; + +public class DataProviderInstanceInfoFactorySample { + + public static final List parameters = new ArrayList<>(); + + private final String parameter; + + private DataProviderInstanceInfoFactorySample(String parameter) { + this.parameter = parameter; + } + + @Test + public void test() { + parameters.add(parameter); + } + + @Factory(indices = 1, dataProvider = "dp") + public static IInstanceInfo[] arrayFactory(String s) { + return new IInstanceInfo[] { + new InstanceInfo<>( + DataProviderInstanceInfoFactorySample.class, new DataProviderInstanceInfoFactorySample(s)) + }; + } + + @DataProvider + public static Object[][] dp() { + return new Object[][] {new Object[] {"foo"}, new Object[] {"bar"}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/github1083/GitHub1083Test.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github1083/GitHub1083Test.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/github1083/GitHub1083Test.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github1083/GitHub1083Test.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,47 @@ +package test.factory.github1083; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.lang.reflect.Field; +import java.util.List; +import org.testng.TestNG; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import test.InvokedMethodNameListener; +import test.SimpleBaseTest; + +public class GitHub1083Test extends SimpleBaseTest { + + @Test(dataProvider = "dp") + public void testArrayFactorySample(Class sampleClass) + throws NoSuchFieldException, IllegalAccessException { + List parameters = getParameters(sampleClass); + parameters.clear(); + TestNG tng = create(sampleClass); + + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener(listener); + + tng.run(); + + assertThat(parameters).containsExactly("bar"); + assertThat(listener.getSucceedMethodNames()).containsExactly("test"); + } + + @DataProvider + public static Object[][] dp() { + return new Object[][] { + new Object[] {ArrayFactorySample.class}, + new Object[] {ConstructorFactorySample.class}, + new Object[] {DataProviderArrayFactorySample.class}, + new Object[] {DataProviderInstanceInfoFactorySample.class}, + new Object[] {InstanceInfoFactorySample.class} + }; + } + + public static List getParameters(Class clazz) + throws NoSuchFieldException, IllegalAccessException { + Field parameters = clazz.getField("parameters"); + return (List) parameters.get(null); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/github1083/InstanceInfoFactorySample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github1083/InstanceInfoFactorySample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/github1083/InstanceInfoFactorySample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github1083/InstanceInfoFactorySample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,32 @@ +package test.factory.github1083; + +import java.util.ArrayList; +import java.util.List; +import org.testng.IInstanceInfo; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; +import org.testng.internal.InstanceInfo; + +public class InstanceInfoFactorySample { + + public static final List parameters = new ArrayList<>(); + + private final String parameter; + + private InstanceInfoFactorySample(String parameter) { + this.parameter = parameter; + } + + @Test + public void test() { + parameters.add(parameter); + } + + @Factory(indices = 1) + public static IInstanceInfo[] arrayFactory() { + return new IInstanceInfo[] { + new InstanceInfo<>(InstanceInfoFactorySample.class, new InstanceInfoFactorySample("foo")), + new InstanceInfo<>(InstanceInfoFactorySample.class, new InstanceInfoFactorySample("bar")) + }; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/github1131/EmptyConstructorSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github1131/EmptyConstructorSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/github1131/EmptyConstructorSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github1131/EmptyConstructorSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package test.factory.github1131; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +public class EmptyConstructorSample { + + public static int count = 0; + + @Factory(dataProvider = "dataProvider") + public EmptyConstructorSample() { + count++; + } + + @Test + public void test() {} + + @DataProvider + public static Object[][] dataProvider() { + return new Object[][] {new Object[] {}, new Object[] {}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/github1131/GitHub1131Test.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github1131/GitHub1131Test.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/github1131/GitHub1131Test.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github1131/GitHub1131Test.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,54 @@ +package test.factory.github1131; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.Assert; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.InvokedMethodNameListener; +import test.SimpleBaseTest; + +public class GitHub1131Test extends SimpleBaseTest { + + @Test + public void testFactoryOnEmptyConstructor() { + EmptyConstructorSample.count = 0; + TestNG tng = create(EmptyConstructorSample.class); + + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener(listener); + + tng.run(); + + assertThat(listener.getSucceedMethodNames()).containsExactly("test", "test"); + Assert.assertEquals(EmptyConstructorSample.count, 2); + } + + @Test + public void testFactoryOnIntConstructor() { + IntConstructorSample.parameters.clear(); + TestNG tng = create(IntConstructorSample.class); + + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener(listener); + + tng.run(); + + assertThat(listener.getSucceedMethodNames()).containsExactly("test", "test"); + assertThat(IntConstructorSample.parameters).containsExactly(1, 2); + } + + @Test + public void testFactoryOnStringConstructor() { + StringConstructorSample.parameters.clear(); + TestNG tng = create(StringConstructorSample.class); + + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener(listener); + + tng.run(); + + assertThat(listener.getSucceedMethodNames()).containsExactly("test", "test"); + assertThat(StringConstructorSample.parameters).containsExactly("foo", "bar"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/github1131/IntConstructorSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github1131/IntConstructorSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/github1131/IntConstructorSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github1131/IntConstructorSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,25 @@ +package test.factory.github1131; + +import java.util.ArrayList; +import java.util.List; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +public class IntConstructorSample { + + public static final List parameters = new ArrayList<>(); + + @Factory(dataProvider = "dataProvider") + public IntConstructorSample(int parameter) { + parameters.add(parameter); + } + + @Test + public void test() {} + + @DataProvider + public static Object[][] dataProvider() { + return new Object[][] {new Object[] {1}, new Object[] {2}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/github1131/StringConstructorSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github1131/StringConstructorSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/github1131/StringConstructorSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github1131/StringConstructorSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,25 @@ +package test.factory.github1131; + +import java.util.ArrayList; +import java.util.List; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +public class StringConstructorSample { + + public static final List parameters = new ArrayList<>(); + + @Factory(dataProvider = "dataProvider") + public StringConstructorSample(String parameter) { + parameters.add(parameter); + } + + @Test + public void test() {} + + @DataProvider + public static Object[][] dataProvider() { + return new Object[][] {new Object[] {"foo"}, new Object[] {"bar"}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/github1631/DataProviderTransformer.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github1631/DataProviderTransformer.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/github1631/DataProviderTransformer.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github1631/DataProviderTransformer.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,46 @@ +package test.factory.github1631; + +import java.lang.reflect.Constructor; +import java.lang.reflect.Method; +import org.testng.IAnnotationTransformer; +import org.testng.annotations.IConfigurationAnnotation; +import org.testng.annotations.IDataProviderAnnotation; +import org.testng.annotations.IFactoryAnnotation; +import org.testng.annotations.ITestAnnotation; + +public class DataProviderTransformer implements IAnnotationTransformer { + + private Class dataProviderClass; + + @Override + public void transform( + final IConfigurationAnnotation annotation, + final Class testClass, + final Constructor testConstructor, + final Method testMethod) { + // not implemented + } + + @Override + public void transform(final IDataProviderAnnotation annotation, final Method testMethod) { + // not implemented + } + + @Override + public void transform( + final ITestAnnotation annotation, + final Class testClass, + final Constructor testConstructor, + final Method testMethod) { + // not implemented + } + + @Override + public void transform(final IFactoryAnnotation annotation, final Method testMethod) { + dataProviderClass = annotation.getDataProviderClass(); + } + + public Class getDataProviderClass() { + return dataProviderClass; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/github1631/ExternalDataProviders.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github1631/ExternalDataProviders.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/github1631/ExternalDataProviders.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github1631/ExternalDataProviders.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.factory.github1631; + +import org.testng.annotations.DataProvider; + +public class ExternalDataProviders { + + @DataProvider + public Object[] data() { + return new Object[] {1, 2, 3}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/github1631/FactoryWithExternalDataProviderTests.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github1631/FactoryWithExternalDataProviderTests.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/github1631/FactoryWithExternalDataProviderTests.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github1631/FactoryWithExternalDataProviderTests.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.factory.github1631; + +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +public class FactoryWithExternalDataProviderTests { + + public FactoryWithExternalDataProviderTests() {} + + @Factory(dataProvider = "data", dataProviderClass = ExternalDataProviders.class) + public FactoryWithExternalDataProviderTests(final int i) { + // not important + } + + @Test + public void fakeTest() { + // not important + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/github1631/FactoryWithLocalDataProviderTests.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github1631/FactoryWithLocalDataProviderTests.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/github1631/FactoryWithLocalDataProviderTests.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github1631/FactoryWithLocalDataProviderTests.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,25 @@ +package test.factory.github1631; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +public class FactoryWithLocalDataProviderTests { + + public FactoryWithLocalDataProviderTests() {} + + @Factory(dataProvider = "data") + public FactoryWithLocalDataProviderTests(final int i) { + // not important + } + + @DataProvider + public Object[] data() { + return new Object[] {1, 2, 3}; + } + + @Test + public void fakeTest() { + // not important + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/github1631/GitHub1631Tests.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github1631/GitHub1631Tests.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/github1631/GitHub1631Tests.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github1631/GitHub1631Tests.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,31 @@ +package test.factory.github1631; + +import org.testng.*; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class GitHub1631Tests extends SimpleBaseTest { + + @Test( + description = "Test @Factory(dataProvider) should implicitly inject data provider class name") + public void factoryWithLocalDataProviderShouldUseHostClassName() { + final DataProviderTransformer transformer = runTest(FactoryWithLocalDataProviderTests.class); + Assert.assertEquals( + transformer.getDataProviderClass(), FactoryWithLocalDataProviderTests.class); + } + + @Test(description = "Test @Factory(dataProvider) should explicitly set data provider class name") + public void factoryWithExplicitDataProviderShouldUseExternalClassName() { + final DataProviderTransformer transformer = runTest(FactoryWithExternalDataProviderTests.class); + Assert.assertEquals(transformer.getDataProviderClass(), ExternalDataProviders.class); + } + + private DataProviderTransformer runTest(final Class cls) { + final TestNG tng = create(cls); + final DataProviderTransformer dpt = new DataProviderTransformer(); + tng.addListener(dpt); + tng.run(); + + return dpt; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/github2428/FactoryTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github2428/FactoryTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/github2428/FactoryTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github2428/FactoryTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +package test.factory.github2428; + +import org.testng.annotations.BeforeClass; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +public class FactoryTest { + + int i; + + @Factory(dataProvider = "dp") + public FactoryTest(int i) { + this.i = i; + } + + @DataProvider(parallel = true) + public static Object[][] dp() { + return new Object[][] {{5}, {4}, {12}, {9}, {2}}; + } + + @BeforeClass + public void beforeClassBody() {} + + @Test + public void testBody() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/github2428/IssueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github2428/IssueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/github2428/IssueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github2428/IssueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,21 @@ +package test.factory.github2428; + +import org.testng.Assert; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class IssueTest extends SimpleBaseTest { + @Test + public void issue2438() { + TestNG testng = create(FactoryTest.class); + testng.setDefaultSuiteName("factory tests"); + Reporter reporter = new Reporter(); + testng.addListener(reporter); + testng.run(); + Assert.assertEquals( + reporter.getResults().size(), + 5, + "Data provider generated 5 rows, so expecting 5 distinct test instances to be used"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/github2428/Reporter.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github2428/Reporter.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/github2428/Reporter.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github2428/Reporter.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,29 @@ +package test.factory.github2428; + +import java.util.Collections; +import java.util.IdentityHashMap; +import java.util.List; +import java.util.Set; +import org.testng.IReporter; +import org.testng.ISuite; +import org.testng.xml.XmlSuite; + +public class Reporter implements IReporter { + private final Set results = Collections.newSetFromMap(new IdentityHashMap<>()); + + public Set getResults() { + return results; + } + + public void generateReport( + List xmlSuites, List suites, String outputDirectory) { + suites + .get(0) + .getResults() + .get("Command line test") + .getTestContext() + .getPassedConfigurations() + .getAllResults() + .forEach(x -> results.add(x.getInstance())); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/github328/ExcludedFactory.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github328/ExcludedFactory.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/github328/ExcludedFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github328/ExcludedFactory.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,24 @@ +package test.factory.github328; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +public class ExcludedFactory { + + public static final String EXCLUDED_GROUP = "excludedCtorFactory"; + public static boolean factoryRan = false; + + @Factory(dataProvider = "empty") + public ExcludedFactory(int a) { + factoryRan = true; + } + + @Test(groups = EXCLUDED_GROUP) + public void emptyTest() {} + + @DataProvider(name = "empty") + private static Object[][] provider() { + return new Object[][] {{1}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/github328/GitHub328Test.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github328/GitHub328Test.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/github328/GitHub328Test.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/github328/GitHub328Test.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,26 @@ +package test.factory.github328; + +import static test.factory.github328.ExcludedFactory.EXCLUDED_GROUP; + +import java.util.Collections; +import org.testng.Assert; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.SimpleBaseTest; + +public class GitHub328Test extends SimpleBaseTest { + + @Test + public void testFactoryExecutionWhenNoIncludedTests() { + XmlSuite suite = createXmlSuite("Suite"); + XmlTest test = createXmlTest(suite, "Test", ExcludedFactory.class); + test.setExcludedGroups(Collections.singletonList(EXCLUDED_GROUP)); + TestNG tng = create(suite); + + tng.run(); + + Assert.assertFalse(ExcludedFactory.factoryRan); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/issue1041/FactoryAnnotatedConstructorExample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/issue1041/FactoryAnnotatedConstructorExample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/issue1041/FactoryAnnotatedConstructorExample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/issue1041/FactoryAnnotatedConstructorExample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,52 @@ +package test.factory.issue1041; + +import java.util.List; +import java.util.Objects; +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; +import org.testng.collections.Lists; + +public class FactoryAnnotatedConstructorExample { + static List objects = Lists.newArrayList(); + + private int data; + + @Factory(dataProvider = "dp") + public FactoryAnnotatedConstructorExample(int data) { + this.data = data; + addInstance(this); + } + + private static void addInstance(FactoryAnnotatedConstructorExample instance) { + objects.add(instance); + } + + @DataProvider(name = "dp") + public static Object[][] getData() { + return new Object[][] {{1}, {2}}; + } + + @Test + public void testMethod() { + Assert.assertTrue(data > 0); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FactoryAnnotatedConstructorExample that = (FactoryAnnotatedConstructorExample) o; + return data == that.data; + } + + @Override + public int hashCode() { + return Objects.hash(data); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/issue1041/IssueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/issue1041/IssueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/issue1041/IssueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/issue1041/IssueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,29 @@ +package test.factory.issue1041; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.List; +import java.util.stream.Collectors; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.collections.Lists; +import test.SimpleBaseTest; + +public class IssueTest extends SimpleBaseTest { + + @Test + public void testFactoryAnnotatedConstructor() { + TestNG testng = create(FactoryAnnotatedConstructorExample.class); + ResultExtractor extractor = new ResultExtractor(); + testng.addListener(extractor); + testng.run(); + List expected = Lists.newArrayList(); + expected.add(new Object[] {1}); + expected.add(new Object[] {2}); + List actual = + FactoryAnnotatedConstructorExample.objects.stream() + .map(extractor::getData) + .collect(Collectors.toList()); + assertThat(actual).containsExactlyInAnyOrderElementsOf(expected); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/issue1041/ResultExtractor.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/issue1041/ResultExtractor.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/issue1041/ResultExtractor.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/issue1041/ResultExtractor.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,47 @@ +package test.factory.issue1041; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import org.testng.IReporter; +import org.testng.IResultMap; +import org.testng.ISuite; +import org.testng.ISuiteResult; +import org.testng.ITestContext; +import org.testng.ITestResult; +import org.testng.collections.Maps; +import org.testng.xml.XmlSuite; + +public class ResultExtractor implements IReporter { + + private Map data = Maps.newHashMap(); + + @Override + public void generateReport( + List xmlSuites, List suites, String outputDirectory) { + suites.forEach(this::process); + } + + private void process(ISuite suite) { + suite.getResults().values().forEach(this::process); + } + + private void process(ISuiteResult suiteResult) { + ITestContext ctx = suiteResult.getTestContext(); + List resultmaps = + Arrays.asList(ctx.getFailedTests(), ctx.getPassedTests(), ctx.getSkippedTests()); + resultmaps.forEach(this::process); + } + + private void process(IResultMap resultMap) { + resultMap.getAllResults().forEach(this::process); + } + + private void process(ITestResult result) { + data.put(result.getInstance(), result.getFactoryParameters()); + } + + public Object[] getData(Object key) { + return data.get(key); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/issue1745/Github1745Test.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/issue1745/Github1745Test.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/issue1745/Github1745Test.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/issue1745/Github1745Test.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,28 @@ +package test.factory.issue1745; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Collections; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlTest; +import test.InvokedMethodNameListener; +import test.SimpleBaseTest; + +public class Github1745Test extends SimpleBaseTest { + + private static final String TEST_METHOD = "testMethod"; + + @Test + public void testMethod() { + XmlTest xmlTest = createXmlTest("1745_suite", "1745_test", SuiteXmlPoweredFactoryTest.class); + xmlTest.addParameter("number", "3"); + TestNG testng = create(); + testng.setXmlSuites(Collections.singletonList(xmlTest.getSuite())); + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + testng.addListener(listener); + testng.run(); + assertThat(listener.getSucceedMethodNames()) + .containsExactly(TEST_METHOD, TEST_METHOD, TEST_METHOD, TEST_METHOD); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/issue1745/SuiteXmlPoweredFactoryTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/issue1745/SuiteXmlPoweredFactoryTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/issue1745/SuiteXmlPoweredFactoryTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/issue1745/SuiteXmlPoweredFactoryTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,28 @@ +package test.factory.issue1745; + +import org.testng.ITestContext; +import org.testng.annotations.Factory; +import org.testng.xml.XmlTest; + +public class SuiteXmlPoweredFactoryTest { + + @Factory + public Object[] createInstances(ITestContext ctx) { + return new Object[] {new TestClassSample(ctx, "testcontext")}; + } + + @Factory + public Object[] createInstances(XmlTest currentXmlTest) { + return new Object[] {new TestClassSample(currentXmlTest, "xmltest")}; + } + + @Factory + public Object[] createInstances(ITestContext ctx, XmlTest currentXmlTest) { + return new Object[] {new TestClassSample(ctx, currentXmlTest)}; + } + + @Factory + public Object[] createInstances(XmlTest currentXmlTest, ITestContext ctx) { + return new Object[] {new TestClassSample(ctx, currentXmlTest)}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/issue1745/TestClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/issue1745/TestClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/issue1745/TestClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/issue1745/TestClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,40 @@ +package test.factory.issue1745; + +import static org.testng.Assert.assertNotNull; +import static org.testng.Assert.assertTrue; + +import org.testng.ITestContext; +import org.testng.annotations.Test; +import org.testng.xml.XmlTest; + +public class TestClassSample { + private ITestContext ctx; + private XmlTest currentXmlTest; + private String whatWasPassed = ""; + + public TestClassSample(ITestContext ctx, String whatWasPassed) { + this.ctx = ctx; + this.whatWasPassed = whatWasPassed; + } + + public TestClassSample(XmlTest currentXmlTest, String whatWasPassed) { + this.currentXmlTest = currentXmlTest; + this.whatWasPassed = whatWasPassed; + } + + public TestClassSample(ITestContext ctx, XmlTest currentXmlTest) { + this.ctx = ctx; + this.currentXmlTest = currentXmlTest; + } + + @Test + public void testMethod() { + if ("testcontext".equalsIgnoreCase(whatWasPassed)) { // only testcontext was provided + assertNotNull(ctx); + currentXmlTest = ctx.getCurrentXmlTest(); + } + assertNotNull(currentXmlTest); + int number = Integer.parseInt(currentXmlTest.getParameter("number")); + assertTrue(number != 0); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/issue1770/SampleTestBase.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/issue1770/SampleTestBase.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/issue1770/SampleTestBase.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/issue1770/SampleTestBase.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,13 @@ +package test.factory.issue1770; + +public class SampleTestBase { + private String flag; + + public SampleTestBase(String fl) { + this.flag = fl; + } + + public String getFlag() { + return flag; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/issue1770/SampleTestFour.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/issue1770/SampleTestFour.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/issue1770/SampleTestFour.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/issue1770/SampleTestFour.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.factory.issue1770; + +import org.testng.Reporter; +import org.testng.annotations.Factory; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; + +public class SampleTestFour extends SampleTestBase { + + @Factory + @Parameters({"isCustom"}) + public SampleTestFour(String fl) { + super(fl); + } + + @Test + public void test() { + Reporter.log(getFlag()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/issue1924/IssueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/issue1924/IssueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/issue1924/IssueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/issue1924/IssueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.factory.issue1924; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Arrays; +import java.util.List; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class IssueTest extends SimpleBaseTest { + + @Test + public void ensureTestClassInstantiationWorksWhenFactoryMethodAndCustomConstructorPresent() { + TestNG testng = create(TestclassSample.class); + testng.run(); + List expected = Arrays.asList("1", "2"); + assertThat(TestclassSample.logs).containsExactlyInAnyOrderElementsOf(expected); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/issue1924/TestclassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/issue1924/TestclassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/issue1924/TestclassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/issue1924/TestclassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,26 @@ +package test.factory.issue1924; + +import java.util.List; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; +import org.testng.collections.Lists; + +public class TestclassSample { + public static List logs = Lists.newArrayList(); + + private int i; + + public TestclassSample(int i) { + this.i = i; + } + + @Factory + public static Object[] produce() { + return new Object[] {new TestclassSample(1), new TestclassSample(2)}; + } + + @Test + public void testMethod() { + logs.add(Integer.toString(this.i)); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/issue326/IssueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/issue326/IssueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/issue326/IssueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/issue326/IssueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,54 @@ +package test.factory.issue326; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.List; +import java.util.Map; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite.ParallelMode; +import test.SimpleBaseTest; +import test.factory.issue326.LocalTrackingListener.Statistics; + +public class IssueTest extends SimpleBaseTest { + + @Test(description = "GITHUB-326") + public void testToCheckParallelExecutionOfInstancesWithOneThreadPerInstance() { + TestNG testng = create(SampleTestClass.class); + testng.setGroupByInstances(true); + testng.setParallel(ParallelMode.INSTANCES); + testng.setThreadCount(20); + testng.setDataProviderThreadCount(10); + LocalTrackingListener listener = new LocalTrackingListener(); + testng.addListener(listener); + testng.run(); + + // Ensure that the difference in start times for the methods in both instances is <= 1000 ms. + long diff = computeDiffInStartTimeFor(listener.getResults(), SampleTestClass.FREDDY); + assertThat(diff).isLessThanOrEqualTo(1000); + diff = computeDiffInStartTimeFor(listener.getResults(), SampleTestClass.BARNEY); + assertThat(diff).isLessThanOrEqualTo(1000); + + // Ensure that the thread ids for both the instances are different. + long threadIdFreddyInstance = listener.getThreadIds().get(SampleTestClass.FREDDY); + long threadIdBarneyInstance = listener.getThreadIds().get(SampleTestClass.BARNEY); + + assertThat(threadIdFreddyInstance).isNotEqualTo(threadIdBarneyInstance); + } + + private static long computeDiffInStartTimeFor( + Map> allStats, String instanceName) { + long test1OnFreddyInstance = getStartTimeFrom(allStats, instanceName, "test1"); + long test2OnFreddyInstance = getStartTimeFrom(allStats, instanceName, "test2"); + return Math.abs(test2OnFreddyInstance - test1OnFreddyInstance); + } + + private static long getStartTimeFrom( + Map> allStats, String instanceName, String methodName) { + return allStats.get(instanceName).stream() + .filter(statistics -> statistics.methodName.equals(methodName)) + .findFirst() + .map(statistics -> statistics.startTimeInMs) + .orElseThrow(IllegalStateException::new); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/issue326/LocalTrackingListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/issue326/LocalTrackingListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/issue326/LocalTrackingListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/issue326/LocalTrackingListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,48 @@ +package test.factory.issue326; + +import java.util.List; +import java.util.Map; +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.ITestResult; +import org.testng.collections.Lists; +import org.testng.collections.Maps; + +public class LocalTrackingListener implements IInvokedMethodListener { + + private Map> results = Maps.newConcurrentMap(); + private Map threadIds = Maps.newConcurrentMap(); + + @Override + public void afterInvocation(IInvokedMethod method, ITestResult testResult) { + String key = testResult.getInstance().toString(); + if (!results.containsKey(key)) { + results.put(key, Lists.newArrayList()); + } + results + .get(key) + .add(new Statistics(testResult.getMethod().getMethodName(), testResult.getStartMillis())); + if (!threadIds.containsKey(key)) { + Long threadId = Long.parseLong(testResult.getAttribute(SampleTestClass.THREAD_ID).toString()); + threadIds.put(key, threadId); + } + } + + public Map> getResults() { + return results; + } + + public Map getThreadIds() { + return threadIds; + } + + static class Statistics { + String methodName; + long startTimeInMs; + + public Statistics(String methodName, long startTimeInMs) { + this.methodName = methodName; + this.startTimeInMs = startTimeInMs; + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/issue326/SampleTestClass.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/issue326/SampleTestClass.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/issue326/SampleTestClass.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/issue326/SampleTestClass.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,55 @@ +package test.factory.issue326; + +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import java.util.Random; +import java.util.concurrent.TimeUnit; +import org.testng.ITestResult; +import org.testng.Reporter; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +public class SampleTestClass { + + static final String THREAD_ID = "threadId"; + static final String FREDDY = "Freddy"; + static final String BARNEY = "Barney"; + + private final String instance; + private final Random random; + + @Factory(dataProvider = "dp") + public SampleTestClass(String instance) { + this.instance = instance; + random = new Random(); + } + + @DataProvider + public static Iterator dp() { + List names = Arrays.asList(new Object[] {FREDDY}, new Object[] {BARNEY}); + return names.iterator(); + } + + @Test + public void test1() throws InterruptedException { + printer(); + } + + @Test + public void test2() throws InterruptedException { + printer(); + } + + @Override + public String toString() { + return this.instance; + } + + private void printer() throws InterruptedException { + ITestResult result = Reporter.getCurrentTestResult(); + result.setAttribute(THREAD_ID, Thread.currentThread().getId()); + TimeUnit.MILLISECONDS.sleep(10 * random.nextInt(100)); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/issue553/Base.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/issue553/Base.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/issue553/Base.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/issue553/Base.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package test.factory.issue553; + +import org.testng.annotations.Factory; + +public abstract class Base { + @Factory + public Object[] createTests() { + return new Object[] {new Inner()}; + } + + public class Inner { + @Factory + public Object[] createTests() { + return new Object[0]; + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/issue553/Concrete.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/issue553/Concrete.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/issue553/Concrete.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/issue553/Concrete.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,3 @@ +package test.factory.issue553; + +public class Concrete extends Base {} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/issue553/IssueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/issue553/IssueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/issue553/IssueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/issue553/IssueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,24 @@ +package test.factory.issue553; + +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.TestNGException; +import org.testng.annotations.Test; +import org.testng.xml.XmlTest; +import test.SimpleBaseTest; + +public class IssueTest extends SimpleBaseTest { + + @Test( + description = "GITHUB-553", + expectedExceptions = TestNGException.class, + expectedExceptionsMessageRegExp = + "\\nFound a default constructor and also a Factory method when working with .*") + public void testMethod() { + XmlTest xmltest = createXmlTest("suite", "test", Concrete.class); + TestNG testng = create(xmltest.getSuite()); + TestListenerAdapter listener = new TestListenerAdapter(); + testng.addListener(listener); + testng.run(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/nested/AbstractBaseSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/nested/AbstractBaseSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/nested/AbstractBaseSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/nested/AbstractBaseSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.factory.nested; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public abstract class AbstractBaseSample { + + protected abstract String someMethod(String param); + + @Test + public void test() { + String result = someMethod("hello"); + Assert.assertEquals(result, "hello world"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/nested/BaseFactorySample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/nested/BaseFactorySample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/nested/BaseFactorySample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/nested/BaseFactorySample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package test.factory.nested; + +import org.testng.annotations.Factory; + +public abstract class BaseFactorySample { + + public abstract AbstractBaseSample buildTest(); + + @Factory + public Object[] createObjects() { + AbstractBaseSample test = buildTest(); + return new Object[] {test}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/nested/FactoryWithAnonymousTestsSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/nested/FactoryWithAnonymousTestsSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/nested/FactoryWithAnonymousTestsSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/nested/FactoryWithAnonymousTestsSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package test.factory.nested; + +public class FactoryWithAnonymousTestsSample extends BaseFactorySample { + + @Override + public AbstractBaseSample buildTest() { + return new AbstractBaseSample() { + @Override + protected String someMethod(String param) { + return param + " world"; + } + }; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/nested/GitHub1307Test.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/nested/GitHub1307Test.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/nested/GitHub1307Test.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/nested/GitHub1307Test.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,25 @@ +package test.factory.nested; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.InvokedMethodNameListener; +import test.SimpleBaseTest; + +public class GitHub1307Test extends SimpleBaseTest { + + @Test + public void testGitHub1307() { + TestNG tng = create(FactoryWithAnonymousTestsSample.class); + + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener(listener); + + tng.run(); + + assertThat(listener.getFailedMethodNames()).isEmpty(); + assertThat(listener.getSkippedMethodNames()).isEmpty(); + assertThat(listener.getSucceedMethodNames()).containsExactly("test"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/sample/Factory2Sample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/sample/Factory2Sample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/sample/Factory2Sample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/sample/Factory2Sample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,66 @@ +package test.factory.sample; + +import static org.testng.Assert.assertEquals; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.AfterSuite; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.BeforeSuite; +import org.testng.annotations.Test; + +/** + * Test that setUp methods are correctly interleaved even when we use similar instances of a same + * test class. + */ +public class Factory2Sample { + + private static List methods = new ArrayList<>(); + + @BeforeSuite + public void init() { + methods = new ArrayList<>(); + } + + @BeforeMethod + public void setUp() { + methods.add("setUp"); + } + + @AfterMethod + public void tearDown() { + methods.add("tearDown"); + } + + private static final List EXPECTED_METHODS = + Arrays.asList( + "setUp", + "testInputImages", + "tearDown", + "setUp", + "testInputImages", + "tearDown", + "setUp", + "testImages", + "tearDown", + "setUp", + "testImages", + "tearDown"); + + @AfterSuite + public void afterSuite() { + assertEquals(methods, EXPECTED_METHODS); + } + + @Test + public void testInputImages() { + methods.add("testInputImages"); + } + + @Test(dependsOnMethods = {"testInputImages"}) + public void testImages() { + methods.add("testImages"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/sample/Factory2TestSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/sample/Factory2TestSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/factory/sample/Factory2TestSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/factory/sample/Factory2TestSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.factory.sample; + +import org.testng.annotations.Factory; + +/** + * Factory to test that setUp methods are correctly interleaved even when we use similar instances + * of a same test class. + */ +public class Factory2TestSample { + + @Factory() + public Object[] createObjects() { + return new Object[] {new Factory2Sample(), new Factory2Sample()}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failedreporter/FailedReporter2SampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/FailedReporter2SampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failedreporter/FailedReporter2SampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/FailedReporter2SampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.failedreporter; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class FailedReporter2SampleTest { + @DataProvider + public Object[][] dp() { + return new Object[][] { + new Object[] {0}, new Object[] {1}, new Object[] {2}, + }; + } + + @Test(dataProvider = "dp") + public void f1(Integer ip) { + if (ip == 1) { + throw new RuntimeException(); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failedreporter/FailedReporterLocalTestClass.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/FailedReporterLocalTestClass.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failedreporter/FailedReporterLocalTestClass.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/FailedReporterLocalTestClass.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,25 @@ +package test.failedreporter; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/** + * A simple test class that is used by {@link FailedReporterScenariosTest} class to test out the + * presence/absence of testng-failed.xml file when there are failures/no failures scenarios. + */ +public class FailedReporterLocalTestClass { + + public static class WithFailure { + @Test + public void testMethodWithFailure() { + Assert.fail(); + } + } + + public static class WithoutFailure { + @Test + public void testMethodWithoutFailure() { + Assert.assertTrue(true); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failedreporter/FailedReporterParametersTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/FailedReporterParametersTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failedreporter/FailedReporterParametersTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/FailedReporterParametersTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,138 @@ +package test.failedreporter; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import org.testng.Assert; +import org.testng.TestNG; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; +import org.testng.collections.Lists; +import org.testng.collections.Maps; +import org.testng.reporters.FailedReporter; +import org.testng.xml.XmlClass; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import org.testng.xml.internal.Parser; +import test.SimpleBaseTest; +import test.reports.SimpleFailedSample; + +public class FailedReporterParametersTest extends SimpleBaseTest { + private File mTempDirectory; + + @BeforeMethod + public void setUp() { + mTempDirectory = createDirInTempDir("testng-tmp-" + System.currentTimeMillis() % 1000); + } + + @AfterMethod + public void tearDown() { + deleteDir(mTempDirectory); + } + + @Test + public void failedSuiteShouldHaveParameters() { + Map suiteParams = create("suite"); + Map testParams = create("test"); + Map classParams = create("class"); + Map methodParams = create("method"); + // In testng-failed.xml, suite will have both origin suite parameters and children tests + // parameters. + + XmlSuite suite = createXmlSuite(suiteParams); + TestNG tng = create(mTempDirectory.toPath(), suite); + tng.setUseDefaultListeners(true); + + XmlTest test = createXmlTest(suite, suite.getName(), testParams); + XmlClass clazz = createXmlClass(test, FailedReporterSampleTest.class, classParams); + createXmlInclude(clazz, "f2", methodParams); + tng.run(); + + runAssertions( + mTempDirectory, + "", + new String[] {"suiteParam", "testParam", "classParam", "methodParam"}); + } + + @Test(description = "github-2008") + public void preserveParameters() throws IOException { + XmlSuite xmlSuite = createXmlSuite("Suite"); + + XmlTest xmlTest = createXmlTest(xmlSuite, "Test"); + + XmlClass xmlClass1 = createXmlClass(xmlTest, SimpleFailedSample.class); + xmlClass1.getLocalParameters().put("sharedParameter", "44"); + xmlClass1.getLocalParameters().put("class1Parameter", "43"); + + XmlClass xmlClass2 = createXmlClass(xmlTest, AnotherSimpleFailedSample.class); + xmlClass2.getLocalParameters().put("sharedParameter", "55"); + xmlClass2.getLocalParameters().put("class2Parameter", "56"); + + TestNG tng = create(xmlSuite); + + Path temp = Files.createTempDirectory("preserveParameters"); + tng.setOutputDirectory(temp.toAbsolutePath().toString()); + tng.addListener(new FailedReporter()); + tng.run(); + + Collection failedSuites = + new Parser(temp.resolve(FailedReporter.TESTNG_FAILED_XML).toAbsolutePath().toString()) + .parse(); + XmlSuite failedSuite = failedSuites.iterator().next(); + XmlTest failedTest = failedSuite.getTests().get(0); + XmlClass failedClass1 = + failedTest.getClasses().stream() + .filter(failedClass -> failedClass.getName().equals("test.reports.SimpleFailedSample")) + .findFirst() + .get(); + XmlClass failedClass2 = + failedTest.getClasses().stream() + .filter( + failedClass -> + failedClass + .getName() + .equals( + "test.failedreporter.FailedReporterParametersTest$AnotherSimpleFailedSample")) + .findFirst() + .get(); + + // Cheeck class1 Parameters + Assert.assertEquals("44", failedClass1.getAllParameters().get("sharedParameter")); + Assert.assertEquals("43", failedClass1.getAllParameters().get("class1Parameter")); + Assert.assertNull(failedClass1.getAllParameters().get("class2Parameter")); + + // Cheeck class2 Parameters + Assert.assertEquals("55", failedClass2.getAllParameters().get("sharedParameter")); + Assert.assertEquals("56", failedClass2.getAllParameters().get("class2Parameter")); + Assert.assertNull(failedClass2.getAllParameters().get("class1Parameter")); + } + + private static Map create(String prefix) { + Map params = Maps.newHashMap(); + params.put(prefix + "Param", prefix + "ParamValue"); + return params; + } + + private static void runAssertions(File outputDir, String expectedFormat, String[] expectedKeys) { + File failed = new File(outputDir, "testng-failed.xml"); + for (String expectedKey : expectedKeys) { + List resultLines = Lists.newArrayList(); + grep(failed, String.format(expectedFormat, expectedKey, expectedKey + "Value"), resultLines); + int expectedSize = 1; + Assert.assertEquals(resultLines.size(), expectedSize, "Mismatch param:" + expectedKey); + } + } + + class AnotherSimpleFailedSample { + + @Test + public void failed() { + throw new RuntimeException("Failing intentionally"); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failedreporter/FailedReporterSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/FailedReporterSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failedreporter/FailedReporterSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/FailedReporterSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.failedreporter; + +import org.testng.SkipException; +import org.testng.annotations.Test; + +public class FailedReporterSampleTest { + @Test + public void f2() { + throw new RuntimeException(); + } + + @Test + public void f1() { + throw new SkipException("Skipped"); + } + + @Test + public void f3() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failedreporter/FailedReporterScenariosTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/FailedReporterScenariosTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failedreporter/FailedReporterScenariosTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/FailedReporterScenariosTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,87 @@ +package test.failedreporter; + +import static test.failedreporter.FailedReporterLocalTestClass.WithFailure; +import static test.failedreporter.FailedReporterLocalTestClass.WithoutFailure; + +import java.io.File; +import java.util.UUID; +import org.testng.Assert; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.reporters.FailedReporter; +import test.SimpleBaseTest; + +public class FailedReporterScenariosTest extends SimpleBaseTest { + + @Test + public void testFileCreationSkipWhenNoFailuresExist() { + File fileLocation = runTests(RUN_TYPES.WITHOUT_FAILURES); + try { + Assert.assertFalse(getLocation(fileLocation).exists()); + } finally { + if (fileLocation.exists()) { + deleteDir(fileLocation); + } + } + } + + @Test + public void testFileCreationInMixedMode() { + File fileLocation = runTests(RUN_TYPES.MIXED_MODE); + runAssertions(fileLocation); + } + + @Test + public void testFileCreationWhenFailuresExist() { + File fileLocation = runTests(RUN_TYPES.WITH_FAILURES); + runAssertions(fileLocation); + } + + private void runAssertions(File fileLocation) { + try { + FailedReporterTest.runAssertions( + fileLocation, new String[] {"testMethodWithFailure"}, ""); + Assert.assertTrue(getLocation(fileLocation).exists()); + } finally { + if (fileLocation.exists()) { + deleteDir(fileLocation); + } + } + } + + private File getLocation(File fileLocation) { + String name = + fileLocation.getAbsolutePath() + File.separator + FailedReporter.TESTNG_FAILED_XML; + return new File(name); + } + + private File runTests(RUN_TYPES runType) { + String suiteName = UUID.randomUUID().toString(); + File fileLocation = createDirInTempDir(suiteName); + Class[] classes = {}; + switch (runType) { + case WITH_FAILURES: + classes = new Class[] {WithFailure.class}; + break; + case WITHOUT_FAILURES: + classes = new Class[] {WithoutFailure.class}; + break; + case MIXED_MODE: + classes = new Class[] {WithFailure.class, WithoutFailure.class}; + } + TestNG testNG = create(fileLocation.toPath(), classes); + testNG.setUseDefaultListeners(true); + try { + testNG.run(); + } catch (AssertionError e) { + // catch all assertion failures. Our intent is not assertions of the test class. + } + return fileLocation; + } + + enum RUN_TYPES { + WITH_FAILURES, + WITHOUT_FAILURES, + MIXED_MODE + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failedreporter/FailedReporterTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/FailedReporterTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failedreporter/FailedReporterTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/FailedReporterTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,207 @@ +package test.failedreporter; + +import java.io.File; +import java.util.List; +import org.testng.Assert; +import org.testng.TestNG; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; +import org.testng.collections.Lists; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.SimpleBaseTest; +import test.failedreporter.issue1297.depend.PassDependsOnFailureSample; +import test.failedreporter.issue1297.depend_on_group.GroupDependFailureSample; +import test.failedreporter.issue1297.depend_on_group.GroupDependPassSample; +import test.failedreporter.issue1297.depend_on_test.PassDependsOnPassSample; +import test.failedreporter.issue1297.groups.GroupsPassSample; +import test.failedreporter.issue1297.groups.GroupsSampleBase; +import test.failedreporter.issue1297.inheritance.InheritanceFailureSample; +import test.failedreporter.issue1297.inheritance.InheritancePassSample; +import test.failedreporter.issue1297.straightforward.AllPassSample; +import test.failedreporter.issue1297.straightforward.FailureSample; + +public class FailedReporterTest extends SimpleBaseTest { + public static final String DEPENDENCY_GROUP = "failed"; + public static final String DEPENDENT_GROUP = "run"; + private File mTempDirectory; + + @BeforeMethod + public void setUp() { + mTempDirectory = createDirInTempDir("testng-tmp-" + System.currentTimeMillis() % 1000); + } + + @AfterMethod + public void tearDown() { + deleteDir(mTempDirectory); + } + + @Test + public void failedAndSkippedMethodsShouldBeIncluded() { + testFailedReporter( + new String[] {"f1", "f2"}, "", FailedReporterSampleTest.class); + } + + @Test + public void failedMethodWithDataProviderShouldHaveInvocationNumbers() { + testFailedReporter( + new String[] {"f1"}, + "", + FailedReporter2SampleTest.class); + } + + @Test(description = "github-1297") + public void testExclusionOfPassedConfigs() { + triggerTest(AllPassSample.class, FailureSample.class); + String[] substitutions = new String[] {AllPassSample.class.getName()}; + runAssertions(mTempDirectory, substitutions, "", 0); + substitutions = + new String[] {"newTest2", "beforeClassFailureSample", "afterClassFailureSample"}; + runAssertions(mTempDirectory, substitutions, "", 1); + } + + @Test(description = "github-1297") + public void testExclusionOfPassedConfigsAmidstInheritance() { + triggerTest(InheritanceFailureSample.class, InheritancePassSample.class); + String[] substitutions = new String[] {InheritancePassSample.class.getName()}; + runAssertions(mTempDirectory, substitutions, "", 0); + substitutions = + new String[] { + "newTest2", "baseBeforeTest", "baseAfterClass", "baseBeforeClass", "baseBeforeMethod" + }; + runAssertions(mTempDirectory, substitutions, "", 1); + } + + @Test(description = "github-1297") + public void testExclusionOfPassedConfigsAmidstInheritanceIndependentOfOrder() { + triggerTest(InheritancePassSample.class, InheritanceFailureSample.class); + String[] substitutions = new String[] {InheritancePassSample.class.getName()}; + runAssertions(mTempDirectory, substitutions, "", 0); + substitutions = + new String[] { + "newTest2", "baseBeforeTest", "baseAfterClass", "baseBeforeClass", "baseBeforeMethod" + }; + runAssertions(mTempDirectory, substitutions, "", 1); + } + + @Test(description = "github-1297") + public void testExclusionOfPassedConfigsInvolvingGroupsAtTestLevel() { + triggerTest(GroupsSampleBase.class.getPackage().getName(), true, DEPENDENT_GROUP); + String[] substitutions = + new String[] {GroupsPassSample.class.getName(), GroupsSampleBase.class.getName()}; + runAssertions(mTempDirectory, substitutions, "", 0); + substitutions = new String[] {"baseBeforeTest", "baseBeforeClassAlwaysRun", "newTest2"}; + runAssertions(mTempDirectory, substitutions, "", 1); + } + + @Test(description = "github-1297") + public void testExclusionOfPassedConfigsInvolvingGroupsAtSuiteLevel() { + triggerTest(GroupsSampleBase.class.getPackage().getName(), false, DEPENDENT_GROUP); + String[] substitutions = + new String[] {GroupsPassSample.class.getName(), GroupsSampleBase.class.getName()}; + runAssertions(mTempDirectory, substitutions, "", 0); + substitutions = new String[] {"baseBeforeTest", "baseBeforeClassAlwaysRun", "newTest2"}; + runAssertions(mTempDirectory, substitutions, "", 1); + } + + @Test(description = "github-1297") + public void testInclusionOfPassedTestsDependOnFailedPackageSuite() { + triggerTest(PassDependsOnFailureSample.class.getPackage().getName()); + String[] substitutions = new String[] {PassDependsOnFailureSample.class.getName()}; + runAssertions(mTempDirectory, substitutions, "", 1); + substitutions = new String[] {"newTest1", "newTest2"}; + runAssertions(mTempDirectory, substitutions, "", 1); + } + + @Test(description = "github-1297") + public void testExclusionOfPassedTestsDependOnPassedTest() { + triggerTest(PassDependsOnPassSample.class); + String[] substitutions = new String[] {PassDependsOnPassSample.class.getName()}; + runAssertions(mTempDirectory, substitutions, "", 1); + substitutions = new String[] {"test1", "test2", "dependsOnTest2"}; + runAssertions(mTempDirectory, substitutions, "", 1); + substitutions = new String[] {"dependsOnTest1"}; + runAssertions(mTempDirectory, substitutions, "", 0); + } + + @Test(description = "github-1297") + public void testInclusionOfPassedTestsDependOnFailedClassSuite() { + triggerTest(PassDependsOnFailureSample.class); + String[] substitutions = new String[] {PassDependsOnFailureSample.class.getName()}; + runAssertions(mTempDirectory, substitutions, "", 1); + substitutions = new String[] {"newTest1", "newTest2"}; + runAssertions(mTempDirectory, substitutions, "", 1); + } + + @Test(description = "github-1297") + public void testInclusionOfPassedTestsDependOnFailedGroup() { + triggerTest( + GroupDependPassSample.class.getPackage().getName(), + false, + DEPENDENT_GROUP, + DEPENDENCY_GROUP); + String[] substitutions = new String[] {GroupDependFailureSample.class.getName()}; + runAssertions(mTempDirectory, substitutions, "", 1); + substitutions = new String[] {GroupDependPassSample.class.getName()}; + runAssertions(mTempDirectory, substitutions, "", 1); + substitutions = new String[] {"baseBeforeTest", "baseBeforeClassAlwaysRun"}; + runAssertions(mTempDirectory, substitutions, "", 2); + substitutions = new String[] {"newTest1", "newTest2"}; + runAssertions(mTempDirectory, substitutions, "", 1); + } + + private void triggerTest( + String packageName, boolean applyGroupSelectionAtTest, String... groups) { + final XmlSuite suite = createXmlSuite("1297_suite"); + + final XmlTest xmlTest = createXmlTestWithPackages(suite, "1297_test", packageName); + if (applyGroupSelectionAtTest) { + createXmlGroups(xmlTest, groups); + } else { + createXmlGroups(suite, groups); + } + TestNG tng = create(mTempDirectory.toPath(), suite); + tng.setUseDefaultListeners(true); + tng.run(); + } + + private void triggerTest(String packageName) { + final XmlSuite suite = createXmlSuite("1297_suite"); + + createXmlTestWithPackages(suite, "1297_test", packageName); + TestNG tng = create(mTempDirectory.toPath(), suite); + tng.setUseDefaultListeners(true); + tng.run(); + } + + private void testFailedReporter(String[] expectedMethods, String expectedLine, Class... cls) { + triggerTest(cls); + runAssertions(mTempDirectory, expectedMethods, expectedLine); + } + + private void triggerTest(Class... cls) { + TestNG tng = create(mTempDirectory.toPath(), cls); + tng.setUseDefaultListeners(true); + tng.run(); + } + + static void runAssertions(File outputDir, String[] expectedMethods, String expectedLine) { + runAssertions(outputDir, expectedMethods, expectedLine, 1); + } + + private static void runAssertions( + File outputDir, String[] expectedMethods, String expectedLine, int expected) { + File failed = new File(outputDir, "testng-failed.xml"); + for (String s : expectedMethods) { + List resultLines = Lists.newArrayList(); + Assert.assertTrue(failed.exists(), String.format("File %s not exists", failed.getName())); + grep(failed, String.format(expectedLine, s), resultLines); + + Assert.assertEquals( + resultLines.size(), + expected, + String.format("Matched lines:\n %s", String.join(",\n", resultLines))); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failedreporter/issue1297/depend/PassDependsOnFailureSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue1297/depend/PassDependsOnFailureSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failedreporter/issue1297/depend/PassDependsOnFailureSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue1297/depend/PassDependsOnFailureSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package test.failedreporter.issue1297.depend; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class PassDependsOnFailureSample { + @Test(dependsOnMethods = "newTest2") + public void newTest1() {} + + @Test + public void newTest2() { + Assert.fail(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failedreporter/issue1297/depend_on_group/GroupDependFailureSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue1297/depend_on_group/GroupDependFailureSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failedreporter/issue1297/depend_on_group/GroupDependFailureSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue1297/depend_on_group/GroupDependFailureSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.failedreporter.issue1297.depend_on_group; + +import org.testng.Assert; +import org.testng.annotations.Test; +import test.failedreporter.FailedReporterTest; + +public class GroupDependFailureSample extends GroupDependSampleBase { + @Test(groups = FailedReporterTest.DEPENDENCY_GROUP) + public void newTest2() { + Assert.fail(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failedreporter/issue1297/depend_on_group/GroupDependPassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue1297/depend_on_group/GroupDependPassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failedreporter/issue1297/depend_on_group/GroupDependPassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue1297/depend_on_group/GroupDependPassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.failedreporter.issue1297.depend_on_group; + +import org.testng.annotations.Test; +import test.failedreporter.FailedReporterTest; + +public class GroupDependPassSample extends GroupDependSampleBase { + @Test( + groups = FailedReporterTest.DEPENDENT_GROUP, + dependsOnGroups = FailedReporterTest.DEPENDENCY_GROUP) + public void newTest1() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failedreporter/issue1297/depend_on_group/GroupDependSampleBase.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue1297/depend_on_group/GroupDependSampleBase.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failedreporter/issue1297/depend_on_group/GroupDependSampleBase.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue1297/depend_on_group/GroupDependSampleBase.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,21 @@ +package test.failedreporter.issue1297.depend_on_group; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.BeforeTest; +import test.failedreporter.FailedReporterTest; + +public class GroupDependSampleBase { + @BeforeTest(groups = FailedReporterTest.DEPENDENT_GROUP) + public void baseBeforeTest() {} + + @BeforeClass(alwaysRun = true) + public void baseBeforeClassAlwaysRun() {} + + @BeforeMethod + public void baseBeforeMethod() {} + + @AfterClass + public void baseAfterClass() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failedreporter/issue1297/depend_on_test/PassDependsOnPassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue1297/depend_on_test/PassDependsOnPassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failedreporter/issue1297/depend_on_test/PassDependsOnPassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue1297/depend_on_test/PassDependsOnPassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.failedreporter.issue1297.depend_on_test; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class PassDependsOnPassSample { + @Test + public void test1() {} + + @Test(dependsOnMethods = "test1") + public void test2() { + Assert.fail(); + } + + @Test(dependsOnMethods = "test1") + public void dependsOnTest1() {} + + @Test(dependsOnMethods = "test2") + public void dependsOnTest2() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failedreporter/issue1297/groups/GroupsFailureSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue1297/groups/GroupsFailureSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failedreporter/issue1297/groups/GroupsFailureSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue1297/groups/GroupsFailureSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.failedreporter.issue1297.groups; + +import org.testng.Assert; +import org.testng.annotations.Test; +import test.failedreporter.FailedReporterTest; + +public class GroupsFailureSample extends GroupsSampleBase { + @Test(groups = FailedReporterTest.DEPENDENT_GROUP) + public void newTest2() { + Assert.fail(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failedreporter/issue1297/groups/GroupsPassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue1297/groups/GroupsPassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failedreporter/issue1297/groups/GroupsPassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue1297/groups/GroupsPassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ +package test.failedreporter.issue1297.groups; + +import org.testng.annotations.Test; + +public class GroupsPassSample extends GroupsSampleBase { + @Test(groups = "run") + public void newTest1() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failedreporter/issue1297/groups/GroupsSampleBase.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue1297/groups/GroupsSampleBase.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failedreporter/issue1297/groups/GroupsSampleBase.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue1297/groups/GroupsSampleBase.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,21 @@ +package test.failedreporter.issue1297.groups; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.BeforeTest; +import test.failedreporter.FailedReporterTest; + +public class GroupsSampleBase { + @BeforeTest(groups = FailedReporterTest.DEPENDENT_GROUP) + public void baseBeforeTest() {} + + @BeforeClass(alwaysRun = true) + public void baseBeforeClassAlwaysRun() {} + + @BeforeMethod + public void baseBeforeMethod() {} + + @AfterClass + public void baseAfterClass() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failedreporter/issue1297/inheritance/InheritanceFailureSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue1297/inheritance/InheritanceFailureSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failedreporter/issue1297/inheritance/InheritanceFailureSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue1297/inheritance/InheritanceFailureSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.failedreporter.issue1297.inheritance; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class InheritanceFailureSample extends SampleBase { + @Test + public void newTest2() { + Assert.fail(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failedreporter/issue1297/inheritance/InheritancePassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue1297/inheritance/InheritancePassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failedreporter/issue1297/inheritance/InheritancePassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue1297/inheritance/InheritancePassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ +package test.failedreporter.issue1297.inheritance; + +import org.testng.annotations.Test; + +public class InheritancePassSample extends SampleBase { + @Test + public void newTest1() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failedreporter/issue1297/inheritance/SampleBase.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue1297/inheritance/SampleBase.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failedreporter/issue1297/inheritance/SampleBase.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue1297/inheritance/SampleBase.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.failedreporter.issue1297.inheritance; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.BeforeTest; + +public class SampleBase { + @BeforeTest + public void baseBeforeTest() {} + + @BeforeClass + public void baseBeforeClass() {} + + @BeforeMethod + public void baseBeforeMethod() {} + + @AfterClass + public void baseAfterClass() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failedreporter/issue1297/straightforward/AllPassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue1297/straightforward/AllPassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failedreporter/issue1297/straightforward/AllPassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue1297/straightforward/AllPassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package test.failedreporter.issue1297.straightforward; + +import org.testng.annotations.*; + +public class AllPassSample { + @BeforeClass + public void beforeClassAllPassSample() {} + + @Test + public void newTest1() {} + + @AfterClass + public void afterClassAllPassSample() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failedreporter/issue1297/straightforward/FailureSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue1297/straightforward/FailureSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failedreporter/issue1297/straightforward/FailureSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue1297/straightforward/FailureSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.failedreporter.issue1297.straightforward; + +import org.testng.Assert; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +public class FailureSample { + @BeforeClass + public void beforeClassFailureSample() {} + + @Test + public void newTest2() { + Assert.fail(); + } + + @AfterClass + public void afterClassFailureSample() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failedreporter/issue2517/DataProviderWithFactoryFailedReporterSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue2517/DataProviderWithFactoryFailedReporterSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failedreporter/issue2517/DataProviderWithFactoryFailedReporterSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue2517/DataProviderWithFactoryFailedReporterSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,28 @@ +package test.failedreporter.issue2517; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +public class DataProviderWithFactoryFailedReporterSample { + private Integer data; + + @Factory(dataProvider = "dp") + public DataProviderWithFactoryFailedReporterSample(Integer data) { + this.data = data; + } + + @DataProvider + public static Object[][] dp() { + return new Object[][] { + new Object[] {0}, new Object[] {1}, new Object[] {2}, + }; + } + + @Test + public void f1() { + if (data == 1) { + throw new RuntimeException(); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failedreporter/issue2517/DataProviderWithFactoryFailedReporterTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue2517/DataProviderWithFactoryFailedReporterTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failedreporter/issue2517/DataProviderWithFactoryFailedReporterTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue2517/DataProviderWithFactoryFailedReporterTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,54 @@ +package test.failedreporter.issue2517; + +import java.io.File; +import java.util.List; +import org.testng.Assert; +import org.testng.TestNG; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; +import org.testng.collections.Lists; +import test.SimpleBaseTest; + +public class DataProviderWithFactoryFailedReporterTest extends SimpleBaseTest { + private File mTempDirectory; + + @BeforeMethod + public void setUp() { + mTempDirectory = createDirInTempDir("testng-tmp-" + System.currentTimeMillis() % 1000); + } + + @AfterMethod + public void tearDown() { + deleteDir(mTempDirectory); + } + + @Test + public void failedMethodWithDataProviderAndFactoryShouldHaveInvocationNumbers() { + testFailedReporter( + new String[] {"f1"}, + "", + DataProviderWithFactoryFailedReporterSample.class); + } + + private void testFailedReporter(String[] expectedMethods, String expectedLine, Class... cls) { + triggerTest(cls); + runAssertions(mTempDirectory, expectedMethods, expectedLine, 1); + } + + private void triggerTest(Class... cls) { + TestNG tng = create(mTempDirectory.toPath(), cls); + tng.setUseDefaultListeners(true); + tng.run(); + } + + private static void runAssertions( + File outputDir, String[] expectedMethods, String expectedLine, int expected) { + File failed = new File(outputDir, "testng-failed.xml"); + for (String s : expectedMethods) { + List resultLines = Lists.newArrayList(); + grep(failed, String.format(expectedLine, s), resultLines); + Assert.assertEquals(resultLines.size(), expected); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failedreporter/issue2521/DataProviderWithFactoryMultiFailedReporterSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue2521/DataProviderWithFactoryMultiFailedReporterSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failedreporter/issue2521/DataProviderWithFactoryMultiFailedReporterSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue2521/DataProviderWithFactoryMultiFailedReporterSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,35 @@ +package test.failedreporter.issue2521; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +public class DataProviderWithFactoryMultiFailedReporterSample { + private Integer data; + + @Factory(dataProvider = "dp") + public DataProviderWithFactoryMultiFailedReporterSample(Integer data) { + this.data = data; + } + + @DataProvider + public static Object[][] dp() { + return new Object[][] { + new Object[] {0}, new Object[] {1}, new Object[] {2}, + }; + } + + @Test + public void f1() { + if (data != 1) { + throw new RuntimeException(); + } + } + + @Test + public void f2() { + if (data != 0) { + throw new RuntimeException(); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failedreporter/issue2521/DataProviderWithFactoryMultiFailedReporterTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue2521/DataProviderWithFactoryMultiFailedReporterTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failedreporter/issue2521/DataProviderWithFactoryMultiFailedReporterTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failedreporter/issue2521/DataProviderWithFactoryMultiFailedReporterTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,54 @@ +package test.failedreporter.issue2521; + +import java.io.File; +import java.util.List; +import org.testng.Assert; +import org.testng.TestNG; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; +import org.testng.collections.Lists; +import test.SimpleBaseTest; + +public class DataProviderWithFactoryMultiFailedReporterTest extends SimpleBaseTest { + private File mTempDirectory; + + @BeforeMethod + public void setUp() { + mTempDirectory = createDirInTempDir("testng-tmp-" + System.currentTimeMillis() % 1000); + } + + @AfterMethod + public void tearDown() { + deleteDir(mTempDirectory); + } + + @Test + public void multiFailedMethodWithDataProviderAndFactoryShouldHaveInvocationNumbers() { + testFailedReporter( + new String[] {"f1"}, + "", + DataProviderWithFactoryMultiFailedReporterSample.class); + } + + private void testFailedReporter(String[] expectedMethods, String expectedLine, Class... cls) { + triggerTest(cls); + runAssertions(mTempDirectory, expectedMethods, expectedLine, 1); + } + + private void triggerTest(Class... cls) { + TestNG tng = create(mTempDirectory.toPath(), cls); + tng.setUseDefaultListeners(true); + tng.run(); + } + + private static void runAssertions( + File outputDir, String[] expectedMethods, String expectedLine, int expected) { + File failed = new File(outputDir, "testng-failed.xml"); + for (String s : expectedMethods) { + List resultLines = Lists.newArrayList(); + grep(failed, String.format(expectedLine, s), resultLines); + Assert.assertEquals(resultLines.size(), expected); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failures/Base0.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failures/Base0.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failures/Base0.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failures/Base0.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.failures; + +import org.testng.annotations.Test; + +public class Base0 { + + @Test + public void base1() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failures/Base1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failures/Base1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failures/Base1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failures/Base1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package test.failures; + +import org.testng.annotations.Test; + +public class Base1 extends Base0 { + + @Test + public void base2() {} + + @Test + public void failFromBase() { + throw new RuntimeException("VOLUNTARILY FAILED"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failures/BaseFailuresTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failures/BaseFailuresTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failures/BaseFailuresTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failures/BaseFailuresTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,82 @@ +package test.failures; + +import java.io.BufferedReader; +import java.io.IOException; +import java.nio.charset.Charset; +import java.nio.file.FileVisitResult; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.SimpleFileVisitor; +import java.nio.file.attribute.BasicFileAttributes; +import java.util.regex.Pattern; +import org.testng.Assert; +import org.testng.TestNG; +import org.testng.reporters.FailedReporter; +import test.SimpleBaseTest; + +public abstract class BaseFailuresTest extends SimpleBaseTest { + + protected static TestNG run(TestNG result, Class[] classes, String outputDir) { + result.setOutputDirectory(outputDir); + result.setTestClasses(classes); + result.run(); + + return result; + } + + protected static boolean containsRegularExpressions(Path f, String[] strRegexps) { + Pattern[] matchers = new Pattern[strRegexps.length]; + boolean[] results = new boolean[strRegexps.length]; + for (int i = 0; i < strRegexps.length; i++) { + matchers[i] = Pattern.compile(".*" + strRegexps[i] + ".*"); + results[i] = false; + } + + try (BufferedReader br = Files.newBufferedReader(f, Charset.forName("UTF-8"))) { + String line = br.readLine(); + while (line != null) { + for (int i = 0; i < strRegexps.length; i++) { + if (matchers[i].matcher(line).matches()) { + results[i] = true; + } + } + line = br.readLine(); + } + } catch (IOException e) { + e.printStackTrace(); + return false; + } + + for (int i = 0; i < results.length; i++) { + if (!results[i]) { + throw new AssertionError("Couldn't find " + strRegexps[i]); + } + } + + return true; + } + + protected static void verify(Path outputDir, String suiteName, String[] expected) + throws IOException { + Path f = outputDir.resolve(suiteName).resolve(FailedReporter.TESTNG_FAILED_XML); + Assert.assertTrue(containsRegularExpressions(f, expected)); + + Files.walkFileTree( + outputDir, + new SimpleFileVisitor() { + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) + throws IOException { + Files.delete(file); + return FileVisitResult.CONTINUE; + } + + @Override + public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException { + Files.delete(dir); + return FileVisitResult.CONTINUE; + } + }); + Files.deleteIfExists(outputDir); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failures/Child.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failures/Child.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failures/Child.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failures/Child.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package test.failures; + +import org.testng.annotations.Test; + +public class Child extends Base1 { + + @Test + public void pass() {} + + @Test + public void fail() { + throw new RuntimeException("VOLUNTARILY FAILED"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failures/DependentTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failures/DependentTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failures/DependentTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failures/DependentTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.failures; + +import org.testng.annotations.Test; + +public class DependentTest { + + @Test + public void f1() {} + + @Test( + dependsOnMethods = {"f1"}, + dependsOnGroups = {"f"}) + public void f2() { + throw new RuntimeException(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failures/FailuresTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failures/FailuresTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failures/FailuresTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failures/FailuresTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,105 @@ +package test.failures; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.collections.Maps; +import org.testng.reporters.FailedReporter; +import org.testng.xml.XmlSuite; +import test.TestHelper; +import test.failures.issue1930.SimpleCliStatus; +import test.failures.issue1930.TestClassSample; + +public class FailuresTest extends BaseFailuresTest { + + private static final String suiteName = "TmpSuite"; + + private static final String[] expected = + new String[] { + "", + "", + "", + }; + + @Test + public void shouldIncludeFailedMethodsFromBaseClass() throws IOException { + Path tempDirectory = Files.createTempDirectory("temp-testng-"); + XmlSuite suite = createXmlSuite(suiteName, "TmpTest", Child.class); + TestNG tng = create(tempDirectory, suite); + tng.addListener(new FailedReporter()); + tng.run(); + + verify(tempDirectory, suiteName, expected); + } + + private static final String[] expectedIncludes = + new String[] {"", ""}; + + @Test(enabled = false) + public void shouldIncludeDependentMethods() throws IOException { + Path tempDirectory = Files.createTempDirectory("temp-testng-"); + XmlSuite suite = TestHelper.createSuite("test.failures.DependentTest", suiteName); + TestNG tng = TestHelper.createTestNG(suite); + tng.run(); + + verify(tempDirectory, suiteName, expectedIncludes); + } + + private static final String[] expectedParameter = + new String[] {""}; + + @Test(enabled = false) + public void shouldIncludeParameters() throws IOException { + Path tempDirectory = Files.createTempDirectory("temp-testng-"); + XmlSuite suite = TestHelper.createSuite("test.failures.Child", suiteName); + Map params = new HashMap<>(); + params.put("first-name", "Cedric"); + params.put("last-name", "Beust"); + suite.setParameters(params); + + TestNG tng = TestHelper.createTestNG(suite); + tng.run(); + + verify(tempDirectory, suiteName, expectedParameter); + } + + @Test(description = "GITHUB-1930") + public void testToEnsureThatWeRunOnlyFailedIterationsFromBaseClass() { + File outputDir = createDirInTempDir("testng-tmp-" + System.currentTimeMillis() % 1000); + TestNG testng = create(TestClassSample.class); + testng.setOutputDirectory(outputDir.getAbsolutePath()); + testng.setUseDefaultListeners(true); + testng.run(); + String file = outputDir.getAbsolutePath() + File.separator + FailedReporter.TESTNG_FAILED_XML; + + // First iteration of running failed tests. + runIteration(outputDir, file); + // Second iteration of running failed tests. + runIteration(outputDir, file); + } + + private static void runIteration(File outputDir, String file) { + SimpleCliStatus listener = new SimpleCliStatus(); + TestNG testng = create(); + testng.setTestSuites(Collections.singletonList(file)); + testng.setOutputDirectory(outputDir.getAbsolutePath()); + testng.setUseDefaultListeners(true); + testng.addListener(listener); + testng.run(); + + Map> expected = Maps.newHashMap(); + expected.put("testPrimeNumberChecker", Arrays.asList(3, 4)); + expected.put("testNumberEquality", Arrays.asList(2, 3)); + assertThat(listener.getFailedTests()).containsAllEntriesOf(expected); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failures/issue1930/PrimeNumberChecker.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failures/issue1930/PrimeNumberChecker.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failures/issue1930/PrimeNumberChecker.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failures/issue1930/PrimeNumberChecker.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.failures.issue1930; + +public class PrimeNumberChecker { + + public boolean validate(int number) { + if (number == 2 || number == 3) { + return true; + } + if (number % 2 == 0) { + return false; + } + int sqrt = (int) Math.sqrt(number) + 1; + for (int i = 3; i < sqrt; i += 2) { + if (number % i == 0) { + return false; + } + } + return true; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failures/issue1930/SimpleCliStatus.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failures/issue1930/SimpleCliStatus.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failures/issue1930/SimpleCliStatus.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failures/issue1930/SimpleCliStatus.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,26 @@ +package test.failures.issue1930; + +import java.util.List; +import java.util.Map; +import org.testng.ITestContext; +import org.testng.ITestListener; +import org.testng.collections.Maps; + +public class SimpleCliStatus implements ITestListener { + private Map> failedTests = Maps.newHashMap(); + + public Map> getFailedTests() { + return failedTests; + } + + @Override + public void onFinish(ITestContext context) { + context + .getFailedTests() + .getAllResults() + .forEach( + result -> + failedTests.put( + result.getMethod().getMethodName(), result.getMethod().getInvocationNumbers())); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failures/issue1930/TestBase.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failures/issue1930/TestBase.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failures/issue1930/TestBase.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failures/issue1930/TestBase.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ +package test.failures.issue1930; + +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class TestBase { + + @Test(dataProvider = "test2") + public void testNumberEquality(Integer i1, Integer i2) { + Assert.assertEquals(i1, i2); + } + + @DataProvider(name = "test2") + public static Object[][] numbers() { + return new Object[][] {{2, 2}, {6, 6}, {19, 18}, {22, 21}, {23, 23}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failures/issue1930/TestClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failures/issue1930/TestClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/failures/issue1930/TestClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/failures/issue1930/TestClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,26 @@ +package test.failures.issue1930; + +import org.testng.Assert; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class TestClassSample extends TestBase { + + private PrimeNumberChecker primeNumberChecker; + + @BeforeMethod + public void initialize() { + primeNumberChecker = new PrimeNumberChecker(); + } + + @DataProvider(name = "test1") + public static Object[][] primeNumbers() { + return new Object[][] {{2, true}, {6, false}, {19, true}, {22, true}, {23, false}}; + } + + @Test(dataProvider = "test1") + public void testPrimeNumberChecker(int inputNumber, boolean expectedResult) { + Assert.assertEquals(expectedResult, primeNumberChecker.validate(inputNumber)); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1336/BaseClass.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1336/BaseClass.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1336/BaseClass.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1336/BaseClass.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,41 @@ +package test.github1336; + +import java.util.Random; +import java.util.concurrent.TimeUnit; +import org.testng.Assert; +import org.testng.annotations.BeforeClass; + +public class BaseClass { + private FakeDriver driver; + + @BeforeClass + public void beforeClass() { + driver = new FakeDriver(); + } + + private FakeDriver getDriver() { + return driver; + } + + public static class FakeDriver { + private String url; + + public void get(String url) { + this.url = url; + } + + String getCurrentUrl() { + try { + TimeUnit.SECONDS.sleep(new Random().nextInt(10)); + return url; + } catch (InterruptedException e) { + return url; + } + } + } + + void runTest(String url) { + getDriver().get(url); + Assert.assertEquals(getDriver().getCurrentUrl(), url); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1336/TestNG1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1336/TestNG1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1336/TestNG1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1336/TestNG1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.github1336; + +import org.testng.annotations.Test; + +public class TestNG1 extends BaseClass { + @Test(priority = 1) + public void test1TestNG1() { + runTest("https://testng.org/doc/download.html"); + } + + @Test(priority = 2) + public void test2TestNG1() { + runTest("https://www3.lenovo.com/in/en/"); + } + + @Test(priority = 3) + public void test3TestNG1() { + runTest("https://github.com/"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1336/TestNG1NoPriority.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1336/TestNG1NoPriority.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1336/TestNG1NoPriority.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1336/TestNG1NoPriority.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.github1336; + +import org.testng.annotations.Test; + +public class TestNG1NoPriority extends BaseClass { + @Test + public void test1TestNG1() { + runTest("https://testng.org/doc/download.html"); + } + + @Test + public void test2TestNG1() { + runTest("https://www3.lenovo.com/in/en/"); + } + + @Test + public void test3TestNG1() { + runTest("https://github.com/"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1336/TestNG2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1336/TestNG2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1336/TestNG2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1336/TestNG2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.github1336; + +import org.testng.annotations.Test; + +public class TestNG2 extends BaseClass { + @Test(priority = 1) + public void test1TestNG2() { + runTest("https://testng.org/doc/download.html"); + } + + @Test(priority = 2) + public void test2TestNG2() { + runTest("https://www3.lenovo.com/in/en/"); + } + + @Test(priority = 3) + public void test3TestNG2() { + runTest("https://github.com/"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1336/TestNG2NoPriority.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1336/TestNG2NoPriority.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1336/TestNG2NoPriority.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1336/TestNG2NoPriority.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.github1336; + +import org.testng.annotations.Test; + +public class TestNG2NoPriority extends BaseClass { + @Test + public void test1TestNG2() { + runTest("https://testng.org/doc/download.html"); + } + + @Test + public void test2TestNG2() { + runTest("https://www3.lenovo.com/in/en/"); + } + + @Test + public void test3TestNG2() { + runTest("https://github.com/"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1336/TestNG3.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1336/TestNG3.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1336/TestNG3.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1336/TestNG3.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.github1336; + +import org.testng.annotations.Test; + +public class TestNG3 extends BaseClass { + @Test(priority = 1) + public void test1TestNG3() { + runTest("https://testng.org/doc/download.html"); + } + + @Test(priority = 2) + public void test2TestNG3() { + runTest("https://www3.lenovo.com/in/en/"); + } + + @Test(priority = 3) + public void test3TestNG3() { + runTest("https://github.com/"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1336/TestNG3NoPriority.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1336/TestNG3NoPriority.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1336/TestNG3NoPriority.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1336/TestNG3NoPriority.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.github1336; + +import org.testng.annotations.Test; + +public class TestNG3NoPriority extends BaseClass { + @Test + public void test1TestNG3() { + runTest("https://testng.org/doc/download.html"); + } + + @Test + public void test2TestNG3() { + runTest("https://www3.lenovo.com/in/en/"); + } + + @Test + public void test3TestNG3() { + runTest("https://github.com/"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1362/AfterGroupsTestInvolvingInterceptors.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1362/AfterGroupsTestInvolvingInterceptors.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1362/AfterGroupsTestInvolvingInterceptors.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1362/AfterGroupsTestInvolvingInterceptors.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,43 @@ +package test.github1362; + +import static org.testng.Assert.assertTrue; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import org.testng.ITestNGListener; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import test.InvokedMethodNameListener; +import test.SimpleBaseTest; + +public class AfterGroupsTestInvolvingInterceptors extends SimpleBaseTest { + + @Test + public void testMethod() { + runTests(new LocalMethodInterceptor(), "setup", "test1", "test3", "clear"); + } + + @Test + public void testMethodWithoutInterceptor() { + runTests(null, "setup", "test1", "test2", "test3", "clear"); + } + + private void runTests(ITestNGListener interceptor, String... names) { + List expected = Arrays.asList(names); + XmlSuite xmlsuite = createXmlSuite("suite", "test", TestSample.class); + xmlsuite.getTests().get(0).setIncludedGroups(Collections.singletonList("exTests")); + TestNG testng = create(xmlsuite); + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + testng.addListener(listener); + if (interceptor != null) { + testng.addListener(interceptor); + } + testng.run(); + for (String each : listener.getInvokedMethodNames()) { + assertTrue( + expected.contains(each), each + " not found in expected invocation methods " + expected); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1362/LocalMethodInterceptor.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1362/LocalMethodInterceptor.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1362/LocalMethodInterceptor.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1362/LocalMethodInterceptor.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.github1362; + +import java.util.List; +import org.testng.IMethodInstance; +import org.testng.IMethodInterceptor; +import org.testng.ITestContext; +import org.testng.collections.Lists; + +public class LocalMethodInterceptor implements IMethodInterceptor { + @Override + public List intercept(List methods, ITestContext context) { + List methodsToReturn = Lists.newArrayList(); + for (IMethodInstance method : methods) { + if (!method.getMethod().getMethodName().equals("test2")) { + methodsToReturn.add(method); + } + } + return methodsToReturn; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1362/TestSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1362/TestSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1362/TestSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1362/TestSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,30 @@ +package test.github1362; + +import org.testng.Assert; +import org.testng.annotations.AfterGroups; +import org.testng.annotations.BeforeGroups; +import org.testng.annotations.Test; + +public class TestSample { + + @BeforeGroups(groups = {"exTests"}) + public void setup() {} + + @Test(groups = {"exTests"}) + public void test1() { + Assert.assertTrue(true, "test1"); + } + + @Test(groups = {"exTests"}) + public void test2() { + Assert.assertTrue(true, "test2"); + } + + @Test(groups = {"exTests"}) + public void test3() { + Assert.assertTrue(true, "test3"); + } + + @AfterGroups(groups = {"exTests"}) + public void clear() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1405/JUnitTestClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1405/JUnitTestClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1405/JUnitTestClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1405/JUnitTestClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ +package test.github1405; + +import org.junit.Test; + +public class JUnitTestClassSample { + @Test + public void testMethod() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1405/TestClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1405/TestClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1405/TestClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1405/TestClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,10 @@ +package test.github1405; + +import org.testng.annotations.Test; + +@Test +public class TestClassSample { + public static void main(String[] args) {} + + public void testMethod() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1405/TestExclusionOfMainMethod.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1405/TestExclusionOfMainMethod.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1405/TestExclusionOfMainMethod.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1405/TestExclusionOfMainMethod.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,26 @@ +package test.github1405; + +import org.testng.Assert; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import test.SimpleBaseTest; + +public class TestExclusionOfMainMethod extends SimpleBaseTest { + @Test + public void testMainMethodExclusion() { + TestNG tng = create(TestClassSample.class); + tng.run(); + Assert.assertEquals(tng.getStatus(), 0); + } + + @Test + public void testMainMethodExclusionForJunit() { + XmlSuite xmlSuite = createXmlSuite("suite"); + xmlSuite.setJunit(true); + createXmlTest(xmlSuite, "test", JUnitTestClassSample.class); + TestNG tng = create(xmlSuite); + tng.run(); + Assert.assertEquals(tng.getStatus(), 0); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1417/AnotherTestClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1417/AnotherTestClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1417/AnotherTestClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1417/AnotherTestClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,46 @@ +package test.github1417; + +import org.testng.Assert; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; + +public class AnotherTestClassSample { + + private static AnotherTestClassSample instance; + private String browsername; + + public AnotherTestClassSample() { + setInstance(this); + } + + private void setInstance(AnotherTestClassSample obj) { + instance = obj; + } + + public static AnotherTestClassSample getInstance() { + return instance; + } + + String getBrowsername() { + return browsername; + } + + @Parameters({"browsername"}) + @BeforeClass + public void beforeClass(String browsername) { + this.browsername = browsername; + } + + @Parameters({"browsername"}) + @AfterClass + public void afterClass(String browsername) { + this.browsername = browsername; + } + + @Test + public void testMethod() { + Assert.assertEquals("chrome", browsername); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1417/TestClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1417/TestClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1417/TestClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1417/TestClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,21 @@ +package test.github1417; + +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; + +public class TestClassSample { + private String browsername; + + @Parameters({"browsername"}) + @BeforeClass + public void beforeClass(String browsername) { + this.browsername = browsername; + } + + @Test + public void testMethod() { + Assert.assertEquals("firefox", browsername); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1417/TestParamsInjectionInBeforeClass.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1417/TestParamsInjectionInBeforeClass.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1417/TestParamsInjectionInBeforeClass.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1417/TestParamsInjectionInBeforeClass.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,24 @@ +package test.github1417; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import org.testng.Assert; +import org.testng.TestNG; +import org.testng.annotations.Test; + +public class TestParamsInjectionInBeforeClass { + @Test + public void testMethod() { + String suite = "src/test/resources/parametertest/1417.xml"; + TestNG testNG = new TestNG(); + testNG.setTestSuites(Collections.singletonList(suite)); + testNG.run(); + Assert.assertFalse(testNG.hasFailure()); + Assert.assertFalse(testNG.hasSkip()); + Assert.assertEquals(AnotherTestClassSample.getInstance().getBrowsername(), "chrome"); + List actual = YetAnotherTestClassSample.getInstance().getBrowsers(); + Assert.assertEquals(actual.size(), 2); + Assert.assertEquals(actual, Arrays.asList("safari", "safari")); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1417/YetAnotherTestClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1417/YetAnotherTestClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1417/YetAnotherTestClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1417/YetAnotherTestClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,48 @@ +package test.github1417; + +import com.beust.jcommander.internal.Lists; +import java.util.List; +import org.testng.Assert; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; + +public class YetAnotherTestClassSample { + private static YetAnotherTestClassSample instance; + + private List browsers = Lists.newArrayList(); + + public YetAnotherTestClassSample() { + setInstance(this); + } + + private void setInstance(YetAnotherTestClassSample obj) { + instance = obj; + } + + public static YetAnotherTestClassSample getInstance() { + return instance; + } + + @Parameters({"browsername"}) + @BeforeClass + public void beforeClass(String browser) { + browsers.add(browser); + } + + @Test + public void testMethod() { + Assert.assertFalse(browsers.isEmpty()); + } + + @Parameters({"browsername"}) + @AfterClass + public void afterClass(String browser) { + browsers.add(browser); + } + + List getBrowsers() { + return browsers; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1461/MemoryLeakTestNg.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1461/MemoryLeakTestNg.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1461/MemoryLeakTestNg.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1461/MemoryLeakTestNg.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,74 @@ +package test.github1461; + +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.log4testng.Logger; + +/** + * This class reproduces a memory leak problem when running TestNG tests. The same (memory behavior + * will be shown when running this test as normal TestNG test (e.g. using Intellij) + * + *

See https://github.com/cbeust/testng/issues/1461 + */ +public class MemoryLeakTestNg { + private static final Logger log = Logger.getLogger(MemoryLeakTestNg.class); + + @Test(timeOut = 10_000) + public void testMemoryLeak() throws Exception { + + // we run the test programmatically + runTest(); + // lets wait for garbage collection + waitForAllObjectsDestructed(); + } + + private static void waitForAllObjectsDestructed() throws InterruptedException { + while (true) { + log.debug("waiting for clean up..."); + // enforce a full gc + System.gc(); + + // check if there are still instances of our test class + if (MyTestClassWithGlobalReferenceCounterSample.currentNumberOfMyTestObjects == 0) { + // if we reach this point, all test instances are gone, + // ... however this never happens ... + break; + } + // let's wait 1 seconds and try again ... + Thread.sleep(1_000); + log.debug( + "[" + + MyTestClassWithGlobalReferenceCounterSample.currentNumberOfMyTestObjects + + "] test object(s) still exist."); + } + } + + private static void runTest() { + + // create TestNG class + TestNG testng = + new TestNG() { + @Override + @SuppressWarnings("deprecation") + protected void finalize() { + // it seems that this object will never be finalized !!! + log.debug("TestNG finalized"); + } + }; + + // and set a test (which also will never be finalized ... see later) + testng.setTestClasses( + new Class[] { + MyTestClassWithGlobalReferenceCounterSample.class, + }); + + // lets run the test + testng.run(); + + // At this point the test run through and we expect both instances + // - testng and + // - the test object of type (MyTest) + // will be garbage collected when leaving this method + // ... + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1461/MyTestClassWithGlobalReferenceCounterSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1461/MyTestClassWithGlobalReferenceCounterSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1461/MyTestClassWithGlobalReferenceCounterSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1461/MyTestClassWithGlobalReferenceCounterSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,37 @@ +package test.github1461; + +import org.testng.annotations.Test; +import org.testng.log4testng.Logger; + +/** we create a test NG class here, which has a global counter, counting all instances. */ +public class MyTestClassWithGlobalReferenceCounterSample { + private static final Logger log = + Logger.getLogger(MyTestClassWithGlobalReferenceCounterSample.class); + + /** global counter that keeps track on how many objects are currently on the heap */ + public static int currentNumberOfMyTestObjects = 0; + + public MyTestClassWithGlobalReferenceCounterSample() { + log.debug("constructor"); + // increase the counter + ++currentNumberOfMyTestObjects; + } + + @Test + public void aTestMethod1() { + log.debug("test method 1"); + } + + @Test + public void aTestMethod2() { + log.debug("test method 2"); + } + + @Override + @SuppressWarnings("deprecation") + protected void finalize() { + log.debug("finalize"); + // this will be called when this object is removed from the heap + --currentNumberOfMyTestObjects; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1490/DataProviderHouse.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1490/DataProviderHouse.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1490/DataProviderHouse.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1490/DataProviderHouse.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,28 @@ +package test.github1490; + +import org.testng.annotations.DataProvider; +import org.testng.internal.ConstructorOrMethod; + +public class DataProviderHouse { + + @DataProvider(name = "cookie-master") + public static Object[][] cookies(ConstructorOrMethod method) { + TestInfo value; + if (method.getConstructor() != null) { + value = (TestInfo) method.getConstructor().getAnnotation(TestInfo.class); + } else { + value = method.getMethod().getAnnotation(TestInfo.class); + } + String name = value.name(); + if ("glutton".equalsIgnoreCase(name)) { + return new Object[][] {{"oreo", 200}}; + } + if ("nibbler".equalsIgnoreCase(name)) { + return new Object[][] {{"marie-gold", 10}}; + } + return new Object[][] { + {"oreo", 200}, + {"marie-gold", 10} + }; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1490/FactoryPoweredDataProviderWithListenerAnnotationSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1490/FactoryPoweredDataProviderWithListenerAnnotationSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1490/FactoryPoweredDataProviderWithListenerAnnotationSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1490/FactoryPoweredDataProviderWithListenerAnnotationSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,28 @@ +package test.github1490; + +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; +import test.listeners.github1490.LocalDataProviderListener; + +@Listeners(LocalDataProviderListener.class) +public class FactoryPoweredDataProviderWithListenerAnnotationSample { + private final int i; + + @Factory(dataProvider = "dp") + public FactoryPoweredDataProviderWithListenerAnnotationSample(int i) { + this.i = i; + } + + @Test + public void testMethod() { + Assert.assertTrue(i > 0); + } + + @DataProvider(name = "dp") + public static Object[][] getData() { + return new Object[][] {{1}, {2}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1490/FactoryPoweredDataProviderWithoutListenerAnnotationSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1490/FactoryPoweredDataProviderWithoutListenerAnnotationSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1490/FactoryPoweredDataProviderWithoutListenerAnnotationSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1490/FactoryPoweredDataProviderWithoutListenerAnnotationSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,25 @@ +package test.github1490; + +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +public class FactoryPoweredDataProviderWithoutListenerAnnotationSample { + private int i; + + @Factory(dataProvider = "dp") + public FactoryPoweredDataProviderWithoutListenerAnnotationSample(int i) { + this.i = i; + } + + @Test + public void testMethod() { + Assert.assertTrue(i > 0); + } + + @DataProvider(name = "dp") + public static Object[][] getData() { + return new Object[][] {{1}, {2}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1490/InstanceBasedDataProviderWithListenerAnnotationSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1490/InstanceBasedDataProviderWithListenerAnnotationSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1490/InstanceBasedDataProviderWithListenerAnnotationSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1490/InstanceBasedDataProviderWithListenerAnnotationSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.github1490; + +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; +import test.listeners.github1490.DataProviderInfoProvider; + +@Listeners(DataProviderInfoProvider.class) +public class InstanceBasedDataProviderWithListenerAnnotationSample { + @Test(dataProvider = "getData") + public void testMethod(int i) { + Assert.assertTrue(i > 0); + } + + @DataProvider + public Object[][] getData() { + return new Object[][] {{1}, {2}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1490/SimpleDataProviderWithListenerAnnotationSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1490/SimpleDataProviderWithListenerAnnotationSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1490/SimpleDataProviderWithListenerAnnotationSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1490/SimpleDataProviderWithListenerAnnotationSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.github1490; + +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; +import test.listeners.github1490.LocalDataProviderListener; + +@Listeners(LocalDataProviderListener.class) +public class SimpleDataProviderWithListenerAnnotationSample { + @Test(dataProvider = "getData") + public void testMethod(int i) { + Assert.assertTrue(i > 0); + } + + @DataProvider + public Object[][] getData() { + return new Object[][] {{1}, {2}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1490/SimpleDataProviderWithListenerAnnotationSample1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1490/SimpleDataProviderWithListenerAnnotationSample1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1490/SimpleDataProviderWithListenerAnnotationSample1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1490/SimpleDataProviderWithListenerAnnotationSample1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.github1490; + +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; +import test.listeners.github1490.LocalDataProviderListener; + +@Listeners(SimpleDataProviderWithListenerAnnotationSample1.class) +public class SimpleDataProviderWithListenerAnnotationSample1 extends LocalDataProviderListener { + @Test(dataProvider = "getData") + public void testMethod(int i) { + Assert.assertTrue(i > 0); + } + + @DataProvider + public Object[][] getData() { + return new Object[][] {{1}, {2}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1490/SimpleDataProviderWithoutListenerAnnotationSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1490/SimpleDataProviderWithoutListenerAnnotationSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1490/SimpleDataProviderWithoutListenerAnnotationSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1490/SimpleDataProviderWithoutListenerAnnotationSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package test.github1490; + +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class SimpleDataProviderWithoutListenerAnnotationSample { + @Test(dataProvider = "getData") + public void testMethod(int i) { + Assert.assertTrue(i > 0); + } + + @DataProvider + public Object[][] getData() { + return new Object[][] {{1}, {2}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1490/StaticDataProviderWithListenerAnnotationSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1490/StaticDataProviderWithListenerAnnotationSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1490/StaticDataProviderWithListenerAnnotationSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1490/StaticDataProviderWithListenerAnnotationSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,28 @@ +package test.github1490; + +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; +import test.listeners.github1490.DataProviderInfoProvider; + +@Listeners(DataProviderInfoProvider.class) +public class StaticDataProviderWithListenerAnnotationSample { + private int i; + + @Factory(dataProvider = "getStaticData") + public StaticDataProviderWithListenerAnnotationSample(int i) { + this.i = i; + } + + @Test + public void testMethod() { + Assert.assertTrue(i > 0); + } + + @DataProvider + public static Object[][] getStaticData() { + return new Object[][] {{1}, {2}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1490/TestInfo.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1490/TestInfo.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1490/TestInfo.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1490/TestInfo.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,13 @@ +package test.github1490; + +import static java.lang.annotation.ElementType.CONSTRUCTOR; +import static java.lang.annotation.ElementType.METHOD; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +@Retention(java.lang.annotation.RetentionPolicy.RUNTIME) +@Target({METHOD, CONSTRUCTOR}) +public @interface TestInfo { + String name() default ""; +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1490/TwoFactoriesShareSameDataProviderSampleOne.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1490/TwoFactoriesShareSameDataProviderSampleOne.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1490/TwoFactoriesShareSameDataProviderSampleOne.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1490/TwoFactoriesShareSameDataProviderSampleOne.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package test.github1490; + +import org.testng.Assert; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +public class TwoFactoriesShareSameDataProviderSampleOne { + private final String cookieName; + private final int count; + + @TestInfo(name = "glutton") + @Factory(dataProvider = "cookie-master", dataProviderClass = DataProviderHouse.class) + public TwoFactoriesShareSameDataProviderSampleOne(String cookieName, int count) { + this.cookieName = cookieName; + this.count = count; + } + + @Test + public void testHowMuchMasterShifuAte() { + Assert.assertEquals("oreo", cookieName); + Assert.assertTrue(count > 100); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1490/TwoFactoriesShareSameDataProviderSampleTwo.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1490/TwoFactoriesShareSameDataProviderSampleTwo.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1490/TwoFactoriesShareSameDataProviderSampleTwo.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1490/TwoFactoriesShareSameDataProviderSampleTwo.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package test.github1490; + +import org.testng.Assert; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +public class TwoFactoriesShareSameDataProviderSampleTwo { + private final String cookieName; + private final int count; + + @TestInfo(name = "nibbler") + @Factory(dataProvider = "cookie-master", dataProviderClass = DataProviderHouse.class) + public TwoFactoriesShareSameDataProviderSampleTwo(String cookieName, int count) { + this.cookieName = cookieName; + this.count = count; + } + + @Test + public void testHowMuchMasterShifuAte() { + Assert.assertEquals("marie-gold", cookieName); + Assert.assertTrue(count < 100); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1490/TwoTestMethodsShareSameDataProviderSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1490/TwoTestMethodsShareSameDataProviderSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1490/TwoTestMethodsShareSameDataProviderSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1490/TwoTestMethodsShareSameDataProviderSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +package test.github1490; + +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import org.testng.internal.ConstructorOrMethod; + +public class TwoTestMethodsShareSameDataProviderSample { + @TestInfo(name = "glutton") + @Test(dataProvider = "cookie-master") + public void testHowMuchPoAte(String cookieName, int count) { + Assert.assertEquals("oreo", cookieName); + Assert.assertTrue(count > 100); + } + + @TestInfo(name = "nibbler") + @Test(dataProvider = "cookie-master") + public void testHowMuchMasterShifuAte(String cookieName, int count) { + Assert.assertEquals("marie-gold", cookieName); + Assert.assertTrue(count < 100); + } + + @DataProvider(name = "cookie-master") + public Object[][] getCookies(ConstructorOrMethod method) { + return DataProviderHouse.cookies(method); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1490/TwoTestMethodsShareSameDataProviderSampleTwo.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1490/TwoTestMethodsShareSameDataProviderSampleTwo.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1490/TwoTestMethodsShareSameDataProviderSampleTwo.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1490/TwoTestMethodsShareSameDataProviderSampleTwo.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.github1490; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class TwoTestMethodsShareSameDataProviderSampleTwo { + @TestInfo(name = "glutton") + @Test(dataProvider = "cookie-master", dataProviderClass = DataProviderHouse.class) + public void testHowMuchPoAte(String cookieName, int count) { + Assert.assertEquals("oreo", cookieName); + Assert.assertTrue(count > 100); + } + + @TestInfo(name = "nibbler") + @Test(dataProvider = "cookie-master", dataProviderClass = DataProviderHouse.class) + public void testHowMuchMasterShifuAte(String cookieName, int count) { + Assert.assertEquals("marie-gold", cookieName); + Assert.assertTrue(count < 100); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1490/VerifyDataProviderListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1490/VerifyDataProviderListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github1490/VerifyDataProviderListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github1490/VerifyDataProviderListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,169 @@ +package test.github1490; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.testng.Assert; +import org.testng.IDataProviderMethod; +import org.testng.TestNG; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.SimpleBaseTest; +import test.listeners.github1490.DataProviderInfoProvider; +import test.listeners.github1490.InstanceAwareLocalDataProviderListener; +import test.listeners.github1490.LocalDataProviderListener; + +public class VerifyDataProviderListener extends SimpleBaseTest { + + @Test + public void testInstanceBasedDataProviderInformation() { + TestNG tng = create(InstanceBasedDataProviderWithListenerAnnotationSample.class); + tng.run(); + IDataProviderMethod before = DataProviderInfoProvider.before; + IDataProviderMethod after = DataProviderInfoProvider.after; + Assert.assertEquals(before, after); + Assert.assertEquals(before.getInstance(), after.getInstance()); + Assert.assertEquals(before.getMethod().getName(), "getData"); + } + + @Test + public void testStaticDataProviderInformation() { + TestNG tng = create(StaticDataProviderWithListenerAnnotationSample.class); + tng.run(); + IDataProviderMethod before = DataProviderInfoProvider.before; + IDataProviderMethod after = DataProviderInfoProvider.after; + Assert.assertEquals(before, after); + Assert.assertNull(before.getInstance()); + Assert.assertEquals(before.getMethod().getName(), "getStaticData"); + } + + @Test + public void testMultipleTestMethodsShareSameDataProvider() { + Class clazz = TwoTestMethodsShareSameDataProviderSample.class; + runTest(1, clazz); + String[] prefixes = {"before", "after"}; + String[] methods = {"testHowMuchMasterShifuAte", "testHowMuchPoAte"}; + List expected = new ArrayList<>(); + for (String prefix : prefixes) { + for (String method : methods) { + String txt = prefix + ":" + clazz.getName() + "." + method; + expected.add(txt); + } + } + assertThat(InstanceAwareLocalDataProviderListener.messages).containsAll(expected); + } + + @Test + public void testMultipleFactoriesShareSameDataProvider() { + Class[] classes = { + TwoFactoriesShareSameDataProviderSampleOne.class, + TwoFactoriesShareSameDataProviderSampleTwo.class + }; + runTest(0, classes); + } + + @Test + public void testMultipleMethodsFactoriesShareSampleDataProvider() { + Class[] classes = { + TwoFactoriesShareSameDataProviderSampleOne.class, + TwoFactoriesShareSameDataProviderSampleTwo.class, + TwoTestMethodsShareSameDataProviderSampleTwo.class + }; + runTest(1, classes); + } + + @Test + public void testSimpleDataProviderWithListenerAnnotation() { + final String prefix = + ":" + SimpleDataProviderWithListenerAnnotationSample.class.getName() + ".testMethod"; + runTest(prefix, SimpleDataProviderWithListenerAnnotationSample.class, true); + } + + @Test + public void testFactoryPoweredDataProviderWithListenerAnnotation() { + final String prefix = + ":" + FactoryPoweredDataProviderWithListenerAnnotationSample.class.getName(); + runTest(prefix, FactoryPoweredDataProviderWithListenerAnnotationSample.class, true); + } + + @Test + public void testSimpleDataProviderWithoutListenerAnnotation() { + final String prefix = + ":" + SimpleDataProviderWithoutListenerAnnotationSample.class.getName() + ".testMethod"; + runTest(prefix, SimpleDataProviderWithoutListenerAnnotationSample.class, false); + } + + @Test + public void testFactoryPoweredDataProviderWithoutListenerAnnotation() { + final String prefix = + ":" + FactoryPoweredDataProviderWithoutListenerAnnotationSample.class.getName(); + runTest(prefix, FactoryPoweredDataProviderWithoutListenerAnnotationSample.class, false); + } + + @Test + public void testSimpleDataProviderWithListenerViaSuiteXml() { + final String prefix = + ":" + SimpleDataProviderWithoutListenerAnnotationSample.class.getName() + ".testMethod"; + runTestWithListenerViaSuiteXml(prefix, SimpleDataProviderWithoutListenerAnnotationSample.class); + } + + @Test + public void testFactoryPoweredDataProviderWithListenerViaSuiteXml() { + final String prefix = + ":" + FactoryPoweredDataProviderWithoutListenerAnnotationSample.class.getName(); + runTestWithListenerViaSuiteXml( + prefix, FactoryPoweredDataProviderWithoutListenerAnnotationSample.class); + } + + @Test + public void testSimpleDataProviderWithListenerAnnotationAndInvolvingInheritance() { + final String prefix = + ":" + SimpleDataProviderWithListenerAnnotationSample1.class.getName() + ".testMethod"; + TestNG tng = create(SimpleDataProviderWithListenerAnnotationSample1.class); + tng.run(); + assertThat(LocalDataProviderListener.messages) + .containsExactlyElementsOf(Arrays.asList("before" + prefix, "after" + prefix)); + } + + @AfterMethod + public void resetListenerMessages() { + LocalDataProviderListener.messages.clear(); + } + + private static void runTestWithListenerViaSuiteXml(String prefix, Class clazz) { + XmlSuite xmlSuite = createXmlSuite("SampleSuite"); + XmlTest xmlTest = createXmlTest(xmlSuite, "SampleTest"); + createXmlClass(xmlTest, clazz); + xmlSuite.addListener(LocalDataProviderListener.class.getName()); + TestNG tng = create(xmlSuite); + tng.run(); + assertThat(LocalDataProviderListener.messages) + .containsExactlyElementsOf(Arrays.asList("before" + prefix, "after" + prefix)); + } + + private static void runTest(String prefix, Class clazz, boolean hasListenerAnnotation) { + TestNG tng = create(clazz); + if (!hasListenerAnnotation) { + tng.addListener(new LocalDataProviderListener()); + } + tng.run(); + assertThat(LocalDataProviderListener.messages) + .containsExactlyElementsOf(Arrays.asList("before" + prefix, "after" + prefix)); + } + + private static void runTest(int expected, Class... classes) { + TestNG tng = create(classes); + tng.addListener(new InstanceAwareLocalDataProviderListener()); + tng.run(); + assertThat(InstanceAwareLocalDataProviderListener.instanceCollectionBeforeExecution) + .size() + .isEqualTo(expected); + assertThat(InstanceAwareLocalDataProviderListener.instanceCollectionAfterExecution) + .size() + .isEqualTo(expected); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github765/DuplicateCallsSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github765/DuplicateCallsSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github765/DuplicateCallsSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github765/DuplicateCallsSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.github765; + +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class DuplicateCallsSample extends TestTemplate { + + private int i = 0; + + @Test(dataProvider = "testParameters") + public void callExecuteTest(Integer testParameters) { + Assert.assertTrue(testParameters > 0); + } + + @DataProvider(name = "testParameters") + public Object[][] getOnboardingTestParameters() { + return new Object[][] {{4}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github765/ExcludeSyntheticMethodsFromTemplateCallsTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github765/ExcludeSyntheticMethodsFromTemplateCallsTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github765/ExcludeSyntheticMethodsFromTemplateCallsTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github765/ExcludeSyntheticMethodsFromTemplateCallsTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,22 @@ +package test.github765; + +import java.util.List; +import org.testng.Assert; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.InvokedMethodNameListener; +import test.SimpleBaseTest; + +public class ExcludeSyntheticMethodsFromTemplateCallsTest extends SimpleBaseTest { + + @Test + public void testMethod() { + TestNG testng = create(DuplicateCallsSample.class); + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + testng.addListener(listener); + testng.run(); + List methods = listener.getMethodsForTestClass(DuplicateCallsSample.class); + Assert.assertEquals(methods.size(), 1); + Assert.assertEquals(methods.get(0), "callExecuteTest"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github765/TestTemplate.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github765/TestTemplate.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github765/TestTemplate.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github765/TestTemplate.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,6 @@ +package test.github765; + +public abstract class TestTemplate { + + public abstract void callExecuteTest(T testParameters) throws Exception; +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github799/EnsureInstancesAreOrderedViaFactories.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github799/EnsureInstancesAreOrderedViaFactories.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github799/EnsureInstancesAreOrderedViaFactories.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github799/EnsureInstancesAreOrderedViaFactories.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,63 @@ +package test.github799; + +import java.util.List; +import org.testng.Assert; +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.ITestResult; +import org.testng.Reporter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.collections.Lists; +import test.SimpleBaseTest; + +public class EnsureInstancesAreOrderedViaFactories extends SimpleBaseTest { + + @Test + public void testMethod() { + System.setProperty("testng.order", "none"); + runTest(TestSample.class, "1", "2", "3", "4"); + } + + @Test + public void randomOrderTestMethod() { + System.setProperty("testng.order", "none"); + runTest(ReverseOrderTestSample.class, "4", "1", "3", "2"); + } + + @Test + public void methodsOrderTest() { + System.setProperty("testng.order", "methods"); + runTest(MethodsTestSample.class, "android", "angry", "birds"); + } + + @Test + public void testInstancesOrder() { + System.setProperty("testng.order", "instances"); + runTest(InstanceTestSample.class, "Master Oogway:90", "Master Shifu:50"); + } + + private void runTest(Class clazz, String... expected) { + TestNG tng = create(clazz); + OrderEavesdropper listener = new OrderEavesdropper(); + tng.addListener(listener); + tng.run(); + + for (int i = 0; i < expected.length; i++) { + String actual = listener.messages.get(i); + Assert.assertEquals(actual, expected[i]); + } + } + + public static class OrderEavesdropper implements IInvokedMethodListener { + List messages = Lists.newArrayList(); + + @Override + public void beforeInvocation(IInvokedMethod method, ITestResult testResult) {} + + @Override + public void afterInvocation(IInvokedMethod method, ITestResult testResult) { + messages.addAll(Reporter.getOutput(testResult)); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github799/InstanceTestSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github799/InstanceTestSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github799/InstanceTestSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github799/InstanceTestSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,37 @@ +package test.github799; + +import org.testng.Assert; +import org.testng.Reporter; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +public class InstanceTestSample { + private String name; + private int age; + + @Factory(dataProvider = "dp") + public InstanceTestSample(String name, int age) { + this.name = name; + this.age = age; + } + + @DataProvider(name = "dp") + public static Object[][] getData() { + return new Object[][] { + {"Master Shifu", 50}, + {"Master Oogway", 90} + }; + } + + @Test + public void testMethod() { + Reporter.log(toString()); + Assert.assertNotNull(this.name); + } + + @Override + public String toString() { + return name + ":" + age; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github799/MethodsTestSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github799/MethodsTestSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github799/MethodsTestSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github799/MethodsTestSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,28 @@ +package test.github799; + +import org.testng.Assert; +import org.testng.Reporter; +import org.testng.annotations.Test; + +public class MethodsTestSample { + @Test + public void angry() { + String methodName = Reporter.getCurrentTestResult().getMethod().getMethodName(); + Reporter.log(methodName); + Assert.assertNotNull(methodName); + } + + @Test + public void birds() { + String methodName = Reporter.getCurrentTestResult().getMethod().getMethodName(); + Reporter.log(methodName); + Assert.assertNotNull(methodName); + } + + @Test + public void android() { + String methodName = Reporter.getCurrentTestResult().getMethod().getMethodName(); + Reporter.log(methodName); + Assert.assertNotNull(methodName); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github799/ReverseOrderTestSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github799/ReverseOrderTestSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github799/ReverseOrderTestSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github799/ReverseOrderTestSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +package test.github799; + +import org.testng.Assert; +import org.testng.Reporter; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +public class ReverseOrderTestSample { + int num; + + @Factory(dataProvider = "data") + public ReverseOrderTestSample(int n) { + num = n; + } + + @DataProvider + public static Object[][] data() { + return new Object[][] {{4}, {1}, {3}, {2}}; + } + + @Test + public void test() { + Reporter.log(Integer.toString(num)); + Assert.assertTrue(num > 0); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github799/TestSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github799/TestSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/github799/TestSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/github799/TestSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +package test.github799; + +import org.testng.Assert; +import org.testng.Reporter; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +public class TestSample { + int num; + + @Factory(dataProvider = "data") + public TestSample(int n) { + num = n; + } + + @DataProvider + public static Object[][] data() { + return new Object[][] {{1}, {2}, {3}, {4}}; + } + + @Test + public void test() { + Reporter.log(Integer.toString(num)); + Assert.assertTrue(num > 0); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/graph/GraphVisualiserTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/graph/GraphVisualiserTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/graph/GraphVisualiserTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/graph/GraphVisualiserTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,38 @@ +package test.graph; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Collections; +import org.testng.TestNG; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import test.SimpleBaseTest; + +public class GraphVisualiserTest extends SimpleBaseTest { + @Test(dataProvider = "dp") + public void testVisualiserInvocation(Class testClass, boolean injectListener) { + TestNG testng = create(); + XmlSuite suite = createXmlSuite("test_suite"); + LocalVisualiser visualiser = null; + if (injectListener) { + visualiser = new LocalVisualiser(); + testng.addListener(visualiser); + } + createXmlTest(suite, "test", testClass); + testng.setXmlSuites(Collections.singletonList(suite)); + testng.run(); + if (visualiser == null) { + visualiser = LocalVisualiser.getInstance(); + } + assertThat(visualiser.getDefinitions()).hasSize(2); + } + + @DataProvider(name = "dp") + public Object[][] getData() { + return new Object[][] { + {TestSampleWithListener.class, true}, + {TestSampleWithoutListener.class, false} + }; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/graph/LocalVisualiser.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/graph/LocalVisualiser.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/graph/LocalVisualiser.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/graph/LocalVisualiser.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,31 @@ +package test.graph; + +import java.util.List; +import org.testng.IExecutionVisualiser; +import org.testng.collections.Lists; + +public class LocalVisualiser implements IExecutionVisualiser { + private List definitions = Lists.newArrayList(); + private static LocalVisualiser instance; + + public LocalVisualiser() { + setInstance(this); + } + + private static void setInstance(LocalVisualiser visualiser) { + instance = visualiser; + } + + public static LocalVisualiser getInstance() { + return instance; + } + + @Override + public void consumeDotDefinition(String dotDefinition) { + definitions.add(dotDefinition.replaceAll("\\n", "")); + } + + public List getDefinitions() { + return definitions; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/graph/TestSampleWithListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/graph/TestSampleWithListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/graph/TestSampleWithListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/graph/TestSampleWithListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package test.graph; + +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +@Listeners(LocalVisualiser.class) +public class TestSampleWithListener { + + @Test + public void parent() {} + + @Test(dependsOnMethods = "parent") + public void child() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/graph/TestSampleWithoutListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/graph/TestSampleWithoutListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/graph/TestSampleWithoutListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/graph/TestSampleWithoutListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.graph; + +import org.testng.annotations.Test; + +public class TestSampleWithoutListener { + + @Test + public void parent() {} + + @Test(dependsOnMethods = "parent") + public void child() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/groupbug/GroupBugTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groupbug/GroupBugTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/groupbug/GroupBugTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groupbug/GroupBugTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,35 @@ +package test.groupbug; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.InvokedMethodNameListener; +import test.SimpleBaseTest; + +public class GroupBugTest extends SimpleBaseTest { + + @Test( + description = + "Comment out dependsOnGroups in ITCaseOne will fix the ordering, that's the bug") + public void shouldOrderByClass() { + TestNG tng = create(ITCaseOne.class, ITCaseTwo.class); + tng.setGroupByInstances(true); + + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener(listener); + + tng.run(); + + assertThat(listener.getInvokedMethodNames()) + .containsExactly( + "beforeClassOne", + "one1", + "one2", + "afterClassOne", + "beforeClassTwo", + "two1", + "two2", + "afterClassTwo"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/groupbug/ITCaseOne.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groupbug/ITCaseOne.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/groupbug/ITCaseOne.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groupbug/ITCaseOne.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,31 @@ +package test.groupbug; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import org.testng.log4testng.Logger; + +public class ITCaseOne { + private static final Logger log = Logger.getLogger(ITCaseOne.class); + + @BeforeClass + public void beforeClassOne() { + log.debug("RUN " + getClass() + ".beforeClass()"); + } + + @AfterClass(alwaysRun = true) + public void afterClassOne() { + log.debug("RUN " + getClass() + ".afterClass()"); + } + + @Test(groups = "std-one") + public void one1() { + log.debug("RUN " + getClass() + ".one1()"); + } + + /** Commenting out dependsOnGroups fixes the ordering, that's the bug. */ + @Test(groups = "logic-one", dependsOnGroups = "std-one") + public void one2() { + log.debug("RUN " + getClass() + ".one2()"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/groupbug/ITCaseTwo.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groupbug/ITCaseTwo.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/groupbug/ITCaseTwo.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groupbug/ITCaseTwo.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,30 @@ +package test.groupbug; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import org.testng.log4testng.Logger; + +public class ITCaseTwo { + private static final Logger log = Logger.getLogger(ITCaseTwo.class); + + @BeforeClass + public void beforeClassTwo() { + log.debug("RUN " + getClass() + ".beforeClass()"); + } + + @AfterClass(alwaysRun = true) + public void afterClassTwo() { + log.debug("RUN " + getClass() + ".afterClass()"); + } + + @Test(groups = "std-two") + public void two1() { + log.debug("RUN " + getClass() + ".one1()"); + } + + @Test(groups = "logic-two", dependsOnGroups = "std-two") + public void two2() { + log.debug("RUN " + getClass() + ".one2()"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/groupinvocation/DummyTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groupinvocation/DummyTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/groupinvocation/DummyTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groupinvocation/DummyTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,36 @@ +package test.groupinvocation; + +import java.util.HashMap; +import java.util.Map; +import org.testng.Assert; +import org.testng.annotations.AfterClass; +import org.testng.annotations.Test; + +public class DummyTest { + private static Map s_externalClassGroups = new HashMap<>(); + + @Test(groups = {"a"}) + public void testA() {} + + @Test(groups = {"b"}) + public void testB() {} + + @Test(groups = {"a", "b"}) + public void testAB() {} + + @AfterClass(alwaysRun = true) + public void checkInvocations() { + Integer hashCode1 = s_externalClassGroups.get("beforeGroups"); + Assert.assertNotNull(hashCode1, "External @BeforeGroups not invoked"); + Integer hashCode2 = s_externalClassGroups.get("afterGroups"); + Assert.assertNotNull(hashCode2, "External @AfterGroups not invoked"); + Assert.assertEquals( + hashCode1, + hashCode2, + "External @BeforeGroups and @AfterGroups were not invoked on the" + " same class instance"); + } + + public static void recordInvocation(String string, int i) { + s_externalClassGroups.put(string, i); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/groupinvocation/DummyTest2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groupinvocation/DummyTest2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/groupinvocation/DummyTest2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groupinvocation/DummyTest2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.groupinvocation; + +import org.testng.Assert; +import org.testng.annotations.AfterClass; +import org.testng.annotations.Test; + +public class DummyTest2 { + private boolean m_invoked = false; + + @Test(groups = {"A"}) + public void dummyTest() { + m_invoked = true; + } + + @AfterClass(alwaysRun = true) + public void checkInvocations() { + Assert.assertFalse(m_invoked, "@Test method invoked even if @BeforeGroups failed"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/groupinvocation/FailingBeforeGroupMethod.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groupinvocation/FailingBeforeGroupMethod.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/groupinvocation/FailingBeforeGroupMethod.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groupinvocation/FailingBeforeGroupMethod.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,10 @@ +package test.groupinvocation; + +import org.testng.annotations.BeforeGroups; + +public class FailingBeforeGroupMethod { + @BeforeGroups(groups = {"A"}) + public void beforeGroupA() { + throw new RuntimeException("Failing @BeforeGroups beforeGroupA method"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/groupinvocation/GroupConfiguration.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groupinvocation/GroupConfiguration.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/groupinvocation/GroupConfiguration.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groupinvocation/GroupConfiguration.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.groupinvocation; + +import org.testng.annotations.AfterGroups; +import org.testng.annotations.BeforeGroups; + +public class GroupConfiguration { + @BeforeGroups(groups = {"a"}) + public void beforeGroups() { + DummyTest.recordInvocation("beforeGroups", hashCode()); + } + + @AfterGroups(groups = {"a"}) + public void afterGroups() { + DummyTest.recordInvocation("afterGroups", hashCode()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/groupinvocation/GroupSuiteSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groupinvocation/GroupSuiteSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/groupinvocation/GroupSuiteSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groupinvocation/GroupSuiteSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.groupinvocation; + +import org.testng.annotations.Test; + +public class GroupSuiteSampleTest { + + @Test(groups = "a") + public void a() {} + + @Test(groups = "b") + public void b() {} + + @Test + public void c() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/groupinvocation/GroupSuiteSampleTest2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groupinvocation/GroupSuiteSampleTest2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/groupinvocation/GroupSuiteSampleTest2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groupinvocation/GroupSuiteSampleTest2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.groupinvocation; + +import org.testng.annotations.Test; + +public class GroupSuiteSampleTest2 { + + @Test(groups = "a") + public void a2() {} + + @Test(groups = "b") + public void b2() {} + + @Test + public void c2() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/groupinvocation/GroupSuiteTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groupinvocation/GroupSuiteTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/groupinvocation/GroupSuiteTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groupinvocation/GroupSuiteTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,158 @@ +package test.groupinvocation; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.common.base.Joiner; +import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import org.testng.TestNG; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.InvokedMethodNameListener; +import test.SimpleBaseTest; + +/** Test that tags can have g. */ +public class GroupSuiteTest extends SimpleBaseTest { + + private static final File PARENT = new File(getPathToResource("groupinvocation")); + + @DataProvider + private static Object[][] dp() { + return new Object[][] { + {new String[] {"suiteA.xml", "suiteB.xml"}, /* Group in xml */ true}, + {new String[] {"suiteA.xml", "suiteB.xml"}, /* Group in TestNG */ false}, + {new String[] {"parent-suiteA.xml", "parent-suiteB.xml"}, /* Group in xml */ true}, + {new String[] {"parent-suiteA.xml", "parent-suiteB.xml"}, /* Group in TestNG */ false}, + {new String[0], /* Group in xml */ true}, + {new String[0], /* Group in TestNG */ false} + }; + } + + @Test(dataProvider = "dp") + public void includeFromSuite0(String[] withSuiteFiles, boolean excludeWithXml) { + runWithSuite(withSuiteFiles, excludeWithXml, "a", "b", "c", "a2", "b2", "c2"); + } + + @Test(dataProvider = "dp") + public void includeFromSuite1(String[] withSuiteFiles, boolean excludeWithXml) { + runWithSuite(withSuiteFiles, excludeWithXml, g("a"), g(), "a", "a2"); + } + + @Test(dataProvider = "dp") + public void includeFromSuite2(String[] withSuiteFiles, boolean excludeWithXml) { + runWithSuite(withSuiteFiles, excludeWithXml, g("a", "b"), g(), "a", "b", "a2", "b2"); + } + + @Test(dataProvider = "dp") + public void excludeFromSuite1(String[] withSuiteFiles, boolean excludeWithXml) { + runWithSuite(withSuiteFiles, excludeWithXml, g(), g("a"), "b", "c", "b2", "c2"); + } + + @Test(dataProvider = "dp") + public void excludeFromSuite2(String[] withSuiteFiles, boolean excludeWithXml) { + runWithSuite(withSuiteFiles, excludeWithXml, g(), g("a", "b"), "c", "c2"); + } + + @Test(description = "Include in both suite and test") + public void includeTestAndSuite1Xml() { + runWithSuite(g("a"), g(), g("b"), g(), true, "a", "b", "a2", "b2"); + } + + @Test(description = "Include in both suite and test") + public void includeTestAndSuite1Cli() { + runWithSuite(g("a"), g(), g("b"), g(), false, "a", "b", "a2", "b2"); + } + + @Test(description = "Include in suite, exclude in test") + public void excludeTestAndSuite2Xml() { + runWithSuite(g("a", "b"), g(), g(), g("a"), true, "b", "b2"); + } + + @Test(description = "Include in suite, exclude in test") + public void excludeTestAndSuite2Cli() { + runWithSuite(g("a", "b"), g(), g(), g("a"), false, "b", "b2"); + } + + private void runWithSuite(String[] withSuiteFiles, boolean excludeWithXml, String... methods) { + runWithSuite(withSuiteFiles, excludeWithXml, g(), g(), g(), g(), methods); + } + + private void runWithSuite( + String[] withSuiteFiles, + boolean excludeWithXml, + List suiteGroups, + List excludedSuiteGroups, + String... methods) { + runWithSuite( + withSuiteFiles, excludeWithXml, suiteGroups, excludedSuiteGroups, g(), g(), methods); + } + + private void runWithSuite( + List suiteGroups, + List excludedSuiteGroups, + List testGroups, + List excludedTestGroups, + boolean groupsWithXml, + String... methods) { + runWithSuite( + new String[0], + groupsWithXml, + suiteGroups, + excludedSuiteGroups, + testGroups, + excludedTestGroups, + methods); + } + + private void runWithSuite( + String[] withSuiteFiles, + boolean groupsWithXml, + List suiteGroups, + List excludedSuiteGroups, + List testGroups, + List excludedTestGroups, + String... methods) { + TestNG tng = create(); + + XmlSuite suite = createXmlSuite("Groups"); + if (groupsWithXml) { + suite.setIncludedGroups(suiteGroups); + suite.setExcludedGroups(excludedSuiteGroups); + } else { + tng.setGroups(Joiner.on(',').join(suiteGroups)); + tng.setExcludedGroups(Joiner.on(',').join(excludedSuiteGroups)); + } + if (withSuiteFiles.length != 0) { + List suiteFiles = new ArrayList<>(withSuiteFiles.length); + for (String suiteFile : withSuiteFiles) { + suiteFiles.add(new File(PARENT, suiteFile).getAbsolutePath()); + } + suite.setSuiteFiles(suiteFiles); + createXmlTest(suite, "Groups-test"); + } else { + XmlTest test = + createXmlTest( + suite, "Groups-test", GroupSuiteSampleTest.class, GroupSuiteSampleTest2.class); + test.setIncludedGroups(testGroups); + test.setExcludedGroups(excludedTestGroups); + } + + tng.setXmlSuites(Collections.singletonList(suite)); + + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener(listener); + + tng.run(); + + assertThat(listener.getInvokedMethodNames()).containsExactly(methods); + } + + private static List g(String... groups) { + return Arrays.asList(groups); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/groupinvocation/InvokerTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groupinvocation/InvokerTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/groupinvocation/InvokerTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groupinvocation/InvokerTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,55 @@ +package test.groupinvocation; + +import org.testng.Assert; +import org.testng.TestNG; +import org.testng.annotations.BeforeGroups; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.InvokedMethodNameListener; +import test.SimpleBaseTest; + +public class InvokerTest extends SimpleBaseTest { + private static final String SMOKE = "smoketests"; + private static final String FUNCTIONAL_TESTS = "functionaltests"; + + @Test + public void testClassWithRedundantGroups() { + Assert.assertEquals(2, privateRun(RedundantGroupNamesSample.class, SMOKE, FUNCTIONAL_TESTS)); + } + + @Test + public void testClassWithUniqueGroups() { + Assert.assertEquals(2, privateRun(UniqueGroupNamesSample.class, SMOKE)); + } + + private int privateRun(final Class className, String... groupNames) { + XmlSuite suite = createXmlSuite("simple-suite"); + XmlTest xmlTest = createXmlTest(suite, "simple-test", className); + for (String group : groupNames) { + xmlTest.addIncludedGroup(group); + } + TestNG tng = create(suite); + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener(listener); + tng.run(); + return listener.getInvokedMethodNames().size(); + } + + public static class UniqueGroupNamesSample { + @BeforeGroups(groups = {InvokerTest.SMOKE}) + public void before() {} + + @Test(groups = {InvokerTest.SMOKE}) + public void test() {} + } + + public static class RedundantGroupNamesSample { + + @BeforeGroups(groups = {InvokerTest.SMOKE, InvokerTest.FUNCTIONAL_TESTS}) + public void before() {} + + @Test(groups = {InvokerTest.SMOKE, InvokerTest.FUNCTIONAL_TESTS}) + public void test() {} + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/groupinvocation/testng.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groupinvocation/testng.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/groupinvocation/testng.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groupinvocation/testng.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/groups/issue182/ChildTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groups/issue182/ChildTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/groups/issue182/ChildTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groups/issue182/ChildTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.groups.issue182; + +import org.testng.annotations.Test; + +@Test(groups = "myGroup") +public class ChildTest extends ParentTest { + + public void childTestMethod() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/groups/issue182/IssueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groups/issue182/IssueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/groups/issue182/IssueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groups/issue182/IssueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,28 @@ +package test.groups.issue182; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Collections; +import java.util.List; +import java.util.Map; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.collections.Maps; +import test.SimpleBaseTest; + +public class IssueTest extends SimpleBaseTest { + + private static final String MY_GROUP = "myGroup"; + + @Test + public void ensureGroupsPresentInInheritedMethods() { + TestNG testng = create(ChildTest.class); + LocalListener listener = new LocalListener(); + testng.addListener(listener); + testng.run(); + Map> expected = Maps.newHashMap(); + expected.put("parentTestMethod", Collections.singletonList(MY_GROUP)); + expected.put("childTestMethod", Collections.singletonList(MY_GROUP)); + assertThat(listener.getMapping()).containsAllEntriesOf(expected); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/groups/issue182/LocalListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groups/issue182/LocalListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/groups/issue182/LocalListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groups/issue182/LocalListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,24 @@ +package test.groups.issue182; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.ITestResult; +import org.testng.collections.Maps; + +public class LocalListener implements IInvokedMethodListener { + + private Map> mapping = Maps.newHashMap(); + + @Override + public void afterInvocation(IInvokedMethod method, ITestResult testResult) { + String methodname = method.getTestMethod().getMethodName(); + mapping.put(methodname, Arrays.asList(method.getTestMethod().getGroups())); + } + + public Map> getMapping() { + return mapping; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/groups/issue182/ParentTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groups/issue182/ParentTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/groups/issue182/ParentTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groups/issue182/ParentTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ +package test.groups.issue182; + +import org.testng.annotations.Test; + +@Test +public abstract class ParentTest { + public void parentTestMethod() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/groups/issue1834/IssueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groups/issue1834/IssueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/groups/issue1834/IssueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groups/issue1834/IssueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,49 @@ +package test.groups.issue1834; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.io.File; +import java.io.IOException; +import java.util.Collections; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.reporters.Files; +import test.SimpleBaseTest; +import test.TestHelper; + +public class IssueTest extends SimpleBaseTest { + + @Test(description = "GITHUB-1834") + public void ensureDependenciesDefinedInSuiteAreHonored() throws IOException { + File file = File.createTempFile("1834", ".xml"); + Files.writeFile(asSuite(), file); + TestNG testng = create(); + testng.setTestSuites(Collections.singletonList(file.getAbsolutePath())); + OutputGatheringListener listener = new OutputGatheringListener(); + testng.addListener(listener); + testng.run(); + assertThat(listener.getConsoleLogs()).containsExactly("Uncached", "Cached"); + } + + private static String asSuite() { + return TestHelper.SUITE_XML_HEADER + + "\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + ""; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/groups/issue1834/OutputGatheringListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groups/issue1834/OutputGatheringListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/groups/issue1834/OutputGatheringListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groups/issue1834/OutputGatheringListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.groups.issue1834; + +import java.util.List; +import org.testng.ITestResult; +import org.testng.Reporter; +import org.testng.TestListenerAdapter; +import org.testng.collections.Lists; + +public class OutputGatheringListener extends TestListenerAdapter { + private List consoleLogs = Lists.newArrayList(); + + @Override + public void onTestSuccess(ITestResult tr) { + consoleLogs.addAll(Reporter.getOutput(tr)); + } + + public List getConsoleLogs() { + return consoleLogs; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/groups/issue1834/TestSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groups/issue1834/TestSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/groups/issue1834/TestSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groups/issue1834/TestSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.groups.issue1834; + +import org.testng.Reporter; +import org.testng.annotations.Test; + +public class TestSample { + @Test(groups = "Cached") + public void dataSuccessfullyReceivedFromCache() { + Reporter.log("Cached"); + } + + @Test(groups = "Uncached") + public void dataSuccessfullyReceivedFromWhapi() { + Reporter.log("Uncached"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/groups/issue2152/IssueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groups/issue2152/IssueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/groups/issue2152/IssueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groups/issue2152/IssueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ +package test.groups.issue2152; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class IssueTest extends SimpleBaseTest { + + @Test(description = "GITHUB-2152") + public void ensureConfigurationsDontInheritGroupsWhenRunningWithoutGroupFiltering() { + TestNG testng = create(TestClassSample.class); + testng.run(); + String[] expected = new String[] {"setup", "test1", "teardown"}; + assertThat(TestClassSample.logs).containsExactly(expected); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/groups/issue2152/TestClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groups/issue2152/TestClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/groups/issue2152/TestClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groups/issue2152/TestClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +package test.groups.issue2152; + +import java.util.ArrayList; +import java.util.List; +import org.testng.ITestResult; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +@Test(groups = {"Group1", "Group2", "Group3", "Group4"}) +public class TestClassSample { + static List logs = new ArrayList<>(); + + @BeforeMethod + public void setUp() { + logs.add("setup"); + } + + @AfterMethod + public void tearDown(ITestResult result) { + logs.add("teardown"); + } + + public void test1() { + logs.add("test1"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/groups/issue2232/IssueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groups/issue2232/IssueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/groups/issue2232/IssueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groups/issue2232/IssueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,85 @@ +package test.groups.issue2232; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.io.File; +import java.io.IOException; +import java.nio.charset.Charset; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import org.testng.Reporter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlGroups; +import org.testng.xml.XmlPackage; +import org.testng.xml.XmlRun; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.SimpleBaseTest; + +public class IssueTest extends SimpleBaseTest { + @Test(description = "GITHUB-2232", invocationCount = 2) + // This test case doesn't vet out the fix completely because the bug by itself is very + // sporadic and is not easy to reproduce. That is why this test is being executed 10 times + // to ensure that the issue can be reproduced in one of the executions + public void ensureNoNPEThrownWhenRunningGroups() throws InterruptedException { + TestNG testng = create(constructSuite()); + testng.run(); + assertThat(testng.getStatus()).isEqualTo(0); + } + + private XmlSuite constructSuite() { + XmlSuite xmlsuite = createXmlSuite("2232_suite"); + xmlsuite.setConfigFailurePolicy(XmlSuite.FailurePolicy.CONTINUE); + xmlsuite.setThreadCount(256); + xmlsuite.setParallel(XmlSuite.ParallelMode.CLASSES); + XmlTest xmltest = createXmlTest(xmlsuite, "2232_test"); + XmlRun xmlrun = new XmlRun(); + xmlrun.onInclude("Group2"); + xmlrun.onExclude("Broken"); + XmlGroups xmlgroup = new XmlGroups(); + xmlgroup.setRun(xmlrun); + xmltest.setGroups(xmlgroup); + XmlPackage xmlpackage = new XmlPackage(); + xmlpackage.setName(getClass().getPackage().getName() + ".samples.*"); + xmltest.setPackages(Collections.singletonList(xmlpackage)); + return xmlsuite; + } + + @Test(invocationCount = 2, description = "GITHUB-2232") + // Ensuring that the bug doesn't surface even when tests are executed via the command line mode + public void commandlineTest() throws IOException, InterruptedException { + Path suitefile = + Files.write( + Files.createTempFile("testng", ".xml"), + constructSuite().toXml().getBytes(Charset.defaultCharset())); + List args = Collections.singletonList(suitefile.toFile().getAbsolutePath()); + int status = exec(Collections.emptyList(), args); + assertThat(status).isEqualTo(0); + } + + private int exec(List jvmArgs, List args) + throws IOException, InterruptedException { + + String javaHome = System.getProperty("java.home"); + String javaBin = javaHome + File.separator + "bin" + File.separator + "java"; + String classpath = System.getProperty("java.class.path"); + String className = TestNG.class.getName(); + List command = new ArrayList<>(); + command.add(javaBin); + command.addAll(jvmArgs); + command.add("-cp"); + command.add(classpath); + command.add(className); + command.addAll(args); + Reporter.log("Executing the command " + command, 2, true); + ProcessBuilder builder = new ProcessBuilder(command); + Process process = builder.inheritIO().start(); + process.waitFor(); + + return process.exitValue(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/groups/issue2232/samples/SampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groups/issue2232/samples/SampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/groups/issue2232/samples/SampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groups/issue2232/samples/SampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,34 @@ +package test.groups.issue2232.samples; + +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +@Test(groups = {"Group1", "Group2", "Group3"}) +public class SampleTest { + + private int variable = 0; + + @BeforeClass + public void setUp() { + variable += 1; + } + + @AfterMethod + public void tearDown() { + variable += 1; + } + + @DataProvider(name = "testData1") + public Object[][] testData1() { + return new Object[][] { + {"Test1"}, {"Test2"}, + }; + } + + @Test(dataProvider = "testData1") + public void test1(String test) { + variable += 1; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/groups/issue2232/samples/SampleTest2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groups/issue2232/samples/SampleTest2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/groups/issue2232/samples/SampleTest2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/groups/issue2232/samples/SampleTest2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,37 @@ +package test.groups.issue2232.samples; + +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +@Test(groups = {"Group1", "Group2", "Group3"}) +public class SampleTest2 { + + private int variable = 0; + + @BeforeClass + public void setUp() throws Exception { + variable += 1; + if (variable == 4) { + throw new Exception("Exception!"); + } + } + + @AfterMethod + public void tearDown() { + variable += 1; + } + + @DataProvider(name = "testData2") + public Object[][] testData2() { + return new Object[][] { + {"Test3"}, {"Test4"}, + }; + } + + @Test(dataProvider = "testData2") + public void test2(String test) { + variable += 1; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/ExampleSingleton.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/ExampleSingleton.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/ExampleSingleton.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/ExampleSingleton.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,7 @@ +package test.guice; + +public class ExampleSingleton implements ISingleton { + + @Override + public void doSomething() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/FakeInjector.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/FakeInjector.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/FakeInjector.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/FakeInjector.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,136 @@ +package test.guice; + +import com.google.inject.Binding; +import com.google.inject.Injector; +import com.google.inject.Key; +import com.google.inject.MembersInjector; +import com.google.inject.Module; +import com.google.inject.Provider; +import com.google.inject.Scope; +import com.google.inject.TypeLiteral; +import com.google.inject.spi.Element; +import com.google.inject.spi.InjectionPoint; +import com.google.inject.spi.TypeConverterBinding; +import java.lang.annotation.Annotation; +import java.util.List; +import java.util.Map; +import java.util.Set; +import org.testng.internal.objects.InstanceCreator; + +public class FakeInjector implements Injector { + + private static FakeInjector instance; + + public FakeInjector() {} + + private static void setInstance(FakeInjector i) { + instance = i; + } + + public static FakeInjector getInstance() { + return instance; + } + + @Override + public void injectMembers(Object instance) {} + + @Override + public MembersInjector getMembersInjector(TypeLiteral typeLiteral) { + return null; + } + + @Override + public MembersInjector getMembersInjector(Class type) { + return null; + } + + @Override + public Map, Binding> getBindings() { + return null; + } + + @Override + public Map, Binding> getAllBindings() { + return null; + } + + @Override + public Binding getBinding(Key key) { + return null; + } + + @Override + public Binding getBinding(Class type) { + return null; + } + + @Override + public Binding getExistingBinding(Key key) { + return null; + } + + @Override + public List> findBindingsByType(TypeLiteral type) { + return null; + } + + @Override + public Provider getProvider(Key key) { + return null; + } + + @Override + public Provider getProvider(Class type) { + return null; + } + + @Override + public T getInstance(Key key) { + return null; + } + + @Override + public T getInstance(Class type) { + try { + setInstance(this); + return InstanceCreator.newInstance(type); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + @Override + public Injector getParent() { + return null; + } + + @Override + public Injector createChildInjector(Iterable modules) { + return null; + } + + @Override + public Injector createChildInjector(Module... modules) { + return null; + } + + @Override + public Map, Scope> getScopeBindings() { + return null; + } + + @Override + public Set getTypeConverterBindings() { + return null; + } + + @Override + public List getElements() { + return null; + } + + @Override + public Map, List> getAllMembersInjectorInjectionPoints() { + return null; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/Guice1Test.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/Guice1Test.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/Guice1Test.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/Guice1Test.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.guice; + +import com.google.inject.Inject; +import org.testng.annotations.Guice; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +@Guice(modules = GuiceExampleModule.class) +public class Guice1Test extends SimpleBaseTest { + static ISingleton m_object; + + @Inject ISingleton m_singleton; + + @Test + public void singletonShouldWork() { + m_singleton.doSomething(); + m_object = m_singleton; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/Guice2Test.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/Guice2Test.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/Guice2Test.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/Guice2Test.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ +package test.guice; + +import com.google.inject.Inject; +import org.testng.annotations.Guice; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +@Guice(modules = GuiceExampleModule.class) +public class Guice2Test extends SimpleBaseTest { + static ISingleton m_object; + + @Inject ISingleton m_singleton; + + @Test + public void singletonShouldWork() { + m_object = m_singleton; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/GuiceBase.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/GuiceBase.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/GuiceBase.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/GuiceBase.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,6 @@ +package test.guice; + +import org.testng.annotations.Guice; + +@Guice(modules = GuiceExampleModule.class) +public class GuiceBase {} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/GuiceExampleModule.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/GuiceExampleModule.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/GuiceExampleModule.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/GuiceExampleModule.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,13 @@ +package test.guice; + +import com.google.inject.Binder; +import com.google.inject.Module; +import com.google.inject.Singleton; + +public class GuiceExampleModule implements Module { + + @Override + public void configure(Binder binder) { + binder.bind(ISingleton.class).to(ExampleSingleton.class).in(Singleton.class); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/GuiceInheritanceTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/GuiceInheritanceTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/GuiceInheritanceTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/GuiceInheritanceTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package test.guice; + +import com.google.inject.Inject; +import org.testng.annotations.Test; + +public class GuiceInheritanceTest extends GuiceBase { + + @Inject ISingleton m_singleton; + + @Test + public void singletonShouldWork() { + m_singleton.doSomething(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/GuiceModuleFactoryTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/GuiceModuleFactoryTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/GuiceModuleFactoryTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/GuiceModuleFactoryTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.guice; + +import com.google.inject.Inject; +import org.testng.annotations.Guice; +import org.testng.annotations.Test; + +@Guice(moduleFactory = ModuleFactory.class) +public class GuiceModuleFactoryTest { + + @Inject ISingleton m_singleton; + + @Test + public void singletonShouldWork() { + m_singleton.doSomething(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/GuiceNoModuleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/GuiceNoModuleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/GuiceNoModuleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/GuiceNoModuleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.guice; + +import org.testng.annotations.Guice; +import org.testng.annotations.Test; + +@Guice +public class GuiceNoModuleTest { + + @Test + public void f() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/GuiceParentModule.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/GuiceParentModule.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/GuiceParentModule.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/GuiceParentModule.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,21 @@ +package test.guice; + +import com.google.inject.AbstractModule; +import com.google.inject.Singleton; +import org.testng.ITestContext; + +public class GuiceParentModule extends AbstractModule { + + private final ITestContext context; + + public GuiceParentModule(ITestContext context) { + this.context = context; + } + + @Override + protected void configure() { + bind(MyService.class).toProvider(MyServiceProvider.class); + bind(MyContext.class).to(MyContextImpl.class).in(Singleton.class); + bind(ITestContext.class).toInstance(context); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/GuiceParentModuleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/GuiceParentModuleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/GuiceParentModuleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/GuiceParentModuleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,24 @@ +package test.guice; + +import com.google.inject.Inject; +import org.testng.Assert; +import org.testng.ITestContext; +import org.testng.annotations.Guice; +import org.testng.annotations.Test; + +@Test +@Guice(modules = GuiceTestModule.class) +public class GuiceParentModuleTest { + @Inject MySession mySession; + @Inject MyService myService; + @Inject ITestContext context; + + public void testService() { + Assert.assertNotNull(myService); + Assert.assertNotNull(mySession); + myService.serve(mySession); + Assert.assertNotNull(context); + Assert.assertEquals(context.getName(), "Guice"); + Assert.assertEquals(context.getSuite().getName(), "parent-module-suite"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/GuiceTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/GuiceTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/GuiceTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/GuiceTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,100 @@ +package test.guice; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.testng.Assert.assertEquals; + +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import test.SimpleBaseTest; +import test.guice.issue2343.Person; +import test.guice.issue2343.SampleA; +import test.guice.issue2343.SampleB; +import test.guice.issue2343.modules.ParentModule; +import test.guice.issue2355.AnotherParentModule; +import test.guice.issue2427.Test1; +import test.guice.issue2427.Test2; +import test.guice.issue2427.modules.TestModuleOne; +import test.guice.issue2427.modules.TestModuleTwo; +import test.guice.issue2427.modules.TestParentConfigModule; +import test.guice.issue2570.GuicePoweredConstructorInjectedRetry; +import test.guice.issue2570.GuicePoweredConstructorInjectedRetryForDPTest; +import test.guice.issue2570.GuicePoweredSetterInjectedRetry; +import test.guice.issue2570.SampleTestClass; + +public class GuiceTest extends SimpleBaseTest { + + @Test + public void guiceTest() { + TestNG tng = create(Guice1Test.class, Guice2Test.class); + Guice1Test.m_object = null; + Guice2Test.m_object = null; + tng.run(); + + assertThat(Guice1Test.m_object).isNotNull(); + assertThat(Guice2Test.m_object).isNotNull(); + assertThat(Guice1Test.m_object).isEqualTo(Guice2Test.m_object); + } + + @Test + public void guiceWithNoModules() { + TestNG tng = create(GuiceNoModuleTest.class); + tng.run(); + } + + @Test(description = "GITHUB-2199") + public void guiceWithExternalDependencyInjector() { + TestNG testng = create(Guice1Test.class); + testng.setInjectorFactory((stage, modules) -> new FakeInjector()); + testng.run(); + assertThat(FakeInjector.getInstance()).isNotNull(); + } + + @Test(description = "GITHUB-2343") + public void ensureInjectorsAreReUsed() { + XmlSuite suite = createXmlSuite("sample_suite", "sample_test", SampleA.class, SampleB.class); + suite.setParentModule(ParentModule.class.getCanonicalName()); + TestNG testng = create(suite); + testng.run(); + assertThat(Person.counter).isEqualTo(1); + } + + @Test(description = "GITHUB-2355") + public void ensureMultipleInjectorsAreNotCreated() { + Person.counter = 0; + XmlSuite suite = createXmlSuite("sample_suite", "sample_test", SampleA.class, SampleB.class); + suite.setParentModule(AnotherParentModule.class.getCanonicalName()); + TestNG testng = create(suite); + testng.run(); + assertThat(AnotherParentModule.getCounter()).isEqualTo(1); + assertThat(Person.counter).isEqualTo(1); + } + + @Test(description = "GITHUB-2427") + public void ensureConfigureMethodCalledOnceForModule() { + XmlSuite suite = createXmlSuite("sample_suite", "sample_test", Test1.class, Test2.class); + suite.setParentModule(TestParentConfigModule.class.getCanonicalName()); + TestNG testng = create(suite); + testng.run(); + assertEquals( + TestParentConfigModule.counter.get(), 1, "TestParentModule configuration called times"); + assertEquals(TestModuleOne.counter.get(), 1, "TestModuleOne configuration called times"); + assertEquals(TestModuleTwo.counter.get(), 1, "TestModuleTwo configuration called times"); + } + + @Test(description = "GITHUB-2570") + public void ensureRetryAnalyzersAreGuiceAware() { + TestNG testng = create(SampleTestClass.class); + testng.run(); + assertThat(GuicePoweredConstructorInjectedRetry.getDragonWarrior()) + .withFailMessage( + "The Retry Analyzer should have been created via Guice constructor injection.") + .isEqualTo("Kungfu-Panda"); + assertThat(GuicePoweredSetterInjectedRetry.getTerminator()) + .withFailMessage("The Retry Analyzer should have been created via Guice setter injection.") + .isEqualTo("Arnold"); + assertThat(GuicePoweredConstructorInjectedRetryForDPTest.getCounter()) + .withFailMessage("There should have been 2 retry analyser instances created by Guice") + .isEqualTo(2); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/GuiceTestModule.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/GuiceTestModule.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/GuiceTestModule.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/GuiceTestModule.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ +package test.guice; + +import com.google.inject.AbstractModule; +import com.google.inject.Inject; + +public class GuiceTestModule extends AbstractModule { + private final MyContext myContext; + + @Inject + GuiceTestModule(MyContext myContext) { + this.myContext = myContext; + } + + @Override + protected void configure() { + bind(MySession.class).toInstance(myContext.getSession()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/ISingleton.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/ISingleton.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/ISingleton.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/ISingleton.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,6 @@ +package test.guice; + +public interface ISingleton { + + void doSomething(); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/ModuleFactory.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/ModuleFactory.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/ModuleFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/ModuleFactory.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,22 @@ +package test.guice; + +import com.google.inject.Module; +import org.testng.IModuleFactory; +import org.testng.ITestContext; + +public class ModuleFactory implements IModuleFactory { + + @Override + public Module createModule(ITestContext context, Class testClass) { + String parameter = context.getCurrentXmlTest().getParameter("inject"); + String expected = "guice"; + if (!expected.equals(parameter)) { + throw new RuntimeException("Excepted parameter to be " + expected + ", got " + parameter); + } + if (GuiceModuleFactoryTest.class == testClass) { + return new GuiceExampleModule(); + } else { + throw new RuntimeException("Don't know how to create a module for class " + testClass); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/MyContext.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/MyContext.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/MyContext.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/MyContext.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,6 @@ +package test.guice; + +public interface MyContext { + + MySession getSession(); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/MyContextImpl.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/MyContextImpl.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/MyContextImpl.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/MyContextImpl.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,10 @@ +package test.guice; + +public class MyContextImpl implements MyContext { + private final MySession mySession = new MySession(); + + @Override + public MySession getSession() { + return mySession; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/MyService.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/MyService.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/MyService.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/MyService.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,6 @@ +package test.guice; + +public interface MyService { + + void serve(MySession mySession); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/MyServiceProvider.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/MyServiceProvider.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/MyServiceProvider.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/MyServiceProvider.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.guice; + +import com.google.inject.Provider; + +public class MyServiceProvider implements Provider { + + @Override + public MyService get() { + return mySession -> {}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/MySession.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/MySession.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/MySession.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/MySession.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,3 @@ +package test.guice; + +public class MySession {} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue2343/Person.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue2343/Person.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue2343/Person.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue2343/Person.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,10 @@ +package test.guice.issue2343; + +public class Person { + + public static int counter; + + public Person() { + ++counter; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue2343/SampleA.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue2343/SampleA.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue2343/SampleA.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue2343/SampleA.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.guice.issue2343; + +import javax.inject.Inject; +import org.testng.annotations.Guice; +import org.testng.annotations.Test; + +@Guice +public class SampleA { + + @Inject + public SampleA(final Person person) {} + + @Test + public void testAnotherApp() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue2343/SampleB.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue2343/SampleB.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue2343/SampleB.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue2343/SampleB.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.guice.issue2343; + +import javax.inject.Inject; +import org.testng.annotations.Guice; +import org.testng.annotations.Test; + +@Guice +public class SampleB { + + @Inject + public SampleB(final Person person) {} + + @Test + public void testApp() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue2343/modules/ParentModule.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue2343/modules/ParentModule.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue2343/modules/ParentModule.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue2343/modules/ParentModule.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +package test.guice.issue2343.modules; + +import com.google.inject.AbstractModule; +import java.util.Objects; +import javax.inject.Singleton; +import test.guice.issue2343.Person; + +public class ParentModule extends AbstractModule { + + @Override + protected void configure() { + bind(Person.class).in(Singleton.class); + } + + @Override + public boolean equals(final Object object) { + if (object == null) { + return false; + } + return Objects.equals(getClass(), object.getClass()); + } + + @Override + public int hashCode() { + return this.getClass().hashCode(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue2355/AnotherParentModule.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue2355/AnotherParentModule.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue2355/AnotherParentModule.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue2355/AnotherParentModule.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,38 @@ +package test.guice.issue2355; + +import com.google.inject.AbstractModule; +import java.util.Objects; +import java.util.concurrent.atomic.AtomicInteger; +import javax.inject.Singleton; +import test.guice.issue2343.Person; + +public class AnotherParentModule extends AbstractModule { + + private static final AtomicInteger counter = new AtomicInteger(0); + + public AnotherParentModule() { + counter.incrementAndGet(); + } + + public static int getCounter() { + return counter.get(); + } + + @Override + protected void configure() { + bind(Person.class).in(Singleton.class); + } + + @Override + public boolean equals(final Object object) { + if (object == null) { + return false; + } + return Objects.equals(getClass(), object.getClass()); + } + + @Override + public int hashCode() { + return this.getClass().hashCode(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue2427/Test1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue2427/Test1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue2427/Test1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue2427/Test1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,13 @@ +package test.guice.issue2427; + +import org.testng.annotations.Guice; +import org.testng.annotations.Test; +import test.guice.issue2427.modules.TestModuleOne; + +@Guice(modules = {TestModuleOne.class}) +@Test() +public class Test1 { + public void shouldInstatiateModulesOnlyOnce() { + // do nothing as test is about configuration part + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue2427/Test2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue2427/Test2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue2427/Test2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue2427/Test2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,13 @@ +package test.guice.issue2427; + +import org.testng.annotations.Guice; +import org.testng.annotations.Test; +import test.guice.issue2427.modules.TestModuleTwo; + +@Guice(modules = {TestModuleTwo.class}) +@Test() +public class Test2 { + public void shouldInstatiateModulesOnlyOnce() { + // do nothing as test is about configuration part + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue2427/modules/TestAbstractModule.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue2427/modules/TestAbstractModule.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue2427/modules/TestAbstractModule.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue2427/modules/TestAbstractModule.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,28 @@ +package test.guice.issue2427.modules; + +import com.google.inject.AbstractModule; +import java.util.Objects; +import java.util.concurrent.atomic.AtomicInteger; + +abstract class TestAbstractModule extends AbstractModule { + private final AtomicInteger counter; + + protected TestAbstractModule(AtomicInteger counter) { + this.counter = counter; + } + + @Override + protected void configure() { + counter.incrementAndGet(); + } + + @Override + public int hashCode() { + return getClass().hashCode(); + } + + @Override + public boolean equals(Object obj) { + return obj != null && Objects.equals(getClass(), obj.getClass()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue2427/modules/TestModuleOne.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue2427/modules/TestModuleOne.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue2427/modules/TestModuleOne.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue2427/modules/TestModuleOne.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.guice.issue2427.modules; + +import java.util.concurrent.atomic.AtomicInteger; + +public class TestModuleOne extends TestAbstractModule { + public static AtomicInteger counter = new AtomicInteger(0); + + public TestModuleOne() { + super(counter); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue2427/modules/TestModuleTwo.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue2427/modules/TestModuleTwo.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue2427/modules/TestModuleTwo.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue2427/modules/TestModuleTwo.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.guice.issue2427.modules; + +import java.util.concurrent.atomic.AtomicInteger; + +public class TestModuleTwo extends TestAbstractModule { + public static AtomicInteger counter = new AtomicInteger(0); + + public TestModuleTwo() { + super(counter); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue2427/modules/TestParentConfigModule.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue2427/modules/TestParentConfigModule.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue2427/modules/TestParentConfigModule.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue2427/modules/TestParentConfigModule.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.guice.issue2427.modules; + +import java.util.concurrent.atomic.AtomicInteger; + +public class TestParentConfigModule extends TestAbstractModule { + public static AtomicInteger counter = new AtomicInteger(0); + + public TestParentConfigModule() { + super(counter); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue2570/GuiceModule.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue2570/GuiceModule.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue2570/GuiceModule.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue2570/GuiceModule.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,37 @@ +package test.guice.issue2570; + +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +import com.google.inject.AbstractModule; +import com.google.inject.Provides; +import java.lang.annotation.Retention; +import javax.inject.Qualifier; +import org.testng.IRetryAnalyzer; + +public class GuiceModule extends AbstractModule { + + @Override + protected void configure() { + bind(IRetryAnalyzer.class).to(GuicePoweredConstructorInjectedRetry.class); + } + + @Provides + @DragonWarrior + public static String dragonWarriorName() { + return "Kungfu-Panda"; + } + + @Provides + @Terminator + public static String terminatorName() { + return "Arnold"; + } + + @Qualifier + @Retention(RUNTIME) + @interface DragonWarrior {} + + @Qualifier + @Retention(RUNTIME) + @interface Terminator {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue2570/GuicePoweredConstructorInjectedRetry.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue2570/GuicePoweredConstructorInjectedRetry.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue2570/GuicePoweredConstructorInjectedRetry.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue2570/GuicePoweredConstructorInjectedRetry.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,33 @@ +package test.guice.issue2570; + +import com.google.inject.Inject; +import org.testng.IRetryAnalyzer; +import org.testng.ITestResult; +import org.testng.annotations.Guice; +import test.guice.issue2570.GuiceModule.DragonWarrior; + +@Guice(modules = GuiceModule.class) +public class GuicePoweredConstructorInjectedRetry implements IRetryAnalyzer { + + private static String dragonWarrior; + + private static void setName(String warriorName) { + dragonWarrior = warriorName; + } + + public static String getDragonWarrior() { + return dragonWarrior; + } + + @Inject + public GuicePoweredConstructorInjectedRetry(@DragonWarrior String name) { + setName(name); + } + + private int count = 1; + + @Override + public boolean retry(ITestResult result) { + return !result.isSuccess() && count-- > 0; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue2570/GuicePoweredConstructorInjectedRetryForDPTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue2570/GuicePoweredConstructorInjectedRetryForDPTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue2570/GuicePoweredConstructorInjectedRetryForDPTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue2570/GuicePoweredConstructorInjectedRetryForDPTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,30 @@ +package test.guice.issue2570; + +import com.google.inject.Inject; +import java.util.concurrent.atomic.AtomicInteger; +import org.testng.IRetryAnalyzer; +import org.testng.ITestResult; +import org.testng.annotations.Guice; +import test.guice.issue2570.GuiceModule.DragonWarrior; + +@Guice(modules = GuiceModule.class) +public class GuicePoweredConstructorInjectedRetryForDPTest implements IRetryAnalyzer { + + private static AtomicInteger counter = new AtomicInteger(0); + + public static int getCounter() { + return counter.get(); + } + + @Inject + public GuicePoweredConstructorInjectedRetryForDPTest(@DragonWarrior String name) { + counter.incrementAndGet(); + } + + private int count = 1; + + @Override + public boolean retry(ITestResult result) { + return !result.isSuccess() && count-- > 0; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue2570/GuicePoweredSetterInjectedRetry.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue2570/GuicePoweredSetterInjectedRetry.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue2570/GuicePoweredSetterInjectedRetry.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue2570/GuicePoweredSetterInjectedRetry.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,33 @@ +package test.guice.issue2570; + +import com.google.inject.Inject; +import org.testng.IRetryAnalyzer; +import org.testng.ITestResult; +import org.testng.annotations.Guice; +import test.guice.issue2570.GuiceModule.Terminator; + +@Guice(modules = GuiceModule.class) +public class GuicePoweredSetterInjectedRetry implements IRetryAnalyzer { + + private int count = 1; + + private static String terminator; + + @Inject + public void setName(@Terminator String name) { + setValue(name); + } + + private static void setValue(String warriorName) { + terminator = warriorName; + } + + public static String getTerminator() { + return terminator; + } + + @Override + public boolean retry(ITestResult result) { + return !result.isSuccess() && count-- > 0; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue2570/SampleTestClass.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue2570/SampleTestClass.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue2570/SampleTestClass.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue2570/SampleTestClass.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,28 @@ +package test.guice.issue2570; + +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class SampleTestClass { + + @Test(retryAnalyzer = GuicePoweredConstructorInjectedRetry.class) + public void test() { + Assert.fail(); + } + + @Test(retryAnalyzer = GuicePoweredSetterInjectedRetry.class) + public void anotherTest() { + Assert.fail(); + } + + @Test(dataProvider = "dp", retryAnalyzer = GuicePoweredConstructorInjectedRetryForDPTest.class) + public void dataDrivenTest(int i) { + Assert.fail(); + } + + @DataProvider(name = "dp") + public Object[][] getData() { + return new Object[][] {{1}, {2}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue279/Car.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue279/Car.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue279/Car.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue279/Car.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,7 @@ +package test.guice.issue279; + +public class Car implements Vehicle { + + @Override + public void drive() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue279/DummyReporter.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue279/DummyReporter.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue279/DummyReporter.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue279/DummyReporter.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,29 @@ +package test.guice.issue279; + +import com.google.inject.Inject; +import java.util.List; +import org.testng.IReporter; +import org.testng.ISuite; +import org.testng.annotations.Guice; +import org.testng.xml.XmlSuite; + +@Guice(moduleFactory = TestDIFactory.class) +public class DummyReporter implements IReporter { + @Inject private Greeter greeter; + + private static Greeter instance; + + @Override + public void generateReport( + List xmlSuites, List suites, String outputDirectory) { + instance = greeter; + } + + public static Greeter getInstance() { + return instance; + } + + static void clearInstance() { + instance = null; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue279/DummyReporterWithoutModuleFactory.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue279/DummyReporterWithoutModuleFactory.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue279/DummyReporterWithoutModuleFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue279/DummyReporterWithoutModuleFactory.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,29 @@ +package test.guice.issue279; + +import com.google.inject.Inject; +import java.util.List; +import org.testng.IReporter; +import org.testng.ISuite; +import org.testng.annotations.Guice; +import org.testng.xml.XmlSuite; + +@Guice +public class DummyReporterWithoutModuleFactory implements IReporter { + @Inject private Vehicle vehicle; + + private static Vehicle instance; + + @Override + public void generateReport( + List xmlSuites, List suites, String outputDirectory) { + instance = vehicle; + } + + public static Vehicle getInstance() { + return instance; + } + + static void clearInstance() { + instance = null; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue279/Greeter.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue279/Greeter.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue279/Greeter.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue279/Greeter.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,6 @@ +package test.guice.issue279; + +public interface Greeter { + + String greet(String name); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue279/IssueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue279/IssueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue279/IssueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue279/IssueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,54 @@ +package test.guice.issue279; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Arrays; +import org.testng.TestNG; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import test.SimpleBaseTest; + +public class IssueTest extends SimpleBaseTest { + + @BeforeMethod + public void cleanup() { + MyListener.clearInstance(); + DummyReporter.clearInstance(); + DummyReporterWithoutModuleFactory.clearInstance(); + } + + @Test + public void classWithListenerAnnotation() { + TestNG testng = create(TestClassWithListener.class); + testng.run(); + assertThat(MyListener.getInstance()).isInstanceOf(TextGreeter.class); + assertThat(DummyReporter.getInstance()).isInstanceOf(TextGreeter.class); + } + + @Test + public void classWithoutListenerAnnotation() { + XmlSuite xmlSuite = createXmlSuite("sample_suite"); + xmlSuite.setListeners(Arrays.asList(MyListener.class.getName(), DummyReporter.class.getName())); + createXmlTest(xmlSuite, "sample_test", TestClassWithoutListener.class); + TestNG testng = create(xmlSuite); + testng.run(); + assertThat(MyListener.getInstance()).isInstanceOf(TextGreeter.class); + assertThat(DummyReporter.getInstance()).isInstanceOf(TextGreeter.class); + } + + @Test + public void classWithModuleDefinedInSuite() { + XmlSuite xmlSuite = createXmlSuite("sample_suite"); + xmlSuite.setParentModule(SampleModule.class.getName()); + xmlSuite.setListeners( + Arrays.asList( + MyListenerWithoutModuleFactory.class.getName(), + DummyReporterWithoutModuleFactory.class.getName())); + createXmlTest(xmlSuite, "sample_test", TestClassWithoutListener.class); + TestNG testng = create(xmlSuite); + testng.run(); + assertThat(MyListenerWithoutModuleFactory.getInstance()).isInstanceOf(TextGreeter.class); + assertThat(DummyReporterWithoutModuleFactory.getInstance()).isInstanceOf(Car.class); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue279/MyListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue279/MyListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue279/MyListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue279/MyListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,28 @@ +package test.guice.issue279; + +import com.google.inject.Inject; +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.ITestResult; +import org.testng.annotations.Guice; + +@Guice(moduleFactory = TestDIFactory.class) +public class MyListener implements IInvokedMethodListener { + + @Inject private Greeter greeter; + + private static Greeter instance; + + @Override + public void afterInvocation(IInvokedMethod method, ITestResult testResult) { + instance = greeter; + } + + static Greeter getInstance() { + return instance; + } + + static void clearInstance() { + instance = null; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue279/MyListenerWithoutModuleFactory.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue279/MyListenerWithoutModuleFactory.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue279/MyListenerWithoutModuleFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue279/MyListenerWithoutModuleFactory.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,28 @@ +package test.guice.issue279; + +import com.google.inject.Inject; +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.ITestResult; +import org.testng.annotations.Guice; + +@Guice +public class MyListenerWithoutModuleFactory implements IInvokedMethodListener { + + @Inject private Greeter greeter; + + private static Greeter instance; + + @Override + public void afterInvocation(IInvokedMethod method, ITestResult testResult) { + instance = greeter; + } + + static Greeter getInstance() { + return instance; + } + + static void clearInstance() { + instance = null; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue279/SampleModule.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue279/SampleModule.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue279/SampleModule.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue279/SampleModule.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.guice.issue279; + +import com.google.inject.AbstractModule; + +public class SampleModule extends AbstractModule { + + @Override + protected void configure() { + bind(Greeter.class).to(TextGreeter.class).asEagerSingleton(); + bind(Vehicle.class).to(Car.class).asEagerSingleton(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue279/TestClassWithListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue279/TestClassWithListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue279/TestClassWithListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue279/TestClassWithListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.guice.issue279; + +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +@Listeners({MyListener.class, DummyReporter.class}) +public class TestClassWithListener { + + @Test + public void testMethod() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue279/TestClassWithoutListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue279/TestClassWithoutListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue279/TestClassWithoutListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue279/TestClassWithoutListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.guice.issue279; + +import org.testng.annotations.Test; + +public class TestClassWithoutListener { + + @Test + public void testMethod() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue279/TestDIFactory.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue279/TestDIFactory.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue279/TestDIFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue279/TestDIFactory.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,13 @@ +package test.guice.issue279; + +import com.google.inject.Module; +import org.testng.IModuleFactory; +import org.testng.ITestContext; + +public class TestDIFactory implements IModuleFactory { + + @Override + public Module createModule(ITestContext context, Class testClass) { + return new SampleModule(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue279/TextGreeter.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue279/TextGreeter.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue279/TextGreeter.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue279/TextGreeter.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.guice.issue279; + +public class TextGreeter implements Greeter { + + @Override + public String greet(String name) { + return "hello " + name; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue279/Vehicle.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue279/Vehicle.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/issue279/Vehicle.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/issue279/Vehicle.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,5 @@ +package test.guice.issue279; + +public interface Vehicle { + void drive(); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/jitbinding/FirstModuleSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/jitbinding/FirstModuleSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/jitbinding/FirstModuleSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/jitbinding/FirstModuleSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,25 @@ +package test.guice.jitbinding; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.inject.AbstractModule; +import javax.inject.Inject; +import org.testng.annotations.Guice; +import org.testng.annotations.Test; + +@Guice(modules = FirstModuleSample.FirstModule.class) +public class FirstModuleSample { + static class FirstModule extends AbstractModule { + @Override + protected void configure() { + // no explicit binding, so value will be just in time bound to `new String()` + } + } + + @Inject String value; + + @Test + public void testInject() { + assertThat(value).isEqualTo(""); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/jitbinding/JitBindingTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/jitbinding/JitBindingTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/jitbinding/JitBindingTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/jitbinding/JitBindingTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,21 @@ +package test.guice.jitbinding; + +import org.testng.Assert; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class JitBindingTest extends SimpleBaseTest { + + @Test + public void testConflictingJitBinding() { + TestNG tng = create(FirstModuleSample.class, SecondModuleSample.class); + TestListenerAdapter adapter = new TestListenerAdapter(); + tng.addListener(adapter); + tng.run(); + Assert.assertTrue(adapter.getFailedTests().isEmpty()); + Assert.assertTrue(adapter.getSkippedTests().isEmpty()); + Assert.assertEquals(adapter.getPassedTests().size(), 2); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/jitbinding/SecondModuleSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/jitbinding/SecondModuleSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/guice/jitbinding/SecondModuleSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/guice/jitbinding/SecondModuleSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,25 @@ +package test.guice.jitbinding; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.inject.AbstractModule; +import javax.inject.Inject; +import org.testng.annotations.Guice; +import org.testng.annotations.Test; + +@Guice(modules = SecondModuleSample.SecondModule.class) +public class SecondModuleSample { + static class SecondModule extends AbstractModule { + @Override + protected void configure() { + bind(String.class).toInstance(new String("Hello")); + } + } + + @Inject String value; + + @Test + public void testInject() { + assertThat(value).isEqualTo("Hello"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/hook/BaseConfigurable.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/BaseConfigurable.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/hook/BaseConfigurable.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/BaseConfigurable.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,37 @@ +package test.hook; + +import java.lang.reflect.Method; +import org.testng.IConfigurable; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.BeforeSuite; +import org.testng.annotations.BeforeTest; + +public abstract class BaseConfigurable implements IConfigurable { + static int m_hookCount = 0; + static boolean m_bs = false; + static boolean m_bt = false; + static boolean m_bm = false; + static boolean m_bc = false; + static String m_methodName = null; + + @BeforeSuite + public void bs() { + m_bs = true; + } + + @BeforeTest + public void bt() { + m_bt = true; + } + + @BeforeMethod + public void bm(Method m) { + m_bm = true; + } + + @BeforeClass + public void bc() { + m_bc = true; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/hook/ConfigurableFailureTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/ConfigurableFailureTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/hook/ConfigurableFailureTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/ConfigurableFailureTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,21 @@ +package test.hook; + +import org.testng.Assert; +import org.testng.IConfigureCallBack; +import org.testng.ITestResult; +import org.testng.annotations.Test; + +public class ConfigurableFailureTest extends BaseConfigurable { + + @Override + public void run(IConfigureCallBack callBack, ITestResult testResult) { + m_hookCount++; + // Not calling the callback + } + + @Test + public void hookWasNotRun() { + Assert.assertFalse(m_bc); + Assert.assertFalse(m_bm); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/hook/ConfigurableListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/ConfigurableListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/hook/ConfigurableListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/ConfigurableListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,21 @@ +package test.hook; + +import java.lang.reflect.Method; +import org.testng.IConfigurable; +import org.testng.IConfigureCallBack; +import org.testng.ITestResult; + +public class ConfigurableListener implements IConfigurable { + static int m_hookCount = 0; + static String m_methodName; + + @Override + public void run(IConfigureCallBack callBack, ITestResult testResult) { + m_hookCount++; + Object[] parameters = callBack.getParameters(); + if (parameters.length > 0) { + m_methodName = ((Method) parameters[0]).getName(); + } + callBack.runConfigurationMethod(testResult); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/hook/ConfigurableSuccessTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/ConfigurableSuccessTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/hook/ConfigurableSuccessTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/ConfigurableSuccessTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package test.hook; + +import java.lang.reflect.Method; +import org.testng.IConfigurable; +import org.testng.IConfigureCallBack; +import org.testng.ITestResult; +import org.testng.annotations.Test; + +/** Test harness for {@link IConfigurable} */ +public class ConfigurableSuccessTest extends BaseConfigurable { + @Override + public void run(IConfigureCallBack callBack, ITestResult testResult) { + m_hookCount++; + Object[] parameters = callBack.getParameters(); + if (parameters.length > 0) { + m_methodName = ((Method) parameters[0]).getName(); + } + callBack.runConfigurationMethod(testResult); + } + + @Test + public void hookWasRun() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/hook/ConfigurableSuccessWithListenerTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/ConfigurableSuccessWithListenerTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/hook/ConfigurableSuccessWithListenerTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/ConfigurableSuccessWithListenerTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,44 @@ +package test.hook; + +import java.lang.reflect.Method; +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.BeforeSuite; +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +@Listeners(ConfigurableListener.class) +public class ConfigurableSuccessWithListenerTest { + static boolean m_bm = false; + static boolean m_bc = false; + static boolean m_bt; + static boolean m_bs; + + @BeforeSuite + public void bs() { + m_bs = true; + } + + @BeforeMethod + public void bt() { + m_bt = true; + } + + @BeforeMethod + public void bm(Method m) { + m_bm = true; + } + + @BeforeClass + public void bc() { + m_bc = true; + } + + @Test + public void hookWasRun() { + Assert.assertEquals(ConfigurableListener.m_hookCount, 2); + Assert.assertTrue(m_bc); + Assert.assertTrue(m_bm); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/hook/HookFailureTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/HookFailureTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/hook/HookFailureTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/HookFailureTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,22 @@ +package test.hook; + +import org.testng.IHookCallBack; +import org.testng.IHookable; +import org.testng.ITestResult; +import org.testng.annotations.Test; + +public class HookFailureTest implements IHookable { + static boolean m_hook = false; + static boolean m_testWasRun = false; + + @Override + public void run(IHookCallBack callBack, ITestResult testResult) { + m_hook = true; + // Not invoking the callback: the method should not be run + } + + @Test + public void verify() { + m_testWasRun = true; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/hook/HookListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/HookListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/hook/HookListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/HookListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.hook; + +import org.testng.IHookCallBack; +import org.testng.IHookable; +import org.testng.ITestResult; + +public class HookListener implements IHookable { + public static boolean m_hook = false; + + @Override + public void run(IHookCallBack callBack, ITestResult testResult) { + m_hook = true; + callBack.runTestMethod(testResult); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/hook/HookSuccess599Test.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/HookSuccess599Test.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/hook/HookSuccess599Test.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/HookSuccess599Test.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,41 @@ +package test.hook; + +import org.testng.IHookCallBack; +import org.testng.IHookable; +import org.testng.ITestResult; +import org.testng.Reporter; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +/** + * Test harness for {@link IHookable} + * + * @author Cedric Beust + * @since Aug 01, 2006 + */ +public class HookSuccess599Test implements IHookable { + static boolean m_hook = false; + static boolean m_testWasRun = false; + static String m_parameter = null; + + @Override + public void run(IHookCallBack callBack, ITestResult testResult) { + m_hook = true; + Object[] parameters = callBack.getParameters(); + if (parameters.length > 0) { + m_parameter = parameters[0].toString(); + } + callBack.runTestMethod(testResult); + } + + @DataProvider + public Object[][] dp() { + return new Object[][] {new Object[] {"foo"}}; + } + + @Test(dataProvider = "dp", timeOut = 100) + public void verify(String name) { + m_testWasRun = true; + Reporter.log("output from hook test.verify"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/hook/HookSuccess862Test.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/HookSuccess862Test.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/hook/HookSuccess862Test.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/HookSuccess862Test.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,37 @@ +package test.hook; + +import java.lang.annotation.Annotation; +import java.lang.reflect.Method; +import javax.inject.Named; +import org.testng.*; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class HookSuccess862Test implements IHookable { + + @Override + public void run(IHookCallBack callBack, ITestResult testResult) { + Method method = testResult.getMethod().getConstructorOrMethod().getMethod(); + for (int i = 0; i < callBack.getParameters().length; i++) { + Annotation[] annotations = method.getParameterAnnotations()[i]; + for (Annotation annotation : annotations) { + if (annotation instanceof Named) { + Named named = (Named) annotation; + callBack.getParameters()[0] = callBack.getParameters()[0] + named.value(); + } + } + } + callBack.runTestMethod(testResult); + } + + @DataProvider + public Object[][] dp() { + return new Object[][] {new Object[] {"foo", "test"}}; + } + + @Test(dataProvider = "dp") + public void verify(@Named("bar") String bar, String test) { + Assert.assertEquals(bar, "foobar"); + Assert.assertEquals(test, "test"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/hook/HookSuccessTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/HookSuccessTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/hook/HookSuccessTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/HookSuccessTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,35 @@ +package test.hook; + +import org.testng.IHookCallBack; +import org.testng.IHookable; +import org.testng.ITestResult; +import org.testng.Reporter; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class HookSuccessTest implements IHookable { + static boolean m_hook = false; + static boolean m_testWasRun = false; + static String m_parameter = null; + + @Override + public void run(IHookCallBack callBack, ITestResult testResult) { + m_hook = true; + Object[] parameters = callBack.getParameters(); + if (parameters.length > 0) { + m_parameter = parameters[0].toString(); + } + callBack.runTestMethod(testResult); + } + + @DataProvider + public Object[][] dp() { + return new Object[][] {new Object[] {"foo"}}; + } + + @Test(dataProvider = "dp") + public void verify(String name) { + m_testWasRun = true; + Reporter.log("output from hook test.verify"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/hook/HookSuccessWithListenerTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/HookSuccessWithListenerTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/hook/HookSuccessWithListenerTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/HookSuccessWithListenerTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package test.hook; + +import org.testng.Assert; +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +@Listeners(HookListener.class) +public class HookSuccessWithListenerTest { + + @Test + public void verify() { + Assert.assertTrue(HookListener.m_hook); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/hook/HookableTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/HookableTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/hook/HookableTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/HookableTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,127 @@ +package test.hook; + +import org.testng.Assert; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; +import test.BaseTest; + +/** + * Because IHookable and IConfigurable are global, it's safer to run them in a sub-TestNG object, + * otherwise they will be run for your entire test suite... + * + * @author cbeust + */ +public class HookableTest extends BaseTest { + + @BeforeMethod + public void bm() { + HookSuccessTest.m_hook = false; + HookSuccessTest.m_testWasRun = false; + HookSuccessTest.m_parameter = null; + HookSuccess599Test.m_hook = false; + HookSuccess599Test.m_testWasRun = false; + HookSuccess599Test.m_parameter = null; + HookFailureTest.m_hook = false; + HookFailureTest.m_testWasRun = false; + HookListener.m_hook = false; + BaseConfigurable.m_hookCount = 0; + BaseConfigurable.m_bc = false; + BaseConfigurable.m_bm = false; + BaseConfigurable.m_bs = false; + BaseConfigurable.m_bt = false; + BaseConfigurable.m_methodName = null; + ConfigurableListener.m_hookCount = 0; + ConfigurableListener.m_methodName = null; + ConfigurableSuccessWithListenerTest.m_bc = false; + ConfigurableSuccessWithListenerTest.m_bm = false; + } + + @Test + public void hookSuccess() { + addClass(HookSuccessTest.class); + run(); + + verifyTests("Passed", new String[] {"verify"}, getPassedTests()); + Assert.assertTrue(HookSuccessTest.m_hook); + Assert.assertTrue(HookSuccessTest.m_testWasRun); + Assert.assertEquals(HookSuccessTest.m_parameter, "foo"); + } + + @Test(description = "https://github.com/cbeust/testng/issues/599") + public void issue599() { + addClass(HookSuccess599Test.class); + run(); + + verifyTests("Passed", new String[] {"verify"}, getPassedTests()); + Assert.assertTrue(HookSuccess599Test.m_hook); + Assert.assertTrue(HookSuccess599Test.m_testWasRun); + Assert.assertEquals(HookSuccess599Test.m_parameter, "foo"); + } + + @Test(description = "https://github.com/cbeust/testng/pull/862") + public void issue862() { + addClass(HookSuccess862Test.class); + run(); + + verifyTests("Passed", new String[] {"verify"}, getPassedTests()); + } + + @Test + public void hookSuccessWithListener() { + addClass(HookSuccessWithListenerTest.class); + run(); + + verifyTests("Passed", new String[] {"verify"}, getPassedTests()); + Assert.assertTrue(HookListener.m_hook); + } + + @Test + public void hookFailure() { + addClass(HookFailureTest.class); + run(); + + // To investigate: TestNG still thinks the test passed since it can't know whether + // the hook ended up invoking the test or not. + // verifyTests("Passed", new String[] { }, getPassedTests()); + Assert.assertTrue(HookFailureTest.m_hook); + Assert.assertFalse(HookFailureTest.m_testWasRun); + } + + @Test + public void configurableSuccess() { + addClass(ConfigurableSuccessTest.class); + run(); + + Assert.assertEquals(BaseConfigurable.m_hookCount, 4); + Assert.assertTrue(BaseConfigurable.m_bc); + Assert.assertTrue(BaseConfigurable.m_bm); + Assert.assertTrue(BaseConfigurable.m_bs); + Assert.assertTrue(BaseConfigurable.m_bt); + Assert.assertEquals(BaseConfigurable.m_methodName, "hookWasRun"); + } + + @Test + public void configurableSuccessWithListener() { + addClass(ConfigurableSuccessWithListenerTest.class); + run(); + + Assert.assertEquals(ConfigurableListener.m_hookCount, 4); + Assert.assertTrue(ConfigurableSuccessWithListenerTest.m_bs); + Assert.assertTrue(ConfigurableSuccessWithListenerTest.m_bt); + Assert.assertTrue(ConfigurableSuccessWithListenerTest.m_bc); + Assert.assertTrue(ConfigurableSuccessWithListenerTest.m_bm); + Assert.assertEquals(ConfigurableListener.m_methodName, "hookWasRun"); + } + + @Test + public void configurableFailure() { + addClass(ConfigurableFailureTest.class); + run(); + + Assert.assertEquals(BaseConfigurable.m_hookCount, 4); + Assert.assertFalse(BaseConfigurable.m_bc); + Assert.assertFalse(BaseConfigurable.m_bm); + Assert.assertFalse(BaseConfigurable.m_bs); + Assert.assertFalse(BaseConfigurable.m_bt); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/hook/issue2251/AbstractBaseTestCase.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/issue2251/AbstractBaseTestCase.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/hook/issue2251/AbstractBaseTestCase.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/issue2251/AbstractBaseTestCase.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,41 @@ +package test.hook.issue2251; + +import java.lang.reflect.InvocationTargetException; +import org.testng.IHookCallBack; +import org.testng.IHookable; +import org.testng.ITestResult; + +/** + * This test class apes on a bare essential What Spring TestNG provides as a base class in terms of + * running Spring based tests. The following methods have been duplicated from + * org.springframework.test.context.testng.AbstractTestNGSpringContextTests to simulate the bug. 1. + * throwAsUncheckedException() 2. getTestResultException() 3. throwAs() + */ +public class AbstractBaseTestCase implements IHookable { + + @Override + public void run(IHookCallBack callBack, ITestResult testResult) { + callBack.runTestMethod(testResult); + Throwable t = getTestResultException(testResult); + if (t != null) { + throwAsUncheckedException(t); + } + } + + @SuppressWarnings("unchecked") + private void throwAs(Throwable t) throws T { + throw (T) t; + } + + private void throwAsUncheckedException(Throwable t) { + throwAs(t); + } + + private Throwable getTestResultException(ITestResult testResult) { + Throwable testResultException = testResult.getThrowable(); + if (testResultException instanceof InvocationTargetException) { + testResultException = testResultException.getCause(); + } + return testResultException; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/hook/issue2251/IssueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/issue2251/IssueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/hook/issue2251/IssueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/issue2251/IssueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.hook.issue2251; + +import org.assertj.core.api.Assertions; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class IssueTest extends SimpleBaseTest { + + @Test(description = "GITHUB-2251") + public void runTest() { + TestNG testng = create(SampleTestCase.class); + TestListenerAdapter l = new TestListenerAdapter(); + testng.addListener(l); + testng.run(); + Throwable t = l.getFailedTests().get(0).getThrowable(); + Assertions.assertThat(t).isInstanceOf(NullPointerException.class); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/hook/issue2251/SampleTestCase.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/issue2251/SampleTestCase.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/hook/issue2251/SampleTestCase.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/issue2251/SampleTestCase.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.hook.issue2251; + +import org.testng.annotations.Test; + +public class SampleTestCase extends AbstractBaseTestCase { + + static class NullExObj { + + @Override + public String toString() { + throw new NullPointerException("expected"); + } + } + + @Test(timeOut = 1000000) // removing timeout fixes error output + public void testError() throws Exception { + new NullExObj().toString(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/hook/issue2257/IssueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/issue2257/IssueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/hook/issue2257/IssueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/issue2257/IssueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,21 @@ +package test.hook.issue2257; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class IssueTest extends SimpleBaseTest { + + @Test(description = "GITHUB-2257") + public void ensureConfigurationsCanBeRetriedViaCallBacks() { + TestNG testng = create(TestClassSample.class); + TestListenerAdapter listener = new TestListenerAdapter(); + testng.run(); + assertThat(listener.getConfigurationSkips()).isEmpty(); + assertThat(listener.getConfigurationFailures()).isEmpty(); + assertThat(testng.getStatus()).isEqualTo(0); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/hook/issue2257/TestClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/issue2257/TestClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/hook/issue2257/TestClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/issue2257/TestClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,60 @@ +package test.hook.issue2257; + +import org.testng.Assert; +import org.testng.IConfigurable; +import org.testng.IConfigureCallBack; +import org.testng.ITestResult; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.BeforeSuite; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.Test; + +public class TestClassSample implements IConfigurable { + + private int counter = 1; + + @Override + public void run(IConfigureCallBack callBack, ITestResult testResult) { + callBack.runConfigurationMethod(testResult); + if (testResult.getThrowable() != null) { + for (int i = 0; i <= 3; i++) { + callBack.runConfigurationMethod(testResult); + if (testResult.getThrowable() == null) { + break; + } + } + } + } + + @BeforeSuite + public void beforeSuite() { + runConfiguration(); + } + + @BeforeTest + public void beforeTest() { + runConfiguration(); + } + + @BeforeClass + public void beforeClass() { + runConfiguration(); + } + + @BeforeMethod + public void beforeMethod() { + runConfiguration(); + } + + @Test + public void runTest() {} + + private void runConfiguration() { + if (counter++ == 2) { + counter = 1; + } else { + Assert.fail(); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/hook/issue2266/IssueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/issue2266/IssueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/hook/issue2266/IssueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/issue2266/IssueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,22 @@ +package test.hook.issue2266; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class IssueTest extends SimpleBaseTest { + + @Test(description = "GITHUB-2266") + public void ensureTestsCanBeRetriedViaCallBacks() { + TestNG testng = create(TestClassSample.class); + TestListenerAdapter listener = new TestListenerAdapter(); + testng.addListener(listener); + testng.run(); + assertThat(listener.getFailedTests()).isEmpty(); + assertThat(listener.getSkippedTests()).isEmpty(); + assertThat(listener.getPassedTests()).hasSize(1); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/hook/issue2266/TestClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/issue2266/TestClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/hook/issue2266/TestClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/hook/issue2266/TestClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,32 @@ +package test.hook.issue2266; + +import org.testng.Assert; +import org.testng.IHookCallBack; +import org.testng.IHookable; +import org.testng.ITestResult; +import org.testng.annotations.Test; + +public class TestClassSample implements IHookable { + + private int counter = 1; + + @Override + public void run(IHookCallBack callBack, ITestResult testResult) { + callBack.runTestMethod(testResult); + if (testResult.getThrowable() != null) { + for (int i = 0; i <= 3; i++) { + callBack.runTestMethod(testResult); + if (testResult.getThrowable() == null) { + break; + } + } + } + } + + @Test(description = "GITHUB-2266") + public void runTest() { + if (counter++ != 2) { + Assert.fail(); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ignore/ChildClassTestSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ignore/ChildClassTestSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ignore/ChildClassTestSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ignore/ChildClassTestSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.ignore; + +import org.testng.annotations.Ignore; + +@Ignore +public class ChildClassTestSample extends ParentClassTestSample { + @Override + protected void hook() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ignore/ChildSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ignore/ChildSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ignore/ChildSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ignore/ChildSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.ignore; + +import org.testng.annotations.Test; + +public class ChildSample extends IgnoreClassParentSample { + + @Test + public void test() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ignore/IgnoreClassParentSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ignore/IgnoreClassParentSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ignore/IgnoreClassParentSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ignore/IgnoreClassParentSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.ignore; + +import org.testng.annotations.Ignore; +import org.testng.annotations.Test; + +@Ignore +public class IgnoreClassParentSample { + + @Test + public void parentTest() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ignore/IgnoreClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ignore/IgnoreClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ignore/IgnoreClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ignore/IgnoreClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package test.ignore; + +import org.testng.annotations.Ignore; +import org.testng.annotations.Test; + +@Ignore +public class IgnoreClassSample extends ParentSample { + + @Test + public void test() {} + + @Test + public void test2() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ignore/IgnoreTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ignore/IgnoreTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ignore/IgnoreTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ignore/IgnoreTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,86 @@ +package test.ignore; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.TestNG; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import test.InvokedMethodListener; +import test.SimpleBaseTest; +import test.ignore.ignorePackage.IgnorePackageSample; +import test.ignore.ignorePackage.subPackage.SubPackageSample; +import test.ignore.issue2396.FirstTest; +import test.ignore.issue2613.LocalClassListener; +import test.ignore.issue2613.SampleTestClassWithEnabledDisabledIgnoredTestMethods; +import test.ignore.issue2613.SampleTestClassWithEnabledIgnoredTestMethods; + +public class IgnoreTest extends SimpleBaseTest { + + @Test + public void ignore_class_should_not_run_tests() { + InvokedMethodListener listener = runTest(IgnoreClassSample.class); + assertThat(listener.getInvokedMethods()).isEmpty(); + } + + @Test + public void ignore_class_with_inheritance_should_not_run_tests() { + InvokedMethodListener listener = runTest(ChildSample.class); + assertThat(listener.getInvokedMethods()).isEmpty(); + } + + @Test + public void ignore_test_should_not_run_test() { + InvokedMethodListener listener = runTest(IgnoreTestSample.class); + assertThat(listener.getInvokedMethods()).containsExactly("test"); + } + + @Test + public void ignore_package_should_not_run_test() { + InvokedMethodListener listener = runTest(IgnorePackageSample.class, SubPackageSample.class); + assertThat(listener.getInvokedMethods()).isEmpty(); + } + + @Test(description = "GITHUB-1709") + public void test_parent_class_tests_ignored_when_ignored_at_child() { + InvokedMethodListener listener = runTest(ChildClassTestSample.class); + assertThat(listener.getInvokedMethods()).isEmpty(); + } + + @Test(description = "GITHUB-2396") + public void test_ignore_happens_for_class_level_methods() { + InvokedMethodListener listener = runTest(FirstTest.class); + assertThat(listener.getInvokedMethods()).containsExactly("testShouldBeInvoked"); + } + + @Test(description = "GITHUB-2613", dataProvider = "getTestData") + public void test_ignored_test_methods_are_retrieved_in_mixed_test_class( + Class cls, String[] expected) { + TestNG tng = create(cls); + LocalClassListener listener = new LocalClassListener(); + tng.addListener(listener); + tng.run(); + assertThat(listener.getMethods()).containsExactlyInAnyOrder(expected); + } + + @DataProvider(name = "getTestData") + public Object[][] getTestData() { + return new Object[][] { + { + SampleTestClassWithEnabledDisabledIgnoredTestMethods.class, + new String[] {"enabledTest", "disabledTest", "ignoredTest"} + }, + { + SampleTestClassWithEnabledIgnoredTestMethods.class, + new String[] {"enabledTest", "ignoredTest"} + } + }; + } + + private static InvokedMethodListener runTest(Class... classes) { + TestNG tng = create(classes); + InvokedMethodListener listener = new InvokedMethodListener(); + tng.addListener(listener); + tng.run(); + return listener; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ignore/IgnoreTestSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ignore/IgnoreTestSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ignore/IgnoreTestSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ignore/IgnoreTestSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package test.ignore; + +import org.testng.annotations.Ignore; +import org.testng.annotations.Test; + +public class IgnoreTestSample { + + @Test + public void test() {} + + @Test + @Ignore + public void ignoredTest() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ignore/ParentClassTestSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ignore/ParentClassTestSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ignore/ParentClassTestSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ignore/ParentClassTestSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package test.ignore; + +import org.testng.annotations.Test; + +public class ParentClassTestSample { + + @Test + public void testa() { + hook(); + } + + @Test + public void testb() { + hook(); + } + + @Test + public void testc() { + hook(); + } + + protected void hook() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ignore/ParentSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ignore/ParentSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ignore/ParentSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ignore/ParentSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.ignore; + +import org.testng.annotations.Test; + +public class ParentSample { + + @Test + public void parentTest() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ignore/ignorePackage/IgnorePackageSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ignore/ignorePackage/IgnorePackageSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ignore/ignorePackage/IgnorePackageSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ignore/ignorePackage/IgnorePackageSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.ignore.ignorePackage; + +import org.testng.annotations.Test; + +public class IgnorePackageSample { + + @Test + public void test() {} + + @Test + public void test2() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ignore/ignorePackage/package-info.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ignore/ignorePackage/package-info.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ignore/ignorePackage/package-info.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ignore/ignorePackage/package-info.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,4 @@ +@Ignore +package test.ignore.ignorePackage; + +import org.testng.annotations.Ignore; diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ignore/ignorePackage/subPackage/SubPackageSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ignore/ignorePackage/subPackage/SubPackageSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ignore/ignorePackage/subPackage/SubPackageSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ignore/ignorePackage/subPackage/SubPackageSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.ignore.ignorePackage.subPackage; + +import org.testng.annotations.Test; + +public class SubPackageSample { + + @Test + public void test() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ignore/issue2396/FirstTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ignore/issue2396/FirstTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ignore/issue2396/FirstTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ignore/issue2396/FirstTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,13 @@ +package test.ignore.issue2396; + +import org.testng.annotations.Ignore; +import org.testng.annotations.Test; + +@Test +public class FirstTest { + + public void testShouldBeInvoked() {} + + @Ignore + public void testShouldBeIgnored(String name) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ignore/issue2613/LocalClassListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ignore/issue2613/LocalClassListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ignore/issue2613/LocalClassListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ignore/issue2613/LocalClassListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,24 @@ +package test.ignore.issue2613; + +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; +import org.testng.IClassListener; +import org.testng.ITestClass; + +public class LocalClassListener implements IClassListener { + + private List methods; + + @Override + public void onBeforeClass(ITestClass testClass) { + methods = + Arrays.stream(testClass.getTestMethods()) + .map(each -> each.getConstructorOrMethod().getMethod().getName()) + .collect(Collectors.toList()); + } + + public List getMethods() { + return methods; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ignore/issue2613/SampleTestClassWithEnabledDisabledIgnoredTestMethods.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ignore/issue2613/SampleTestClassWithEnabledDisabledIgnoredTestMethods.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ignore/issue2613/SampleTestClassWithEnabledDisabledIgnoredTestMethods.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ignore/issue2613/SampleTestClassWithEnabledDisabledIgnoredTestMethods.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package test.ignore.issue2613; + +import org.testng.annotations.Ignore; +import org.testng.annotations.Test; + +public class SampleTestClassWithEnabledDisabledIgnoredTestMethods { + + @Test + public void enabledTest() {} + + @Test(enabled = false) + public void disabledTest() {} + + @Test + @Ignore + public void ignoredTest() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ignore/issue2613/SampleTestClassWithEnabledIgnoredTestMethods.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ignore/issue2613/SampleTestClassWithEnabledIgnoredTestMethods.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/ignore/issue2613/SampleTestClassWithEnabledIgnoredTestMethods.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/ignore/issue2613/SampleTestClassWithEnabledIgnoredTestMethods.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package test.ignore.issue2613; + +import org.testng.annotations.Ignore; +import org.testng.annotations.Test; + +public class SampleTestClassWithEnabledIgnoredTestMethods { + + @Test + public void enabledTest() {} + + @Test + @Ignore + public void ignoredTest() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/BaseClassScope.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/BaseClassScope.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/BaseClassScope.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/BaseClassScope.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,6 @@ +package test.inheritance; + +import org.testng.annotations.Test; + +@Test +public class BaseClassScope {} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/Child_1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/Child_1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/Child_1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/Child_1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package test.inheritance; + +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; + +public class Child_1 extends ZBase_0 { + + @BeforeMethod + public void initDialog() { + m_methodList.add("initDialog"); + } + + @AfterMethod + public void tearDownDialog() { + m_methodList.add("tearDownDialog"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/ClassScopeTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/ClassScopeTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/ClassScopeTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/ClassScopeTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ +package test.inheritance; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class ClassScopeTest extends BaseClassScope { + + private boolean m_verify = false; + + public void setVerify() { + m_verify = true; + } + + @Test(dependsOnMethods = "setVerify") + public void verify() { + Assert.assertTrue(m_verify); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/DChild_2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/DChild_2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/DChild_2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/DChild_2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,31 @@ +package test.inheritance; + +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +/** + * Make sure that configuration inherited methods are invoked in the right order. The funny naming + * is to make sure that the class names do not play any role in the ordering of methods. + * + *

Created on Sep 8, 2005 + * + * @author cbeust + */ +public class DChild_2 extends Child_1 { + + @BeforeMethod + public void initDialog2() { + m_methodList.add("initDialog2"); + } + + @AfterMethod + public void tearDownDialog2() { + m_methodList.add("tearDownDialog2"); + } + + @Test(groups = {"before"}) + public void test() { + m_methodList.add("test"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/InheritanceConfigTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/InheritanceConfigTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/InheritanceConfigTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/InheritanceConfigTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +package test.inheritance; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Collections; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlClass; +import org.testng.xml.XmlTest; +import test.SampleInheritance; +import test.SimpleBaseTest; + +public class InheritanceConfigTest extends SimpleBaseTest { + + @Test + public void testMethod() { + XmlTest xmlTest = createXmlTest("xml_suite", "xml_test"); + xmlTest.setXmlClasses(Collections.singletonList(new XmlClass(SampleInheritance.class))); + xmlTest.addIncludedGroup("configuration0"); + xmlTest.addIncludedGroup("configuration1"); + xmlTest.addIncludedGroup("inheritedTestMethod"); + xmlTest.addIncludedGroup("final"); + TestNG tng = create(xmlTest.getSuite()); + tng.run(); + assertThat(tng.getStatus()).isEqualTo(0); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/VerifyTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/VerifyTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/VerifyTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/VerifyTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,28 @@ +package test.inheritance; + +import java.util.List; +import org.testng.AssertJUnit; +import org.testng.annotations.Test; + +public class VerifyTest { + + @Test(dependsOnGroups = {"before"}) + public void verify() { + String[] expected = { + "initApplication", + "initDialog", + "initDialog2", + "test", + "tearDownDialog2", + "tearDownDialog", + "tearDownApplication" + }; + + int i = 0; + List l = ZBase_0.getMethodList(); + AssertJUnit.assertEquals(expected.length, l.size()); + for (String s : l) { + AssertJUnit.assertEquals(expected[i++], s); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/ZBase_0.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/ZBase_0.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/ZBase_0.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/ZBase_0.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,30 @@ +package test.inheritance; + +import java.util.ArrayList; +import java.util.List; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.BeforeTest; + +public class ZBase_0 { + protected static List m_methodList = new ArrayList<>(); + + @BeforeTest + public void beforeTest() { + m_methodList = new ArrayList<>(); + } + + @BeforeMethod + public void initApplication() { + m_methodList.add("initApplication"); + } + + @AfterMethod + public void tearDownApplication() { + m_methodList.add("tearDownApplication"); + } + + public static List getMethodList() { + return m_methodList; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/github949/ChildClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/github949/ChildClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/github949/ChildClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/github949/ChildClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.inheritance.github949; + +import org.testng.annotations.Test; + +public class ChildClassSample extends ParentClassSample { + + @Override + @Test + public void independent() { + logMessage(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/github949/ChildClassWithAlwasyRunEnabledSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/github949/ChildClassWithAlwasyRunEnabledSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/github949/ChildClassWithAlwasyRunEnabledSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/github949/ChildClassWithAlwasyRunEnabledSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.inheritance.github949; + +import org.testng.annotations.Test; + +public class ChildClassWithAlwasyRunEnabledSample extends ParentClassWithAlwasyRunEnabledSample { + + @Override + @Test + public void independent() { + logMessage(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/github949/CommonBaseClass.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/github949/CommonBaseClass.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/github949/CommonBaseClass.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/github949/CommonBaseClass.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package test.inheritance.github949; + +import java.util.ArrayList; +import java.util.List; +import org.testng.ITestResult; +import org.testng.Reporter; + +public class CommonBaseClass { + static List messages = new ArrayList<>(); + + protected static void logMessage() { + ITestResult iTestResult = Reporter.getCurrentTestResult(); + String method = iTestResult.getMethod().getMethodName(); + String clazz = iTestResult.getMethod().getTestClass().getName(); + messages.add(clazz + "." + method); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/github949/Github949Test.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/github949/Github949Test.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/github949/Github949Test.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/github949/Github949Test.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,30 @@ +package test.inheritance.github949; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.TestNG; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class Github949Test extends SimpleBaseTest { + @Test(dataProvider = "getdata") + public void runTest(Class child) { + TestNG testng = create(child); + testng.run(); + String prefix = child.getName() + "."; + assertThat(CommonBaseClass.messages) + .containsExactly(prefix + "independent", prefix + "dependent"); + } + + @AfterMethod + public void cleanup() { + CommonBaseClass.messages.clear(); + } + + @DataProvider + public Object[][] getdata() { + return new Object[][] {{ChildClassSample.class}, {ChildClassWithAlwasyRunEnabledSample.class}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/github949/ParentClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/github949/ParentClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/github949/ParentClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/github949/ParentClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.inheritance.github949; + +import org.testng.annotations.Test; + +public class ParentClassSample extends CommonBaseClass { + @Test + public void independent() { + logMessage(); + } + + @Test(dependsOnMethods = "independent") + public void dependent() { + logMessage(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/github949/ParentClassWithAlwasyRunEnabledSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/github949/ParentClassWithAlwasyRunEnabledSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/github949/ParentClassWithAlwasyRunEnabledSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/github949/ParentClassWithAlwasyRunEnabledSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.inheritance.github949; + +import org.testng.annotations.Test; + +public class ParentClassWithAlwasyRunEnabledSample extends CommonBaseClass { + @Test + public void independent() { + logMessage(); + } + + @Test(dependsOnMethods = "independent", alwaysRun = true) + public void dependent() { + logMessage(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/github980/ChildClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/github980/ChildClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/github980/ChildClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/github980/ChildClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.inheritance.github980; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class ChildClassSample extends ParentClassSample { + @Test + public void c() { + Assert.assertTrue(true); + } + + @Test + public void d() { + Assert.assertTrue(true); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/github980/Github980Test.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/github980/Github980Test.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/github980/Github980Test.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/github980/Github980Test.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,35 @@ +package test.inheritance.github980; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.List; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlClass; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.InvokedMethodNameListener; +import test.SimpleBaseTest; + +public class Github980Test extends SimpleBaseTest { + + @Test + public void testToEnsureDuplicateMethodsAreNotExecuted() { + XmlSuite suite = createXmlSuite("980_suite"); + XmlTest xmltest = createXmlTest(suite, "980_test"); + XmlClass parentClass = createXmlClass(xmltest, ParentClassSample.class); + createXmlInclude(parentClass, "a"); + createXmlInclude(parentClass, "b"); + XmlClass childClass = createXmlClass(xmltest, ChildClassSample.class); + createXmlInclude(childClass, "c"); + createXmlInclude(childClass, "d"); + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + TestNG tng = create(suite); + tng.addListener(listener); + tng.run(); + List parentClassMethods = listener.getMethodsForTestClass(ParentClassSample.class); + assertThat(parentClassMethods).containsExactly("a", "b"); + List childClassMethods = listener.getMethodsForTestClass(ChildClassSample.class); + assertThat(childClassMethods).containsExactly("c", "d"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/github980/ParentClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/github980/ParentClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/github980/ParentClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/github980/ParentClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.inheritance.github980; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class ParentClassSample { + @Test + public void a() { + Assert.assertTrue(true); + } + + @Test + public void b() { + Assert.assertTrue(true); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/issue2489/IssueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/issue2489/IssueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/issue2489/IssueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/issue2489/IssueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,45 @@ +package test.inheritance.issue2489; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlPackage; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.SimpleBaseTest; +import test.inheritance.issue2489.tests.BaseClassA; +import test.inheritance.issue2489.tests.TestClassA; + +public class IssueTest extends SimpleBaseTest { + + @Test(description = "GITHUB-2489") + public void verifyConfigInvocationOrderInInheritance() { + XmlSuite xmlSuite = new XmlSuite(); + xmlSuite.setName("2489_suite"); + XmlTest xmlTest = createXmlTest(xmlSuite, "2489_test"); + XmlPackage xmlPackage = new XmlPackage(); + xmlPackage.setName(TestClassA.class.getPackage().getName() + ".*"); + xmlTest.setPackages(Collections.singletonList(xmlPackage)); + TestNG testng = create(xmlSuite); + testng.run(); + List expected = + Arrays.asList( + "beforeSuite_BaseClass_A", + "beforeClasses_BaseClass_A", + "beforeClass_TestClass_A", + "beforeMethod_TestClass_A", + "test1_TestClass_A", + "afterMethod_TestClass_A", + "beforeMethod_TestClass_A", + "test2_TestClass_A", + "afterMethod_TestClass_A", + "afterClass_TestClass_A", + "afterClasses_BaseClass_A", + "afterSuite_BaseClass_A"); + assertThat(BaseClassA.logs).containsExactlyElementsOf(expected); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/issue2489/tests/BaseClassA.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/issue2489/tests/BaseClassA.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/issue2489/tests/BaseClassA.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/issue2489/tests/BaseClassA.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,36 @@ +package test.inheritance.issue2489.tests; + +import java.util.List; +import org.testng.annotations.AfterClass; +import org.testng.annotations.AfterSuite; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeSuite; +import org.testng.collections.Lists; + +public class BaseClassA { + public static final List logs = Lists.newArrayList(); + + @BeforeSuite(groups = "a") + public void beforeSuite() { + print("beforeSuite_BaseClass_A"); + } + + @AfterSuite(groups = "a") + public void afterSuite() { + print("afterSuite_BaseClass_A"); + } + + @BeforeClass(groups = "a") + public void beforeAllClasses() { + print("beforeClasses_BaseClass_A"); + } + + @AfterClass(groups = "a") + public void afterAllClasses() { + print("afterClasses_BaseClass_A"); + } + + protected synchronized void print(String message) { + logs.add(message); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/issue2489/tests/TestClassA.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/issue2489/tests/TestClassA.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/issue2489/tests/TestClassA.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/issue2489/tests/TestClassA.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,40 @@ +package test.inheritance.issue2489.tests; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class TestClassA extends BaseClassA { + + @BeforeClass(groups = "a") + public void beforeClass() { + print("beforeClass_TestClass_A"); + } + + @AfterClass(groups = "a") + public void afterClass() { + print("afterClass_TestClass_A"); + } + + @BeforeMethod(groups = "a") + public void beforeMethod() { + print("beforeMethod_TestClass_A"); + } + + @AfterMethod(groups = "a") + public void afterMethod() { + print("afterMethod_TestClass_A"); + } + + @Test(groups = "a") + public void test1() { + print("test1_TestClass_A"); + } + + @Test(groups = "a") + public void test2() { + print("test2_TestClass_A"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/testng234/ChildTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/testng234/ChildTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/testng234/ChildTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/testng234/ChildTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package test.inheritance.testng234; + +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +public class ChildTest extends ParentTest { + + @BeforeClass + public void beforeClassMethod() { + Assert.assertTrue(false, "This is so sad... I must skip all my tests ..."); + } + + @Override + @Test + public void polymorphicMethod() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/testng234/ParentTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/testng234/ParentTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/testng234/ParentTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/testng234/ParentTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.inheritance.testng234; + +import org.testng.annotations.Test; + +public abstract class ParentTest { + + @Test + public void executePolymorphicMethod() {} + + protected abstract void polymorphicMethod(); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/testng234/PolymorphicFailureTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/testng234/PolymorphicFailureTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/testng234/PolymorphicFailureTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/testng234/PolymorphicFailureTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,24 @@ +package test.inheritance.testng234; + +import java.util.Arrays; +import org.testng.Assert; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class PolymorphicFailureTest extends SimpleBaseTest { + + @Test + public void superclassFailureShouldCauseFailure() { + TestNG tng = create(ChildTest.class); + TestListenerAdapter tla = new TestListenerAdapter(); + tng.addListener(tla); + tng.run(); + + assertTestResultsEqual( + tla.getSkippedTests(), Arrays.asList("polymorphicMethod", "executePolymorphicMethod")); + Assert.assertEquals(0, tla.getPassedTests().size()); + Assert.assertEquals(0, tla.getFailedTests().size()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/testng471/Class1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/testng471/Class1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/testng471/Class1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/testng471/Class1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +package test.inheritance.testng471; + +import org.junit.Assert; +import org.testng.annotations.*; + +public class Class1 extends SuperClass1 { + + @BeforeClass + public void beforeClass1() {} + + @AfterClass + public void afterClass1() {} + + @BeforeMethod + public void beforeMethodClass1() {} + + @AfterMethod + public void afterMethodClass1() { + Assert.fail(); + } + + @Test + public void test1_1() {} + + @Test + public void test1_2() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/testng471/Class2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/testng471/Class2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/testng471/Class2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/testng471/Class2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,24 @@ +package test.inheritance.testng471; + +import org.testng.annotations.*; + +public class Class2 extends SuperClass1 { + + @BeforeClass + public void beforeClass2() {} + + @AfterClass + public void afterClass2() {} + + @BeforeMethod + public void beforeMethodClass2() {} + + @AfterMethod + public void afterMethodClass2() {} + + @Test + public void test2_1() {} + + @Test + public void test2_2() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/testng471/Class3.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/testng471/Class3.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/testng471/Class3.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/testng471/Class3.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,28 @@ +package test.inheritance.testng471; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class Class3 extends SuperClass2 { + + @BeforeClass + public void beforeClass3() {} + + @AfterClass + public void afterClass3() {} + + @BeforeMethod + public void beforeMethodClass3() {} + + @AfterMethod + public void afterMethodClass3() {} + + @Test + public void test3_1() {} + + @Test + public void test3_2() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/testng471/SuperClass1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/testng471/SuperClass1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/testng471/SuperClass1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/testng471/SuperClass1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.inheritance.testng471; + +import org.testng.annotations.BeforeClass; + +public class SuperClass1 { + + @BeforeClass + public void beforeSuperClass1() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/testng471/SuperClass2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/testng471/SuperClass2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/testng471/SuperClass2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/testng471/SuperClass2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.inheritance.testng471; + +import org.testng.annotations.BeforeClass; + +public class SuperClass2 { + + @BeforeClass + public void beforeSuperClass2() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/testng471/TestNG471.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/testng471/TestNG471.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/testng471/TestNG471.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/testng471/TestNG471.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,50 @@ +package test.inheritance.testng471; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.InvokedMethodNameListener; +import test.SimpleBaseTest; + +public class TestNG471 extends SimpleBaseTest { + + @Test + public void test_classes_should_not_be_skipped_when_a_after_method_fails() { + TestNG tng = create(Class1.class, Class2.class, Class3.class); + tng.setPreserveOrder(true); + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.setPreserveOrder(true); + tng.addListener(listener); + + tng.run(); + assertThat(listener.getFailedMethodNames()).containsExactly("afterMethodClass1"); + assertThat(listener.getSkippedMethodNames()).containsExactly("test1_2"); + assertThat(listener.getSucceedMethodNames()) + .containsExactly( + "beforeSuperClass1", + "beforeClass1", + "beforeMethodClass1", + "test1_1", // "afterMethodClass1" failed + // "beforeMethodClass1", "test1_2" and "afterMethodClass1" skipped + // "afterClass1" skipped + "beforeSuperClass1", + "beforeClass2", + "beforeMethodClass2", + "test2_1", + "afterMethodClass2", + "beforeMethodClass2", + "test2_2", + "afterMethodClass2", + "afterClass2", + "beforeSuperClass2", + "beforeClass3", + "beforeMethodClass3", + "test3_1", + "afterMethodClass3", + "beforeMethodClass3", + "test3_2", + "afterMethodClass3", + "afterClass3"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/testng739/A.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/testng739/A.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/testng739/A.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/testng739/A.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.inheritance.testng739; + +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +public class A extends BaseClass { + + @BeforeClass + public void beforeClassA() { + Assert.fail(); + } + + @Test + public void testA() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/testng739/B.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/testng739/B.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/testng739/B.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/testng739/B.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.inheritance.testng739; + +import org.testng.annotations.Test; + +public class B extends BaseClass { + + @Test + public void testB() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/testng739/BaseClass.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/testng739/BaseClass.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/testng739/BaseClass.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/testng739/BaseClass.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.inheritance.testng739; + +import org.testng.annotations.BeforeClass; + +public class BaseClass { + + @BeforeClass + public void beforeBaseClass() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/testng739/TestNG739.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/testng739/TestNG739.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inheritance/testng739/TestNG739.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inheritance/testng739/TestNG739.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,26 @@ +package test.inheritance.testng739; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.InvokedMethodNameListener; +import test.SimpleBaseTest; + +public class TestNG739 extends SimpleBaseTest { + + @Test + public void test_classes_should_be_skipped_when_a_before_class_fails() { + TestNG tng = create(A.class, B.class); + tng.setPreserveOrder(true); + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.setPreserveOrder(true); + tng.addListener(listener); + + tng.run(); + assertThat(listener.getSucceedMethodNames()) + .containsExactly("beforeBaseClass", "beforeBaseClass", "testB"); + assertThat(listener.getFailedMethodNames()).containsExactly("beforeClassA"); + assertThat(listener.getSkippedMethodNames()).containsExactly("testA"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inject/Github1298Test.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inject/Github1298Test.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inject/Github1298Test.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inject/Github1298Test.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,22 @@ +package test.inject; + +import org.testng.Assert; +import org.testng.ITestResult; +import org.testng.Reporter; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class Github1298Test { + @BeforeMethod + public void setUp(ITestResult tr) { + tr.setAttribute("class", getClass().getName()); + tr.setAttribute("toString", tr.toString()); + } + + @Test + public void testPlugin() { + ITestResult result = Reporter.getCurrentTestResult(); + Assert.assertEquals(result.getAttribute("class").toString(), getClass().getName()); + Assert.assertNotNull(result.getAttribute("toString")); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inject/Github1649Test.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inject/Github1649Test.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inject/Github1649Test.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inject/Github1649Test.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,111 @@ +package test.inject; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.lang.reflect.Method; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.ITestContext; +import org.testng.ITestResult; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.collections.Lists; +import org.testng.collections.Maps; +import org.testng.xml.XmlTest; +import test.SimpleBaseTest; + +public class Github1649Test extends SimpleBaseTest { + @Test + public void testHappyFlowForNativeInjectionOnTestMethods() { + Map> mapping = Maps.newHashMap(); + mapping.put("m1", Collections.singletonList(Method.class.getName())); + mapping.put("m2", Collections.singletonList(ITestContext.class.getName())); + mapping.put("m3", Collections.singletonList(XmlTest.class.getName())); + + mapping.put("m4", Arrays.asList(ITestContext.class.getName(), XmlTest.class.getName())); + mapping.put("m5", Arrays.asList(XmlTest.class.getName(), ITestContext.class.getName())); + mapping.put("m6", Arrays.asList(Method.class.getName(), ITestContext.class.getName())); + mapping.put("m7", Arrays.asList(ITestContext.class.getName(), Method.class.getName())); + mapping.put("m8", Arrays.asList(Method.class.getName(), XmlTest.class.getName())); + mapping.put("m9", Arrays.asList(XmlTest.class.getName(), Method.class.getName())); + + mapping.put( + "m10", + Arrays.asList( + Method.class.getName(), XmlTest.class.getName(), ITestContext.class.getName())); + mapping.put( + "m11", + Arrays.asList( + Method.class.getName(), ITestContext.class.getName(), XmlTest.class.getName())); + mapping.put( + "m12", + Arrays.asList( + XmlTest.class.getName(), Method.class.getName(), ITestContext.class.getName())); + mapping.put( + "m13", + Arrays.asList( + XmlTest.class.getName(), ITestContext.class.getName(), Method.class.getName())); + mapping.put( + "m14", + Arrays.asList( + ITestContext.class.getName(), Method.class.getName(), XmlTest.class.getName())); + mapping.put( + "m15", + Arrays.asList( + ITestContext.class.getName(), XmlTest.class.getName(), Method.class.getName())); + TestNG testng = create(HappyPathNativeInjectionTestSample.class); + Github1649TestListener listener = new Github1649TestListener(); + testng.addListener(listener); + testng.run(); + assertThat(listener.mapping).containsAllEntriesOf(mapping); + } + + @Test + public void testNegativeFlowForNativeInjectionOnTestMethods() { + Map failures = Maps.newHashMap(); + failures.put( + "m1", "Cannot inject @Test annotated Method [m1] with [interface org.testng.ITestResult]."); + failures.put("m2", "Cannot inject @Test annotated Method [m2] with [int]."); + TestNG testng = create(NegativeNativeInjectionTestSample.class); + Github1649TestListener listener = new Github1649TestListener(); + testng.addListener(listener); + testng.run(); + assertThat(listener.failures).containsAllEntriesOf(failures); + } + + public static class Github1649TestListener extends TestListenerAdapter + implements IInvokedMethodListener { + Map> mapping = Maps.newHashMap(); + Map failures = Maps.newHashMap(); + + @Override + public void beforeInvocation(IInvokedMethod method, ITestResult testResult) {} + + @Override + public void onTestFailure(ITestResult testResult) { + String methodName = testResult.getMethod().getMethodName(); + String raw = testResult.getThrowable().getMessage(); + String actual = raw.split("\n")[1]; + failures.put(methodName, actual); + } + + @Override + public void afterInvocation(IInvokedMethod method, ITestResult testResult) { + String methodName = testResult.getMethod().getMethodName(); + List paramTypes = Lists.newArrayList(); + for (Object parameter : testResult.getParameters()) { + String value = parameter.getClass().getName(); + if (parameter instanceof ITestContext) { + value = ITestContext.class.getName(); + } + paramTypes.add(value); + } + mapping.put(methodName, paramTypes); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inject/HappyPathNativeInjectionTestSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inject/HappyPathNativeInjectionTestSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inject/HappyPathNativeInjectionTestSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inject/HappyPathNativeInjectionTestSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,54 @@ +package test.inject; + +import java.lang.reflect.Method; +import org.testng.ITestContext; +import org.testng.annotations.Test; +import org.testng.xml.XmlTest; + +public class HappyPathNativeInjectionTestSample { + + @Test + public void m1(Method object) {} + + @Test + public void m2(ITestContext object) {} + + @Test + public void m3(XmlTest object) {} + + @Test + public void m4(ITestContext ctx, XmlTest xmlTest) {} + + @Test + public void m5(XmlTest xmlTest, ITestContext ctx) {} + + @Test + public void m6(Method method, ITestContext ctx) {} + + @Test + public void m7(ITestContext ctx, Method method) {} + + @Test + public void m8(Method method, XmlTest xmlTest) {} + + @Test + public void m9(XmlTest xmlTest, Method method) {} + + @Test + public void m10(Method method, XmlTest xmlTest, ITestContext ctx) {} + + @Test + public void m11(Method method, ITestContext ctx, XmlTest xmlTest) {} + + @Test + public void m12(XmlTest xmlTest, Method method, ITestContext ctx) {} + + @Test + public void m13(XmlTest xmlTest, ITestContext ctx, Method method) {} + + @Test + public void m14(ITestContext ctx, Method method, XmlTest xmlTest) {} + + @Test + public void m15(ITestContext ctx, XmlTest xmlTest, Method method) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inject/InjectAfterMethodWithTestResultSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inject/InjectAfterMethodWithTestResultSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inject/InjectAfterMethodWithTestResultSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inject/InjectAfterMethodWithTestResultSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,46 @@ +package test.inject; + +import java.lang.reflect.Method; +import org.testng.ITestResult; +import org.testng.SkipException; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class InjectAfterMethodWithTestResultSampleTest { + static int m_success; + + @Test + public void pass() {} + + @Test + public void fail() { + throw new RuntimeException(); + } + + @Test + public void skip() { + throw new SkipException("Skipped"); + } + + @BeforeClass + public void init() { + m_success = 3; + } + + @BeforeMethod + public void before(Method m, ITestResult r) { + System.out.println("Before result: " + r); + } + + @AfterMethod + public void after(Method m, ITestResult r) { + String name = m.getName(); + if (("pass".equals(name) && r.getStatus() == ITestResult.SUCCESS) + || ("fail".equals(name) && r.getStatus() == ITestResult.FAILURE) + || ("skip".equals(name) && r.getStatus() == ITestResult.SKIP)) { + m_success--; + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inject/InjectAfterMethodWithTestResultTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inject/InjectAfterMethodWithTestResultTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inject/InjectAfterMethodWithTestResultTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inject/InjectAfterMethodWithTestResultTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package test.inject; + +import org.testng.Assert; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class InjectAfterMethodWithTestResultTest extends SimpleBaseTest { + + @Test + public void verifyTestResultInjection() { + TestNG tng = create(InjectAfterMethodWithTestResultSampleTest.class); + tng.run(); + + Assert.assertEquals(0, InjectAfterMethodWithTestResultSampleTest.m_success); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inject/InjectBeforeAndAfterMethodsWithTestResultSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inject/InjectBeforeAndAfterMethodsWithTestResultSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inject/InjectBeforeAndAfterMethodsWithTestResultSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inject/InjectBeforeAndAfterMethodsWithTestResultSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,67 @@ +package test.inject; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.lang.reflect.Method; +import java.util.Map; +import org.testng.Assert; +import org.testng.ITestResult; +import org.testng.Reporter; +import org.testng.SkipException; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; +import org.testng.collections.Maps; + +public class InjectBeforeAndAfterMethodsWithTestResultSampleTest { + static int m_success; + private ITestResult m_testResult; + + @Test + public void pass() { + Assert.assertEquals(Reporter.getCurrentTestResult().getAttribute("before"), 10); + Assert.assertEquals(m_testResult.getAttribute("before"), 10); + } + + @Test + public void fail() { + throw new RuntimeException(); + } + + @Test + public void skip() { + throw new SkipException("Skipped"); + } + + @BeforeClass + public void init() { + m_success = 3; + } + + @BeforeMethod + public void before(Method m, ITestResult r) { + m_testResult = r; + r.setAttribute("before", 10); + } + + @AfterMethod + public void after(Method m, ITestResult r) { + String name = m.getName(); + assertThat(m_testResult.getMethod()).isEqualTo(r.getMethod()); + assertThat(attributesFrom(m_testResult)).isEqualTo(attributesFrom(r)); + if (("pass".equals(name) && r.getStatus() == ITestResult.SUCCESS) + || ("fail".equals(name) && r.getStatus() == ITestResult.FAILURE) + || ("skip".equals(name) && r.getStatus() == ITestResult.SKIP)) { + m_success--; + } + } + + private static Map attributesFrom(ITestResult r) { + Map attributes = Maps.newHashMap(); + for (String key : r.getAttributeNames()) { + attributes.put(key, r.getAttribute(key)); + } + return attributes; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inject/InjectBeforeMethodTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inject/InjectBeforeMethodTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inject/InjectBeforeMethodTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inject/InjectBeforeMethodTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,42 @@ +package test.inject; + +import java.lang.reflect.Method; +import org.testng.Assert; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class InjectBeforeMethodTest { + private int m_beforeIndex = 0; + private int m_afterIndex = 0; + private static final Object[][] DATA = { + new Object[] {"a"}, new Object[] {"b"}, + }; + + @BeforeMethod + public void before(Object[] parameters) { + Assert.assertEquals(DATA[m_beforeIndex], parameters); + m_beforeIndex++; + } + + @BeforeMethod + public void before2(Object[] parameters, Method m) {} + + @BeforeMethod + public void before3(Method m, Object[] parameters) {} + + @DataProvider + public Object[][] dp() { + return DATA; + } + + @AfterMethod + public void after(Object[] parameters) { + Assert.assertEquals(DATA[m_afterIndex], parameters); + m_afterIndex++; + } + + @Test(dataProvider = "dp") + public void f(String a) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inject/InjectDataProviderTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inject/InjectDataProviderTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inject/InjectDataProviderTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inject/InjectDataProviderTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,46 @@ +package test.inject; + +import java.util.Arrays; +import java.util.Iterator; +import org.testng.ITestContext; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +/** + * Test that injection works for data providers. + * + * @author Cedric Beust, Mar 3, 2010 + */ +public class InjectDataProviderTest { + + @DataProvider + public Object[][] dp1() { + return new Object[][] { + new Object[] {1, "a"}, + new Object[] {2, "b"}, + }; + } + + @Test(dataProvider = "dp1", enabled = true) + public void dpObject1(Integer n, ITestContext ctx, String a) {} + + @Test(dataProvider = "dp1", enabled = true) + public void dpObject2(ITestContext ctx, Integer n, String a) {} + + @Test(dataProvider = "dp1", enabled = true) + public void dpObject3(Integer n, String a, ITestContext ctx) {} + + @DataProvider + public Iterator dp2() { + return Arrays.asList(new Object[] {1, "a"}, new Object[] {2, "b"}).iterator(); + } + + @Test(dataProvider = "dp2", enabled = false) + public void dpIterator1(Integer n, ITestContext ctx, String a) {} + + @Test(dataProvider = "dp2", enabled = false) + public void dpIterator2(ITestContext ctx, Integer n, String a) {} + + @Test(dataProvider = "dp2", enabled = false) + public void dpIterator3(Integer n, String a, ITestContext ctx) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inject/InjectTestContextTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inject/InjectTestContextTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inject/InjectTestContextTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inject/InjectTestContextTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,30 @@ +package test.inject; + +import org.testng.Assert; +import org.testng.ITestContext; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; +import org.testng.xml.XmlTest; +import test.SimpleBaseTest; + +public class InjectTestContextTest extends SimpleBaseTest { + + @Test(enabled = false) + public void verifyTestContextInjection(ITestContext tc, XmlTest xmlTest) { + TestNG tng = create(); + tng.setTestClasses(new Class[] {Sample.class}); + TestListenerAdapter tla = new TestListenerAdapter(); + tng.addListener(tla); + tng.run(); + + Assert.assertEquals(xmlTest.getName(), "Injection"); + Assert.assertEquals(tla.getPassedTests().size(), 1); + Assert.assertEquals(tla.getPassedTests().get(0).getMethod().getMethodName(), "f"); + } + + @Parameters("string") + @Test + public void injectionAndParameters(String s, ITestContext ctx) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inject/InjectTestResultTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inject/InjectTestResultTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inject/InjectTestResultTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inject/InjectTestResultTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package test.inject; + +import org.testng.Assert; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class InjectTestResultTest extends SimpleBaseTest { + + @Test + public void verifyTestResultInjection() { + TestNG tng = create(InjectBeforeAndAfterMethodsWithTestResultSampleTest.class); + tng.run(); + + Assert.assertEquals(InjectBeforeAndAfterMethodsWithTestResultSampleTest.m_success, 0); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inject/NativeInjectionTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inject/NativeInjectionTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inject/NativeInjectionTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inject/NativeInjectionTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,92 @@ +package test.inject; + +import static test.inject.NativeInjectionTestSamples.*; + +import org.testng.*; +import org.testng.annotations.*; +import test.SimpleBaseTest; + +public class NativeInjectionTest extends SimpleBaseTest { + + @Test(dataProvider = "getTestData") + public void testBeforeSuiteInjection(Class clazz, String methodName, String expected) { + TestNG tng = create(clazz); + InjectionResultHolder holder = new InjectionResultHolder(); + tng.addListener(holder); + tng.setGroups("test"); + tng.run(); + Assert.assertTrue(holder.getErrorMessage().contains(expected + methodName)); + } + + @DataProvider + public Object[][] getTestData() { + String variant1 = "Can inject only one of into a @%s annotated "; + String variant2 = + "Can inject only one of into a @%s annotated "; + return new Object[][] { + { + BadBeforeSuiteSample.class, + "beforeSuite", + String.format(variant1, BeforeSuite.class.getSimpleName()) + }, + { + BadBeforeTestSample.class, + "beforeTest", + String.format(variant1, BeforeTest.class.getSimpleName()) + }, + { + BadBeforeClassSample.class, + "beforeClass", + String.format(variant1, BeforeClass.class.getSimpleName()) + }, + { + BadBeforeMethodSample.class, + "beforeMethod", + String.format(variant2, BeforeMethod.class.getSimpleName()) + }, + { + BadAfterMethodSample.class, + "afterMethod", + String.format(variant2, AfterMethod.class.getSimpleName()) + }, + { + BadAfterClassSample.class, + "afterClass", + String.format(variant1, AfterClass.class.getSimpleName()) + }, + { + BadAfterTestSample.class, + "afterTest", + String.format(variant1, AfterTest.class.getSimpleName()) + }, + { + BadAfterSuiteSample.class, + "afterSuite", + String.format(variant1, AfterSuite.class.getSimpleName()) + }, + { + BadBeforeGroupsSample.class, + "beforeGroups", + String.format(variant1, BeforeGroups.class.getSimpleName()) + }, + { + BadAfterGroupsSample.class, + "afterGroups", + String.format(variant1, AfterGroups.class.getSimpleName()) + } + }; + } + + public static class InjectionResultHolder extends TestListenerAdapter { + private String errorMessage; + + String getErrorMessage() { + return errorMessage; + } + + @Override + public void onConfigurationFailure(ITestResult itr) { + this.errorMessage = itr.getThrowable().getMessage(); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inject/NativeInjectionTestSamples.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inject/NativeInjectionTestSamples.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inject/NativeInjectionTestSamples.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inject/NativeInjectionTestSamples.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,61 @@ +package test.inject; + +import org.testng.annotations.*; + +class NativeInjectionTestSamples { + + public static class SimpleBase { + @Test(groups = "test") + public void testMethod() {} + } + + public static class BadBeforeSuiteSample { + @BeforeSuite(groups = "test") + public void beforeSuite(int foo) {} + } + + public static class BadBeforeTestSample { + @BeforeTest(groups = "test") + public void beforeTest(int foo) {} + } + + public static class BadBeforeClassSample extends SimpleBase { + @BeforeClass(groups = "test") + public void beforeClass(int foo) {} + } + + public static class BadBeforeMethodSample extends SimpleBase { + @BeforeMethod(groups = "test") + public void beforeMethod(int foo) {} + } + + public static class BadAfterMethodSample extends SimpleBase { + @AfterMethod(groups = "test") + public void afterMethod(int foo) {} + } + + public static class BadAfterClassSample extends SimpleBase { + @AfterClass(groups = "test") + public void afterClass(int foo) {} + } + + public static class BadAfterTestSample extends SimpleBase { + @AfterTest(groups = "test") + public void afterTest(int foo) {} + } + + public static class BadAfterSuiteSample extends SimpleBase { + @AfterSuite(groups = "test") + public void afterSuite(int foo) {} + } + + public static class BadBeforeGroupsSample extends SimpleBase { + @BeforeGroups(groups = "test") + public void beforeGroups(int foo) {} + } + + public static class BadAfterGroupsSample extends SimpleBase { + @AfterGroups(groups = "test") + public void afterGroups(int foo) {} + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inject/NegativeNativeInjectionTestSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inject/NegativeNativeInjectionTestSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inject/NegativeNativeInjectionTestSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inject/NegativeNativeInjectionTestSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,13 @@ +package test.inject; + +import org.testng.ITestResult; +import org.testng.annotations.Test; + +public class NegativeNativeInjectionTestSample { + + @Test + public void m1(ITestResult result) {} + + @Test + public void m2(int foo) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inject/NoInjectionTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inject/NoInjectionTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inject/NoInjectionTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inject/NoInjectionTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,35 @@ +package test.inject; + +import java.lang.reflect.Method; +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.NoInjection; +import org.testng.annotations.Test; + +/** + * Test the @NoInjection annotation. + * + * @author cbeust + */ +public class NoInjectionTest { + + @DataProvider(name = "provider") + public Object[][] provide() throws Exception { + return new Object[][] {{CC.class.getMethod("f")}}; + } + + @Test(dataProvider = "provider") + public void withoutInjection(@NoInjection Method m) { + Assert.assertEquals(m.getName(), "f"); + } + + @Test(dataProvider = "provider") + public void withInjection(Method m) { + Assert.assertEquals(m.getName(), "withInjection"); + } +} + +class CC { + + public void f() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inject/Sample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inject/Sample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/inject/Sample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/inject/Sample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package test.inject; + +import org.testng.Assert; +import org.testng.ITestContext; +import org.testng.ITestNGMethod; +import org.testng.annotations.Test; + +public class Sample { + + @Test + public void f(ITestContext tc) { + Assert.assertNotNull(tc); + ITestNGMethod[] allMethods = tc.getAllTestMethods(); + Assert.assertEquals(allMethods.length, 1); + Assert.assertEquals(allMethods[0].getConstructorOrMethod().getName(), "f"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/interleavedorder/BaseTestClass.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/interleavedorder/BaseTestClass.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/interleavedorder/BaseTestClass.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/interleavedorder/BaseTestClass.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.interleavedorder; + +import org.testng.annotations.Test; + +public class BaseTestClass { + @Test + public void testOne() { + InterleavedInvocationTest.LOG.add("test1"); + } + + @Test + public void testTwo() { + InterleavedInvocationTest.LOG.add("test2"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/interleavedorder/InterleavedInvocationTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/interleavedorder/InterleavedInvocationTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/interleavedorder/InterleavedInvocationTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/interleavedorder/InterleavedInvocationTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,45 @@ +package test.interleavedorder; + +import java.util.ArrayList; +import java.util.List; +import org.testng.Assert; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.Test; +import test.BaseTest; +import testhelper.OutputDirectoryPatch; + +public class InterleavedInvocationTest extends BaseTest { + public static List LOG = new ArrayList<>(); + + @BeforeTest + public void beforeTest() { + LOG = new ArrayList<>(); + } + + private void verifyInvocation(int number, List log, int index) { + Assert.assertEquals(log.get(index), "beforeTestChild" + number + "Class"); + Assert.assertTrue( + ("test1".equals(log.get(index + 1)) && "test2".equals(LOG.get(index + 2))) + || ("test2".equals(LOG.get(index + 1)) && "test1".equals(LOG.get(index + 2))), + "test methods were not invoked correctly"); + Assert.assertEquals(log.get(index + 3), "afterTestChild" + number + "Class"); + } + + @Test + public void invocationOrder() { + TestListenerAdapter tla = new TestListenerAdapter(); + TestNG testng = new TestNG(); + testng.setOutputDirectory(OutputDirectoryPatch.getOutputDirectory()); + testng.setTestClasses(new Class[] {TestChild1.class, TestChild2.class}); + testng.addListener(tla); + testng.run(); + + Assert.assertEquals(LOG.size(), 8, LOG.toString()); + int number1 = "beforeTestChild1Class".equals(LOG.get(0)) ? 1 : 2; + int number2 = number1 == 1 ? 2 : 1; + verifyInvocation(number1, LOG, 0); + verifyInvocation(number2, LOG, 4); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/interleavedorder/TestChild1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/interleavedorder/TestChild1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/interleavedorder/TestChild1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/interleavedorder/TestChild1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.interleavedorder; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; + +public class TestChild1 extends BaseTestClass { + @BeforeClass + public void beforeTestChildOneClass() { + InterleavedInvocationTest.LOG.add("beforeTestChild1Class"); + } + + @AfterClass + public void afterTestChildOneClass() { + InterleavedInvocationTest.LOG.add("afterTestChild1Class"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/interleavedorder/TestChild2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/interleavedorder/TestChild2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/interleavedorder/TestChild2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/interleavedorder/TestChild2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.interleavedorder; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; + +public class TestChild2 extends BaseTestClass { + @BeforeClass + public void beforeTestChildTwoClass() { + InterleavedInvocationTest.LOG.add("beforeTestChild2Class"); + } + + @AfterClass + public void afterTestChildTwoClass() { + InterleavedInvocationTest.LOG.add("afterTestChild2Class"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/interleavedorder/testng-order.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/interleavedorder/testng-order.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/interleavedorder/testng-order.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/interleavedorder/testng-order.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ + + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invocationcount/DataProviderBase.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/DataProviderBase.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invocationcount/DataProviderBase.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/DataProviderBase.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,24 @@ +package test.invocationcount; + +import java.util.Arrays; +import java.util.Iterator; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class DataProviderBase { + @Test(dataProvider = "dp") + public void f(Integer n) {} + + @DataProvider + public Object[][] dp() { + return new Integer[][] {new Integer[] {0}, new Integer[] {1}, new Integer[] {2}}; + } + + @Test(dataProvider = "dp2") + public void f2(Integer n) {} + + @DataProvider + public Iterator dp2() { + return Arrays.asList(new Object[] {0}, new Object[] {1}, new Object[] {2}).iterator(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invocationcount/DataProviderFalseFalseTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/DataProviderFalseFalseTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invocationcount/DataProviderFalseFalseTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/DataProviderFalseFalseTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.invocationcount; + +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; + +public class DataProviderFalseFalseTest extends DataProviderBase { + @BeforeMethod(firstTimeOnly = false) + public void beforeMethod() {} + + @AfterMethod(lastTimeOnly = false) + public void afterMethod() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invocationcount/DataProviderFalseTrueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/DataProviderFalseTrueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invocationcount/DataProviderFalseTrueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/DataProviderFalseTrueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.invocationcount; + +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; + +public class DataProviderFalseTrueTest extends DataProviderBase { + @BeforeMethod(firstTimeOnly = false) + public void beforeMethod() {} + + @AfterMethod(lastTimeOnly = true) + public void afterMethod() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invocationcount/DataProviderTrueFalseTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/DataProviderTrueFalseTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invocationcount/DataProviderTrueFalseTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/DataProviderTrueFalseTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.invocationcount; + +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; + +public class DataProviderTrueFalseTest extends DataProviderBase { + @BeforeMethod(firstTimeOnly = true) + public void beforeMethod() {} + + @AfterMethod(lastTimeOnly = false) + public void afterMethod() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invocationcount/DataProviderTrueTrueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/DataProviderTrueTrueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invocationcount/DataProviderTrueTrueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/DataProviderTrueTrueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.invocationcount; + +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; + +public class DataProviderTrueTrueTest extends DataProviderBase { + @BeforeMethod(firstTimeOnly = true) + public void beforeMethod() {} + + @AfterMethod(lastTimeOnly = true) + public void afterMethod() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invocationcount/FailedInvocationCount.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/FailedInvocationCount.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invocationcount/FailedInvocationCount.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/FailedInvocationCount.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.invocationcount; + +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +public class FailedInvocationCount { + int m_count; + + @BeforeClass + public void setUp() { + m_count = 0; + } + + @Test(invocationCount = 10) + public void f() { + if (m_count++ > 3) { + throw new RuntimeException(); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invocationcount/FailedInvocationCount2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/FailedInvocationCount2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invocationcount/FailedInvocationCount2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/FailedInvocationCount2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,29 @@ +package test.invocationcount; + +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +public class FailedInvocationCount2 { + int m_count; + int m_count2; + + @BeforeClass + public void setUp() { + m_count = 0; + m_count2 = 0; + } + + @Test(invocationCount = 10, skipFailedInvocations = true) + public void shouldSkipFromAnnotation() { + if (m_count++ > 3) { + throw new RuntimeException(); + } + } + + @Test(invocationCount = 10, skipFailedInvocations = false) + public void shouldNotSkipFromAnnotation() { + if (m_count2++ > 3) { + throw new RuntimeException(); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invocationcount/FailedInvocationCountTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/FailedInvocationCountTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invocationcount/FailedInvocationCountTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/FailedInvocationCountTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,44 @@ +package test.invocationcount; + +import org.testng.Assert; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class FailedInvocationCountTest extends SimpleBaseTest { + + private void runTest(boolean skip, int passed, int failed, int skipped) { + TestNG testng = create(FailedInvocationCount.class); + TestListenerAdapter tla = new TestListenerAdapter(); + testng.setSkipFailedInvocationCounts(skip); + testng.addListener(tla); + testng.run(); + + Assert.assertEquals(tla.getPassedTests().size(), passed); + Assert.assertEquals(tla.getFailedTests().size(), failed); + Assert.assertEquals(tla.getSkippedTests().size(), skipped); + } + + @Test + public void verifyGloballyShouldStop() { + runTest(true, 4, 1, 5); + } + + @Test + public void verifyGloballyShouldNotStop() { + runTest(false, 4, 6, 0); + } + + @Test + public void verifyAttributeShouldStop() { + TestNG testng = create(FailedInvocationCount2.class); + TestListenerAdapter tla = new TestListenerAdapter(); + testng.addListener(tla); + testng.run(); + + Assert.assertEquals(tla.getPassedTests().size(), 8); + Assert.assertEquals(tla.getFailedTests().size(), 7); + Assert.assertEquals(tla.getSkippedTests().size(), 5); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invocationcount/FirstAndLastTimeTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/FirstAndLastTimeTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invocationcount/FirstAndLastTimeTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/FirstAndLastTimeTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,174 @@ +package test.invocationcount; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.List; +import org.testng.TestNG; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import test.InvokedMethodNameListener; +import test.SimpleBaseTest; +import test.invocationcount.issue426.SampleTestClassWithNoThreadPoolSizeDefined; +import test.invocationcount.issue426.SampleTestClassWithThreadPoolSizeDefined; + +/** + * Test various combination of @BeforeMethod(firstTimeOnly = true/false) and + * AfterMethod(lastTimeOnly = true/false) with invocation counts and data providers. + */ +public class FirstAndLastTimeTest extends SimpleBaseTest { + + @Test + public void verifyDataProviderFalseFalse() { + List invokedMethodNames = run(DataProviderFalseFalseTest.class); + + assertThat(invokedMethodNames) + .containsExactly( + "beforeMethod", + "f(0)", + "afterMethod", + "beforeMethod", + "f(1)", + "afterMethod", + "beforeMethod", + "f(2)", + "afterMethod", + "beforeMethod", + "f2(0)", + "afterMethod", + "beforeMethod", + "f2(1)", + "afterMethod", + "beforeMethod", + "f2(2)", + "afterMethod"); + } + + @Test + public void verifyDataProviderTrueFalse() { + List invokedMethodNames = run(DataProviderTrueFalseTest.class); + + assertThat(invokedMethodNames) + .containsExactly( + "beforeMethod", + "f(0)", + "afterMethod", + "f(1)", + "afterMethod", + "f(2)", + "afterMethod", + "beforeMethod", + "f2(0)", + "afterMethod", + "f2(1)", + "afterMethod", + "f2(2)", + "afterMethod"); + } + + @Test + public void verifyDataProviderFalseTrue() { + List invokedMethodNames = run(DataProviderFalseTrueTest.class); + + assertThat(invokedMethodNames) + .containsExactly( + "beforeMethod", + "f(0)", + "beforeMethod", + "f(1)", + "beforeMethod", + "f(2)", + "afterMethod", + "beforeMethod", + "f2(0)", + "beforeMethod", + "f2(1)", + "beforeMethod", + "f2(2)", + "afterMethod"); + } + + @Test + public void verifyDataProviderTrueTrue() { + List invokedMethodNames = run(DataProviderTrueTrueTest.class); + + assertThat(invokedMethodNames) + .containsExactly( + "beforeMethod", + "f(0)", + "f(1)", + "f(2)", + "afterMethod", + "beforeMethod", + "f2(0)", + "f2(1)", + "f2(2)", + "afterMethod"); + } + + @Test + public void verifyInvocationCountFalseFalse() { + List invokedMethodNames = run(InvocationCountFalseFalseTest.class); + + assertThat(invokedMethodNames) + .containsExactly( + "beforeMethod", + "f", + "afterMethod", + "beforeMethod", + "f", + "afterMethod", + "beforeMethod", + "f", + "afterMethod"); + } + + @Test + public void verifyInvocationCountTrueFalse() { + List invokedMethodNames = run(InvocationCountTrueFalseTest.class); + + assertThat(invokedMethodNames) + .containsExactly( + "beforeMethod", "f", "afterMethod", "f", "afterMethod", "f", "afterMethod"); + } + + @Test + public void verifyInvocationCountFalseTrue() { + List invokedMethodNames = run(InvocationCountFalseTrueTest.class); + + assertThat(invokedMethodNames) + .containsExactly( + "beforeMethod", "f", "beforeMethod", "f", "beforeMethod", "f", "afterMethod"); + } + + @Test + public void verifyInvocationCountTrueTrue() { + List invokedMethodNames = run(InvocationCountTrueTrueTest.class); + + assertThat(invokedMethodNames).containsExactly("beforeMethod", "f", "f", "f", "afterMethod"); + } + + @Test(dataProvider = "classNames", description = "GITHUB-426") + public void verifyFirstTimeOnly(Class clazz) { + List invokedMethodNames = run(clazz); + String[] expected = new String[] {"beforeMethod", "testMethod", "testMethod"}; + assertThat(invokedMethodNames).containsExactly(expected); + } + + @DataProvider(name = "classNames") + public Object[][] getClassNames() { + return new Object[][] { + {SampleTestClassWithNoThreadPoolSizeDefined.class}, + {SampleTestClassWithThreadPoolSizeDefined.class} + }; + } + + private static List run(Class cls) { + TestNG tng = create(cls); + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener(listener); + + tng.run(); + + return listener.getInvokedMethodNames(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invocationcount/InvocationBase.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/InvocationBase.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invocationcount/InvocationBase.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/InvocationBase.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ +package test.invocationcount; + +import org.testng.annotations.Test; + +public class InvocationBase { + @Test(invocationCount = 3) + public void f() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invocationcount/InvocationCountFalseFalseTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/InvocationCountFalseFalseTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invocationcount/InvocationCountFalseFalseTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/InvocationCountFalseFalseTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.invocationcount; + +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; + +public class InvocationCountFalseFalseTest extends InvocationBase { + @BeforeMethod(firstTimeOnly = false) + public void beforeMethod() {} + + @AfterMethod(lastTimeOnly = false) + public void afterMethod() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invocationcount/InvocationCountFalseTrueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/InvocationCountFalseTrueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invocationcount/InvocationCountFalseTrueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/InvocationCountFalseTrueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.invocationcount; + +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; + +public class InvocationCountFalseTrueTest extends InvocationBase { + @BeforeMethod(firstTimeOnly = false) + public void beforeMethod() {} + + @AfterMethod(lastTimeOnly = true) + public void afterMethod() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invocationcount/InvocationCountTrueFalseTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/InvocationCountTrueFalseTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invocationcount/InvocationCountTrueFalseTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/InvocationCountTrueFalseTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.invocationcount; + +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; + +public class InvocationCountTrueFalseTest extends InvocationBase { + @BeforeMethod(firstTimeOnly = true) + public void beforeMethod() {} + + @AfterMethod(lastTimeOnly = false) + public void afterMethod() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invocationcount/InvocationCountTrueTrueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/InvocationCountTrueTrueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invocationcount/InvocationCountTrueTrueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/InvocationCountTrueTrueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.invocationcount; + +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; + +public class InvocationCountTrueTrueTest extends InvocationBase { + @BeforeMethod(firstTimeOnly = true) + public void beforeMethod() {} + + @AfterMethod(lastTimeOnly = true) + public void afterMethod() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invocationcount/issue1719/DummyReporter.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/issue1719/DummyReporter.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invocationcount/issue1719/DummyReporter.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/issue1719/DummyReporter.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,53 @@ +package test.invocationcount.issue1719; + +import java.util.List; +import java.util.Set; +import org.testng.IReporter; +import org.testng.ISuite; +import org.testng.ITestResult; +import org.testng.collections.Sets; +import org.testng.xml.XmlSuite; + +public class DummyReporter implements IReporter { + private Set failures = Sets.newHashSet(); + private Set skip = Sets.newHashSet(); + private Set success = Sets.newHashSet(); + private Set failedWithinSuccessPercentage = Sets.newHashSet(); + + public void generateReport( + List xmlSuites, List suites, String outputDirectory) { + suites.forEach( + iSuite -> + iSuite + .getResults() + .values() + .forEach( + suiteResult -> { + failures.addAll( + suiteResult.getTestContext().getFailedTests().getAllResults()); + skip.addAll(suiteResult.getTestContext().getSkippedTests().getAllResults()); + success.addAll(suiteResult.getTestContext().getPassedTests().getAllResults()); + failedWithinSuccessPercentage.addAll( + suiteResult + .getTestContext() + .getFailedButWithinSuccessPercentageTests() + .getAllResults()); + })); + } + + public Set getFailures() { + return failures; + } + + public Set getSkip() { + return skip; + } + + public Set getSuccess() { + return success; + } + + public Set getFailedWithinSuccessPercentage() { + return failedWithinSuccessPercentage; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invocationcount/issue1719/IssueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/issue1719/IssueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invocationcount/issue1719/IssueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/issue1719/IssueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,22 @@ +package test.invocationcount.issue1719; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class IssueTest extends SimpleBaseTest { + + @Test + public void testSuccessPercentageCalculation() { + TestNG testng = create(TestclassSample.class); + DummyReporter listener = new DummyReporter(); + testng.addListener(listener); + testng.run(); + assertThat(listener.getFailures()).isEmpty(); + assertThat(listener.getSkip()).isEmpty(); + assertThat(listener.getSuccess()).isEmpty(); + assertThat(listener.getFailedWithinSuccessPercentage()).hasSize(5); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invocationcount/issue1719/TestclassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/issue1719/TestclassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invocationcount/issue1719/TestclassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/issue1719/TestclassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,28 @@ +package test.invocationcount.issue1719; + +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class TestclassSample { + + @Test(successPercentage = 0, dataProvider = "dp") + public void dataDrivenTestMethod(int i) { + Assert.fail("Failing iteration:" + i); + } + + @DataProvider(name = "dp") + public Object[][] getData() { + return new Object[][] {{1}, {2}}; + } + + @Test(successPercentage = 0) + public void simpleTestMethod() { + Assert.fail(); + } + + @Test(successPercentage = 0, invocationCount = 2) + public void testMethodWithMultipleInvocations() { + Assert.fail(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invocationcount/issue426/SampleTestClassWithNoThreadPoolSizeDefined.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/issue426/SampleTestClassWithNoThreadPoolSizeDefined.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invocationcount/issue426/SampleTestClassWithNoThreadPoolSizeDefined.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/issue426/SampleTestClassWithNoThreadPoolSizeDefined.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.invocationcount.issue426; + +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class SampleTestClassWithNoThreadPoolSizeDefined { + @BeforeMethod(firstTimeOnly = true) + public void beforeMethod() {} + + @Test(invocationCount = 2, threadPoolSize = 5) + public void testMethod() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invocationcount/issue426/SampleTestClassWithThreadPoolSizeDefined.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/issue426/SampleTestClassWithThreadPoolSizeDefined.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invocationcount/issue426/SampleTestClassWithThreadPoolSizeDefined.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invocationcount/issue426/SampleTestClassWithThreadPoolSizeDefined.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.invocationcount.issue426; + +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class SampleTestClassWithThreadPoolSizeDefined { + @BeforeMethod(firstTimeOnly = true) + public void beforeMethod() {} + + @Test(invocationCount = 2) + public void testMethod() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invokedmethodlistener/A.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invokedmethodlistener/A.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invokedmethodlistener/A.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invokedmethodlistener/A.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.invokedmethodlistener; + +import org.testng.annotations.BeforeSuite; + +public class A { + + @BeforeSuite(alwaysRun = false) + public static void someMethod1() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invokedmethodlistener/B.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invokedmethodlistener/B.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invokedmethodlistener/B.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invokedmethodlistener/B.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,13 @@ +package test.invokedmethodlistener; + +import org.testng.annotations.BeforeSuite; +import org.testng.annotations.Test; + +@Test(enabled = false) +public class B extends A { + + @BeforeSuite + public static void someMethod2() {} + + public void someTest() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invokedmethodlistener/Base.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invokedmethodlistener/Base.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invokedmethodlistener/Base.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invokedmethodlistener/Base.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,54 @@ +package test.invokedmethodlistener; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.AfterSuite; +import org.testng.annotations.AfterTest; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.BeforeSuite; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.Test; + +public class Base { + private boolean m_fail; + + public Base(boolean fail) { + m_fail = fail; + } + + @BeforeMethod + public void beforeMethod() {} + + @AfterMethod + public void afterMethod() {} + + @BeforeTest + public void beforeTest() {} + + @AfterTest + public void afterTest() {} + + @BeforeClass + public void beforeClass() {} + + @AfterClass + public void afterClass() {} + + @BeforeSuite + public void beforeSuite() {} + + @AfterSuite + public void afterSuite() { + if (m_fail) { + throw new RuntimeException("After Suite FAILING"); + } + } + + @Test + public void a() { + if (m_fail) { + throw new IllegalArgumentException("Test Method FAILING"); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invokedmethodlistener/C.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invokedmethodlistener/C.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invokedmethodlistener/C.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invokedmethodlistener/C.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,13 @@ +package test.invokedmethodlistener; + +import org.testng.annotations.BeforeSuite; +import org.testng.annotations.Test; + +@Test +public class C extends A { + + @BeforeSuite + public static void someMethod3() {} + + public void someTest() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invokedmethodlistener/Failure.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invokedmethodlistener/Failure.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invokedmethodlistener/Failure.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invokedmethodlistener/Failure.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,7 @@ +package test.invokedmethodlistener; + +public class Failure extends Base { + public Failure() { + super(true); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invokedmethodlistener/InvokedMethodListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invokedmethodlistener/InvokedMethodListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invokedmethodlistener/InvokedMethodListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invokedmethodlistener/InvokedMethodListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,24 @@ +package test.invokedmethodlistener; + +import java.util.List; +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.ITestResult; +import org.testng.collections.Lists; + +public class InvokedMethodListener implements IInvokedMethodListener { + + private final List m_methods = Lists.newArrayList(); + + @Override + public void beforeInvocation(IInvokedMethod method, ITestResult testResult) { + m_methods.add(method); + } + + @Override + public void afterInvocation(IInvokedMethod method, ITestResult testResult) {} + + public List getInvokedMethods() { + return m_methods; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invokedmethodlistener/InvokedMethodListenerTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invokedmethodlistener/InvokedMethodListenerTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invokedmethodlistener/InvokedMethodListenerTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invokedmethodlistener/InvokedMethodListenerTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,139 @@ +package test.invokedmethodlistener; + +import java.util.List; +import org.testng.Assert; +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.ITestNGListener; +import org.testng.ITestResult; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import test.SimpleBaseTest; + +public class InvokedMethodListenerTest extends SimpleBaseTest { + + private static void run(Class[] classes, IInvokedMethodListener l) { + TestNG tng = create(); + tng.setTestClasses(classes); + + tng.addListener((ITestNGListener) l); + tng.run(); + } + + private static void assertMethodCount(MyListener l) { + Assert.assertEquals(l.getBeforeCount(), 9); + Assert.assertEquals(l.getAfterCount(), 9); + } + + @Test + public void withSuccess() { + MyListener l = new MyListener(); + run(new Class[] {Success.class}, l); + assertMethodCount(l); + } + + @Test + public void withFailure() { + MyListener l = new MyListener(); + run(new Class[] {Failure.class}, l); + assertMethodCount(l); + Assert.assertEquals(l.getSuiteStatus(), ITestResult.FAILURE); + Assert.assertTrue(null != l.getSuiteThrowable()); + Assert.assertTrue(l.getSuiteThrowable().getClass() == RuntimeException.class); + + Assert.assertEquals(l.getMethodStatus(), ITestResult.FAILURE); + Assert.assertTrue(null != l.getMethodThrowable()); + Assert.assertTrue(l.getMethodThrowable().getClass() == IllegalArgumentException.class); + } + + /** + * Fix for: https://github.com/juherr/testng-googlecode/issues/7 + * https://github.com/juherr/testng-googlecode/issues/86 + * https://github.com/cbeust/testng/issues/93 + */ + @Test + public void sameMethodInvokedMultipleTimesShouldHaveDifferentTimeStamps() { + TestNG tng = create(Sample.class); + InvokedMethodListener listener = new InvokedMethodListener(); + tng.addListener((ITestNGListener) listener); + tng.run(); + List m = listener.getInvokedMethods(); + IInvokedMethod beforeSuite = m.get(0); + Assert.assertFalse(beforeSuite.getTestMethod().isAfterMethodConfiguration()); + Assert.assertTrue(beforeSuite.isConfigurationMethod()); + IInvokedMethod after1 = m.get(2); + Assert.assertTrue(after1.getTestMethod().isAfterMethodConfiguration()); + Assert.assertTrue(after1.isConfigurationMethod()); + IInvokedMethod after2 = m.get(4); + Assert.assertTrue(after2.getTestMethod().isAfterMethodConfiguration()); + Assert.assertTrue(after2.isConfigurationMethod()); + Assert.assertTrue(after1.getDate() != after2.getDate()); + } + + @Test( + description = + "Test methods with expected exceptions should show up as pass" + + " in IInvokedMethodListener's afterInvocation method") + public void testMethodsWithExpectedExceptionsShouldShowUpAsPass() { + TestNG tng = create(Sample2.class); + Sample2.Sample2InvokedMethodListener l = new Sample2().new Sample2InvokedMethodListener(); + tng.addListener((ITestNGListener) l); + tng.run(); + + Assert.assertTrue(l.isSuccess); + } + + @Test(description = "Invoked method does not recognize configuration method") + public void issue629_InvokedMethodDoesNotRecognizeConfigurationMethod() { + InvokedMethodNameListener l = new InvokedMethodNameListener(); + run(new Class[] {Success.class}, l); + + Assert.assertEquals(l.testMethods.size(), 1); + Assert.assertTrue(l.testMethods.contains("a")); + + Assert.assertEquals(l.testMethodsFromTM.size(), 1); + Assert.assertTrue(l.testMethodsFromTM.contains("a")); + + Assert.assertEquals(l.configurationMethods.size(), 8); + Assert.assertTrue(l.configurationMethods.contains("beforeMethod")); + Assert.assertTrue(l.configurationMethods.contains("afterMethod")); + Assert.assertTrue(l.configurationMethods.contains("beforeTest")); + Assert.assertTrue(l.configurationMethods.contains("afterTest")); + Assert.assertTrue(l.configurationMethods.contains("beforeClass")); + Assert.assertTrue(l.configurationMethods.contains("afterClass")); + Assert.assertTrue(l.configurationMethods.contains("beforeSuite")); + Assert.assertTrue(l.configurationMethods.contains("afterSuite")); + + Assert.assertEquals(l.configurationMethodsFromTM.size(), 8); + Assert.assertTrue(l.configurationMethodsFromTM.contains("beforeMethod")); + Assert.assertTrue(l.configurationMethodsFromTM.contains("afterMethod")); + Assert.assertTrue(l.configurationMethodsFromTM.contains("beforeTest")); + Assert.assertTrue(l.configurationMethodsFromTM.contains("afterTest")); + Assert.assertTrue(l.configurationMethodsFromTM.contains("beforeClass")); + Assert.assertTrue(l.configurationMethodsFromTM.contains("afterClass")); + Assert.assertTrue(l.configurationMethodsFromTM.contains("beforeSuite")); + Assert.assertTrue(l.configurationMethodsFromTM.contains("afterSuite")); + } + + @Test + public void issue87_method_orderning_with_disable_test_class() { + assertIssue87(A.class, B.class, C.class); + assertIssue87(A.class, C.class, B.class); + assertIssue87(B.class, A.class, C.class); + } + + private void assertIssue87(Class... tests) { + TestNG tng = create(tests); + tng.setParallel(XmlSuite.ParallelMode.NONE); + tng.setPreserveOrder(true); + InvokedMethodListener listener = new InvokedMethodListener(); + tng.addListener((ITestNGListener) listener); + tng.run(); + List m = listener.getInvokedMethods(); + Assert.assertEquals(m.get(0).getTestMethod().getMethodName(), "someMethod1"); + Assert.assertEquals(m.get(1).getTestMethod().getMethodName(), "someMethod3"); + Assert.assertEquals(m.get(2).getTestMethod().getMethodName(), "someTest"); + Assert.assertEquals(m.size(), 3); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invokedmethodlistener/InvokedMethodNameListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invokedmethodlistener/InvokedMethodNameListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invokedmethodlistener/InvokedMethodNameListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invokedmethodlistener/InvokedMethodNameListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,43 @@ +package test.invokedmethodlistener; + +import java.util.HashSet; +import java.util.Set; +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.ITestResult; + +public class InvokedMethodNameListener implements IInvokedMethodListener { + + final Set testMethods = new HashSet<>(); + final Set configurationMethods = new HashSet<>(); + final Set testMethodsFromTM = new HashSet<>(); + final Set configurationMethodsFromTM = new HashSet<>(); + + @Override + public void beforeInvocation(IInvokedMethod method, ITestResult testResult) {} + + @Override + public void afterInvocation(IInvokedMethod method, ITestResult testResult) { + String methodName = method.getTestMethod().getMethodName(); + + if (method.isTestMethod()) { + testMethods.add(methodName); + } + if (method.isConfigurationMethod()) { + configurationMethods.add(methodName); + } + if (method.getTestMethod().isTest()) { + testMethodsFromTM.add(methodName); + } + if (method.getTestMethod().isBeforeMethodConfiguration() + || method.getTestMethod().isAfterMethodConfiguration() + || method.getTestMethod().isBeforeTestConfiguration() + || method.getTestMethod().isAfterTestConfiguration() + || method.getTestMethod().isBeforeClassConfiguration() + || method.getTestMethod().isAfterClassConfiguration() + || method.getTestMethod().isBeforeSuiteConfiguration() + || method.getTestMethod().isAfterSuiteConfiguration()) { + configurationMethodsFromTM.add(methodName); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invokedmethodlistener/MyListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invokedmethodlistener/MyListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invokedmethodlistener/MyListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invokedmethodlistener/MyListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,57 @@ +package test.invokedmethodlistener; + +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.ITestResult; + +public class MyListener implements IInvokedMethodListener { + private int m_beforeCount = 0; + private int m_afterCount = 0; + + private Throwable suiteThrowable; + private int suiteStatus = 0; + private Throwable methodThrowable; + private int methodStatus = 0; + + @Override + public void afterInvocation(IInvokedMethod method, ITestResult testResult) { + m_afterCount++; + if (method.getTestMethod().isAfterSuiteConfiguration()) { + suiteStatus = testResult.getStatus(); + suiteThrowable = testResult.getThrowable(); + } + if (method.getTestMethod().isTest()) { + methodStatus = testResult.getStatus(); + methodThrowable = testResult.getThrowable(); + } + } + + @Override + public void beforeInvocation(IInvokedMethod method, ITestResult testResult) { + m_beforeCount++; + } + + public int getBeforeCount() { + return m_beforeCount; + } + + public int getAfterCount() { + return m_afterCount; + } + + public Throwable getSuiteThrowable() { + return suiteThrowable; + } + + public int getSuiteStatus() { + return suiteStatus; + } + + public Throwable getMethodThrowable() { + return methodThrowable; + } + + public int getMethodStatus() { + return methodStatus; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invokedmethodlistener/Sample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invokedmethodlistener/Sample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invokedmethodlistener/Sample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invokedmethodlistener/Sample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,32 @@ +package test.invokedmethodlistener; + +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeSuite; +import org.testng.annotations.Test; + +public class Sample { + + @Test + public void t1() { + try { + Thread.sleep(100); + } catch (InterruptedException handled) { + Thread.currentThread().interrupt(); + } + } + + @Test + public void t2() { + try { + Thread.sleep(100); + } catch (InterruptedException handled) { + Thread.currentThread().interrupt(); + } + } + + @AfterMethod + public void am() {} + + @BeforeSuite + public void bs() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invokedmethodlistener/Sample2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invokedmethodlistener/Sample2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invokedmethodlistener/Sample2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invokedmethodlistener/Sample2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,35 @@ +package test.invokedmethodlistener; + +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.ITestResult; +import org.testng.annotations.Test; + +public class Sample2 { + + @Test(expectedExceptions = IllegalArgumentException.class) + public void t1() { + throw new IllegalArgumentException("Throw this exception on purpose in test"); + } + + public class Sample2InvokedMethodListener implements IInvokedMethodListener { + + boolean isSuccess = false; + + /** {@inheritDoc} */ + @Override + public void afterInvocation(IInvokedMethod m, ITestResult tr) { + isSuccess = tr.isSuccess(); + } + + /** {@inheritDoc} */ + @Override + public void beforeInvocation(IInvokedMethod arg0, ITestResult arg1) { + // no need to implement this right now + } + + public boolean isSuccess() { + return isSuccess; + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invokedmethodlistener/Success.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invokedmethodlistener/Success.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/invokedmethodlistener/Success.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/invokedmethodlistener/Success.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,7 @@ +package test.invokedmethodlistener; + +public class Success extends Base { + public Success() { + super(false); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/issue107/Issue107Test.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/issue107/Issue107Test.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/issue107/Issue107Test.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/issue107/Issue107Test.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,52 @@ +package test.issue107; + +import java.util.Collections; +import java.util.Map; +import org.testng.Assert; +import org.testng.ITestNGListener; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.SimpleBaseTest; + +public class Issue107Test extends SimpleBaseTest { + + @Test( + description = + "GITHUB-107, Check that suite parameters set from listener does not affects tests count") + public void testSuiteParameterModificationFromListener() { + final XmlSuite suite = createXmlSuite("Simple suite"); + + final Map parameters = suite.getParameters(); + parameters.put( + TestTestngCounter.PARAMETER_NAME, "some value that must be overriden in listener"); + suite.setParameters(parameters); + + runTest(suite); + } + + @Test( + description = + "GITHUB-107, Check that suite parameters modification from listener does not affects tests count") + public void testSuiteParameterSetFromListener() { + final XmlSuite suite = createXmlSuite("Simple suite"); + + runTest(suite); + } + + private void runTest(XmlSuite suite) { + final XmlTest test = createXmlTest(suite, "Simple Test", TestTestngCounter.class.getName()); + suite.setTests(Collections.singletonList(test)); + + final TestListenerAdapter tla = new TestListenerAdapter(); + final TestNG tng = create(); + tng.setXmlSuites(Collections.singletonList(suite)); + tng.addListener((ITestNGListener) tla); + tng.run(); + + Assert.assertEquals(tla.getFailedTests().size(), 0); + Assert.assertEquals(tla.getPassedTests().size(), 2); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/issue107/MySuiteListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/issue107/MySuiteListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/issue107/MySuiteListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/issue107/MySuiteListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package test.issue107; + +import java.util.Map; +import org.testng.ISuite; +import org.testng.ISuiteListener; +import org.testng.xml.XmlSuite; + +public class MySuiteListener implements ISuiteListener { + public void onFinish(ISuite suite) {} + + public void onStart(ISuite suite) { + final XmlSuite xmlSuite = suite.getXmlSuite(); + final Map parameters = xmlSuite.getParameters(); + parameters.put(TestTestngCounter.PARAMETER_NAME, TestTestngCounter.EXPECTED_VALUE); + xmlSuite.setParameters(parameters); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/issue107/TestTestngCounter.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/issue107/TestTestngCounter.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/issue107/TestTestngCounter.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/issue107/TestTestngCounter.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,26 @@ +package test.issue107; + +import org.testng.Assert; +import org.testng.annotations.Listeners; +import org.testng.annotations.Optional; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; + +@Listeners(MySuiteListener.class) +public class TestTestngCounter { + + public static final String PARAMETER_NAME = "key1"; + public static final String EXPECTED_VALUE = "zzz"; + + @Parameters({PARAMETER_NAME}) + @Test + public void testParameter(String key) { + Assert.assertEquals(key, EXPECTED_VALUE); + } + + @Parameters({PARAMETER_NAME}) + @Test + public void testParameterAsOptional(@Optional("Unknown") String key) { + Assert.assertEquals(key, EXPECTED_VALUE); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/issue1430/TestFileToClass.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/issue1430/TestFileToClass.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/issue1430/TestFileToClass.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/issue1430/TestFileToClass.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package test.issue1430; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.testng.internal.ClassHelper; + +public class TestFileToClass { + + @Test + public void testFileToClass() { + Class c1 = this.getClass(); + String p = c1.getResource("TestFileToClass.class").getPath(); + Class c2 = ClassHelper.fileToClass(p); + Assert.assertNotNull(c2); + Assert.assertEquals(c1.getName(), c2.getName()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/issue565/Issue565Test.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/issue565/Issue565Test.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/issue565/Issue565Test.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/issue565/Issue565Test.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,40 @@ +package test.issue565; + +import org.testng.Assert; +import org.testng.ITestNGListener; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlSuite.ParallelMode; +import org.testng.xml.XmlTest; +import test.SimpleBaseTest; +import test.issue565.deadlock.ClassInGroupB; +import test.issue565.deadlock.GeneratedClassFactory; + +public class Issue565Test extends SimpleBaseTest { + + @Test + public void ThereShouldNotBeDeadlockWhenGroupByInstanceAndGroupDependencyUsed() throws Exception { + + XmlSuite suite = createXmlSuite("Deadlock-Suite"); + suite.setParallel(ParallelMode.CLASSES); + suite.setThreadCount(5); + suite.setGroupByInstances(true); + + XmlTest test = createXmlTestWithPackages(suite, "Deadlock-Test", ClassInGroupB.class); + + // Prevent real deadlock + suite.setTimeOut("1000"); + test.setTimeOut(1_000); + + TestNG tng = create(suite); + TestListenerAdapter tla = new TestListenerAdapter(); + tng.addListener((ITestNGListener) tla); + tng.run(); + + Assert.assertEquals(tla.getFailedTests().size(), 0); + Assert.assertEquals(tla.getSkippedTests().size(), 0); + Assert.assertEquals(tla.getPassedTests().size(), 2 + 4 * GeneratedClassFactory.SIZE); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/issue565/deadlock/ClassInGroupB.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/issue565/deadlock/ClassInGroupB.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/issue565/deadlock/ClassInGroupB.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/issue565/deadlock/ClassInGroupB.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,13 @@ +package test.issue565.deadlock; + +import org.testng.annotations.Test; + +@Test(groups = "B", dependsOnGroups = "A") +public class ClassInGroupB { + + @Test + public void groupB_1() {} + + @Test(dependsOnMethods = "groupB_1") + public void groupB_2() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/issue565/deadlock/GeneratedClassFactory.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/issue565/deadlock/GeneratedClassFactory.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/issue565/deadlock/GeneratedClassFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/issue565/deadlock/GeneratedClassFactory.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package test.issue565.deadlock; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; + +public class GeneratedClassFactory { + + public static final int SIZE = 20; + + @DataProvider(name = "ids", parallel = true) + public Object[][] ids() { + Integer[][] params = new Integer[SIZE][1]; + for (int id = 0; id < params.length; id++) { + params[id] = new Integer[] {id}; + } + return params; + } + + @Factory(dataProvider = "ids") + public Object[] generate(int id) { + return new Object[] {new GeneratedClassInGroupA(id)}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/issue565/deadlock/GeneratedClassInGroupA.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/issue565/deadlock/GeneratedClassInGroupA.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/issue565/deadlock/GeneratedClassInGroupA.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/issue565/deadlock/GeneratedClassInGroupA.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,33 @@ +package test.issue565.deadlock; + +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +public class GeneratedClassInGroupA { + + private final int id; + + public GeneratedClassInGroupA(int id) { + this.id = id; + } + + @BeforeClass(groups = "A") + public void init() {} + + @Test(groups = "A") + public void test1() {} + + @Test(groups = "A", dependsOnMethods = "test4") + public void test2() {} + + @Test(groups = "A") + public void test3() {} + + @Test(groups = "A", dependsOnMethods = "test3") + public void test4() {} + + @Override + public String toString() { + return "GeneratedClassInGroupA{" + id + '}'; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/jarpackages/JarPackagesTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/jarpackages/JarPackagesTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/jarpackages/JarPackagesTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/jarpackages/JarPackagesTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,48 @@ +package test.jarpackages; + +import java.io.File; +import org.testng.Assert; +import org.testng.ITestNGListener; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class JarPackagesTest extends SimpleBaseTest { + private TestListenerAdapter init(String jarFile) { + TestNG tng = create(); + File currentDir = new File("."); + String path = currentDir.getAbsolutePath(); + char s = File.separatorChar; + path = path + s + "test" + s + "src" + s + "test" + s + "jarpackages" + s; + String finalPath = path + jarFile; + tng.setTestJar(finalPath); + TestListenerAdapter result = new TestListenerAdapter(); + tng.addListener((ITestNGListener) result); + tng.run(); + + return result; + } + + @Test + public void jarWithTestngXml() { + TestListenerAdapter tla = init("withtestngxml.jar"); + Assert.assertEquals(tla.getPassedTests().size(), 2); + String first = tla.getPassedTests().get(0).getName(); + String second = tla.getPassedTests().get(1).getName(); + boolean fThenG = "f".equals(first) && "g".equals(second); + boolean gThenF = "g".equals(first) && "f".equals(second); + Assert.assertTrue(fThenG || gThenF); + } + + @Test + public void jarWithoutTestngXml() { + TestListenerAdapter tla = init("withouttestngxml.jar"); + Assert.assertEquals(tla.getPassedTests().size(), 2); + String first = tla.getPassedTests().get(0).getName(); + String second = tla.getPassedTests().get(1).getName(); + boolean fThenG = "f".equals(first) && "g".equals(second); + boolean gThenF = "g".equals(first) && "f".equals(second); + Assert.assertTrue(fThenG || gThenF); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/jarpackages/testng.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/jarpackages/testng.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/jarpackages/testng.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/jarpackages/testng.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,10 @@ + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/jarpackages/tests/A.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/jarpackages/tests/A.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/jarpackages/tests/A.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/jarpackages/tests/A.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.jarpackages.tests; + +import org.testng.annotations.Test; + +public class A { + + @Test + public void f() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/jarpackages/tests/B.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/jarpackages/tests/B.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/jarpackages/tests/B.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/jarpackages/tests/B.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.jarpackages.tests; + +import org.testng.annotations.Test; + +public class B { + + @Test + public void g() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/jason/Main.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/jason/Main.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/jason/Main.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/jason/Main.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.jason; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.Test; + +public class Main extends MainBase { + public static boolean m_passed = false; + + @AfterClass + public void afterClass() { + m_passed = true; + } + + @Test(description = "This test is run") + public void test1() throws InterruptedException {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/jason/MainBase.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/jason/MainBase.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/jason/MainBase.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/jason/MainBase.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.jason; + +import org.testng.annotations.Test; + +public class MainBase { + + @Test(description = "This test is never run but prevents AfterClass") + public void checkReportsExist() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/jason/MainTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/jason/MainTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/jason/MainTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/jason/MainTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,28 @@ +package test.jason; + +import java.util.Arrays; +import org.testng.Assert; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlClass; +import org.testng.xml.XmlInclude; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.SimpleBaseTest; + +public class MainTest extends SimpleBaseTest { + + @Test + public void afterClassShouldRun() { + XmlSuite s = createXmlSuite("S"); + XmlTest t = createXmlTest(s, "T", Main.class.getName()); + XmlClass c = t.getXmlClasses().get(0); + c.getIncludedMethods().add(new XmlInclude("test1")); + t.setPreserveOrder(true); + TestNG tng = create(); + tng.setXmlSuites(Arrays.asList(new XmlSuite[] {s})); + Main.m_passed = false; + tng.run(); + Assert.assertTrue(Main.m_passed); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit/BaseTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/BaseTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit/BaseTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/BaseTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,40 @@ +package test.junit; + +import junit.framework.TestCase; + +/** + * Base JUnit test case to verify TestNG handles TestCase hierarchies properly. + * + * @author mperham + */ +public abstract class BaseTest extends TestCase { + + private static int setUpInvokeCount = 0; + private static int tearDownInvokeCount = 0; + + public BaseTest(String name) { + super(name); + } + + @Override + protected void setUp() throws Exception { + setUpInvokeCount++; + } + + @Override + protected void tearDown() throws Exception { + tearDownInvokeCount++; + } + + public abstract void testA(); + + public abstract void testB(); + + public static int getSetUpInvokeCount() { + return setUpInvokeCount; + } + + public static int getTearDownInvokeCount() { + return tearDownInvokeCount; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit/JUnitConstructorTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/JUnitConstructorTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit/JUnitConstructorTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/JUnitConstructorTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,35 @@ +package test.junit; + +import junit.framework.TestCase; + +/** + * Test that the correct number of constructors is called + * + *

Created on Aug 9, 2005 + * + * @author cbeust + */ +public class JUnitConstructorTest extends TestCase { + private static int m_constructorCount = 0; + private static int m_createCount = 0; + private static int m_queryCount = 0; + + public JUnitConstructorTest(/*String string */ ) { + m_constructorCount++; + } + + public void testCreate() { + m_createCount++; + } + + public void testQuery() { + m_queryCount++; + } + + @Override + public void tearDown() { + assertEquals(3, m_constructorCount); + assertTrue( + (1 == m_createCount && 0 == m_queryCount) || (0 == m_createCount && 1 == m_queryCount)); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit/JUnitEmptyTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/JUnitEmptyTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit/JUnitEmptyTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/JUnitEmptyTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package test.junit; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +public class JUnitEmptyTest extends TestCase { + + public JUnitEmptyTest(String name) { + super(name); + } + + public static Test suite() { + TestSuite s = new TestSuite(JUnitEmptyTest.class); + return s; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit/MainSuite.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/MainSuite.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit/MainSuite.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/MainSuite.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.junit; + +import junit.framework.Test; +import junit.framework.TestSuite; + +public class MainSuite { + public static Test suite() { + TestSuite suite = new TestSuite("MainSuite"); + + suite.addTest(Suite1.suite()); + suite.addTest(Suite2.suite()); + suite.addTest(Suite3.suite()); + + return suite; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit/SetNameTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/SetNameTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit/SetNameTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/SetNameTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,25 @@ +package test.junit; + +import junit.framework.TestCase; +import org.testng.Assert; + +public class SetNameTest extends TestCase { + public static int m_ctorCount = 0; + + public SetNameTest() { + m_ctorCount++; + } + + @Override + public void setName(String name) { + super.setName(name); + } + + public void testFoo() { + Assert.assertEquals("testFoo", getName()); + } + + public void testBar() { + Assert.assertEquals("testBar", getName()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit/SetUpExceptionSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/SetUpExceptionSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit/SetUpExceptionSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/SetUpExceptionSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.junit; + +import junit.framework.TestCase; + +public class SetUpExceptionSampleTest extends TestCase { + + @Override + protected void setUp() throws Exception { + throw new RuntimeException(); + } + + public void testM1() {} + + @Override + protected void tearDown() throws Exception {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit/SetUpExceptionTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/SetUpExceptionTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit/SetUpExceptionTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/SetUpExceptionTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.junit; + +import org.testng.annotations.Test; + +public class SetUpExceptionTest extends test.BaseTest { + + @Test + public void setUpFailingShouldCauseMethodsToBeSkipped() { + addClass("test.junit.SetUpExceptionSampleTest"); + setJUnit(true); + run(); + String[] passed = {}; + String[] failed = {"setUp"}; + String[] skipped = {"testM1", "tearDown"}; + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Skipped", skipped, getSkippedTests()); + verifyTests("Failed", failed, getFailedTests()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit/Suite1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/Suite1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit/Suite1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/Suite1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package test.junit; + +import junit.framework.Test; +import junit.framework.TestSuite; + +public class Suite1 { + public Suite1(String s) { + // dummy + } + + public static Test suite() { + TestSuite suite = new TestSuite("JUnitSuite1"); + suite.addTestSuite(TestAa.class); + suite.addTestSuite(TestAb.class); + return suite; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit/Suite2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/Suite2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit/Suite2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/Suite2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package test.junit; + +import junit.framework.Test; +import junit.framework.TestSuite; + +public class Suite2 { + public static Test suite() { + TestSuite suite = new TestSuite("Suite2"); + suite.addTestSuite(TestAc.class); + suite.addTestSuite(TestAd.class); + suite.addTest(Suite3.suite()); + return suite; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit/Suite3.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/Suite3.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit/Suite3.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/Suite3.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.junit; + +import junit.framework.Test; +import junit.framework.TestSuite; + +public class Suite3 { + public static Test suite() { + TestSuite suite = new TestSuite("Suite3"); + suite.addTest(Suite4.suite()); + return suite; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit/Suite4.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/Suite4.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit/Suite4.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/Suite4.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,13 @@ +package test.junit; + +import junit.framework.Test; +import junit.framework.TestSuite; + +public class Suite4 { + public static Test suite() { + TestSuite suite = new TestSuite("Suite4"); + suite.addTestSuite(TestAe.class); + suite.addTestSuite(TestAf.class); + return suite; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit/TestAa.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/TestAa.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit/TestAa.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/TestAa.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ +package test.junit; + +import junit.framework.TestCase; + +public class TestAa extends TestCase { + + public void testAa1() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit/TestAb.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/TestAb.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit/TestAb.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/TestAb.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ +package test.junit; + +import junit.framework.TestCase; + +public class TestAb extends TestCase { + + public void testAb1() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit/TestAc.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/TestAc.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit/TestAc.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/TestAc.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ +package test.junit; + +import junit.framework.TestCase; + +public class TestAc extends TestCase { + + public void testAc1() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit/TestAd.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/TestAd.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit/TestAd.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/TestAd.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ +package test.junit; + +import junit.framework.TestCase; + +public class TestAd extends TestCase { + + public void testAd1() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit/TestAe.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/TestAe.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit/TestAe.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/TestAe.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ +package test.junit; + +import junit.framework.TestCase; + +public class TestAe extends TestCase { + + public void testAe1() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit/TestAf.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/TestAf.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit/TestAf.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/TestAf.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ +package test.junit; + +import junit.framework.TestCase; + +public class TestAf extends TestCase { + + public void testAf1() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit/testsetup/ATest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/testsetup/ATest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit/testsetup/ATest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/testsetup/ATest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.junit.testsetup; + +import junit.framework.TestCase; + +public class ATest extends TestCase { + public void testIt() { + System.out.println("A.testIt()"); + Data d = TestSuiteContainerWrapper.getData(); + assertEquals(3, d.i); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit/testsetup/Data.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/testsetup/Data.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit/testsetup/Data.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/testsetup/Data.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,5 @@ +package test.junit.testsetup; + +public class Data { + public int i = 3; +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit/testsetup/LayerATestSuite.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/testsetup/LayerATestSuite.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit/testsetup/LayerATestSuite.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/testsetup/LayerATestSuite.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.junit.testsetup; + +import junit.framework.Test; +import junit.framework.TestSuite; + +public class LayerATestSuite { + public static Test suite() { + TestSuite suite = new TestSuite("Layer A Test Suite"); + + suite.addTestSuite(ATest.class); + + TestSuiteContainerWrapper wrapper = new TestSuiteContainerWrapper(suite, Data.class); + return wrapper; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit/testsetup/LoggingTestSuite.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/testsetup/LoggingTestSuite.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit/testsetup/LoggingTestSuite.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/testsetup/LoggingTestSuite.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,21 @@ +package test.junit.testsetup; + +import junit.framework.Test; +import junit.framework.TestResult; +import junit.framework.TestSuite; + +public class LoggingTestSuite extends TestSuite { + public LoggingTestSuite(String string) { + super(string); + } + + @Override + public void run(TestResult result) { + super.run(result); + } + + @Override + public void runTest(Test test, TestResult result) { + super.runTest(test, result); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit/testsetup/SmokeSuite.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/testsetup/SmokeSuite.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit/testsetup/SmokeSuite.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/testsetup/SmokeSuite.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +package test.junit.testsetup; + +import junit.framework.Test; +import junit.framework.TestSuite; + +public class SmokeSuite extends LoggingTestSuite { + public static void main(String[] args) { + junit.textui.TestRunner.run(suite()); + } + + public static Test suite() { + TestSuite suite = new TestSuite("Smoke Test Suite"); + + suite.addTest(LayerATestSuite.suite()); + + return suite; + } + + // public SmokeSuite() + // { + // this("SmokeSuite"); + // } + + public SmokeSuite(String name) { + super(name); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit/testsetup/TestSuiteContainerWrapper.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/testsetup/TestSuiteContainerWrapper.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit/testsetup/TestSuiteContainerWrapper.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit/testsetup/TestSuiteContainerWrapper.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,40 @@ +package test.junit.testsetup; + +import junit.extensions.TestSetup; +import junit.framework.TestSuite; +import org.testng.internal.objects.InstanceCreator; + +public class TestSuiteContainerWrapper extends TestSetup { + private static Data INSTANCE = null; + private static TestSuite _test = null; + private static Class dataImpl = null; + + public TestSuiteContainerWrapper(TestSuite testSuite, Class dataImpl) { + super(testSuite); + _test = testSuite; + TestSuiteContainerWrapper.dataImpl = dataImpl; + } + + public static Data getData() { + return INSTANCE; + } + + @Override + protected void setUp() throws Exception { + System.out.println("setup"); + INSTANCE = InstanceCreator.newInstance(dataImpl); + } + + @Override + protected void tearDown() throws Exception { + System.out.println("teardown"); + + INSTANCE = null; + + System.out.println( + _test.countTestCases() + + " test cases defined by \"" + + _test.getName() + + "\" were executed."); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit4/BeforeClassJUnit4Sample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit4/BeforeClassJUnit4Sample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit4/BeforeClassJUnit4Sample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit4/BeforeClassJUnit4Sample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package test.junit4; + +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +public class BeforeClassJUnit4Sample { + + @BeforeClass + public static void before() { + throw new IllegalArgumentException("before failed"); + } + + @AfterClass + public static void after() { + // throw new IllegalArgumentException("after failed"); + } + + @Test + public void myTest() { + System.out.println("yay!"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit4/ClassRuleJUnit4Sample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit4/ClassRuleJUnit4Sample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit4/ClassRuleJUnit4Sample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit4/ClassRuleJUnit4Sample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +package test.junit4; + +import org.junit.ClassRule; +import org.junit.Test; +import org.junit.rules.ExternalResource; + +public class ClassRuleJUnit4Sample { + + @ClassRule + public static ExternalResource resource = + new ExternalResource() { + @Override + protected void before() throws Throwable { + throw new IllegalArgumentException("before"); + } + + @Override + protected void after() { + throw new IllegalArgumentException("after"); + } + }; + + @Test + public void myTest() { + System.out.println("yay!"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit4/InheritedTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit4/InheritedTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit4/InheritedTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit4/InheritedTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,4 @@ +package test.junit4; + +/** @author lukas */ +public class InheritedTest extends JUnit4Sample1 {} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit4/JUnit4Child.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit4/JUnit4Child.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit4/JUnit4Child.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit4/JUnit4Child.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.junit4; + +import org.junit.runners.Suite; + +/** @author lukas */ +@Suite.SuiteClasses({JUnit4Sample1.class}) +public class JUnit4Child extends JUnit4SampleSuite { + public static final String[] EXPECTED = {"t1"}; +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit4/JUnit4ParameterizedTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit4/JUnit4ParameterizedTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit4/JUnit4ParameterizedTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit4/JUnit4ParameterizedTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,54 @@ +package test.junit4; + +import java.util.Arrays; +import java.util.Collection; +import org.junit.Assert; +import org.junit.Assume; +import org.junit.Ignore; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.junit.runners.Parameterized.Parameters; + +@RunWith(Parameterized.class) +public class JUnit4ParameterizedTest { + + public static final String[] EXPECTED = {"t2[0]", "t2[1]", "t4[0]"}; + public static final String[] SKIPPED = {"t3[0]", "t3[1]", "ta[0]", "ta[1]"}; + public static final String[] FAILED = {"t4[1]", "tf[0]", "tf[1]"}; + + private int param; + + @Parameters + public static Collection data() { + return Arrays.asList(new Object[][] {{1}, {5}}); + } + + public JUnit4ParameterizedTest(int param) { + this.param = param; + } + + @Test + public void t2() {} + + @Test + @Ignore + public void t3() {} + + @Test + public void t4() { + if (param == 5) { + Assert.fail("a test"); + } + } + + @Test + public void tf() { + Assert.fail("a test"); + } + + @Test + public void ta() { + Assume.assumeTrue(false); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit4/JUnit4Sample1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit4/JUnit4Sample1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit4/JUnit4Sample1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit4/JUnit4Sample1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,10 @@ +package test.junit4; + +import org.junit.Test; + +/** @author lukas */ +public class JUnit4Sample1 { + + @Test + public void t1() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit4/JUnit4Sample2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit4/JUnit4Sample2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit4/JUnit4Sample2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit4/JUnit4Sample2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,34 @@ +package test.junit4; + +import org.junit.Assert; +import org.junit.Assume; +import org.junit.Ignore; +import org.junit.Test; + +/** @author lukas */ +public class JUnit4Sample2 { + + public static final String[] EXPECTED = {"t2", "t4"}; + public static final String[] SKIPPED = {"t3", "ta"}; + public static final String[] FAILED = {"tf"}; + + @Test + public void t2() {} + + @Test + @Ignore + public void t3() {} + + @Test + public void t4() {} + + @Test + public void tf() { + Assert.fail("a test"); + } + + @Test + public void ta() { + Assume.assumeTrue(false); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit4/JUnit4SampleSuite.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit4/JUnit4SampleSuite.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit4/JUnit4SampleSuite.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit4/JUnit4SampleSuite.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package test.junit4; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +/** @author lukas */ +@RunWith(Suite.class) +@Suite.SuiteClasses({JUnit4Sample1.class, JUnit4Sample2.class}) +public class JUnit4SampleSuite { + + public static final String[] EXPECTED = {"t1", "t2", "t4"}; + public static final String[] SKIPPED = {"t3", "ta"}; + public static final String[] FAILED = {"tf"}; +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit4/listeners/Issue323JUnitInvocationListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit4/listeners/Issue323JUnitInvocationListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit4/listeners/Issue323JUnitInvocationListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit4/listeners/Issue323JUnitInvocationListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,21 @@ +package test.junit4.listeners; + +import java.util.ArrayList; +import java.util.List; +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.ITestResult; + +public class Issue323JUnitInvocationListener implements IInvokedMethodListener { + public static List messages = new ArrayList<>(); + + @Override + public void beforeInvocation(IInvokedMethod method, ITestResult testResult) { + messages.add("beforeInvocation"); + } + + @Override + public void afterInvocation(IInvokedMethod method, ITestResult testResult) { + messages.add("afterInvocation"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit4/listeners/Issue323TestRunner.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit4/listeners/Issue323TestRunner.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit4/listeners/Issue323TestRunner.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit4/listeners/Issue323TestRunner.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,21 @@ +package test.junit4.listeners; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.ITestNGListener; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class Issue323TestRunner extends SimpleBaseTest { + @Test + public void testMethod() { + TestNG testng = create(Issue323TestSample.class); + Issue323JUnitInvocationListener listener = new Issue323JUnitInvocationListener(); + testng.addListener((ITestNGListener) listener); + testng.setJUnit(true); + testng.run(); + assertThat(Issue323JUnitInvocationListener.messages) + .containsExactly("beforeInvocation", "afterInvocation"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit4/listeners/Issue323TestSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit4/listeners/Issue323TestSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junit4/listeners/Issue323TestSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junit4/listeners/Issue323TestSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ +package test.junit4.listeners; + +import org.junit.Test; + +public class Issue323TestSample { + @Test + public void testMethod() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junitreports/Issue1262TestSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junitreports/Issue1262TestSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junitreports/Issue1262TestSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junitreports/Issue1262TestSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ +package test.junitreports; + +import org.testng.annotations.Test; + +public class Issue1262TestSample { + + @Test(priority = 3) + public void testRoles003_Post() {} + + @Test(priority = 4) + public void testRoles004_Post() {} + + @Test(priority = 1) + public void testRoles001_Post() {} + + @Test(priority = 2) + public void testRoles002_Post() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junitreports/JUnitReportsTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junitreports/JUnitReportsTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junitreports/JUnitReportsTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junitreports/JUnitReportsTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,218 @@ +package test.junitreports; + +import static javax.xml.XMLConstants.W3C_XML_SCHEMA_NS_URI; +import static org.assertj.core.api.Assertions.assertThat; +import static org.testng.Assert.*; +import static test.junitreports.TestClassContainerForGithubIssue1265.*; + +import com.beust.jcommander.internal.Lists; +import java.io.File; +import java.io.IOException; +import java.nio.file.Path; +import java.util.Arrays; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathFactory; +import org.testng.ITestNGListener; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.collections.Maps; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import org.w3c.dom.Document; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; +import org.xml.sax.helpers.DefaultHandler; +import test.SimpleBaseTest; +import test.TestHelper; +import test.junitreports.issue2124.TestClassSample; +import test.junitreports.issue993.SampleTestClass; + +public class JUnitReportsTest extends SimpleBaseTest { + + private static final String TESTS = "tests"; + private static final String ERRORS = "errors"; + private static final String FAILURES = "failures"; + private static final String IGNORED = "ignored"; + private static final String SKIPPED = "skipped"; + private static final String JUNIT_XSD = "jenkins-junit.xsd"; + private static String clazz = SimpleTestSample.class.getName(); + private static List testcaseList = + Arrays.asList( + Testcase.newInstance("childTest", clazz, SKIPPED), + Testcase.newInstance("masterTest", clazz, "error"), + Testcase.newInstance("masterTest", clazz, "failure"), + Testcase.newInstance("iShouldNeverBeExecuted", clazz, SKIPPED), + Testcase.newInstance("iShouldNeverBeExecuted", clazz, IGNORED)); + + @Test + public void testJUnitXMLReporter() throws IOException { + runTest(2, 0, 1, 1, 0, new LocalJUnitXMLReporter(), false); + } + + @Test + public void testJUnitReportReporter() throws IOException { + runTest(3, 1, 0, 0, 2, new LocalJUnitReportReporter(), true); + } + + @Test + public void testJUnitReportReporterWithMultipleClasses() throws IOException { + Path outputDir = TestHelper.createRandomDirectory(); + Class[] classes = new Class[] {FirstTest.class, SecondTest.class, ThirdTest.class}; + Map, Map> mapping = Maps.newHashMap(); + mapping.put(FirstTest.class, createMapFor(2, 1)); + mapping.put(SecondTest.class, createMapFor(1, 0)); + mapping.put(ThirdTest.class, createMapFor(1, 0)); + + TestNG tng = createTests(outputDir, "suite", classes); + LocalJUnitReportReporter reportReporter = new LocalJUnitReportReporter(); + tng.addListener(reportReporter); + tng.run(); + for (Class clazz : classes) { + Testsuite suite = reportReporter.getTestsuite(clazz.getName()); + Map attributes = mapping.get(clazz); + assertEquals(suite.getName(), clazz.getName(), "Suite Name validation."); + assertEquals(suite.getTests(), attributes.get(TESTS).intValue(), " count validation."); + assertEquals( + suite.getErrors(), attributes.get(ERRORS).intValue(), "errored count validation."); + assertEquals( + suite.getIgnored(), attributes.get(IGNORED).intValue(), "ignored count validation."); + assertEquals( + suite.getFailures(), attributes.get(FAILURES).intValue(), "failure count validation."); + assertEquals( + suite.getSkipped(), attributes.get(SKIPPED).intValue(), "skipped count validation."); + } + } + + @Test + public void testTestCaseOrderingInJUnitReportReporterWhenPrioritiesDefined() throws IOException { + Path outputDir = TestHelper.createRandomDirectory(); + TestNG tng = createTests(outputDir, "suite", Issue1262TestSample.class); + LocalJUnitReportReporter reportReporter = new LocalJUnitReportReporter(); + tng.addListener(reportReporter); + tng.run(); + Testsuite suite = reportReporter.getTestsuite(Issue1262TestSample.class.getName()); + List expected = + new LinkedList() { + { + add("testRoles001_Post"); + add("testRoles002_Post"); + add("testRoles003_Post"); + add("testRoles004_Post"); + } + }; + List actual = Lists.newLinkedList(); + for (Testcase testcase : suite.getTestcase()) { + actual.add(testcase.getName().trim()); + } + assertEquals(actual, expected); + } + + @Test + public void testEnsureTestnameDoesnotAcceptNullValues() throws IOException { + Path outputDir = TestHelper.createRandomDirectory(); + TestNG tng = createTests(outputDir, "suite", SampleTestClass.class); + LocalJUnitReportReporter reportReporter = new LocalJUnitReportReporter(); + tng.addListener(reportReporter); + tng.run(); + Testsuite suite = reportReporter.getTestsuite(SampleTestClass.class.getName()); + Testcase testcase = suite.getTestcase().get(0); + String actual = testcase.getName(); + assertEquals(actual, "Test_001"); + } + + @Test + public void ensureTestReportContainsValidSysOutContent() throws Exception { + Path outputDir = TestHelper.createRandomDirectory(); + TestNG tng = createTests(outputDir, "suite", TestClassSample.class); + tng.setUseDefaultListeners(true); + tng.run(); + DocumentBuilder builder = getJUnitDocumentBuilder(); + String name = "TEST-" + TestClassSample.class.getName(); + File file = + new File( + outputDir.toFile().getAbsolutePath() + + File.separator + + "junitreports" + + File.separator + + name + + ".xml"); + Document doc = builder.parse(file); + XPath xPath = XPathFactory.newInstance().newXPath(); + String expression = "//testsuite/system-out"; + String data = (String) xPath.compile(expression).evaluate(doc, XPathConstants.STRING); + assertThat(data.trim()).isEqualTo(TestClassSample.MESSAGE_1 + "\n" + TestClassSample.MESSAGE_2); + } + + private DocumentBuilder getJUnitDocumentBuilder() + throws SAXException, ParserConfigurationException { + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + SchemaFactory xsdFactory = SchemaFactory.newInstance(W3C_XML_SCHEMA_NS_URI); + Schema schema = xsdFactory.newSchema(new File(getPathToResource(JUNIT_XSD))); + factory.setSchema(schema); + DocumentBuilder builder = factory.newDocumentBuilder(); + builder.setErrorHandler( + new DefaultHandler() { + @Override + public void error(SAXParseException e) { + fail("Test Report Parse Error", e); + } + }); + return builder; + } + + private static Map createMapFor(int testCount, int skipped) { + Map map = Maps.newHashMap(); + map.put(TESTS, testCount); + map.put(ERRORS, 0); + map.put(IGNORED, 0); + map.put(FAILURES, 0); + map.put(SKIPPED, skipped); + return map; + } + + private void runTest( + int tests, + int errors, + int ignored, + int failures, + int skipped, + ITestNGListener reporter, + boolean useClazzAsSuiteName) + throws IOException { + Path outputDir = TestHelper.createRandomDirectory(); + XmlSuite xmlSuite = createXmlSuite("suite"); + XmlTest xmlTest = createXmlTest(xmlSuite, "test"); + createXmlClass(xmlTest, SimpleTestSample.class); + TestNG tng = create(outputDir, xmlSuite); + TestsuiteRetriever reportReporter = (TestsuiteRetriever) reporter; + tng.addListener(reporter); + tng.run(); + String suitename = SimpleTestSample.class.getName(); + if (!useClazzAsSuiteName) { + suitename = xmlTest.getName(); + } + Testsuite suite = reportReporter.getTestsuite(suitename); + assertEquals(suite.getName(), suitename, "Suite Name validation."); + assertEquals(suite.getTests(), tests, " count validation."); + assertEquals(suite.getErrors(), errors, "errored count validation."); + assertEquals(suite.getIgnored(), ignored, "ignored count validation."); + assertEquals(suite.getFailures(), failures, "failure count validation."); + assertEquals(suite.getSkipped(), skipped, "skipped count validation."); + assertEquals(suite.getTestcase().size(), 3, "test case count validation."); + List actualTestcases = suite.getTestcase(); + for (Testcase actualTestcase : actualTestcases) { + assertTrue( + testcaseList.contains(actualTestcase), + "Validation of " + actualTestcase.getName() + " " + "presence."); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junitreports/LocalJUnitReportReporter.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junitreports/LocalJUnitReportReporter.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junitreports/LocalJUnitReportReporter.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junitreports/LocalJUnitReportReporter.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,31 @@ +package test.junitreports; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; +import org.testng.ISuite; +import org.testng.reporters.JUnitReportReporter; +import org.testng.xml.XmlSuite; + +public class LocalJUnitReportReporter extends JUnitReportReporter implements TestsuiteRetriever { + private List testsuites = new ArrayList<>(); + + @Override + public void generateReport( + List xmlSuites, List suites, String defaultOutputDirectory) { + super.generateReport(xmlSuites, suites, defaultOutputDirectory); + String dir = defaultOutputDirectory + File.separator + "junitreports"; + File directory = new File(dir); + File[] files = directory.listFiles((dir1, name) -> name.endsWith(".xml")); + testsuites.addAll(LocalJUnitXMLReporter.getSuites(files)); + } + + public Testsuite getTestsuite(String name) { + for (Testsuite suite : testsuites) { + if (suite.getName().equals(name)) { + return suite; + } + } + return null; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junitreports/LocalJUnitXMLReporter.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junitreports/LocalJUnitXMLReporter.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junitreports/LocalJUnitXMLReporter.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junitreports/LocalJUnitXMLReporter.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,45 @@ +package test.junitreports; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.util.ArrayList; +import java.util.List; +import org.testng.ITestContext; +import org.testng.reporters.JUnitXMLReporter; + +public class LocalJUnitXMLReporter extends JUnitXMLReporter implements TestsuiteRetriever { + private List testsuites = new ArrayList<>(); + + protected void generateReport(ITestContext context) { + super.generateReport(context); + String dir = context.getOutputDirectory(); + File directory = new File(dir); + File[] files = directory.listFiles((dir1, name) -> name.endsWith(".xml")); + testsuites.addAll(getSuites(files)); + } + + public Testsuite getTestsuite(String name) { + for (Testsuite suite : testsuites) { + if (suite.getName().equals(name)) { + return suite; + } + } + return null; + } + + static List getSuites(File[] files) { + List testsuites = new ArrayList<>(); + if (files != null) { + for (File file : files) { + TestsuiteXmlParser parser = new TestsuiteXmlParser(); + try { + testsuites.add(parser.parse("", new FileInputStream(file), false)); + } catch (FileNotFoundException e) { + e.printStackTrace(); + } + } + } + return testsuites; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junitreports/SimpleTestSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junitreports/SimpleTestSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junitreports/SimpleTestSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junitreports/SimpleTestSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package test.junitreports; + +import org.testng.annotations.Test; + +public class SimpleTestSample { + + @Test(enabled = false) + public void iShouldNeverBeExecuted() {} + + @Test + public void masterTest() { + throw new IllegalStateException("Simulating a llegal state."); + } + + @Test(dependsOnMethods = "masterTest") + public void childTest() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junitreports/TestClassContainerForGithubIssue1265.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junitreports/TestClassContainerForGithubIssue1265.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junitreports/TestClassContainerForGithubIssue1265.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junitreports/TestClassContainerForGithubIssue1265.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,47 @@ +package test.junitreports; + +import static org.testng.Assert.assertEquals; + +import org.testng.annotations.AfterSuite; +import org.testng.annotations.BeforeSuite; +import org.testng.annotations.Test; + +public class TestClassContainerForGithubIssue1265 { + public abstract static class ParentTest { + + @BeforeSuite + public synchronized void startEverything() throws Exception {} + + @AfterSuite + public synchronized void shutdownContainer() throws Exception {} + } + + public static class FirstTest extends ParentTest { + + @Test + public void should_pass() { + assertEquals("abc", "abc"); + } + + @Test(enabled = false) + public void should_be_ignored() { + assertEquals("abcd", "abc"); + } + } + + public static class SecondTest extends ParentTest { + + @Test + public void should_pass_second() { + assertEquals("abc", "abc"); + } + } + + public static class ThirdTest extends ParentTest { + + @Test + public void should_pass_third() { + assertEquals("abc", "abc"); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junitreports/TestSuiteHandler.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junitreports/TestSuiteHandler.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junitreports/TestSuiteHandler.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junitreports/TestSuiteHandler.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,52 @@ +package test.junitreports; + +import java.util.Arrays; +import java.util.List; +import java.util.Stack; +import org.xml.sax.Attributes; +import org.xml.sax.SAXException; +import org.xml.sax.helpers.DefaultHandler; + +public class TestSuiteHandler extends DefaultHandler { + private static List tags = Arrays.asList("error", "skipped", "ignored", "failure"); + private Testsuite testsuite = new Testsuite(); + private Stack elementStack = new Stack(); + private Stack testcaseStack = new Stack<>(); + + @Override + public void startElement(String uri, String localName, String qName, Attributes attributes) + throws SAXException { + this.elementStack.push(qName); + if ("testsuite".equals(qName)) { + if (attributes != null) { + testsuite.init(attributes); + } + } + if ("testcase".equals(qName)) { + Testcase testcase = new Testcase(); + if (attributes != null) { + testcase.init(attributes); + } + testcaseStack.push(testcase); + } + if (tags.contains(qName)) { + Testcase testcase = testcaseStack.pop(); + String innerTag = qName; + testcase.setInnerTagType(innerTag); + testcaseStack.push(testcase); + } + } + + @Override + public void endElement(String uri, String localName, String qName) throws SAXException { + elementStack.pop(); + if ("testcase".equals(qName)) { + Testcase testcase = testcaseStack.pop(); + testsuite.addTestcase(testcase); + } + } + + public Testsuite getTestsuite() { + return testsuite; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junitreports/Testcase.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junitreports/Testcase.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junitreports/Testcase.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junitreports/Testcase.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,87 @@ +package test.junitreports; + +import org.xml.sax.Attributes; + +public class Testcase { + private String name; + private String classname; + private String innerTagType; + + public String getName() { + return name; + } + + public String getClassname() { + return classname; + } + + public String getInnerTagType() { + return innerTagType; + } + + public void setInnerTagType(String innerTagType) { + this.innerTagType = innerTagType; + } + + public void init(Attributes attributes) { + String value = attributes.getValue("name"); + if (value != null) { + this.name = value; + } + value = attributes.getValue("classname"); + if (value != null) { + this.classname = value; + } + } + + @Override + public String toString() { + return "Testcase{" + + "name='" + + name + + '\'' + + ", classname='" + + classname + + '\'' + + ", innerTagType='" + + innerTagType + + '\'' + + '}'; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + Testcase testcase = (Testcase) o; + + if (!name.equals(testcase.name)) { + return false; + } + if (!classname.equals(testcase.classname)) { + return false; + } + return innerTagType.equals(testcase.innerTagType); + } + + @Override + public int hashCode() { + int result = name.hashCode(); + result = 31 * result + classname.hashCode(); + result = 31 * result + innerTagType.hashCode(); + return result; + } + + public static Testcase newInstance(String name, String classname, String innerTagType) { + Testcase testcase = new Testcase(); + testcase.name = name; + testcase.classname = classname; + testcase.innerTagType = innerTagType; + return testcase; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junitreports/Testsuite.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junitreports/Testsuite.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junitreports/Testsuite.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junitreports/Testsuite.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,96 @@ +package test.junitreports; + +import java.util.LinkedList; +import java.util.List; +import org.xml.sax.Attributes; + +public class Testsuite { + + public String getName() { + return name; + } + + public int getTests() { + return tests; + } + + public int getIgnored() { + return ignored; + } + + public int getFailures() { + return failures; + } + + public int getSkipped() { + return skipped; + } + + public int getErrors() { + return errors; + } + + public List getTestcase() { + return testcase; + } + + public void addTestcase(Testcase testcase) { + this.testcase.add(testcase); + } + + public void init(Attributes attributes) { + String value = attributes.getValue("name"); + if (value != null) { + this.name = value; + } + value = attributes.getValue("tests"); + if (value != null) { + this.tests = Integer.parseInt(value); + } + value = attributes.getValue("ignored"); + if (value != null) { + this.ignored = Integer.parseInt(value); + } + value = attributes.getValue("failures"); + if (value != null) { + this.failures = Integer.parseInt(value); + } + value = attributes.getValue("skipped"); + if (value != null) { + this.skipped = Integer.parseInt(value); + } + value = attributes.getValue("errors"); + if (value != null) { + this.errors = Integer.parseInt(value); + } + } + + @Override + public String toString() { + return "Testsuite{" + + "name='" + + name + + '\'' + + ", tests=" + + tests + + ", ignored=" + + ignored + + ", failures=" + + failures + + ", skipped=" + + skipped + + ", errors=" + + errors + + ", testcase=" + + testcase + + '}'; + } + + private String name; + private int tests; + private int ignored; + private int failures; + private int skipped; + private int errors; + private List testcase = new LinkedList<>(); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junitreports/TestsuiteRetriever.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junitreports/TestsuiteRetriever.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junitreports/TestsuiteRetriever.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junitreports/TestsuiteRetriever.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,5 @@ +package test.junitreports; + +public interface TestsuiteRetriever { + Testsuite getTestsuite(String name); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junitreports/TestsuiteXmlParser.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junitreports/TestsuiteXmlParser.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junitreports/TestsuiteXmlParser.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junitreports/TestsuiteXmlParser.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,22 @@ +package test.junitreports; + +import java.io.IOException; +import java.io.InputStream; +import org.testng.TestNGException; +import org.testng.xml.XMLParser; +import org.xml.sax.SAXException; + +public class TestsuiteXmlParser extends XMLParser { + + @Override + public Testsuite parse(String filePath, InputStream is, boolean loadClasses) + throws TestNGException { + TestSuiteHandler handler = new TestSuiteHandler(); + try { + super.parse(is, handler); + return handler.getTestsuite(); + } catch (SAXException | IOException e) { + throw new TestNGException(e); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junitreports/issue2124/TestClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junitreports/issue2124/TestClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junitreports/issue2124/TestClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junitreports/issue2124/TestClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.junitreports.issue2124; + +import org.testng.Reporter; +import org.testng.annotations.Test; + +public class TestClassSample { + + public static final String MESSAGE_1 = "Teenage Mutant Ninja Turtles"; + public static final String MESSAGE_2 = "Teenage Mutant Ninja Turtles: Out of the Shadows"; + + @Test + public void testReporter() { + Reporter.log(MESSAGE_1, true); + Reporter.log(MESSAGE_2, true); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junitreports/issue993/SampleTestClass.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junitreports/issue993/SampleTestClass.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/junitreports/issue993/SampleTestClass.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/junitreports/issue993/SampleTestClass.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,30 @@ +package test.junitreports.issue993; + +import java.lang.reflect.Method; +import org.testng.ITest; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class SampleTestClass implements ITest { + + private String testName; + + @BeforeMethod + public void setTestName(Method method, Object[] testData) { + testName = (String) testData[0]; + } + + @Test(dataProvider = "DP") + public void Test_001(String param) {} + + @DataProvider(name = "DP") + public Object[][] getData() { + return new Object[][] {{null}}; + } + + @Override + public String getTestName() { + return testName; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/justin/BaseTestCase.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/justin/BaseTestCase.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/justin/BaseTestCase.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/justin/BaseTestCase.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,49 @@ +package test.justin; + +import org.testng.annotations.Test; + +/** @author Justin Lee Date: Aug 15, 2004 */ +@Test +public abstract class BaseTestCase { + protected static final String TEST_PASSWORD = "testPassword"; + + public BaseTestCase() { + init(); + } + + public BaseTestCase(String name) { + this(); + } + + private void init() { + setSessionUser(null); + } + + protected void commit() {} + + protected void tearDown() throws Exception { + commit(); + } + + protected Object createCustomer() throws Exception { + return null; + } + + protected Object createProject() throws Exception { + return null; + } + + protected Object createTimeEntry() throws Exception { + return null; + } + + protected Object createUser(String name) throws Exception { + return null; + } + + protected Object createUserGroup() throws Exception { + return null; + } + + protected void setSessionUser(Object user) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/justin/MonthTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/justin/MonthTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/justin/MonthTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/justin/MonthTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package test.justin; + +import java.text.ParseException; +import org.testng.annotations.Test; + +/** + * Created Jul 10, 2005 + * + * @author Justin Lee + */ +public class MonthTest extends BaseTestCase { + public MonthTest() {} + + public MonthTest(String name) { + super(name); + } + + @Test(groups = {"bean-tests"}) + public void july2005() throws ParseException {} + + @Test + public void weekendDay() throws ParseException {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/AggregateSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/AggregateSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/AggregateSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/AggregateSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.listeners; + +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +@Listeners(L2.class) +public class AggregateSampleTest extends BaseAggregate { + static int m_count = 0; + + public static void incrementCount() { + m_count++; + } + + @Test + public void f() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/AlterSuiteListenerTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/AlterSuiteListenerTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/AlterSuiteListenerTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/AlterSuiteListenerTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,141 @@ +package test.listeners; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Optional; +import org.testng.*; +import org.testng.annotations.Test; +import org.testng.internal.collections.Pair; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.SimpleBaseTest; + +public class AlterSuiteListenerTest extends SimpleBaseTest { + + public static final String ALTER_SUITE_LISTENER = "AlterSuiteListener"; + + @Test + public void executionListenerWithXml() { + XmlSuite suite = + runTest(AlterSuiteListener1SampleTest.class, AlterSuiteNameListener.class.getName()) + .second(); + Assert.assertEquals(suite.getName(), AlterSuiteNameListener.class.getSimpleName()); + } + + @Test + public void executionListenerWithoutListener() { + XmlSuite suite = runTest(AlterSuiteListener1SampleTest.class).second(); + Assert.assertEquals(suite.getName(), ALTER_SUITE_LISTENER); + } + + @Test + public void executionListenerWithXml2() { + XmlSuite suite = + runTest(AlterSuiteListener1SampleTest.class, AlterXmlTestsInSuiteListener.class.getName()) + .second(); + Assert.assertEquals(suite.getTests().size(), 2); + } + + @Test(description = "GITHUB-2469") + public void executionListenerWithXml3() { + Pair retObjects = + runTest( + AlterSuiteListener1SampleTest.class, + AlterXmlTestWithParameterInSuiteListener.class.getName(), + AlteredXmlSuiteReadListener.class.getName()); + TestNG tng = retObjects.first(); + XmlSuite suite = retObjects.second(); + Assert.assertEquals(suite.getTests().size(), 2); + List listeners = + Optional.ofNullable(tng.getSuiteListeners()).orElse(new ArrayList<>()); + Assert.assertFalse(listeners.isEmpty()); + for (ISuiteListener iSuiteListener : listeners) { + if (iSuiteListener instanceof AlteredXmlSuiteReadListener) { + AlteredXmlSuiteReadListener alteredXmlSuiteReadListener = + (AlteredXmlSuiteReadListener) iSuiteListener; + XmlSuite xmlSuite = alteredXmlSuiteReadListener.currentSuiteOnStart.getXmlSuite(); + List tests = xmlSuite.getTests(); + int i = 1; + for (XmlTest xmlTest : tests) { + Assert.assertEquals(xmlTest.getParameter("param"), String.valueOf(i)); + i++; + } + } + } + } + + private Pair runTest(Class listenerClass, String... listenerNames) { + XmlSuite s = createXmlSuite(ALTER_SUITE_LISTENER); + createXmlTest(s, "Test", listenerClass.getName()); + + for (String listenerName : listenerNames) { + s.addListener(listenerName); + } + TestNG tng = create(); + tng.setXmlSuites(Arrays.asList(s)); + tng.run(); + Pair returnObj = new Pair<>(tng, s); + return returnObj; + } + + public static class AlterSuiteListener1SampleTest { + @Test + public void foo() {} + } + + public static class AlterSuiteNameListener implements IAlterSuiteListener { + + @Override + public void alter(List suites) { + XmlSuite suite = suites.get(0); + suite.setName(getClass().getSimpleName()); + } + } + + public static class AlterXmlTestsInSuiteListener implements IAlterSuiteListener { + + @Override + public void alter(List suites) { + XmlSuite suite = suites.get(0); + List tests = suite.getTests(); + XmlTest test = tests.get(0); + XmlTest anotherTest = new XmlTest(suite); + anotherTest.setName("foo"); + anotherTest.setClasses(test.getClasses()); + } + } + + public static class AlterXmlTestWithParameterInSuiteListener implements IAlterSuiteListener { + + @Override + public void alter(List suites) { + XmlSuite suite = suites.get(0); + List tests = suite.getTests(); + XmlTest test = tests.get(0); + + List newXmlTests = new ArrayList<>(); + XmlTest newXmlTest = (XmlTest) test.clone(); + newXmlTest.setName("name_1"); + newXmlTest.addParameter("param", "1"); + newXmlTests.add(newXmlTest); + + newXmlTest = (XmlTest) test.clone(); + newXmlTest.setName("name_2"); + newXmlTest.addParameter("param", "2"); + newXmlTests.add(newXmlTest); + + suite.setTests(newXmlTests); + } + } + + public static class AlteredXmlSuiteReadListener implements ISuiteListener { + + public ISuite currentSuiteOnStart; + + @Override + public void onStart(ISuite suite) { + currentSuiteOnStart = suite; + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/BaseAggregate.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/BaseAggregate.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/BaseAggregate.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/BaseAggregate.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,6 @@ +package test.listeners; + +import org.testng.annotations.Listeners; + +@Listeners(L1.class) +public class BaseAggregate {} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/BaseListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/BaseListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/BaseListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/BaseListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,31 @@ +package test.listeners; + +import org.testng.ITestContext; +import org.testng.ITestListener; +import org.testng.ITestResult; + +public class BaseListener implements ITestListener { + + @Override + public void onTestStart(ITestResult result) { + AggregateSampleTest.incrementCount(); + } + + @Override + public void onTestSuccess(ITestResult result) {} + + @Override + public void onTestFailure(ITestResult result) {} + + @Override + public void onTestSkipped(ITestResult result) {} + + @Override + public void onTestFailedButWithinSuccessPercentage(ITestResult result) {} + + @Override + public void onStart(ITestContext context) {} + + @Override + public void onFinish(ITestContext context) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/BaseWithListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/BaseWithListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/BaseWithListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/BaseWithListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.listeners; + +import org.testng.annotations.Listeners; + +@Listeners(value = {L3.class, SuiteListener.class, MyInvokedMethodListener.class}) +class BaseWithListener { + static int m_count = 0; + + public static void incrementCount() { + m_count++; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ClassListenerSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ClassListenerSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ClassListenerSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ClassListenerSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package test.listeners; + +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +@Listeners(MyClassListener.class) +public class ClassListenerSample { + + @Test + public void test() {} + + @Test + public void test2() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ConfigurationListenerFailSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ConfigurationListenerFailSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ConfigurationListenerFailSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ConfigurationListenerFailSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.listeners; + +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class ConfigurationListenerFailSampleTest { + + @BeforeMethod + public void bmShouldFail() { + throw new RuntimeException(); + } + + @Test + public void f() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ConfigurationListenerSkipSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ConfigurationListenerSkipSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ConfigurationListenerSkipSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ConfigurationListenerSkipSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ +package test.listeners; + +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class ConfigurationListenerSkipSampleTest { + + @BeforeMethod + public void bmShouldFail() { + throw new RuntimeException(); + } + + @BeforeMethod(dependsOnMethods = "bmShouldFail") + public void bm() {} + + @Test + public void f() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ConfigurationListenerSucceedSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ConfigurationListenerSucceedSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ConfigurationListenerSucceedSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ConfigurationListenerSucceedSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,13 @@ +package test.listeners; + +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class ConfigurationListenerSucceedSampleTest { + + @BeforeMethod + public void bmShouldSucceed() {} + + @Test + public void f() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ConfigurationListenerTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ConfigurationListenerTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ConfigurationListenerTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ConfigurationListenerTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,61 @@ +package test.listeners; + +import org.testng.Assert; +import org.testng.IConfigurationListener; +import org.testng.ITestResult; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class ConfigurationListenerTest extends SimpleBaseTest { + + public static class CL implements IConfigurationListener { + + private static int m_status = 0; + + @Override + public void beforeConfiguration(ITestResult tr) { + m_status += 1; + } + + @Override + public void onConfigurationSuccess(ITestResult itr) { + m_status += 3; + } + + @Override + public void onConfigurationFailure(ITestResult itr) { + m_status += 5; + } + + @Override + public void onConfigurationSkip(ITestResult itr) { + m_status += 7; + } + } + + private void runTest(Class cls, int expected) { + TestNG tng = create(cls); + CL listener = new CL(); + CL.m_status = 0; + tng.addListener(listener); + tng.run(); + + Assert.assertEquals(CL.m_status, expected); + } + + @Test + public void shouldSucceed() { + runTest(ConfigurationListenerSucceedSampleTest.class, 1 + 3); + } + + @Test + public void shouldFail() { + runTest(ConfigurationListenerFailSampleTest.class, 1 + 5); + } + + @Test + public void shouldSkip() { + runTest(ConfigurationListenerSkipSampleTest.class, 1 + 5 + 7); // fail + skip + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/Derived1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/Derived1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/Derived1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/Derived1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ +package test.listeners; + +import org.testng.annotations.Test; + +class Derived1 extends BaseWithListener { + @Test + public void t() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/Derived2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/Derived2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/Derived2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/Derived2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ +package test.listeners; + +import org.testng.annotations.Test; + +class Derived2 extends BaseWithListener { + @Test + public void s() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/Derived3.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/Derived3.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/Derived3.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/Derived3.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.listeners; + +import org.testng.annotations.Test; + +class Derived3 extends BaseWithListener { + @Test + public void r() {} + + @Test + public void r1() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/EndMillisShouldNotBeZeroTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/EndMillisShouldNotBeZeroTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/EndMillisShouldNotBeZeroTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/EndMillisShouldNotBeZeroTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,47 @@ +package test.listeners; + +import org.testng.Assert; +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.ITestResult; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; +import test.listeners.EndMillisShouldNotBeZeroTest.MyInvokedMethodListener; + +@Listeners(MyInvokedMethodListener.class) +public class EndMillisShouldNotBeZeroTest { + private static long m_end; + + public static class MyInvokedMethodListener implements IInvokedMethodListener { + + @Override + public void beforeInvocation(IInvokedMethod method, ITestResult testResult) {} + + @Override + public void afterInvocation(IInvokedMethod method, ITestResult testResult) { + m_end = testResult.getEndMillis(); + } + } + + @BeforeClass + public void bm() { + m_end = 0; + } + + @Test + public void f1() { + try { + Thread.sleep(1); + } catch (InterruptedException handled) { + Thread.currentThread().interrupt(); + } + } + + @Test( + description = "Make sure that ITestResult#getEndMillis is properly set", + dependsOnMethods = "f1") + public void f2() { + Assert.assertTrue(m_end > 0); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ExecutionListener1SampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ExecutionListener1SampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ExecutionListener1SampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ExecutionListener1SampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ +package test.listeners; + +import org.testng.annotations.Test; + +public class ExecutionListener1SampleTest { + @Test + public void f() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ExecutionListener2SampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ExecutionListener2SampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ExecutionListener2SampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ExecutionListener2SampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,10 @@ +package test.listeners; + +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +@Listeners(ExecutionListenerTest.ExecutionListener.class) +public class ExecutionListener2SampleTest { + @Test + public void f() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ExecutionListener3SampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ExecutionListener3SampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ExecutionListener3SampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ExecutionListener3SampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ +package test.listeners; + +import org.testng.annotations.Test; + +public class ExecutionListener3SampleTest { + @Test + public void f() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ExecutionListenerAndSuiteListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ExecutionListenerAndSuiteListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ExecutionListenerAndSuiteListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ExecutionListenerAndSuiteListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,32 @@ +package test.listeners; + +import java.util.Locale; +import org.testng.IExecutionListener; +import org.testng.ISuite; +import org.testng.ISuiteListener; + +public class ExecutionListenerAndSuiteListener implements ISuiteListener, IExecutionListener { + + private String testString; + private static String tmp; + + @Override + public void onExecutionStart() { + testString = "initialized"; + } + + @Override + public void onExecutionFinish() {} + + @Override + public void onStart(ISuite suite) { + tmp = testString.toUpperCase(Locale.ROOT); + } + + @Override + public void onFinish(ISuite suite) {} + + public static String getTmpString() { + return tmp; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ExecutionListenerAndSuiteListenerTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ExecutionListenerAndSuiteListenerTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ExecutionListenerAndSuiteListenerTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ExecutionListenerAndSuiteListenerTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,22 @@ +package test.listeners; + +import static org.testng.Assert.assertEquals; + +import java.util.List; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import test.SimpleBaseTest; + +public class ExecutionListenerAndSuiteListenerTest extends SimpleBaseTest { + + @Test + public void executionListenerAndSuiteListenerTest() { + String suiteFile = getPathToResource("executionlistenersingletoncheck/parent.xml"); + List suites = getSuites(suiteFile); + TestNG testng = new TestNG(); + testng.setXmlSuites(suites); + testng.run(); + assertEquals(ExecutionListenerAndSuiteListener.getTmpString(), "INITIALIZED"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ExecutionListenerTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ExecutionListenerTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ExecutionListenerTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ExecutionListenerTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,64 @@ +package test.listeners; + +import java.util.Arrays; +import org.testng.Assert; +import org.testng.IExecutionListener; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.SimpleBaseTest; + +public class ExecutionListenerTest extends SimpleBaseTest { + + public static class ExecutionListener implements IExecutionListener { + public static boolean m_start = false; + public static boolean m_finish = false; + + @Override + public void onExecutionStart() { + m_start = true; + } + + @Override + public void onExecutionFinish() { + m_finish = true; + } + } + + @Test + public void executionListenerWithXml() { + runTest(ExecutionListener1SampleTest.class, true /* add listener */, true /* should run */); + } + + @Test + public void executionListenerWithoutListener() { + runTest( + ExecutionListener1SampleTest.class, + false /* don't add listener */, + false /* should not run */); + } + + @Test + public void executionListenerAnnotation() { + runTest( + ExecutionListener2SampleTest.class, false /* don't add listener */, true /* should run */); + } + + private void runTest(Class listenerClass, boolean addListener, boolean expected) { + XmlSuite s = createXmlSuite("ExecutionListener"); + XmlTest t = createXmlTest(s, "Test", listenerClass.getName()); + + if (addListener) { + s.addListener(ExecutionListener.class.getName()); + } + TestNG tng = create(); + tng.setXmlSuites(Arrays.asList(s)); + ExecutionListener.m_start = false; + ExecutionListener.m_finish = false; + tng.run(); + + Assert.assertEquals(ExecutionListener.m_start, expected); + Assert.assertEquals(ExecutionListener.m_finish, expected); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/FailingSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/FailingSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/FailingSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/FailingSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.listeners; + +import org.testng.annotations.AfterMethod; +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +@Listeners(SimpleListener.class) +public class FailingSampleTest { + @AfterMethod + public void am() { + SimpleListener.m_list.add(6); + } + + @Test + public void a1() { + SimpleListener.m_list.add(4); + throw new RuntimeException(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/GitHub911Listener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/GitHub911Listener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/GitHub911Listener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/GitHub911Listener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,51 @@ +package test.listeners; + +import org.testng.ITestContext; +import org.testng.ITestListener; +import org.testng.ITestResult; + +public class GitHub911Listener implements ITestListener { + + int onTestStart = 0; + int onTestSuccess = 0; + int onTestFailure = 0; + int onTestSkipped = 0; + int onTestFailedButWithinSuccessPercentage = 0; + int onStart = 0; + int onFinish = 0; + + @Override + public void onTestStart(ITestResult result) { + onTestStart++; + } + + @Override + public void onTestSuccess(ITestResult result) { + onTestSuccess++; + } + + @Override + public void onTestFailure(ITestResult result) { + onTestFailure++; + } + + @Override + public void onTestSkipped(ITestResult result) { + onTestSkipped++; + } + + @Override + public void onTestFailedButWithinSuccessPercentage(ITestResult result) { + onTestFailedButWithinSuccessPercentage++; + } + + @Override + public void onStart(ITestContext context) { + onStart++; + } + + @Override + public void onFinish(ITestContext context) { + onFinish++; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/GitHub911Sample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/GitHub911Sample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/GitHub911Sample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/GitHub911Sample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.listeners; + +import org.testng.Assert; +import org.testng.annotations.BeforeSuite; +import org.testng.annotations.Test; + +public class GitHub911Sample { + + @BeforeSuite(alwaysRun = true) + public void setUp() { + Assert.fail(); + } + // TODO check before invocation + + @Test + public void myTest1() {} + + @Test + public void myTest2() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/InterceptorInvokeTwiceSimulateListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/InterceptorInvokeTwiceSimulateListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/InterceptorInvokeTwiceSimulateListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/InterceptorInvokeTwiceSimulateListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,26 @@ +package test.listeners; + +import java.util.List; +import org.testng.IMethodInstance; +import org.testng.IMethodInterceptor; +import org.testng.ITestContext; +import org.testng.ITestListener; + +/** + * This listener is used to trigger the bug 1863: IMethodInterceptor will be invoked twice when + * listener implements both ITestListener and IMethodInterceptor via eclipse execution way + */ +public class InterceptorInvokeTwiceSimulateListener implements ITestListener, IMethodInterceptor { + + private int count = 0; + + @Override + public List intercept(List methods, ITestContext context) { + count++; + return methods; + } + + public int getCount() { + return count; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/L1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/L1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/L1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/L1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,3 @@ +package test.listeners; + +public class L1 extends BaseListener {} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/L2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/L2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/L2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/L2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,3 @@ +package test.listeners; + +public class L2 extends BaseListener {} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/L3.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/L3.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/L3.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/L3.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.listeners; + +import org.testng.ITestResult; +import org.testng.TestListenerAdapter; + +public class L3 extends TestListenerAdapter { + @Override + public void onTestStart(ITestResult result) { + BaseWithListener.incrementCount(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/LListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/LListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/LListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/LListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package test.listeners; + +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.ITestResult; + +public class LListener implements IInvokedMethodListener { + public static boolean invoked = false; + + @Override + public void beforeInvocation(IInvokedMethod method, ITestResult testResult) { + invoked = true; + } + + @Override + public void afterInvocation(IInvokedMethod method, ITestResult testResult) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/LSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/LSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/LSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/LSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.listeners; + +import org.testng.annotations.Test; + +public class LSampleTest { + + @Test + public void dummy() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ListenerAssert.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ListenerAssert.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ListenerAssert.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ListenerAssert.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.listeners; + +import java.util.List; +import org.testng.Assert; +import org.testng.ITestNGListener; + +public final class ListenerAssert { + + private ListenerAssert() {} + + public static void assertListenerType( + List listeners, Class clazz) { + for (ITestNGListener listener : listeners) { + if (clazz.isInstance(listener)) { + return; + } + } + Assert.fail(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ListenerInXmlTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ListenerInXmlTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ListenerInXmlTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ListenerInXmlTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.listeners; + +import java.util.Arrays; +import org.testng.Assert; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class ListenerInXmlTest extends SimpleBaseTest { + + @Test(description = "Make sure that listeners defined in testng.xml are invoked") + public void listenerInXmlShouldBeInvoked() { + TestNG tng = create(); + tng.setTestSuites(Arrays.asList(getPathToResource("listener-in-xml.xml"))); + LListener.invoked = false; + tng.run(); + Assert.assertTrue(LListener.invoked); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ListenerTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ListenerTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ListenerTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ListenerTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,433 @@ +package test.listeners; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.entry; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import org.testng.*; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import org.testng.collections.Lists; +import org.testng.xml.XmlSuite; +import test.SimpleBaseTest; +import test.listeners.github1029.Issue1029InvokedMethodListener; +import test.listeners.github1029.Issue1029SampleTestClassWithDataDrivenMethod; +import test.listeners.github1029.Issue1029SampleTestClassWithFiveInstances; +import test.listeners.github1029.Issue1029SampleTestClassWithFiveMethods; +import test.listeners.github1029.Issue1029SampleTestClassWithOneMethod; +import test.listeners.github1393.Listener1393; +import test.listeners.github2558.CallHolder; +import test.listeners.github2558.ClassMethodListenersHolder; +import test.listeners.github2558.ExecutionListenersHolder; +import test.listeners.github2558.ReportersHolder; +import test.listeners.github2558.SuiteAlterListenersHolder; +import test.listeners.github2558.SuiteListenersHolder; +import test.listeners.github2558.TestClassSamples; +import test.listeners.github2558.TestListenersHolder; +import test.listeners.github956.ListenerFor956; +import test.listeners.github956.TestClassContainer; +import test.listeners.issue1952.TestclassSample; +import test.listeners.issue2043.SampleTestClass; +import test.listeners.issue2043.listeners.FailFastListener; +import test.listeners.issue2055.DynamicTestListener; +import test.listeners.issue2055.TestClassSample; + +public class ListenerTest extends SimpleBaseTest { + + @BeforeMethod + public void bm() { + SimpleListener.m_list = Lists.newArrayList(); + CallHolder.clear(); + } + + @Test( + description = + "Ensure that if a listener is present, we get test(), onSuccess()," + " afterMethod()") + public void listenerShouldBeCalledBeforeConfiguration() { + TestNG tng = create(OrderedListenerSampleTest.class); + tng.run(); + Assert.assertEquals(SimpleListener.m_list, Arrays.asList(1, 2, 3, 4)); + } + + @Test(description = "TESTNG-400: onTestFailure should be called before @AfterMethod") + public void failureBeforeAfterMethod() { + TestNG tng = create(FailingSampleTest.class); + tng.run(); + Assert.assertEquals(SimpleListener.m_list, Arrays.asList(4, 5, 6)); + } + + @Test(description = "Inherited @Listeners annotations should aggregate") + public void aggregateListeners() { + TestNG tng = create(AggregateSampleTest.class); + AggregateSampleTest.m_count = 0; + tng.run(); + Assert.assertEquals(AggregateSampleTest.m_count, 2); + } + + @Test(description = "Should attach only one instance of the same @Listener class per test") + public void shouldAttachOnlyOneInstanceOfTheSameListenerClassPerTest() { + TestNG tng = create(Derived1.class, Derived2.class); + BaseWithListener.m_count = 0; + tng.run(); + Assert.assertEquals(BaseWithListener.m_count, 2); + } + + @Test(description = "@Listeners with an ISuiteListener") + public void suiteListenersShouldWork() { + TestNG tng = create(SuiteListenerSample.class); + SuiteListener.start = 0; + SuiteListener.finish = 0; + tng.run(); + Assert.assertEquals(SuiteListener.start, 1); + Assert.assertEquals(SuiteListener.finish, 1); + } + + @Test(description = "GITHUB-767: ISuiteListener called twice when @Listeners") + public void suiteListenerInListernersAnnotationShouldBeRunOnce() { + TestNG tng = createTests("Suite", SuiteListenerSample2.class); + SuiteListener2.start = 0; + SuiteListener2.finish = 0; + tng.run(); + Assert.assertEquals(SuiteListener2.start, 1); + Assert.assertEquals(SuiteListener2.finish, 1); + } + + @Test(description = "GITHUB-171") + public void suiteListenersShouldBeOnlyRunOnceWithManyTests() { + TestNG tng = createTests("suite", Derived1.class, Derived2.class); + SuiteListener.start = 0; + SuiteListener.finish = 0; + tng.run(); + Assert.assertEquals(SuiteListener.start, 1); + Assert.assertEquals(SuiteListener.finish, 1); + } + + @Test(description = "GITHUB-795") + public void suiteListenersShouldBeOnlyRunOnceWithManyIdenticalTests() { + TestNG tng = createTests("suite", Derived1.class, Derived1.class); + SuiteListener.start = 0; + SuiteListener.finish = 0; + tng.run(); + Assert.assertEquals(SuiteListener.start, 1); + Assert.assertEquals(SuiteListener.finish, 1); + } + + @Test(description = "GITHUB-169") + public void invokedMethodListenersShouldBeOnlyRunOnceWithManyTests() { + TestNG tng = createTests("suite", Derived1.class, Derived2.class); + MyInvokedMethodListener.beforeInvocation.clear(); + MyInvokedMethodListener.afterInvocation.clear(); + tng.run(); + assertThat(MyInvokedMethodListener.beforeInvocation).containsOnly(entry("t", 1), entry("s", 1)); + assertThat(MyInvokedMethodListener.afterInvocation).containsOnly(entry("t", 1), entry("s", 1)); + } + + @Test(description = "GITHUB-154: MethodInterceptor will be called twice") + public void methodInterceptorShouldBeRunOnce() { + TestNG tng = create(SuiteListenerSample.class); + MyMethodInterceptor interceptor = new MyMethodInterceptor(); + tng.addListener(interceptor); + tng.run(); + Assert.assertEquals(interceptor.getCount(), 1); + } + + @Test( + description = + "GITHUB-1863:IMethodInterceptor will be invoked twice when listener implements both ITestListener and IMethodInterceptor via eclipse execution way") + public void + methodInterceptorShouldBeRunOnceWhenCustomisedListenerImplementsITestListenerAndIMethodInterceptor() { + TestNG tng = create(LSampleTest.class); + InterceptorInvokeTwiceSimulateListener interceptor = + new InterceptorInvokeTwiceSimulateListener(); + tng.addListener(interceptor); + tng.run(); + Assert.assertEquals(interceptor.getCount(), 1); + } + + @Test(description = "GITHUB-356: Add listeners for @BeforeClass/@AfterClass") + public void classListenerShouldWork() { + MyClassListener.names.clear(); + TestNG tng = create(Derived1.class, Derived2.class); + MyClassListener listener = new MyClassListener(); + tng.addListener(listener); + TestListenerAdapter adapter = new TestListenerAdapter(); + tng.addListener(adapter); + tng.run(); + assertThat(adapter.getFailedTests()).isEmpty(); + assertThat(adapter.getSkippedTests()).isEmpty(); + assertThat(MyClassListener.names) + .containsExactly( + "BeforeClass=Derived1", + "BeforeMethod=Derived1.t", + "AfterMethod=Derived1.t", + "AfterClass=Derived1", + "BeforeClass=Derived2", + "BeforeMethod=Derived2.s", + "AfterMethod=Derived2.s", + "AfterClass=Derived2"); + } + + @Test + public void classListenerShouldWorkWithManyTestMethods() { + MyClassListener.names.clear(); + TestNG tng = create(Derived3.class); + MyClassListener listener = new MyClassListener(); + tng.addListener(listener); + TestListenerAdapter adapter = new TestListenerAdapter(); + tng.addListener(adapter); + tng.run(); + assertThat(adapter.getFailedTests()).isEmpty(); + assertThat(adapter.getSkippedTests()).isEmpty(); + assertThat(MyClassListener.names) + .containsExactly( + "BeforeClass=Derived3", + "BeforeMethod=Derived3.r", + "AfterMethod=Derived3.r", + "BeforeMethod=Derived3.r1", + "AfterMethod=Derived3.r1", + "AfterClass=Derived3"); + } + + @Test(description = "GITHUB-356: Add listeners for @BeforeClass/@AfterClass") + public void classListenerShouldWorkFromAnnotation() { + MyClassListener.names.clear(); + TestNG tng = create(ClassListenerSample.class); + TestListenerAdapter adapter = new TestListenerAdapter(); + tng.addListener(adapter); + tng.run(); + assertThat(adapter.getFailedTests()).isEmpty(); + assertThat(adapter.getSkippedTests()).isEmpty(); + assertThat(MyClassListener.names) + .containsExactly( + "BeforeClass=ClassListenerSample", + "BeforeMethod=ClassListenerSample.test", + "AfterMethod=ClassListenerSample.test", + "BeforeMethod=ClassListenerSample.test2", + "AfterMethod=ClassListenerSample.test2", + "AfterClass=ClassListenerSample"); + } + + @Test + public void classListenerShouldBeOnlyRunOnce() { + MyClassListener.names.clear(); + TestNG tng = create(Derived3.class); + MyClassListener listener = new MyClassListener(); + tng.addListener(listener); + TestListenerAdapter adapter = new TestListenerAdapter(); + tng.addListener(adapter); + TestAndClassListener tacl = new TestAndClassListener(); + tng.addListener(tacl); + tng.run(); + assertThat(adapter.getFailedTests()).isEmpty(); + assertThat(adapter.getSkippedTests()).isEmpty(); + assertThat(tacl.getBeforeClassCount()).isEqualTo(1); + assertThat(tacl.getAfterClassCount()).isEqualTo(1); + } + + @Test(description = "GITHUB-911: Should not call method listeners for skipped methods") + public void methodListenersShouldNotBeCalledForSkippedMethods() { + GitHub911Listener listener = new GitHub911Listener(); + TestNG tng = create(GitHub911Sample.class); + tng.addListener(listener); + tng.run(); + Assert.assertEquals(listener.onStart, 1); + Assert.assertEquals(listener.onFinish, 1); + Assert.assertEquals(listener.onTestStart, 2); + Assert.assertEquals(listener.onTestSuccess, 0); + Assert.assertEquals(listener.onTestFailure, 0); + Assert.assertEquals(listener.onTestFailedButWithinSuccessPercentage, 0); + Assert.assertEquals(listener.onTestSkipped, 2); + } + + @Test(description = "GITHUB-895: Changing status of test by setStatus of ITestResult") + public void setStatusShouldWorkInListener() { + SetStatusListener listener = new SetStatusListener(); + TestNG tng = create(SetStatusSample.class); + tng.addListener(listener); + tng.run(); + Assert.assertEquals(listener.getContext().getFailedTests().size(), 0); + Assert.assertEquals(listener.getContext().getFailedButWithinSuccessPercentageTests().size(), 0); + Assert.assertEquals(listener.getContext().getSkippedTests().size(), 0); + Assert.assertEquals(listener.getContext().getPassedTests().size(), 1); + } + + @Test( + description = + "GITHUB-1084: Using deprecated addListener methods should not register many times") + public void listenerRegistration() { + MultiListener listener = new MultiListener(); + TestNG tng = create(SimpleSample.class); + // Keep using deprecated addListener methods. It is what the test is testing + tng.addListener((ITestNGListener) listener); + tng.addListener((ITestNGListener) listener); + tng.addListener((ITestNGListener) listener); + tng.run(); + Assert.assertEquals(listener.getOnSuiteStartCount(), 1); + Assert.assertEquals(listener.getOnSuiteFinishCount(), 1); + Assert.assertEquals(listener.getOnTestStartCount(), 1); + Assert.assertEquals(listener.getOnTestFinishCount(), 1); + Assert.assertEquals(listener.getBeforeInvocationCount(), 1); + Assert.assertEquals(listener.getAfterInvocationCount(), 1); + Assert.assertEquals(listener.getOnMethodTestStartCount(), 1); + Assert.assertEquals(listener.getOnMethodTestSuccessCount(), 1); + } + + @Test + public void testListenerCallInvocation() { + XmlSuite suite = + createXmlSuite( + "suite956", + "test956", + TestClassContainer.FirstTestClass.class, + TestClassContainer.SecondTestClass.class); + TestNG tng = create(suite); + ListenerFor956 listener = new ListenerFor956(); + tng.addListener(listener); + tng.run(); + List messages = ListenerFor956.getMessages(); + Assert.assertEquals(messages.size(), 1); + Assert.assertEquals(messages.get(0), "Executing test956"); + } + + @Test(description = "GITHUB-1393: fail a test from onTestStart method") + public void testFailATestFromOnTestStart() { + TestNG tng = create(SimpleSample.class); + TestListenerAdapter adapter = new TestListenerAdapter(); + tng.addListener(adapter); + tng.addListener(new Listener1393()); + tng.run(); + Assert.assertEquals(adapter.getPassedTests().size(), 0); + Assert.assertEquals(adapter.getFailedTests().size(), 1); + } + + @Test(dataProvider = "dp", description = "GITHUB-1029") + public void ensureXmlTestIsNotNull(Class clazz, XmlSuite.ParallelMode mode) { + XmlSuite xmlSuite = createXmlSuite("Suite"); + createXmlTest(xmlSuite, "GITHUB-1029-Test", clazz); + xmlSuite.setParallel(mode); + Issue1029InvokedMethodListener listener = new Issue1029InvokedMethodListener(); + TestNG testng = create(xmlSuite); + testng.addListener(listener); + testng.setThreadCount(10); + testng.setDataProviderThreadCount(10); + testng.run(); + List expected = Collections.nCopies(5, "GITHUB-1029-Test"); + assertThat(listener.getBeforeInvocation()).containsExactlyElementsOf(expected); + assertThat(listener.getAfterInvocation()).containsExactlyElementsOf(expected); + } + + @Test(description = "GITHUB-1952") + public void ensureTimeoutListenerIsInvokedForTimingoutTests() { + TestNG tng = create(TestclassSample.class); + TestListenerAdapter adapter = new TestListenerAdapter(); + tng.addListener(adapter); + tng.run(); + assertThat(adapter.getTimedoutTests()).hasSize(1); + } + + @DataProvider(name = "dp") + public Object[][] getData() { + return new Object[][] { + {Issue1029SampleTestClassWithFiveMethods.class, XmlSuite.ParallelMode.METHODS}, + {Issue1029SampleTestClassWithOneMethod.class, XmlSuite.ParallelMode.METHODS}, + {Issue1029SampleTestClassWithDataDrivenMethod.class, XmlSuite.ParallelMode.METHODS}, + {Issue1029SampleTestClassWithFiveInstances.class, XmlSuite.ParallelMode.INSTANCES} + }; + } + + @Test(description = "GITHUB-2043") + public void runTest() { + TestNG testng = create(SampleTestClass.class); + testng.run(); + assertThat(FailFastListener.msgs) + .containsExactly( + "FailFastListener:afterInvocation", + "FailFastListener:beforeDataProviderExecution", + "FailFastListener:beforeConfiguration"); + } + + @Test(description = "GITHUB-2055") + public void ensureDynamicTestListenerInjection() { + TestNG testng = create(TestClassSample.class); + testng.run(); + assertThat(DynamicTestListener.MSGS).containsExactly("Starting testMethod"); + } + + @Test(description = "GITHUB-2061") + public void ensureDynamicListenerAdditionsDontTriggerConcurrentModificationExceptions() { + TestNG testng = create(test.listeners.issue2061.TestClassSample.class); + testng.run(); + assertThat(testng.getStatus()).isEqualTo(0); + } + + @Test(description = "GITHUB-2558") + public void ensureInsertionOrderIsHonouredByListeners() { + String prefix = "test.listeners.github2558."; + String[] expectedOrder = + new String[] { + prefix + "ExecutionListenersHolder$ExecutionListenerB.onExecutionStart()", + prefix + "ExecutionListenersHolder$ExecutionListenerA.onExecutionStart()", + prefix + "SuiteAlterListenersHolder$SuiteAlterB.alter()", + prefix + "SuiteAlterListenersHolder$SuiteAlterA.alter()", + prefix + "SuiteListenersHolder$SuiteListenerB.onStart()", + prefix + "SuiteListenersHolder$SuiteListenerA.onStart()", + prefix + "TestListenersHolder$TestListenerB.onStart(ctx)", + prefix + "TestListenersHolder$TestListenerA.onStart(ctx)", + prefix + "ClassMethodListenersHolder$ClassMethodListenerB.onBeforeClass()", + prefix + "ClassMethodListenersHolder$ClassMethodListenerA.onBeforeClass()", + prefix + "ClassMethodListenersHolder$ClassMethodListenerB.beforeInvocation()", + prefix + "ClassMethodListenersHolder$ClassMethodListenerA.beforeInvocation()", + prefix + "ClassMethodListenersHolder$ClassMethodListenerA.afterInvocation()", + prefix + "ClassMethodListenersHolder$ClassMethodListenerB.afterInvocation()", + prefix + "ClassMethodListenersHolder$ClassMethodListenerB.onBeforeClass()", + prefix + "ClassMethodListenersHolder$ClassMethodListenerA.onBeforeClass()", + prefix + "ClassMethodListenersHolder$ClassMethodListenerB.onBeforeClass()", + prefix + "ClassMethodListenersHolder$ClassMethodListenerA.onBeforeClass()", + prefix + "ClassMethodListenersHolder$ClassMethodListenerB.beforeInvocation()", + prefix + "ClassMethodListenersHolder$ClassMethodListenerA.beforeInvocation()", + prefix + "ClassMethodListenersHolder$ClassMethodListenerA.afterInvocation()", + prefix + "ClassMethodListenersHolder$ClassMethodListenerB.afterInvocation()", + prefix + "ClassMethodListenersHolder$ClassMethodListenerB.onBeforeClass()", + prefix + "ClassMethodListenersHolder$ClassMethodListenerA.onBeforeClass()", + prefix + "TestListenersHolder$TestListenerA.onFinish(ctx)", + prefix + "TestListenersHolder$TestListenerB.onFinish(ctx)", + prefix + "SuiteListenersHolder$SuiteListenerA.onFinish()", + prefix + "SuiteListenersHolder$SuiteListenerB.onFinish()", + prefix + "ReportersHolder$ReporterB.generateReport()", + prefix + "ReportersHolder$ReporterA.generateReport()", + prefix + "ExecutionListenersHolder$ExecutionListenerA.onExecutionFinish()", + prefix + "ExecutionListenersHolder$ExecutionListenerB.onExecutionFinish()" + }; + List> listeners = + Arrays.asList( + ExecutionListenersHolder.ExecutionListenerB.class, + SuiteAlterListenersHolder.SuiteAlterB.class, + SuiteListenersHolder.SuiteListenerB.class, + TestListenersHolder.TestListenerB.class, + ClassMethodListenersHolder.ClassMethodListenerB.class, + ReportersHolder.ReporterB.class, + ExecutionListenersHolder.ExecutionListenerA.class, + SuiteAlterListenersHolder.SuiteAlterA.class, + SuiteListenersHolder.SuiteListenerA.class, + TestListenersHolder.TestListenerA.class, + ClassMethodListenersHolder.ClassMethodListenerA.class, + ReportersHolder.ReporterA.class); + + XmlSuite xmlSuite = new XmlSuite(); + xmlSuite.setName("Random_Suite"); + listeners.forEach(each -> xmlSuite.addListener(each.getName())); + createXmlTest( + xmlSuite, + "random_test", + TestClassSamples.TestClassSampleA.class, + TestClassSamples.TestClassSampleB.class); + TestNG testng = create(xmlSuite); + testng.setUseDefaultListeners(false); + testng.run(); + List actual = CallHolder.getCalls(); + assertThat(actual).containsExactly(expectedOrder); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ListenersTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ListenersTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ListenersTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ListenersTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,139 @@ +package test.listeners; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import org.testng.TestNG; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import test.SimpleBaseTest; +import test.listeners.issue2638.DummyInvokedMethodListener; +import test.listeners.issue2638.TestClassASample; +import test.listeners.issue2638.TestClassBSample; + +public class ListenersTest extends SimpleBaseTest { + + private static final String[] github2638ExpectedList = + new String[] { + "test.listeners.issue2638.TestClassASample.testMethod", + "test.listeners.issue2638.TestClassBSample.testMethod" + }; + + @Test(description = "GITHUB-2638", dataProvider = "suiteProvider") + public void ensureDuplicateListenersAreNotWiredInAcrossSuites( + XmlSuite xmlSuite, Map expected) { + TestNG testng = create(xmlSuite); + testng.run(); + + assertThat(DummyInvokedMethodListener.getMethods("Container_Suite")) + .containsExactly(expected.get("Container_Suite")); + assertThat(DummyInvokedMethodListener.getMethods("Inner_Suite1")) + .containsExactly(expected.get("Inner_Suite1")); + assertThat(DummyInvokedMethodListener.getMethods("Inner_Suite2")) + .containsExactly(expected.get("Inner_Suite2")); + DummyInvokedMethodListener.reset(); + } + + @DataProvider(name = "suiteProvider") + public Object[][] getSuites() throws IOException { + return new Object[][] { + new Object[] {getNestedSuitesViaXmlFiles(), getExpectations()}, + new Object[] {getNestedSuitesViaApis(), getExpectations()}, + new Object[] {getNestedSuitesViaXmlFilesWithListenerInChildSuite(), getExpectations()}, + new Object[] {getNestedSuitesViaApisWithListenerInChildSuite(), getExpectations()} + }; + } + + private static Map getExpectations() { + Map expected = new HashMap<>(); + expected.put("Container_Suite", new String[] {}); + expected.put("Inner_Suite1", github2638ExpectedList); + expected.put("Inner_Suite2", github2638ExpectedList); + return expected; + } + + private static XmlSuite getNestedSuitesViaXmlFiles() throws IOException { + XmlSuite containerSuite = createXmlSuite("Container_Suite"); + containerSuite.setListeners( + Collections.singletonList(DummyInvokedMethodListener.class.getName())); + + XmlSuite innerSuite1 = createXmlSuite("Inner_Suite1"); + createXmlTest(innerSuite1, "Inner_Test_1", TestClassASample.class); + createXmlTest(innerSuite1, "Inner_Test_2", TestClassBSample.class); + Path s1 = Files.createTempFile("testng", ".xml"); + Files.write(s1, Collections.singletonList(innerSuite1.toXml())); + + XmlSuite innerSuite2 = createXmlSuite("Inner_Suite2"); + createXmlTest(innerSuite2, "Inner_Test_1", TestClassASample.class); + createXmlTest(innerSuite2, "Inner_Test_2", TestClassBSample.class); + Path s2 = Files.createTempFile("testng", ".xml"); + Files.write(s2, Collections.singletonList(innerSuite2.toXml())); + + containerSuite.setSuiteFiles( + Arrays.asList(s1.toFile().getAbsolutePath(), s2.toFile().getAbsolutePath())); + return containerSuite; + } + + private static XmlSuite getNestedSuitesViaXmlFilesWithListenerInChildSuite() throws IOException { + XmlSuite containerSuite = createXmlSuite("Container_Suite"); + + XmlSuite innerSuite1 = createXmlSuite("Inner_Suite1"); + innerSuite1.setListeners(Collections.singletonList(DummyInvokedMethodListener.class.getName())); + createXmlTest(innerSuite1, "Inner_Test_1", TestClassASample.class); + createXmlTest(innerSuite1, "Inner_Test_2", TestClassBSample.class); + Path s1 = Files.createTempFile("testng", ".xml"); + Files.write(s1, Collections.singletonList(innerSuite1.toXml())); + + XmlSuite innerSuite2 = createXmlSuite("Inner_Suite2"); + createXmlTest(innerSuite2, "Inner_Test_1", TestClassASample.class); + createXmlTest(innerSuite2, "Inner_Test_2", TestClassBSample.class); + Path s2 = Files.createTempFile("testng", ".xml"); + Files.write(s2, Collections.singletonList(innerSuite2.toXml())); + + containerSuite.setSuiteFiles( + Arrays.asList(s1.toFile().getAbsolutePath(), s2.toFile().getAbsolutePath())); + return containerSuite; + } + + private static XmlSuite getNestedSuitesViaApisWithListenerInChildSuite() { + XmlSuite containerSuite = createXmlSuite("Container_Suite"); + + XmlSuite innerSuite1 = createXmlSuite("Inner_Suite1"); + innerSuite1.setListeners(Collections.singletonList(DummyInvokedMethodListener.class.getName())); + createXmlTest(innerSuite1, "Inner_Test_1", TestClassASample.class); + createXmlTest(innerSuite1, "Inner_Test_2", TestClassBSample.class); + containerSuite.getChildSuites().add(innerSuite1); + innerSuite1.setParentSuite(containerSuite); + + XmlSuite innerSuite2 = createXmlSuite("Inner_Suite2"); + createXmlTest(innerSuite2, "Inner_Test_1", TestClassASample.class); + createXmlTest(innerSuite2, "Inner_Test_2", TestClassBSample.class); + containerSuite.getChildSuites().add(innerSuite2); + innerSuite2.setParentSuite(containerSuite); + return containerSuite; + } + + private static XmlSuite getNestedSuitesViaApis() { + XmlSuite containerSuite = createXmlSuite("Container_Suite"); + containerSuite.setListeners( + Collections.singletonList(DummyInvokedMethodListener.class.getName())); + XmlSuite innerSuite1 = createXmlSuite("Inner_Suite1"); + createXmlTest(innerSuite1, "Inner_Test_1", TestClassASample.class); + createXmlTest(innerSuite1, "Inner_Test_2", TestClassBSample.class); + XmlSuite innerSuite2 = createXmlSuite("Inner_Suite2"); + createXmlTest(innerSuite2, "Inner_Test_1", TestClassASample.class); + createXmlTest(innerSuite2, "Inner_Test_2", TestClassBSample.class); + containerSuite.getChildSuites().add(innerSuite1); + containerSuite.getChildSuites().add(innerSuite2); + innerSuite1.setParentSuite(containerSuite); + innerSuite2.setParentSuite(containerSuite); + return containerSuite; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/MultiListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/MultiListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/MultiListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/MultiListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,153 @@ +package test.listeners; + +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.ISuite; +import org.testng.ISuiteListener; +import org.testng.ITestContext; +import org.testng.ITestResult; +import org.testng.internal.IResultListener; + +public class MultiListener implements ISuiteListener, IResultListener, IInvokedMethodListener { + + private int onConfigurationSuccessCount = 0; + private int onConfigurationFailureCount = 0; + private int onConfigurationSkipCount = 0; + private int beforeInvocationCount = 0; + private int afterInvocationCount = 0; + private int onSuiteStartCount = 0; + private int onSuiteFinishCount = 0; + private int onMethodTestStartCount = 0; + private int onMethodTestSuccessCount = 0; + private int onMethodTestFailureCount = 0; + private int onMethodTestSkippedCount = 0; + private int onMethodTestFailedButWithinSuccessPercentageCount = 0; + private int onTestStartCount = 0; + private int onTestFinishCount = 0; + + @Override + public void onConfigurationSuccess(ITestResult itr) { + onConfigurationSuccessCount++; + } + + @Override + public void onConfigurationFailure(ITestResult itr) { + onConfigurationFailureCount++; + } + + @Override + public void onConfigurationSkip(ITestResult itr) { + onConfigurationSkipCount++; + } + + @Override + public void beforeInvocation(IInvokedMethod method, ITestResult testResult) { + beforeInvocationCount++; + } + + @Override + public void afterInvocation(IInvokedMethod method, ITestResult testResult) { + afterInvocationCount++; + } + + @Override + public void onStart(ISuite suite) { + onSuiteStartCount++; + } + + @Override + public void onFinish(ISuite suite) { + onSuiteFinishCount++; + } + + @Override + public void onTestStart(ITestResult result) { + onMethodTestStartCount++; + } + + @Override + public void onTestSuccess(ITestResult result) { + onMethodTestSuccessCount++; + } + + @Override + public void onTestFailure(ITestResult result) { + onMethodTestFailureCount++; + } + + @Override + public void onTestSkipped(ITestResult result) { + onMethodTestSkippedCount++; + } + + @Override + public void onTestFailedButWithinSuccessPercentage(ITestResult result) { + onMethodTestFailedButWithinSuccessPercentageCount++; + } + + @Override + public void onStart(ITestContext context) { + onTestStartCount++; + } + + @Override + public void onFinish(ITestContext context) { + onTestFinishCount++; + } + + public int getOnConfigurationSuccessCount() { + return onConfigurationSuccessCount; + } + + public int getOnConfigurationFailureCount() { + return onConfigurationFailureCount; + } + + public int getOnConfigurationSkipCount() { + return onConfigurationSkipCount; + } + + public int getBeforeInvocationCount() { + return beforeInvocationCount; + } + + public int getAfterInvocationCount() { + return afterInvocationCount; + } + + public int getOnSuiteStartCount() { + return onSuiteStartCount; + } + + public int getOnSuiteFinishCount() { + return onSuiteFinishCount; + } + + public int getOnMethodTestStartCount() { + return onMethodTestStartCount; + } + + public int getOnMethodTestSuccessCount() { + return onMethodTestSuccessCount; + } + + public int getOnMethodTestFailureCount() { + return onMethodTestFailureCount; + } + + public int getOnMethodTestSkippedCount() { + return onMethodTestSkippedCount; + } + + public int getOnMethodTestFailedButWithinSuccessPercentageCount() { + return onMethodTestFailedButWithinSuccessPercentageCount; + } + + public int getOnTestStartCount() { + return onTestStartCount; + } + + public int getOnTestFinishCount() { + return onTestFinishCount; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/MyClassListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/MyClassListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/MyClassListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/MyClassListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,37 @@ +package test.listeners; + +import java.util.ArrayList; +import java.util.List; +import org.testng.IClassListener; +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.ITestClass; +import org.testng.ITestResult; +import org.testng.internal.BaseTestMethod; + +public class MyClassListener implements IClassListener, IInvokedMethodListener { + + public static final List names = new ArrayList<>(); + + @Override + public void onBeforeClass(ITestClass testClass) { + names.add("BeforeClass=" + testClass.getRealClass().getSimpleName()); + } + + @Override + public void onAfterClass(ITestClass testClass) { + names.add("AfterClass=" + testClass.getRealClass().getSimpleName()); + } + + @Override + public void beforeInvocation(IInvokedMethod method, ITestResult testResult) { + BaseTestMethod m = (BaseTestMethod) method.getTestMethod(); + names.add("BeforeMethod=" + m.getSimpleName()); + } + + @Override + public void afterInvocation(IInvokedMethod method, ITestResult testResult) { + BaseTestMethod m = (BaseTestMethod) method.getTestMethod(); + names.add("AfterMethod=" + m.getSimpleName()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/MyInvokedMethodListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/MyInvokedMethodListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/MyInvokedMethodListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/MyInvokedMethodListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,32 @@ +package test.listeners; + +import java.util.HashMap; +import java.util.Map; +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.ITestResult; + +public class MyInvokedMethodListener implements IInvokedMethodListener { + + public static Map beforeInvocation = new HashMap<>(); + public static Map afterInvocation = new HashMap<>(); + + @Override + public void beforeInvocation(IInvokedMethod method, ITestResult testResult) { + increments(beforeInvocation, method); + } + + @Override + public void afterInvocation(IInvokedMethod method, ITestResult testResult) { + increments(afterInvocation, method); + } + + private static void increments(Map map, IInvokedMethod method) { + String stringValue = method.getTestMethod().getMethodName(); + Integer count = map.get(stringValue); + if (count == null) { + count = 0; + } + map.put(stringValue, count + 1); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/MyMethodInterceptor.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/MyMethodInterceptor.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/MyMethodInterceptor.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/MyMethodInterceptor.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,21 @@ +package test.listeners; + +import java.util.List; +import org.testng.IMethodInstance; +import org.testng.IMethodInterceptor; +import org.testng.ITestContext; + +public class MyMethodInterceptor implements IMethodInterceptor { + + private int count = 0; + + @Override + public List intercept(List methods, ITestContext context) { + count++; + return methods; + } + + public int getCount() { + return count; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/OrderedListenerSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/OrderedListenerSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/OrderedListenerSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/OrderedListenerSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,26 @@ +package test.listeners; + +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +@Listeners(SimpleListener.class) +public class OrderedListenerSampleTest extends SimpleBaseTest { + + @BeforeMethod + public void bm() { + SimpleListener.m_list.add(1); + } + + @Test + public void f() { + SimpleListener.m_list.add(2); + } + + @AfterMethod + public void am() { + SimpleListener.m_list.add(4); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ResultContextListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ResultContextListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ResultContextListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ResultContextListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,29 @@ +package test.listeners; + +import org.testng.ITestContext; +import org.testng.ITestListener; +import org.testng.ITestResult; + +public class ResultContextListener implements ITestListener { + + public static boolean contextProvided = false; + + public void onTestStart(ITestResult result) { + ITestContext context = result.getTestContext(); + if (context != null) { + contextProvided = true; + } + } + + public void onTestSuccess(ITestResult result) {} + + public void onTestFailure(ITestResult result) {} + + public void onTestSkipped(ITestResult result) {} + + public void onTestFailedButWithinSuccessPercentage(ITestResult result) {} + + public void onStart(ITestContext context) {} + + public void onFinish(ITestContext context) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ResultContextListenerSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ResultContextListenerSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ResultContextListenerSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ResultContextListenerSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.listeners; + +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +@Listeners(ResultContextListener.class) +public class ResultContextListenerSample { + + @Test + public void f() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ResultContextTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ResultContextTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ResultContextTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ResultContextTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package test.listeners; + +import org.testng.Assert; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class ResultContextTest extends SimpleBaseTest { + + @Test + public void testResultContext() { + TestNG tng = create(ResultContextListenerSample.class); + tng.run(); + Assert.assertTrue( + ResultContextListener.contextProvided, "Test context was not provided to the listener"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ResultEndMillisTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ResultEndMillisTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ResultEndMillisTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ResultEndMillisTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,21 @@ +package test.listeners; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.ITestNGListener; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; +import test.sample.Sample1; + +public class ResultEndMillisTest extends SimpleBaseTest { + + @Test + public void endMillisShouldBeNonNull() { + TestNG tng = create(Sample1.class); + tng.addListener((ITestNGListener) new ResultListener()); + tng.run(); + + assertThat(ResultListener.m_end > 0).isTrue(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ResultListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ResultListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ResultListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ResultListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,72 @@ +package test.listeners; + +import org.testng.ITestContext; +import org.testng.ITestResult; +import org.testng.internal.IResultListener2; + +public class ResultListener implements IResultListener2 { + + public static long m_end = 0; + + @Override + public void onTestStart(ITestResult result) { + // TODO Auto-generated method stub + + } + + @Override + public void beforeConfiguration(ITestResult tr) {} + + @Override + public void onTestSuccess(ITestResult result) { + m_end = result.getEndMillis(); + } + + @Override + public void onTestFailure(ITestResult result) { + // TODO Auto-generated method stub + + } + + @Override + public void onTestSkipped(ITestResult result) { + // TODO Auto-generated method stub + + } + + @Override + public void onTestFailedButWithinSuccessPercentage(ITestResult result) { + // TODO Auto-generated method stub + + } + + @Override + public void onStart(ITestContext context) { + // TODO Auto-generated method stub + + } + + @Override + public void onFinish(ITestContext context) { + // TODO Auto-generated method stub + + } + + @Override + public void onConfigurationSuccess(ITestResult itr) { + // TODO Auto-generated method stub + + } + + @Override + public void onConfigurationFailure(ITestResult itr) { + // TODO Auto-generated method stub + + } + + @Override + public void onConfigurationSkip(ITestResult itr) { + // TODO Auto-generated method stub + + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/SetStatusListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/SetStatusListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/SetStatusListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/SetStatusListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,40 @@ +package test.listeners; + +import org.testng.ITestContext; +import org.testng.ITestListener; +import org.testng.ITestResult; + +/** From https://github.com/rajsrivastav1919/TestNGTest */ +public class SetStatusListener implements ITestListener { + + private ITestContext context; + + @Override + public void onTestStart(ITestResult result) {} + + @Override + public void onTestSuccess(ITestResult result) {} + + @Override + public void onTestFailure(ITestResult result) { + result.setStatus(ITestResult.SUCCESS); + } + + @Override + public void onTestSkipped(ITestResult result) {} + + @Override + public void onTestFailedButWithinSuccessPercentage(ITestResult result) {} + + @Override + public void onStart(ITestContext context) {} + + @Override + public void onFinish(ITestContext context) { + this.context = context; + } + + public ITestContext getContext() { + return context; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/SetStatusSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/SetStatusSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/SetStatusSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/SetStatusSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.listeners; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class SetStatusSample { + + @Test + public void aFailingTest() { + Assert.fail("Failing deliberately"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/SimpleListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/SimpleListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/SimpleListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/SimpleListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,21 @@ +package test.listeners; + +import java.util.List; +import org.testng.ITestResult; +import org.testng.TestListenerAdapter; + +public class SimpleListener extends TestListenerAdapter { + public static List m_list; + + @Override + public void onTestSuccess(ITestResult tr) { + m_list.add(3); + super.onTestSuccess(tr); + } + + @Override + public void onTestFailure(ITestResult tr) { + m_list.add(5); + super.onTestSuccess(tr); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/SimpleSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/SimpleSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/SimpleSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/SimpleSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.listeners; + +import org.testng.annotations.Test; + +public class SimpleSample { + + @Test + public void test() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/SuiteAndConfigurationListenerTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/SuiteAndConfigurationListenerTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/SuiteAndConfigurationListenerTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/SuiteAndConfigurationListenerTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,50 @@ +package test.listeners; + +import java.util.concurrent.atomic.AtomicInteger; +import org.testng.Assert; +import org.testng.IConfigurationListener; +import org.testng.ISuite; +import org.testng.ISuiteListener; +import org.testng.ITestResult; +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; +import test.listeners.SuiteAndConfigurationListenerTest.MyListener; + +/** + * Check that if a listener implements IConfigurationListener additionally to ISuiteListener, + * ISuiteListener gets invoked exactly once. + * + * @author Mihails Volkovs + */ +@Listeners(MyListener.class) +public class SuiteAndConfigurationListenerTest { + public static class MyListener implements ISuiteListener, IConfigurationListener { + + private static volatile AtomicInteger started = new AtomicInteger(0); + + public MyListener() {} + + @Override + public void onStart(ISuite suite) { + started.incrementAndGet(); + } + + @Override + public void onFinish(ISuite suite) {} + + @Override + public void onConfigurationSuccess(ITestResult itr) {} + + @Override + public void onConfigurationFailure(ITestResult itr) {} + + @Override + public void onConfigurationSkip(ITestResult itr) {} + } + + @Test + public void bothListenersShouldRun() { + Assert.assertEquals( + MyListener.started.get(), 1, "ISuiteListener was not invoked exactly once:"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/SuiteAndInvokedMethodListenerTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/SuiteAndInvokedMethodListenerTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/SuiteAndInvokedMethodListenerTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/SuiteAndInvokedMethodListenerTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,50 @@ +package test.listeners; + +import org.testng.Assert; +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.ISuite; +import org.testng.ISuiteListener; +import org.testng.ITestResult; +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; +import test.listeners.SuiteAndInvokedMethodListenerTest.MyListener; + +/** + * Make sure that if a listener implements both IInvokedMethodListener and ISuiteListener, both + * listeners get invoked. + * + * @author Cedric Beust + */ +@Listeners(MyListener.class) +public class SuiteAndInvokedMethodListenerTest { + public static class MyListener implements IInvokedMethodListener, ISuiteListener { + + private static boolean m_before = false; + private static boolean m_start = false; + + public MyListener() {} + + @Override + public void beforeInvocation(IInvokedMethod method, ITestResult result) { + m_before = true; + } + + @Override + public void afterInvocation(IInvokedMethod method, ITestResult result) {} + + @Override + public void onStart(ISuite suite) { + m_start = true; + } + + @Override + public void onFinish(ISuite suite) {} + } + + @Test + public void bothListenersShouldRun() { + Assert.assertTrue(MyListener.m_before, "IInvokedMethodListener was not invoked"); + Assert.assertTrue(MyListener.m_start, "ISuiteListener was not invoked"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/SuiteListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/SuiteListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/SuiteListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/SuiteListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.listeners; + +import org.testng.ISuite; +import org.testng.ISuiteListener; + +public class SuiteListener implements ISuiteListener { + public static int start = 0; + public static int finish = 0; + + @Override + public void onFinish(ISuite suite) { + finish++; + } + + @Override + public void onStart(ISuite suite) { + start++; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/SuiteListener2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/SuiteListener2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/SuiteListener2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/SuiteListener2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,73 @@ +package test.listeners; + +import java.lang.reflect.Constructor; +import java.lang.reflect.Method; +import java.util.List; +import org.testng.*; +import org.testng.annotations.ITestAnnotation; + +public class SuiteListener2 + implements IAnnotationTransformer, + IInvokedMethodListener, + ITestListener, + ISuiteListener, + IExecutionListener, + IMethodInterceptor { + public static int start = 0; + public static int finish = 0; + + @Override + public void onFinish(ISuite suite) { + finish++; + } + + @Override + public void onStart(ISuite suite) { + start++; + } + + @Override + public void beforeInvocation(IInvokedMethod method, ITestResult testResult) {} + + @Override + public void afterInvocation(IInvokedMethod method, ITestResult testResult) {} + + @Override + public void transform( + ITestAnnotation annotation, + Class testClass, + Constructor testConstructor, + Method testMethod) {} + + @Override + public void onExecutionStart() {} + + @Override + public void onExecutionFinish() {} + + @Override + public List intercept(List methods, ITestContext context) { + return methods; + } + + @Override + public void onTestStart(ITestResult result) {} + + @Override + public void onTestSuccess(ITestResult result) {} + + @Override + public void onTestFailure(ITestResult result) {} + + @Override + public void onTestSkipped(ITestResult result) {} + + @Override + public void onTestFailedButWithinSuccessPercentage(ITestResult result) {} + + @Override + public void onStart(ITestContext context) {} + + @Override + public void onFinish(ITestContext context) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/SuiteListenerSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/SuiteListenerSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/SuiteListenerSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/SuiteListenerSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.listeners; + +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +@Listeners(SuiteListener.class) +public class SuiteListenerSample { + + @Test + public void foo() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/SuiteListenerSample2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/SuiteListenerSample2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/SuiteListenerSample2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/SuiteListenerSample2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.listeners; + +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +@Listeners(SuiteListener2.class) +public class SuiteListenerSample2 { + + @Test + public void foo() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/TestAndClassListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/TestAndClassListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/TestAndClassListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/TestAndClassListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,52 @@ +package test.listeners; + +import org.testng.IClassListener; +import org.testng.ITestClass; +import org.testng.ITestContext; +import org.testng.ITestListener; +import org.testng.ITestResult; + +public class TestAndClassListener implements ITestListener, IClassListener { + + private int beforeClassCount = 0; + private int afterClassCount = 0; + + @Override + public void onBeforeClass(ITestClass testClass) { + beforeClassCount++; + } + + @Override + public void onAfterClass(ITestClass testClass) { + afterClassCount++; + } + + @Override + public void onTestStart(ITestResult result) {} + + @Override + public void onTestSuccess(ITestResult result) {} + + @Override + public void onTestFailure(ITestResult result) {} + + @Override + public void onTestSkipped(ITestResult result) {} + + @Override + public void onTestFailedButWithinSuccessPercentage(ITestResult result) {} + + @Override + public void onStart(ITestContext context) {} + + @Override + public void onFinish(ITestContext context) {} + + public int getBeforeClassCount() { + return beforeClassCount; + } + + public int getAfterClassCount() { + return afterClassCount; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1029/Issue1029InvokedMethodListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1029/Issue1029InvokedMethodListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1029/Issue1029InvokedMethodListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1029/Issue1029InvokedMethodListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,34 @@ +package test.listeners.github1029; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.ITestResult; +import org.testng.xml.XmlTest; + +public class Issue1029InvokedMethodListener implements IInvokedMethodListener { + private List beforeInvocation = Collections.synchronizedList(new ArrayList()); + private List afterInvocation = Collections.synchronizedList(new ArrayList()); + + @Override + public void beforeInvocation(IInvokedMethod method, ITestResult testResult) { + XmlTest xmlTest = method.getTestMethod().getXmlTest(); + beforeInvocation.add(xmlTest.getName()); + } + + @Override + public void afterInvocation(IInvokedMethod method, ITestResult testResult) { + XmlTest xmlTest = method.getTestMethod().getXmlTest(); + afterInvocation.add(xmlTest.getName()); + } + + public List getAfterInvocation() { + return afterInvocation; + } + + public List getBeforeInvocation() { + return beforeInvocation; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1029/Issue1029SampleTestClassWithDataDrivenMethod.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1029/Issue1029SampleTestClassWithDataDrivenMethod.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1029/Issue1029SampleTestClassWithDataDrivenMethod.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1029/Issue1029SampleTestClassWithDataDrivenMethod.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package test.listeners.github1029; + +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class Issue1029SampleTestClassWithDataDrivenMethod { + @Test(dataProvider = "dp") + public void a(int i) { + Assert.assertTrue(i > 0); + } + + @DataProvider(name = "dp", parallel = true) + public Object[][] getData() { + return new Object[][] {{1}, {2}, {3}, {4}, {5}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1029/Issue1029SampleTestClassWithFiveInstances.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1029/Issue1029SampleTestClassWithFiveInstances.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1029/Issue1029SampleTestClassWithFiveInstances.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1029/Issue1029SampleTestClassWithFiveInstances.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,26 @@ +package test.listeners.github1029; + +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +public class Issue1029SampleTestClassWithFiveInstances { + + private int i; + + @Factory(dataProvider = "dp") + public Issue1029SampleTestClassWithFiveInstances(int i) { + this.i = i; + } + + @Test + public void a() { + Assert.assertTrue(i > 0); + } + + @DataProvider(name = "dp") + public static Object[][] getData() { + return new Object[][] {{1}, {2}, {3}, {4}, {5}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1029/Issue1029SampleTestClassWithFiveMethods.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1029/Issue1029SampleTestClassWithFiveMethods.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1029/Issue1029SampleTestClassWithFiveMethods.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1029/Issue1029SampleTestClassWithFiveMethods.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,31 @@ +package test.listeners.github1029; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class Issue1029SampleTestClassWithFiveMethods { + @Test + public void a() { + Assert.assertTrue(true); + } + + @Test + public void b() { + Assert.assertTrue(true); + } + + @Test + public void c() { + Assert.assertTrue(true); + } + + @Test + public void d() { + Assert.assertTrue(true); + } + + @Test + public void e() { + Assert.assertTrue(true); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1029/Issue1029SampleTestClassWithOneMethod.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1029/Issue1029SampleTestClassWithOneMethod.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1029/Issue1029SampleTestClassWithOneMethod.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1029/Issue1029SampleTestClassWithOneMethod.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.listeners.github1029; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class Issue1029SampleTestClassWithOneMethod { + @Test(invocationCount = 5, threadPoolSize = 10) + public void a() { + Assert.assertTrue(true); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1130/ASample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1130/ASample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1130/ASample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1130/ASample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.listeners.github1130; + +import org.testng.annotations.Test; + +public class ASample extends BaseSample { + + @Test + public void testA1() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1130/BSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1130/BSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1130/BSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1130/BSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.listeners.github1130; + +import org.testng.annotations.Test; + +public class BSample extends BaseSample { + + @Test + public void testB1() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1130/BaseSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1130/BaseSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1130/BaseSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1130/BaseSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,6 @@ +package test.listeners.github1130; + +import org.testng.annotations.Listeners; + +@Listeners(MyListener.class) +public class BaseSample {} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1130/GitHub1130Test.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1130/GitHub1130Test.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1130/GitHub1130Test.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1130/GitHub1130Test.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,40 @@ +package test.listeners.github1130; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.ArrayList; +import org.testng.ITestNGListener; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class GitHub1130Test extends SimpleBaseTest { + + @Test(description = "GITHUB-1130: IClassListener should only be instantiated once") + public void classListenerShouldBeOnlyInstantiatedOnceInMultiTestContext() { + checkGithub1130(createTests("GITHUB-1130", ASample.class, BSample.class)); + } + + @Test + public void classListenerShouldBeOnlyInstantiatedOnce() { + checkGithub1130(create(ASample.class, BSample.class)); + } + + private void checkGithub1130(TestNG tng) { + MyListener.count = 0; + MyListener.beforeSuiteCount = new ArrayList<>(); + MyListener.beforeClassCount = new ArrayList<>(); + TestListenerAdapter adapter = new TestListenerAdapter(); + tng.addListener((ITestNGListener) adapter); + tng.run(); + assertThat(adapter.getFailedTests()).isEmpty(); + assertThat(adapter.getSkippedTests()).isEmpty(); + assertThat(MyListener.beforeSuiteCount.size()).isEqualTo(1); + assertThat(MyListener.beforeClassCount.size()).isEqualTo(2); + assertThat(MyListener.beforeSuiteCount.get(0)) + .isEqualTo(MyListener.beforeClassCount.get(0)) + .isEqualTo(MyListener.beforeClassCount.get(1)); + assertThat(MyListener.count).isEqualTo(1); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1130/MyListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1130/MyListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1130/MyListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1130/MyListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,47 @@ +package test.listeners.github1130; + +import java.util.ArrayList; +import java.util.List; +import org.testng.IClassListener; +import org.testng.ISuite; +import org.testng.ISuiteListener; +import org.testng.ITestClass; +import org.testng.ITestContext; +import org.testng.ITestResult; + +public class MyListener implements ISuiteListener, IClassListener { + + public static int count = 0; + public static List beforeSuiteCount = new ArrayList<>(); + public static List beforeClassCount = new ArrayList<>(); + + public MyListener() { + count++; + } + + public void onStart(ISuite suite) { + beforeSuiteCount.add(this.toString()); + } + + public void onBeforeClass(ITestClass testClass) { + beforeClassCount.add(this.toString()); + } + + public void onTestStart(ITestResult result) {} + + public void onTestSuccess(ITestResult result) {} + + public void onTestFailure(ITestResult result) {} + + public void onTestSkipped(ITestResult result) {} + + public void onTestFailedButWithinSuccessPercentage(ITestResult result) {} + + public void onStart(ITestContext context) {} + + public void onFinish(ITestContext context) {} + + public void onFinish(ISuite suite) {} + + public void onAfterClass(ITestClass testClass) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1284/Listener1284.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1284/Listener1284.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1284/Listener1284.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1284/Listener1284.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,31 @@ +package test.listeners.github1284; + +import java.util.LinkedList; +import java.util.List; +import org.testng.IClassListener; +import org.testng.ITestClass; + +public class Listener1284 implements IClassListener { + private static Listener1284 instance; + static List testList = new LinkedList<>(); + + public Listener1284() { + setInstance(this); + } + + private static void setInstance(Listener1284 newInstance) { + instance = newInstance; + } + + public static Listener1284 getInstance() { + return instance; + } + + public void onBeforeClass(ITestClass iTestClass) { + Listener1284.testList.add(iTestClass.getRealClass().getName() + " - Before Invocation"); + } + + public void onAfterClass(ITestClass iTestClass) { + Listener1284.testList.add(iTestClass.getRealClass().getName() + " - After Invocation"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1284/Sample1284.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1284/Sample1284.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1284/Sample1284.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1284/Sample1284.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,35 @@ +package test.listeners.github1284; + +import java.util.List; +import org.testng.Assert; +import org.testng.annotations.Test; +import org.testng.collections.Lists; + +public class Sample1284 { + @Test + public void testWithNoListener() { + Assert.assertNull(Listener1284.getInstance()); + Assert.assertEquals(Listener1284.testList.size(), 0); + } + + @Test + public void testWithListener() { + Assert.assertNotNull(Listener1284.getInstance()); + Assert.assertEquals(Listener1284.testList.size(), 1); + Assert.assertEquals( + Listener1284.testList.get(0), Sample1284.class.getName() + " - Before Invocation"); + } + + @Test + public void testWithChildListener() { + Assert.assertNotNull(Listener1284.getInstance()); + Assert.assertEquals(Listener1284.testList.size(), 3); + + String beforeInvocation = Sample1284.class.getName() + " - Before Invocation"; + String afterInvocation = Sample1284.class.getName() + " - After Invocation"; + List expectedList = + Lists.newArrayList(beforeInvocation, afterInvocation, beforeInvocation); + + Assert.assertEquals(Listener1284.testList, expectedList); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1284/Sample1284B.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1284/Sample1284B.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1284/Sample1284B.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1284/Sample1284B.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,21 @@ +package test.listeners.github1284; + +import java.util.List; +import org.testng.Assert; +import org.testng.annotations.Test; +import org.testng.collections.Lists; + +public class Sample1284B { + @Test + public void testTheOrderOfInvokedMethods() { + Assert.assertNotNull(Listener1284.getInstance()); + Assert.assertEquals(Listener1284.testList.size(), 5); + + String b1 = Sample1284.class.getName() + " - Before Invocation"; + String a1 = Sample1284.class.getName() + " - After Invocation"; + String b2 = Sample1284B.class.getName() + " - Before Invocation"; + + List expectedList = Lists.newArrayList(b1, a1, b1, a1, b2); + Assert.assertEquals(Listener1284.testList, expectedList); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1284/TestListeners.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1284/TestListeners.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1284/TestListeners.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1284/TestListeners.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,39 @@ +package test.listeners.github1284; + +import java.util.Collections; +import org.testng.Assert; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class TestListeners extends SimpleBaseTest { + + @Test(priority = 1) + public void verifyWithoutListener() { + TestNG testNG = create(); + testNG.setTestSuites( + Collections.singletonList( + getPathToResource("test/listeners/github1284/github1284_nolistener.xml"))); + testNG.run(); + Assert.assertEquals(testNG.getStatus(), 0); + } + + @Test(priority = 2) + public void verifyWithListener() { + TestNG testNG = create(); + testNG.setTestSuites( + Collections.singletonList( + getPathToResource("test/listeners/github1284/github1284_withlistener.xml"))); + testNG.run(); + Assert.assertEquals(testNG.getStatus(), 0); + } + + @Test(priority = 3) + public void verifyWithChildSuite() { + TestNG testNG = create(); + testNG.setTestSuites( + Collections.singletonList(getPathToResource("test/listeners/github1284/github1284.xml"))); + testNG.run(); + Assert.assertEquals(testNG.getStatus(), 0); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1296/GitHub1296Test.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1296/GitHub1296Test.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1296/GitHub1296Test.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1296/GitHub1296Test.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,29 @@ +package test.listeners.github1296; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.entry; + +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import test.SimpleBaseTest; + +public class GitHub1296Test extends SimpleBaseTest { + + @Test(description = "https://github.com/cbeust/testng/issues/1296") + public void test_number_of_call_of_configuration_listener() { + MyConfigurationListener.CALLS.clear(); + XmlSuite suite = createXmlSuite("Tests"); + createXmlTest(suite, "Test version", MyTest.class); + createXmlTest(suite, "Test version 2", MyTest.class); + createXmlTest(suite, "Test version 3", MyTest.class); + TestNG tng = create(suite); + + tng.run(); + + assertThat(MyConfigurationListener.CALLS) + .hasSize(3) + .containsOnly( + entry("Test version", 2), entry("Test version 2", 2), entry("Test version 3", 2)); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1296/MyConfigurationListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1296/MyConfigurationListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1296/MyConfigurationListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1296/MyConfigurationListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,28 @@ +package test.listeners.github1296; + +import java.util.HashMap; +import java.util.Map; +import org.testng.IConfigurationListener; +import org.testng.ITestResult; + +public class MyConfigurationListener implements IConfigurationListener { + + public static final Map CALLS = new HashMap<>(); + + @Override + public void onConfigurationSuccess(ITestResult itr) { + String xmlTestName = itr.getTestContext().getCurrentXmlTest().getName(); + Integer count = CALLS.get(xmlTestName); + if (count == null) { + count = 0; + } + count++; + CALLS.put(xmlTestName, count); + } + + @Override + public void onConfigurationFailure(ITestResult iTestResult) {} + + @Override + public void onConfigurationSkip(ITestResult itr) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1296/MyTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1296/MyTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1296/MyTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1296/MyTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package test.listeners.github1296; + +import static org.testng.Assert.assertTrue; + +import org.testng.annotations.AfterTest; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +@Listeners(MyConfigurationListener.class) +public class MyTest { + + @BeforeTest + public void setUp() {} + + @Test + public void test() { + assertTrue(true); + } + + @AfterTest + public void tearDown() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1319/TestResultInstanceCheckTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1319/TestResultInstanceCheckTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1319/TestResultInstanceCheckTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1319/TestResultInstanceCheckTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.listeners.github1319; + +import org.testng.Assert; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class TestResultInstanceCheckTest extends SimpleBaseTest { + @Test + public void testInstances() { + TestNG tng = create(TestSample.class); + tng.run(); + int hashCode = TestSample.hashcode; + Assert.assertEquals(TestSample.Listener.maps.size(), 6, "Validating the number of instances"); + for (Object object : TestSample.Listener.maps.values()) { + Assert.assertNotNull(object); + Assert.assertEquals(object.hashCode(), hashCode); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1319/TestSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1319/TestSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1319/TestSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1319/TestSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,86 @@ +package test.listeners.github1319; + +import com.google.common.collect.Maps; +import java.util.Map; +import org.testng.*; +import org.testng.annotations.*; + +@Listeners(TestSample.Listener.class) +public class TestSample { + public static int hashcode; + + public TestSample() { + hashcode = hashCode(); + } + + @Test + public void test1() { + Assert.assertTrue(true); + } + + @Test + public void test2() { + Assert.assertTrue(false); + } + + @Test + public void test3() { + throw new SkipException("simulating a skip"); + } + + @AfterClass + public void afterClass() {} + + @AfterTest + public void afterTest() { + throw new RuntimeException("Simulating a failure"); + } + + @AfterSuite + public void afterSuite() { + throw new SkipException("simulating a skip"); + } + + public static class Listener implements IConfigurationListener, ITestListener { + public static Map maps = Maps.newConcurrentMap(); + + public void onConfigurationSuccess(ITestResult itr) { + maps.put(itr.getMethod().getMethodName(), itr.getInstance()); + } + + public void onConfigurationFailure(ITestResult itr) { + maps.put(itr.getMethod().getMethodName(), itr.getInstance()); + } + + public void onConfigurationSkip(ITestResult itr) { + maps.put(itr.getMethod().getMethodName(), itr.getInstance()); + } + + @Override + public void onTestStart(ITestResult result) {} + + @Override + public void onTestSuccess(ITestResult itr) { + maps.put(itr.getMethod().getMethodName(), itr.getInstance()); + } + + @Override + public void onTestFailure(ITestResult itr) { + maps.put(itr.getMethod().getMethodName(), itr.getInstance()); + } + + @Override + public void onTestSkipped(ITestResult itr) { + maps.put(itr.getMethod().getMethodName(), itr.getInstance()); + } + + @Override + public void onTestFailedButWithinSuccessPercentage(ITestResult result) {} + + @Override + public void onStart(ITestContext context) {} + + @Override + public void onFinish(ITestContext context) {} + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1393/Listener1393.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1393/Listener1393.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1393/Listener1393.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1393/Listener1393.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package test.listeners.github1393; + +import org.testng.ITestResult; +import org.testng.TestListenerAdapter; + +public class Listener1393 extends TestListenerAdapter { + + public void onTestStart(ITestResult testContext) { + super.onTestStart(testContext); + System.out.println("In onTestStart"); + testContext.setStatus(ITestResult.FAILURE); + throw new RuntimeException("Trying to fail a test"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1465/ExampleClassListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1465/ExampleClassListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1465/ExampleClassListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1465/ExampleClassListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,63 @@ +package test.listeners.github1465; + +import java.lang.reflect.Method; +import java.util.LinkedList; +import java.util.List; +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.ITestNGMethod; +import org.testng.ITestResult; + +public class ExampleClassListener implements IInvokedMethodListener { + final List messages = new LinkedList<>(); + final List configMsgs = new LinkedList<>(); + + @Override + public void beforeInvocation(IInvokedMethod method, ITestResult testResult) { + log("beforeInvocation:", method, testResult); + } + + @Override + public void afterInvocation(IInvokedMethod method, ITestResult testResult) { + log("afterInvocation:", method, testResult); + } + + private void log(String prefix, IInvokedMethod method, ITestResult testResult) { + String msg = prefix + "_" + typeOfMethod(method); + msg += method.getTestMethod().getMethodName() + parameters(testResult); + if (method.isConfigurationMethod()) { + configMsgs.add(msg); + } else { + messages.add(msg); + } + } + + private static String typeOfMethod(IInvokedMethod method) { + ITestNGMethod tm = method.getTestMethod(); + if (tm.isBeforeMethodConfiguration()) { + return "before_method: "; + } + if (tm.isAfterMethodConfiguration()) { + return "after_method: "; + } + return "test_method: "; + } + + private static String parameters(ITestResult testResult) { + Object[] parameters = testResult.getParameters(); + if (parameters == null) { + return ""; + } + String returnValue = ""; + StringBuilder builder = new StringBuilder(); + for (Object parameter : parameters) { + if (parameter instanceof Method) { + builder.append(((Method) parameter).getName()); + } + } + if (builder.length() != 0) { + returnValue = "[" + builder.toString() + "]"; + } + return returnValue; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1465/ExampleClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1465/ExampleClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1465/ExampleClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1465/ExampleClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,31 @@ +package test.listeners.github1465; + +import static org.testng.Assert.assertTrue; + +import java.lang.reflect.Method; +import org.testng.SkipException; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class ExampleClassSample { + @BeforeMethod + public void beforeMethod(Method method) { + if ("test1".equals(method.getName())) { + throw new SkipException("Skip from [before]"); + } + } + + @Test + public void test1() { + assertTrue(true); + } + + @Test + public void test2() { + assertTrue(true); + } + + @AfterMethod + public void afterMethod(Method method) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1465/IssueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1465/IssueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1465/IssueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1465/IssueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,58 @@ +package test.listeners.github1465; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.TestNG; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import test.SimpleBaseTest; + +public class IssueTest extends SimpleBaseTest { + + @Test(dataProvider = "dp") + public void reproduceIssue(XmlSuite.FailurePolicy policy, String[] expectedMsgs) { + TestNG testNG = create(ExampleClassSample.class); + testNG.setConfigFailurePolicy(policy); + ExampleClassListener listener = new ExampleClassListener(); + testNG.addListener(listener); + testNG.run(); + String[] expected = + new String[] { + "beforeInvocation:_test_method: test1", "afterInvocation:_test_method: test1", + "beforeInvocation:_test_method: test2", "afterInvocation:_test_method: test2" + }; + assertThat(listener.messages).containsExactly(expected); + assertThat(listener.configMsgs).containsExactly(expectedMsgs); + } + + @DataProvider(name = "dp") + public Object[][] getdata() { + String[] continueFailurePolicyExpected = + new String[] { + "beforeInvocation:_before_method: beforeMethod[test1]", + "afterInvocation:_before_method: beforeMethod[test1]", + "beforeInvocation:_after_method: afterMethod[test1]", + "afterInvocation:_after_method: afterMethod[test1]", + "beforeInvocation:_before_method: beforeMethod[test2]", + "afterInvocation:_before_method: beforeMethod[test2]", + "beforeInvocation:_after_method: afterMethod[test2]", + "afterInvocation:_after_method: afterMethod[test2]" + }; + String[] skipFailurePolicyExpected = + new String[] { + "beforeInvocation:_before_method: beforeMethod[test1]", + "afterInvocation:_before_method: beforeMethod[test1]", + "beforeInvocation:_after_method: afterMethod", + "afterInvocation:_after_method: afterMethod", + "beforeInvocation:_before_method: beforeMethod", + "afterInvocation:_before_method: beforeMethod", + "beforeInvocation:_after_method: afterMethod", + "afterInvocation:_after_method: afterMethod" + }; + return new Object[][] { + {XmlSuite.FailurePolicy.CONTINUE, continueFailurePolicyExpected}, + {XmlSuite.FailurePolicy.SKIP, skipFailurePolicyExpected} + }; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1490/DataProviderInfoProvider.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1490/DataProviderInfoProvider.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1490/DataProviderInfoProvider.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1490/DataProviderInfoProvider.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package test.listeners.github1490; + +import org.testng.IDataProviderListener; +import org.testng.IDataProviderMethod; +import org.testng.ITestContext; +import org.testng.ITestNGMethod; + +public class DataProviderInfoProvider implements IDataProviderListener { + public static IDataProviderMethod before; + public static IDataProviderMethod after; + + @Override + public void beforeDataProviderExecution( + IDataProviderMethod dataProviderMethod, ITestNGMethod method, ITestContext iTestContext) { + before = dataProviderMethod; + } + + @Override + public void afterDataProviderExecution( + IDataProviderMethod dataProviderMethod, ITestNGMethod method, ITestContext iTestContext) { + after = dataProviderMethod; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1490/InstanceAwareLocalDataProviderListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1490/InstanceAwareLocalDataProviderListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1490/InstanceAwareLocalDataProviderListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1490/InstanceAwareLocalDataProviderListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,35 @@ +package test.listeners.github1490; + +import java.util.Set; +import org.testng.IDataProviderMethod; +import org.testng.ITestContext; +import org.testng.ITestNGMethod; +import org.testng.collections.Sets; + +public class InstanceAwareLocalDataProviderListener extends LocalDataProviderListener { + public static Set instanceCollectionBeforeExecution = Sets.newHashSet(); + public static Set instanceCollectionAfterExecution = Sets.newHashSet(); + + public InstanceAwareLocalDataProviderListener() { + instanceCollectionBeforeExecution.clear(); + instanceCollectionAfterExecution.clear(); + } + + @Override + public void beforeDataProviderExecution( + IDataProviderMethod dataProviderMethod, ITestNGMethod method, ITestContext iTestContext) { + super.beforeDataProviderExecution(dataProviderMethod, method, iTestContext); + if (dataProviderMethod.getInstance() != null) { + instanceCollectionBeforeExecution.add(dataProviderMethod.getInstance()); + } + } + + @Override + public void afterDataProviderExecution( + IDataProviderMethod dataProviderMethod, ITestNGMethod method, ITestContext iTestContext) { + super.afterDataProviderExecution(dataProviderMethod, method, iTestContext); + if (dataProviderMethod.getInstance() != null) { + instanceCollectionAfterExecution.add(dataProviderMethod.getInstance()); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1490/LocalDataProviderListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1490/LocalDataProviderListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1490/LocalDataProviderListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1490/LocalDataProviderListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,33 @@ +package test.listeners.github1490; + +import java.util.List; +import org.testng.IDataProviderListener; +import org.testng.IDataProviderMethod; +import org.testng.ITestContext; +import org.testng.ITestNGMethod; +import org.testng.collections.Lists; + +public class LocalDataProviderListener implements IDataProviderListener { + public static final List messages = Lists.newArrayList(); + + @Override + public void beforeDataProviderExecution( + IDataProviderMethod dataProviderMethod, ITestNGMethod method, ITestContext iTestContext) { + log(method, "before:"); + } + + @Override + public void afterDataProviderExecution( + IDataProviderMethod dataProviderMethod, ITestNGMethod method, ITestContext iTestContext) { + log(method, "after:"); + } + + private static void log(ITestNGMethod method, String prefix) { + if (method.getInstance() != null) { + messages.add( + prefix + method.getInstance().getClass().getName() + "." + method.getMethodName()); + } else { + messages.add(prefix + method.getMethodName()); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1602/IssueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1602/IssueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1602/IssueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1602/IssueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,55 @@ +package test.listeners.github1602; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Arrays; +import java.util.List; +import org.testng.TestNG; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import org.testng.collections.Lists; +import org.testng.xml.XmlSuite; +import test.SimpleBaseTest; + +public class IssueTest extends SimpleBaseTest { + + @Test(dataProvider = "dp") + public void testListenerInvocation( + Class clazz, XmlSuite.FailurePolicy policy, List expected) { + TestNG tng = create(clazz); + ListenerForIssue1602 listener = new ListenerForIssue1602(); + tng.setConfigFailurePolicy(policy); + tng.addListener(listener); + tng.run(); + assertThat(listener.getLogs()).containsExactlyElementsOf(expected); + } + + @DataProvider(name = "dp") + public Object[][] getData() { + List passList = + Arrays.asList( + "BeforeInvocation_beforeMethod_STARTED", + "AfterInvocation_beforeMethod_SUCCESS", + "BeforeInvocation_testMethod_STARTED", + "AfterInvocation_testMethod_SUCCESS", + "BeforeInvocation_afterMethod_STARTED", + "AfterInvocation_afterMethod_SUCCESS"); + List baseList = + Arrays.asList( + "BeforeInvocation_beforeMethod_STARTED", + "AfterInvocation_beforeMethod_FAILURE", + "BeforeInvocation_testMethod_SKIP", + "AfterInvocation_testMethod_SKIP", + "BeforeInvocation_afterMethod_STARTED"); + List skipList = Lists.newArrayList(baseList); + skipList.add("AfterInvocation_afterMethod_SKIP"); + List failList = Lists.newArrayList(baseList); + failList.add("AfterInvocation_afterMethod_FAILURE"); + return new Object[][] { + {TestClassWithPassingConfigsSample.class, XmlSuite.FailurePolicy.SKIP, passList}, + {TestClassWithFailingConfigsSample.class, XmlSuite.FailurePolicy.SKIP, skipList}, + {TestClassWithPassingConfigsSample.class, XmlSuite.FailurePolicy.CONTINUE, passList}, + {TestClassWithFailingConfigsSample.class, XmlSuite.FailurePolicy.CONTINUE, failList} + }; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1602/ListenerForIssue1602.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1602/ListenerForIssue1602.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1602/ListenerForIssue1602.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1602/ListenerForIssue1602.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,53 @@ +package test.listeners.github1602; + +import java.util.Collections; +import java.util.List; +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.ITestResult; +import org.testng.collections.Lists; + +public class ListenerForIssue1602 implements IInvokedMethodListener { + private List logs = Collections.synchronizedList(Lists.newArrayList()); + + @Override + public void beforeInvocation(IInvokedMethod method, ITestResult testResult) { + logs.add( + "BeforeInvocation_" + + method.getTestMethod().getMethodName() + + "_" + + intToStatus(testResult)); + } + + @Override + public void afterInvocation(IInvokedMethod method, ITestResult testResult) { + logs.add( + "AfterInvocation_" + + method.getTestMethod().getMethodName() + + "_" + + intToStatus(testResult)); + } + + public List getLogs() { + return logs; + } + + private String intToStatus(ITestResult testResult) { + int status = testResult.getStatus(); + switch (status) { + case ITestResult.CREATED: + return "CREATED"; + case ITestResult.SUCCESS: + return "SUCCESS"; + case ITestResult.SKIP: + return "SKIP"; + case ITestResult.FAILURE: + return "FAILURE"; + case ITestResult.STARTED: + return "STARTED"; + case ITestResult.SUCCESS_PERCENTAGE_FAILURE: + return "SUCCESS_PERCENTAGE_FAILURE"; + } + return " ??? " + String.valueOf(status); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1602/TestClassWithFailingConfigsSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1602/TestClassWithFailingConfigsSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1602/TestClassWithFailingConfigsSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1602/TestClassWithFailingConfigsSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.listeners.github1602; + +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class TestClassWithFailingConfigsSample { + @BeforeMethod + public void beforeMethod() { + throw new RuntimeException(); + } + + @Test + public void testMethod() {} + + @AfterMethod + public void afterMethod() { + throw new RuntimeException(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1602/TestClassWithPassingConfigsSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1602/TestClassWithPassingConfigsSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1602/TestClassWithPassingConfigsSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1602/TestClassWithPassingConfigsSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.listeners.github1602; + +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class TestClassWithPassingConfigsSample { + @BeforeMethod + public void beforeMethod() {} + + @Test + public void testMethod() {} + + @AfterMethod + public void afterMethod() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1735/ExecutionListenerTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1735/ExecutionListenerTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1735/ExecutionListenerTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1735/ExecutionListenerTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,24 @@ +package test.listeners.github1735; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Collections; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import test.SimpleBaseTest; + +public class ExecutionListenerTest extends SimpleBaseTest { + @Test + public void ensureExecutionListenerIsInvokedOnlyOnce() { + XmlSuite suite = createXmlSuite("suite"); + createXmlTest(suite, "test1", TestClassSample.class, TestClassTwoSample.class); + createXmlTest(suite, "test2", TestClassSample.class, TestClassTwoSample.class); + TestNG testng = create(suite); + testng.run(); + assertThat(LocalExecutionListener.getFinish()) + .containsExactlyElementsOf(Collections.singletonList("finish")); + assertThat(LocalExecutionListener.getStart()) + .containsExactlyElementsOf(Collections.singletonList("start")); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1735/LocalExecutionListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1735/LocalExecutionListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1735/LocalExecutionListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1735/LocalExecutionListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,28 @@ +package test.listeners.github1735; + +import java.util.List; +import org.testng.IExecutionListener; +import org.testng.collections.Lists; + +public class LocalExecutionListener implements IExecutionListener { + private static final List start = Lists.newArrayList(); + private static final List finish = Lists.newArrayList(); + + @Override + public void onExecutionStart() { + start.add("start"); + } + + @Override + public void onExecutionFinish() { + finish.add("finish"); + } + + public static List getFinish() { + return finish; + } + + public static List getStart() { + return start; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1735/TestClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1735/TestClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1735/TestClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1735/TestClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,10 @@ +package test.listeners.github1735; + +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +@Listeners(LocalExecutionListener.class) +public class TestClassSample { + @Test + public void testMethod() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1735/TestClassTwoSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1735/TestClassTwoSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github1735/TestClassTwoSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github1735/TestClassTwoSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,10 @@ +package test.listeners.github1735; + +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +@Listeners(LocalExecutionListener.class) +public class TestClassTwoSample { + @Test + public void testMethod() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2385/BaseTestCLass.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/BaseTestCLass.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2385/BaseTestCLass.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/BaseTestCLass.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,6 @@ +package test.listeners.github2385; + +import org.testng.annotations.Listeners; + +@Listeners(TestListener.class) +public class BaseTestCLass {} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2385/FatherTestClass.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/FatherTestClass.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2385/FatherTestClass.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/FatherTestClass.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,10 @@ +package test.listeners.github2385; + +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +@Listeners(TestClassListener.class) +public class FatherTestClass extends BaseTestCLass { + @Test + public void testClassListeners() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2385/ITestClassInterface.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/ITestClassInterface.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2385/ITestClassInterface.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/ITestClassInterface.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,6 @@ +package test.listeners.github2385; + +import org.testng.annotations.Listeners; + +@Listeners(TestClassListener.class) +public interface ITestClassInterface {} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2385/ITestInheritedInterface.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/ITestInheritedInterface.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2385/ITestInheritedInterface.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/ITestInheritedInterface.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,6 @@ +package test.listeners.github2385; + +import org.testng.annotations.Listeners; + +@Listeners(TestClassListener.class) +public interface ITestInheritedInterface extends ITestInterface {} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2385/ITestInterface.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/ITestInterface.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2385/ITestInterface.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/ITestInterface.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,6 @@ +package test.listeners.github2385; + +import org.testng.annotations.Listeners; + +@Listeners(TestListener.class) +public interface ITestInterface {} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2385/ITestInterfaceSame.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/ITestInterfaceSame.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2385/ITestInterfaceSame.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/ITestInterfaceSame.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,6 @@ +package test.listeners.github2385; + +import org.testng.annotations.Listeners; + +@Listeners(TestListener.class) +public interface ITestInterfaceSame {} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2385/ITestInterfaceSameInherit.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/ITestInterfaceSameInherit.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2385/ITestInterfaceSameInherit.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/ITestInterfaceSameInherit.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,6 @@ +package test.listeners.github2385; + +import org.testng.annotations.Listeners; + +@Listeners(TestListener.class) +public interface ITestInterfaceSameInherit extends ITestInterface {} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2385/IssueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/IssueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2385/IssueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/IssueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,111 @@ +package test.listeners.github2385; + +import static org.testng.Assert.assertFalse; +import static org.testng.Assert.assertTrue; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import org.testng.TestNG; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.Test; +import org.testng.xml.XmlPackage; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.SimpleBaseTest; + +public class IssueTest extends SimpleBaseTest { + @Test + public void testExtendClass() { + TestNG testNG = create(SonTestClassSample.class); + testNG.run(); + assertTrue(TestListener.listenerExecuted); + assertTrue(TestListener.listenerMethodInvoked); + } + + @Test + public void testClassAndInterface() { + TestNG testNG = create(TestClassAndInterfaceInheritSample.class); + testNG.run(); + assertTrue(TestListener.listenerExecuted); + assertTrue(TestListener.listenerMethodInvoked); + assertTrue(TestClassListener.listenerMethodInvoked); + } + + @Test + public void testClassListeners() { + TestNG testNG = create(TestClassListenersInheritSample.class); + testNG.run(); + assertTrue(TestListener.listenerExecuted); + assertTrue(TestListener.listenerMethodInvoked); + } + + @Test + public void testInterface() { + TestNG testNG = create(TestInterfaceListenersInheritSample.class); + testNG.run(); + assertTrue(TestListener.listenerExecuted); + assertTrue(TestListener.listenerMethodInvoked); + } + + @Test + public void testMultiInherit() { + TestNG testNG = create(TestMultiInheritSample.class); + testNG.run(); + assertTrue(TestListener.listenerMethodInvoked); + assertTrue(TestClassListener.listenerMethodInvoked); + } + + @Test + public void testMultiInheritSameAnnotation() { + TestNG testNG = create(TestMultiInheritSameAnnotationSample.class); + testNG.run(); + assertTrue(TestListener.listenerMethodInvoked); + } + + @Test + public void testMultiLevel() { + TestNG testNG = create(TestMultiLevelInheritSample.class); + testNG.run(); + assertTrue(TestListener.listenerExecuted); + assertTrue(TestListener.listenerMethodInvoked); + assertTrue(TestClassListener.listenerMethodInvoked); + } + + @Test + public void testMultiLevelSameAnnotation() { + TestNG testNG = create(TestMultiLevelInheritSameAnnotationSample.class); + testNG.run(); + assertTrue(TestListener.listenerExecuted); + assertTrue(TestListener.listenerMethodInvoked); + } + + @Test + public void testPackages() { + List packages = new ArrayList<>(); + XmlPackage xmlPackage = new XmlPackage("test.listeners.github2385.packages"); + packages.add(xmlPackage); + XmlTest test = new XmlTest(); + test.setName("MyTest"); + test.setXmlPackages(packages); + + XmlSuite xmlSuite = new XmlSuite(); + xmlSuite.setName("MySuite"); + xmlSuite.setTests(Collections.singletonList(test)); + + test.setXmlSuite(xmlSuite); + + TestNG tng = new TestNG(); + tng.setXmlSuites(Collections.singletonList(xmlSuite)); + tng.run(); + + assertFalse(TestListener.listenerMethodInvoked); + } + + @AfterMethod + public void reset() { + TestListener.listenerExecuted = false; + TestListener.listenerMethodInvoked = false; + TestClassListener.listenerMethodInvoked = false; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2385/SonTestClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/SonTestClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2385/SonTestClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/SonTestClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ +package test.listeners.github2385; + +import org.testng.annotations.Test; + +public class SonTestClassSample extends FatherTestClass { + @Test + public void testSonClass() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2385/TestClassAndInterfaceInheritSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/TestClassAndInterfaceInheritSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2385/TestClassAndInterfaceInheritSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/TestClassAndInterfaceInheritSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,10 @@ +package test.listeners.github2385; + +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +@Listeners(TestClassListener.class) +public class TestClassAndInterfaceInheritSample implements ITestInterface { + @Test + public void testClassAndInterface() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2385/TestClassListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/TestClassListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2385/TestClassListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/TestClassListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.listeners.github2385; + +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.ITestResult; + +public class TestClassListener implements IInvokedMethodListener { + public static boolean listenerExecuted = false; + public static boolean listenerMethodInvoked = false; + + public TestClassListener() { + listenerExecuted = true; + } + + @Override + public void beforeInvocation(IInvokedMethod method, ITestResult testResult) { + listenerMethodInvoked = true; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2385/TestClassListenersInheritSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/TestClassListenersInheritSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2385/TestClassListenersInheritSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/TestClassListenersInheritSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ +package test.listeners.github2385; + +import org.testng.annotations.Test; + +public class TestClassListenersInheritSample extends BaseTestCLass { + @Test + public void testClassListeners() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2385/TestInterfaceListenersInheritSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/TestInterfaceListenersInheritSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2385/TestInterfaceListenersInheritSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/TestInterfaceListenersInheritSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.listeners.github2385; + +import org.testng.annotations.Test; + +public class TestInterfaceListenersInheritSample implements ITestInterface { + + @Test + public void testInterface() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2385/TestListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/TestListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2385/TestListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/TestListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.listeners.github2385; + +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.ITestResult; + +public final class TestListener implements IInvokedMethodListener { + public static boolean listenerExecuted = false; + public static boolean listenerMethodInvoked = false; + + public TestListener() { + listenerExecuted = true; + } + + @Override + public void beforeInvocation(IInvokedMethod method, ITestResult testResult) { + listenerMethodInvoked = true; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2385/TestMultiInheritSameAnnotationSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/TestMultiInheritSameAnnotationSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2385/TestMultiInheritSameAnnotationSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/TestMultiInheritSameAnnotationSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.listeners.github2385; + +import org.testng.annotations.Test; + +public class TestMultiInheritSameAnnotationSample implements ITestInterface, ITestInterfaceSame { + + @Test + public void testMultiInheritSameAnnotation() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2385/TestMultiInheritSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/TestMultiInheritSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2385/TestMultiInheritSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/TestMultiInheritSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.listeners.github2385; + +import org.testng.annotations.Test; + +public class TestMultiInheritSample implements ITestClassInterface, ITestInterface { + + @Test + public void testMultiInherit() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2385/TestMultiLevelInheritSameAnnotationSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/TestMultiLevelInheritSameAnnotationSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2385/TestMultiLevelInheritSameAnnotationSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/TestMultiLevelInheritSameAnnotationSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.listeners.github2385; + +import org.testng.annotations.Test; + +public class TestMultiLevelInheritSameAnnotationSample implements ITestInterfaceSameInherit { + + @Test + public void testMultiLevel() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2385/TestMultiLevelInheritSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/TestMultiLevelInheritSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2385/TestMultiLevelInheritSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/TestMultiLevelInheritSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.listeners.github2385; + +import org.testng.annotations.Test; + +public class TestMultiLevelInheritSample implements ITestInheritedInterface { + + @Test + public void testMultiLevel() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2385/packages/ITestInterfaceWithoutImpl.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/packages/ITestInterfaceWithoutImpl.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2385/packages/ITestInterfaceWithoutImpl.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/packages/ITestInterfaceWithoutImpl.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,6 @@ +package test.listeners.github2385.packages; + +import org.testng.annotations.Listeners; + +@Listeners(TestPackageListener.class) +public interface ITestInterfaceWithoutImpl {} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2385/packages/TestPackageListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/packages/TestPackageListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2385/packages/TestPackageListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/packages/TestPackageListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.listeners.github2385.packages; + +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.ITestResult; + +public class TestPackageListener implements IInvokedMethodListener { + public static boolean listenerExecuted = false; + public static boolean listenerMethodInvoked = false; + + public TestPackageListener() { + listenerExecuted = true; + } + + @Override + public void beforeInvocation(IInvokedMethod method, ITestResult testResult) { + listenerMethodInvoked = true; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2385/packages/TestWithoutImplSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/packages/TestWithoutImplSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2385/packages/TestWithoutImplSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2385/packages/TestWithoutImplSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ +package test.listeners.github2385.packages; + +import org.testng.annotations.Test; + +public class TestWithoutImplSample { + @Test + public void testWithoutImpl() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2522/FirstTestSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2522/FirstTestSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2522/FirstTestSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2522/FirstTestSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package test.listeners.github2522; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class FirstTestSample { + @Test(description = "First test step") + public void firstMethod() {} + + @Test(description = "Second test step", dependsOnMethods = "firstMethod") + public void secondMethod() { + Assert.fail(); + } + + @Test(description = "Third test step", dependsOnMethods = "secondMethod") + public void thirdMethod() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2522/IssueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2522/IssueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2522/IssueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2522/IssueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,88 @@ +package test.listeners.github2522; + +import org.testng.Assert; +import org.testng.ITestResult; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class IssueTest extends SimpleBaseTest { + + @Test + public void issueTest() { + TestNG testNG = create(FirstTestSample.class, SecondTestSample.class); + testNG.addListener(new TestListener()); + testNG.run(); + + Assert.assertEquals( + ITestResult.STARTED, + TestListener.beforeInvocation + .get("test.listeners.github2522.FirstTestSamplefirstMethod") + .intValue()); + Assert.assertEquals( + ITestResult.STARTED, + TestListener.beforeInvocation + .get("test.listeners.github2522.FirstTestSamplesecondMethod") + .intValue()); + Assert.assertEquals( + ITestResult.SKIP, + TestListener.beforeInvocation + .get("test.listeners.github2522.FirstTestSamplethirdMethod") + .intValue()); + Assert.assertEquals( + ITestResult.STARTED, + TestListener.beforeInvocation + .get("test.listeners.github2522.SecondTestSamplefirstMethod") + .intValue()); + Assert.assertEquals( + ITestResult.SKIP, + TestListener.beforeInvocation + .get("test.listeners.github2522.SecondTestSamplesecondMethod") + .intValue()); + Assert.assertEquals( + ITestResult.SKIP, + TestListener.beforeInvocation + .get("test.listeners.github2522.SecondTestSamplethirdMethod") + .intValue()); + + Assert.assertEquals( + ITestResult.SUCCESS, + TestListener.afterInvocation + .get("test.listeners.github2522.FirstTestSamplefirstMethod") + .intValue()); + Assert.assertEquals( + ITestResult.FAILURE, + TestListener.afterInvocation + .get("test.listeners.github2522.FirstTestSamplesecondMethod") + .intValue()); + Assert.assertEquals( + ITestResult.SKIP, + TestListener.afterInvocation + .get("test.listeners.github2522.FirstTestSamplethirdMethod") + .intValue()); + Assert.assertEquals( + ITestResult.SKIP, + TestListener.afterInvocation + .get("test.listeners.github2522.SecondTestSamplefirstMethod") + .intValue()); + Assert.assertEquals( + ITestResult.SKIP, + TestListener.afterInvocation + .get("test.listeners.github2522.SecondTestSamplesecondMethod") + .intValue()); + Assert.assertEquals( + ITestResult.SKIP, + TestListener.afterInvocation + .get("test.listeners.github2522.SecondTestSamplethirdMethod") + .intValue()); + } + + @Test + public void testSkip() { + TestNG testNG = create(SkipTestSample.class); + testNG.addListener(new SkipTestListener()); + testNG.run(); + + Assert.assertTrue(SkipTestSample.getFlag()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2522/SecondTestSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2522/SecondTestSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2522/SecondTestSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2522/SecondTestSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package test.listeners.github2522; + +import org.testng.annotations.Test; + +public class SecondTestSample { + @Test(description = "First test step") + public void firstMethod() {} + + @Test(description = "Second test step", dependsOnMethods = "firstMethod") + public void secondMethod() {} + + @Test(description = "Third test step", dependsOnMethods = "secondMethod") + public void thirdMethod() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2522/SkipTestListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2522/SkipTestListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2522/SkipTestListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2522/SkipTestListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package test.listeners.github2522; + +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.ITestResult; + +public class SkipTestListener implements IInvokedMethodListener { + @Override + public void beforeInvocation(IInvokedMethod invokedMethod, ITestResult result) { + if (invokedMethod.getTestMethod().getMethodName().contains("oneTest")) { + result.setStatus(ITestResult.SKIP); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2522/SkipTestSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2522/SkipTestSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2522/SkipTestSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2522/SkipTestSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.listeners.github2522; + +import org.testng.annotations.Test; + +public class SkipTestSample { + private static boolean flag = true; + + @Test() + public void oneTest() { + flag = false; + } + + @Test() + public void twoTest() {} + + public static boolean getFlag() { + return flag; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2522/TestListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2522/TestListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2522/TestListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2522/TestListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,33 @@ +package test.listeners.github2522; + +import java.util.HashMap; +import java.util.Map; +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.ITestResult; + +public class TestListener implements IInvokedMethodListener { + private boolean hasFailures = false; + public static Map beforeInvocation = new HashMap<>(); + public static Map afterInvocation = new HashMap<>(); + + @Override + public void beforeInvocation(IInvokedMethod invokedMethod, ITestResult result) { + beforeInvocation.put(result.getTestClass().getName() + result.getName(), result.getStatus()); + if (hasFailures) { + result.setStatus(ITestResult.SKIP); + } + } + + @Override + public void afterInvocation(IInvokedMethod method, ITestResult testResult) { + afterInvocation.put( + testResult.getTestClass().getName() + testResult.getName(), testResult.getStatus()); + if (!method.isTestMethod()) { + return; + } + if (!testResult.isSuccess()) { + hasFailures = true; + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2558/CallHolder.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2558/CallHolder.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2558/CallHolder.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2558/CallHolder.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,21 @@ +package test.listeners.github2558; + +import java.util.List; +import org.assertj.core.util.Lists; + +public class CallHolder { + + private static final List calls = Lists.newArrayList(); + + public static void addCall(String identifier) { + calls.add(identifier); + } + + public static void clear() { + calls.clear(); + } + + public static List getCalls() { + return calls; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2558/ClassMethodListenersHolder.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2558/ClassMethodListenersHolder.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2558/ClassMethodListenersHolder.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2558/ClassMethodListenersHolder.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,68 @@ +package test.listeners.github2558; + +import org.testng.IClassListener; +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.ITestClass; +import org.testng.ITestResult; + +public class ClassMethodListenersHolder { + + public static class ClassMethodListenerA implements IClassListener, IInvokedMethodListener { + + @Override + public void onBeforeClass(ITestClass testClass) { + CallHolder.addCall(getClass().getName() + ".onBeforeClass()"); + } + + @Override + public void onAfterClass(ITestClass testClass) { + CallHolder.addCall(getClass().getName() + ".onBeforeClass()"); + } + + @Override + public void beforeInvocation(IInvokedMethod method, ITestResult testResult) { + if (method.isConfigurationMethod()) { + return; + } + CallHolder.addCall(getClass().getName() + ".beforeInvocation()"); + } + + @Override + public void afterInvocation(IInvokedMethod method, ITestResult testResult) { + if (method.isConfigurationMethod()) { + return; + } + CallHolder.addCall(getClass().getName() + ".afterInvocation()"); + } + } + + public static class ClassMethodListenerB implements IClassListener, IInvokedMethodListener { + + @Override + public void onBeforeClass(ITestClass testClass) { + CallHolder.addCall(getClass().getName() + ".onBeforeClass()"); + } + + @Override + public void onAfterClass(ITestClass testClass) { + CallHolder.addCall(getClass().getName() + ".onBeforeClass()"); + } + + @Override + public void beforeInvocation(IInvokedMethod method, ITestResult testResult) { + if (method.isConfigurationMethod()) { + return; + } + CallHolder.addCall(getClass().getName() + ".beforeInvocation()"); + } + + @Override + public void afterInvocation(IInvokedMethod method, ITestResult testResult) { + if (method.isConfigurationMethod()) { + return; + } + CallHolder.addCall(getClass().getName() + ".afterInvocation()"); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2558/DataProviderListenersHolder.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2558/DataProviderListenersHolder.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2558/DataProviderListenersHolder.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2558/DataProviderListenersHolder.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,39 @@ +package test.listeners.github2558; + +import org.testng.IDataProviderListener; +import org.testng.IDataProviderMethod; +import org.testng.ITestContext; +import org.testng.ITestNGMethod; + +public class DataProviderListenersHolder { + + public static class DataProviderListenerA implements IDataProviderListener { + + @Override + public void beforeDataProviderExecution( + IDataProviderMethod dataProviderMethod, ITestNGMethod method, ITestContext iTestContext) { + CallHolder.addCall(getClass().getName() + ".beforeDataProviderExecution()"); + } + + @Override + public void afterDataProviderExecution( + IDataProviderMethod dataProviderMethod, ITestNGMethod method, ITestContext iTestContext) { + CallHolder.addCall(getClass().getName() + ".afterDataProviderExecution()"); + } + } + + public static class DataProviderListenerB implements IDataProviderListener { + + @Override + public void beforeDataProviderExecution( + IDataProviderMethod dataProviderMethod, ITestNGMethod method, ITestContext iTestContext) { + CallHolder.addCall(getClass().getName() + ".beforeDataProviderExecution()"); + } + + @Override + public void afterDataProviderExecution( + IDataProviderMethod dataProviderMethod, ITestNGMethod method, ITestContext iTestContext) { + CallHolder.addCall(getClass().getName() + ".afterDataProviderExecution()"); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2558/ExecutionListenersHolder.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2558/ExecutionListenersHolder.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2558/ExecutionListenersHolder.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2558/ExecutionListenersHolder.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,32 @@ +package test.listeners.github2558; + +import org.testng.IExecutionListener; + +public class ExecutionListenersHolder { + + public static class ExecutionListenerA implements IExecutionListener { + + @Override + public void onExecutionStart() { + CallHolder.addCall(getClass().getName() + ".onExecutionStart()"); + } + + @Override + public void onExecutionFinish() { + CallHolder.addCall(getClass().getName() + ".onExecutionFinish()"); + } + } + + public static class ExecutionListenerB implements IExecutionListener { + + @Override + public void onExecutionStart() { + CallHolder.addCall(getClass().getName() + ".onExecutionStart()"); + } + + @Override + public void onExecutionFinish() { + CallHolder.addCall(getClass().getName() + ".onExecutionFinish()"); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2558/ReportersHolder.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2558/ReportersHolder.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2558/ReportersHolder.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2558/ReportersHolder.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +package test.listeners.github2558; + +import java.util.List; +import org.testng.IReporter; +import org.testng.ISuite; +import org.testng.xml.XmlSuite; + +public class ReportersHolder { + + public static class ReporterA implements IReporter { + + @Override + public void generateReport( + List xmlSuites, List suites, String outputDirectory) { + CallHolder.addCall(getClass().getName() + ".generateReport()"); + } + } + + public static class ReporterB implements IReporter { + + @Override + public void generateReport( + List xmlSuites, List suites, String outputDirectory) { + CallHolder.addCall(getClass().getName() + ".generateReport()"); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2558/SuiteAlterListenersHolder.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2558/SuiteAlterListenersHolder.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2558/SuiteAlterListenersHolder.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2558/SuiteAlterListenersHolder.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,24 @@ +package test.listeners.github2558; + +import java.util.List; +import org.testng.IAlterSuiteListener; +import org.testng.xml.XmlSuite; + +public class SuiteAlterListenersHolder { + + public static class SuiteAlterA implements IAlterSuiteListener { + + @Override + public void alter(List suites) { + CallHolder.addCall(getClass().getName() + ".alter()"); + } + } + + public static class SuiteAlterB implements IAlterSuiteListener { + + @Override + public void alter(List suites) { + CallHolder.addCall(getClass().getName() + ".alter()"); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2558/SuiteListenersHolder.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2558/SuiteListenersHolder.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2558/SuiteListenersHolder.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2558/SuiteListenersHolder.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,33 @@ +package test.listeners.github2558; + +import org.testng.ISuite; +import org.testng.ISuiteListener; + +public class SuiteListenersHolder { + + public static class SuiteListenerA implements ISuiteListener { + + @Override + public void onStart(ISuite suite) { + CallHolder.addCall(getClass().getName() + ".onStart()"); + } + + @Override + public void onFinish(ISuite suite) { + CallHolder.addCall(getClass().getName() + ".onFinish()"); + } + } + + public static class SuiteListenerB implements ISuiteListener { + + @Override + public void onStart(ISuite suite) { + CallHolder.addCall(getClass().getName() + ".onStart()"); + } + + @Override + public void onFinish(ISuite suite) { + CallHolder.addCall(getClass().getName() + ".onFinish()"); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2558/TestClassSamples.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2558/TestClassSamples.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2558/TestClassSamples.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2558/TestClassSamples.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,32 @@ +package test.listeners.github2558; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +public class TestClassSamples { + + public static class TestClassSampleA { + + @BeforeClass + public void beforeClass() {} + + @Test + public void testMethod() {} + + @AfterClass + public void afterClass() {} + } + + public static class TestClassSampleB { + + @BeforeClass + public void beforeClass() {} + + @Test + public void testMethod() {} + + @AfterClass + public void afterClass() {} + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2558/TestListenersHolder.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2558/TestListenersHolder.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github2558/TestListenersHolder.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github2558/TestListenersHolder.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,33 @@ +package test.listeners.github2558; + +import org.testng.ITestContext; +import org.testng.ITestListener; + +public class TestListenersHolder { + + public static class TestListenerA implements ITestListener { + + @Override + public void onStart(ITestContext context) { + CallHolder.addCall(getClass().getName() + ".onStart(ctx)"); + } + + @Override + public void onFinish(ITestContext context) { + CallHolder.addCall(getClass().getName() + ".onFinish(ctx)"); + } + } + + public static class TestListenerB implements ITestListener { + + @Override + public void onStart(ITestContext context) { + CallHolder.addCall(getClass().getName() + ".onStart(ctx)"); + } + + @Override + public void onFinish(ITestContext context) { + CallHolder.addCall(getClass().getName() + ".onFinish(ctx)"); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github551/ConfigListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github551/ConfigListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github551/ConfigListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github551/ConfigListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.listeners.github551; + +import org.testng.IConfigurationListener; +import org.testng.ITestResult; + +public class ConfigListener implements IConfigurationListener { + + public static long executionTime = 0; + + @Override + public void onConfigurationSuccess(ITestResult itr) {} + + @Override + public void onConfigurationFailure(ITestResult itr) { + executionTime = itr.getEndMillis() - itr.getStartMillis(); + } + + @Override + public void onConfigurationSkip(ITestResult itr) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github551/Test551.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github551/Test551.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github551/Test551.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github551/Test551.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.listeners.github551; + +import java.io.IOException; +import org.testng.Assert; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class Test551 extends SimpleBaseTest { + + @Test + public void testExecutionTimeOfFailedConfig() throws IOException { + ConfigListener listener = new ConfigListener(); + + TestNG testNG = create(TestWithFailingConfig.class); + testNG.addListener(listener); + testNG.run(); + Assert.assertTrue(listener.executionTime >= TestWithFailingConfig.EXEC_TIME); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github551/TestWithFailingConfig.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github551/TestWithFailingConfig.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github551/TestWithFailingConfig.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github551/TestWithFailingConfig.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ +package test.listeners.github551; + +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +public class TestWithFailingConfig { + + public static final int EXEC_TIME = 300; + + @BeforeClass + public void setUpClassWaitThenFail() throws InterruptedException { + Thread.sleep(EXEC_TIME); + throw new RuntimeException(); + } + + @Test + public void testNothing() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github956/ListenerFor956.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github956/ListenerFor956.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github956/ListenerFor956.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github956/ListenerFor956.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,38 @@ +package test.listeners.github956; + +import java.util.List; +import org.testng.ITestContext; +import org.testng.ITestListener; +import org.testng.ITestResult; +import org.testng.collections.Lists; + +public class ListenerFor956 implements ITestListener { + private static final List messages = Lists.newArrayList(); + + public static List getMessages() { + return messages; + } + + @Override + public void onStart(ITestContext context) { + messages.add("Executing " + context.getCurrentXmlTest().getName()); + } + + @Override + public void onTestStart(ITestResult result) {} + + @Override + public void onTestSuccess(ITestResult result) {} + + @Override + public void onTestFailure(ITestResult result) {} + + @Override + public void onTestSkipped(ITestResult result) {} + + @Override + public void onTestFailedButWithinSuccessPercentage(ITestResult result) {} + + @Override + public void onFinish(ITestContext context) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github956/TestClassContainer.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github956/TestClassContainer.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/github956/TestClassContainer.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/github956/TestClassContainer.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package test.listeners.github956; + +import org.testng.Assert; +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +public class TestClassContainer { + @Listeners(ListenerFor956.class) + public static class FirstTestClass { + @Test + public void testMethod() { + Assert.assertEquals(true, true); + } + } + + @Listeners(ListenerFor956.class) + public static class SecondTestClass { + @Test + public void testMethod() { + Assert.assertEquals(true, true); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue1777/IssueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue1777/IssueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue1777/IssueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue1777/IssueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,59 @@ +package test.listeners.issue1777; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Arrays; +import java.util.List; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import test.SimpleBaseTest; + +public class IssueTest extends SimpleBaseTest { + + public static final String GITHUB_1777 = "GITHUB-1777"; + + @Test(description = GITHUB_1777) + public void testOnStartInvokedForSkippedTests() { + TestNG testNG = create(TestClassSample.class); + testNG.alwaysRunListeners(true); + testNG.setConfigFailurePolicy(XmlSuite.FailurePolicy.CONTINUE); + MyListener listener = new MyListener(); + testNG.addListener(listener); + testNG.run(); + List expectedTestMessages = + Arrays.asList( + "testStart_test_method: test1", + "before_test_method: test1", + "before_test_method: test1", + "after_test_method: test1", + "after_test_method: test1", + "testSkipped_test_method: test1", + "testStart_test_method: test2", + "before_test_method: test2", + "before_test_method: test2", + "after_test_method: test2", + "after_test_method: test2", + "testSuccess_test_method: test2"); + assertThat(listener.tstMsgs).containsExactlyElementsOf(expectedTestMessages); + List expectedConfigMessages = + Arrays.asList( + "before_configuration_method: beforeMethod[test1]", + "before_configuration_method: beforeMethod[test1]", + "after_configuration_method: beforeMethod[test1]", + "after_configuration_method: beforeMethod[test1]", + "before_configuration_method: afterMethod[test1]", + "before_configuration_method: afterMethod[test1]", + "after_configuration_method: afterMethod[test1]", + "after_configuration_method: afterMethod[test1]", + "before_configuration_method: beforeMethod[test2]", + "before_configuration_method: beforeMethod[test2]", + "after_configuration_method: beforeMethod[test2]", + "after_configuration_method: beforeMethod[test2]", + "before_configuration_method: afterMethod[test2]", + "before_configuration_method: afterMethod[test2]", + "after_configuration_method: afterMethod[test2]", + "after_configuration_method: afterMethod[test2]"); + assertThat(listener.cfgMsgs).containsExactlyElementsOf(expectedConfigMessages); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue1777/MyListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue1777/MyListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue1777/MyListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue1777/MyListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,110 @@ +package test.listeners.issue1777; + +import java.lang.reflect.Method; +import java.util.LinkedList; +import java.util.List; +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.ITestContext; +import org.testng.ITestListener; +import org.testng.ITestNGMethod; +import org.testng.ITestResult; + +public class MyListener implements IInvokedMethodListener, ITestListener { + List allMsgs = new LinkedList<>(); + List tstMsgs = new LinkedList<>(); + List cfgMsgs = new LinkedList<>(); + + @Override + public void onFinish(ITestContext testContext) {} + + @Override + public void onStart(ITestContext testContext) {} + + @Override + public void onTestFailedButWithinSuccessPercentage(ITestResult testResult) { + log("testFailedBut", testResult); + } + + @Override + public void onTestFailure(ITestResult testResult) { + log("testFailed", testResult); + } + + @Override + public void onTestSkipped(ITestResult testResult) { + log("testSkipped", testResult); + } + + @Override + public void onTestStart(ITestResult testResult) { + log("testStart", testResult); + } + + @Override + public void onTestSuccess(ITestResult testResult) { + log("testSuccess", testResult); + } + + @Override + public void afterInvocation( + IInvokedMethod method, ITestResult testResult, ITestContext testContext) { + log("after", method, testResult); + } + + @Override + public void beforeInvocation( + IInvokedMethod method, ITestResult testResult, ITestContext testContext) { + log("before", method, testResult); + } + + @Override + public void beforeInvocation(IInvokedMethod method, ITestResult testResult) { + log("before", method, testResult); + } + + @Override + public void afterInvocation(IInvokedMethod method, ITestResult testResult) { + log("after", method, testResult); + } + + private void log(String prefix, ITestResult testResult) { + log(prefix, testResult.getMethod(), testResult); + } + + private void log(String prefix, IInvokedMethod method, ITestResult testResult) { + log(prefix, method.getTestMethod(), testResult); + } + + private void log(String prefix, ITestNGMethod method, ITestResult testResult) { + String msg = prefix + "_"; + if (method.isTest()) { + msg += "test_method: "; + } else { + msg += "configuration_method: "; + } + msg += method.getMethodName() + parameters(testResult); + allMsgs.add(msg); + if (method.isTest()) { + tstMsgs.add(msg); + } else { + cfgMsgs.add(msg); + } + } + + private String parameters(ITestResult testResult) { + Object[] parameters = testResult.getParameters(); + if (parameters != null) { + StringBuilder builder = new StringBuilder(); + for (Object parameter : parameters) { + if (parameter instanceof Method) { + builder.append(((Method) parameter).getName()); + } + } + if (builder.length() != 0) { + return "[" + builder.toString() + "]"; + } + } + return ""; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue1777/TestClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue1777/TestClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue1777/TestClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue1777/TestClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,30 @@ +package test.listeners.issue1777; + +import static org.testng.Assert.assertTrue; + +import java.lang.reflect.Method; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class TestClassSample { + @BeforeMethod + public void beforeMethod(Method method) { + if ("test1".equals(method.getName())) { + throw new AssertionError("Assertion error from [before]"); + } + } + + @Test + public void test1() { + assertTrue(true); + } + + @Test + public void test2() { + assertTrue(true); + } + + @AfterMethod + public void afterMethod(Method method) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue1952/TestclassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue1952/TestclassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue1952/TestclassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue1952/TestclassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.listeners.issue1952; + +import java.util.concurrent.TimeUnit; +import org.testng.annotations.Test; + +public class TestclassSample { + + @Test(timeOut = 500) + public void testMethod() throws InterruptedException { + TimeUnit.SECONDS.sleep(10); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue2043/SampleDataProvider.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2043/SampleDataProvider.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue2043/SampleDataProvider.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2043/SampleDataProvider.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.listeners.issue2043; + +import org.testng.annotations.DataProvider; + +public class SampleDataProvider { + + @DataProvider + public Object[][] dp1master() { + return new Object[][] {new Object[] {Object.class}, {Object.class}}; + } + + @DataProvider + public Object[][] dp2master() { + return new Object[][] {new Object[] {Object.class}, {Object.class}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue2043/SampleTestClass.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2043/SampleTestClass.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue2043/SampleTestClass.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2043/SampleTestClass.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +package test.listeners.issue2043; + +import org.testng.ISuite; +import org.testng.ISuiteListener; +import org.testng.ITestListener; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; +import test.listeners.issue2043.listeners.FailFastListener; + +@Listeners({SampleTestClass.class}) +public class SampleTestClass implements ITestListener, ISuiteListener { + + @Override + public void onStart(ISuite suite) { + suite.addListener(new FailFastListener()); + } + + @BeforeClass + public void beforeClass() {} + + @Test(dataProviderClass = SampleDataProvider.class, dataProvider = "dp1master") + public void test1(Class clazz) {} + + @Test(dataProviderClass = SampleDataProvider.class, dataProvider = "dp1master") + public void test2(Class clazz) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue2043/listeners/FailFastListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2043/listeners/FailFastListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue2043/listeners/FailFastListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2043/listeners/FailFastListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,33 @@ +package test.listeners.issue2043.listeners; + +import java.util.Set; +import org.testng.IConfigurationListener; +import org.testng.IDataProviderListener; +import org.testng.IDataProviderMethod; +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.ITestContext; +import org.testng.ITestNGMethod; +import org.testng.ITestResult; +import org.testng.collections.Sets; + +public class FailFastListener + implements IInvokedMethodListener, IConfigurationListener, IDataProviderListener { + public static final Set msgs = Sets.newHashSet(); + + @Override + public synchronized void afterInvocation(IInvokedMethod method, ITestResult testResult) { + msgs.add(getClass().getSimpleName() + ":afterInvocation"); + } + + @Override + public void beforeConfiguration(ITestResult testResult) { + msgs.add(getClass().getSimpleName() + ":beforeConfiguration"); + } + + @Override + public void beforeDataProviderExecution( + IDataProviderMethod dataProviderMethod, ITestNGMethod method, ITestContext iTestContext) { + msgs.add(getClass().getSimpleName() + ":beforeDataProviderExecution"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue2055/DynamicTestListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2055/DynamicTestListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue2055/DynamicTestListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2055/DynamicTestListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.listeners.issue2055; + +import java.util.List; +import org.testng.ITestListener; +import org.testng.ITestResult; +import org.testng.collections.Lists; + +public class DynamicTestListener implements ITestListener { + + public static final List MSGS = Lists.newArrayList(); + + @Override + public void onTestStart(ITestResult result) { + MSGS.add("Starting " + result.getMethod().getMethodName()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue2055/TestClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2055/TestClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue2055/TestClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2055/TestClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.listeners.issue2055; + +import org.testng.ISuite; +import org.testng.ISuiteListener; +import org.testng.ITestListener; +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +@Listeners(TestClassSample.class) +public class TestClassSample implements ITestListener, ISuiteListener { + + @Override + public void onStart(ISuite suite) { + suite.addListener(new DynamicTestListener()); + } + + @Test + public void testMethod() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue2061/DynamicSuiteListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2061/DynamicSuiteListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue2061/DynamicSuiteListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2061/DynamicSuiteListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.listeners.issue2061; + +import org.testng.ISuite; +import org.testng.ISuiteListener; + +public class DynamicSuiteListener implements ISuiteListener { + + @Override + public void onStart(ISuite suite) { + suite.addListener(new DynamicTestListener()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue2061/DynamicTestListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2061/DynamicTestListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue2061/DynamicTestListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2061/DynamicTestListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,5 @@ +package test.listeners.issue2061; + +import org.testng.ITestListener; + +public class DynamicTestListener implements ITestListener {} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue2061/ListenerEnabledBaseClass.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2061/ListenerEnabledBaseClass.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue2061/ListenerEnabledBaseClass.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2061/ListenerEnabledBaseClass.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.listeners.issue2061; + +import org.testng.ISuite; +import org.testng.ISuiteListener; +import org.testng.ITestListener; +import org.testng.annotations.Listeners; + +@Listeners(ListenerEnabledBaseClass.class) +public class ListenerEnabledBaseClass implements ITestListener, ISuiteListener { + + @Override + public void onStart(ISuite suite) { + suite.addListener(new DynamicSuiteListener()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue2061/TestClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2061/TestClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue2061/TestClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2061/TestClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.listeners.issue2061; + +import org.testng.annotations.Test; + +public class TestClassSample extends ListenerEnabledBaseClass { + + @Test + public void testMethod() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue2220/IssueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2220/IssueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue2220/IssueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2220/IssueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,35 @@ +package test.listeners.issue2220; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Arrays; +import java.util.List; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import test.SimpleBaseTest; + +public class IssueTest extends SimpleBaseTest { + + @Test + public void ensureAnnotatedListenersAreWiredInOnlyOnce() { + XmlSuite xmlsuite = createXmlSuite("my_suite"); + createXmlTest(xmlsuite, "test_1", TestClass01.class); + createXmlTest(xmlsuite, "test_2", TestClass02.class); + TestNG testng = create(xmlsuite); + testng.run(); + List expected = + Arrays.asList( + "started__test_1", + "started_test_method_test.listeners.issue2220.TestClass01.test01", + "started_test_method_test.listeners.issue2220.TestClass01.test02", + "started_test_method_test.listeners.issue2220.TestClass01.test03", + "finished__test_1", + "started__test_2", + "started_test_method_test.listeners.issue2220.TestClass02.test01", + "started_test_method_test.listeners.issue2220.TestClass02.test02", + "started_test_method_test.listeners.issue2220.TestClass02.test03", + "finished__test_2"); + assertThat(Listener1.logs).containsExactlyElementsOf(expected); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue2220/Listener1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2220/Listener1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue2220/Listener1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2220/Listener1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,31 @@ +package test.listeners.issue2220; + +import java.util.LinkedList; +import java.util.List; +import org.testng.ITestContext; +import org.testng.ITestListener; +import org.testng.ITestResult; + +public class Listener1 implements ITestListener { + + static final List logs = new LinkedList<>(); + + @Override + public void onTestStart(ITestResult result) { + logs.add("started_test_method_" + getMethodName(result)); + } + + @Override + public void onStart(ITestContext context) { + logs.add("started__" + context.getName()); + } + + @Override + public void onFinish(ITestContext context) { + logs.add("finished__" + context.getName()); + } + + private static String getMethodName(ITestResult result) { + return result.getTestClass().getRealClass().getName() + "." + result.getName(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue2220/TestClass01.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2220/TestClass01.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue2220/TestClass01.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2220/TestClass01.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,21 @@ +package test.listeners.issue2220; + +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +@Listeners(Listener1.class) +public class TestClass01 { + + @BeforeClass + public void setup() {} + + @Test(priority = 1) + public void test01() {} + + @Test(priority = 2) + public void test02() {} + + @Test(priority = 3) + public void test03() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue2220/TestClass02.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2220/TestClass02.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue2220/TestClass02.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2220/TestClass02.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,21 @@ +package test.listeners.issue2220; + +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +@Listeners(Listener1.class) +public class TestClass02 { + + @BeforeClass + public void setup() {} + + @Test(priority = 1) + public void test01() {} + + @Test(priority = 2) + public void test02() {} + + @Test(priority = 3) + public void test03() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue2328/ConfigListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2328/ConfigListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue2328/ConfigListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2328/ConfigListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,36 @@ +package test.listeners.issue2328; + +import java.util.HashMap; +import java.util.Map; +import org.testng.IConfigurationListener; +import org.testng.ITestNGMethod; +import org.testng.ITestResult; + +public class ConfigListener implements IConfigurationListener { + + private final Map data = new HashMap<>(); + + public ITestNGMethod getDataFor(String key) { + return data.get(key); + } + + @Override + public void beforeConfiguration(ITestResult tr, ITestNGMethod tm) { + data.put("before", tm); + } + + @Override + public void onConfigurationFailure(ITestResult tr, ITestNGMethod tm) { + data.put("failed", tm); + } + + @Override + public void onConfigurationSkip(ITestResult tr, ITestNGMethod tm) { + data.put("skip", tm); + } + + @Override + public void onConfigurationSuccess(ITestResult tr, ITestNGMethod tm) { + data.put("success", tm); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue2328/IssueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2328/IssueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue2328/IssueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2328/IssueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,25 @@ +package test.listeners.issue2328; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class IssueTest extends SimpleBaseTest { + + private static final String TEST_METHOD = + "test.listeners.issue2328.SampleWithConfiguration.testMethod"; + + @Test(description = "GITHUB-2328") + public void testIfTestMethodInfoPassedToConfigListeners() { + TestNG testng = create(SampleWithConfiguration.class); + ConfigListener listener = new ConfigListener(); + testng.addListener(listener); + testng.run(); + assertThat(listener.getDataFor("before").getQualifiedName()).isEqualTo(TEST_METHOD); + assertThat(listener.getDataFor("failed").getQualifiedName()).isEqualTo(TEST_METHOD); + assertThat(listener.getDataFor("skip").getQualifiedName()).isEqualTo(TEST_METHOD); + assertThat(listener.getDataFor("success").getQualifiedName()).isEqualTo(TEST_METHOD); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue2328/SampleWithConfiguration.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2328/SampleWithConfiguration.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue2328/SampleWithConfiguration.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2328/SampleWithConfiguration.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,21 @@ +package test.listeners.issue2328; + +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class SampleWithConfiguration { + + @BeforeMethod + public void passingConfig() {} + + @BeforeMethod(dependsOnMethods = "passingConfig") + public void failingConfig() { + throw new RuntimeException("Simulate failure"); + } + + @BeforeMethod(dependsOnMethods = "failingConfig") + public void skippingConfig() {} + + @Test + public void testMethod() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue2456/IssueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2456/IssueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue2456/IssueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2456/IssueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package test.listeners.issue2456; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.internal.ExitCode; +import test.SimpleBaseTest; + +public class IssueTest extends SimpleBaseTest { + + @Test(description = "GITHUB-2456") + public void testEavesdroppingIntoDataProviderExceptions() { + TestNG testng = create(TestClassSample.class); + SimpleErrorSniffingListener listener = new SimpleErrorSniffingListener(); + testng.addListener(listener); + testng.run(); + assertThat(listener.getTestMethod().getName()).isEqualTo("sampleTest"); + assertThat(listener.getDataProvider().getName()).isEqualTo("getData"); + assertThat(listener.getException()).isInstanceOf(TestClassSample.TestCaseFailedException.class); + assertThat(testng.getStatus()).isEqualTo(ExitCode.SKIPPED); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue2456/SimpleErrorSniffingListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2456/SimpleErrorSniffingListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue2456/SimpleErrorSniffingListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2456/SimpleErrorSniffingListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,32 @@ +package test.listeners.issue2456; + +import java.lang.reflect.Method; +import org.testng.IDataProviderListener; +import org.testng.ITestContext; +import org.testng.ITestNGMethod; + +public class SimpleErrorSniffingListener implements IDataProviderListener { + + private Method testMethod; + private Method dataProvider; + private Throwable exception; + + @Override + public void onDataProviderFailure(ITestNGMethod method, ITestContext ctx, RuntimeException t) { + this.testMethod = method.getConstructorOrMethod().getMethod(); + this.dataProvider = method.getDataProviderMethod().getMethod(); + this.exception = t.getCause(); + } + + public Method getDataProvider() { + return dataProvider; + } + + public Method getTestMethod() { + return testMethod; + } + + public Throwable getException() { + return exception; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue2456/TestClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2456/TestClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue2456/TestClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2456/TestClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,22 @@ +package test.listeners.issue2456; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class TestClassSample { + + @Test(dataProvider = "dp") + public void sampleTest(int i) {} + + @DataProvider(name = "dp") + public Object[][] getData() { + throw new TestCaseFailedException("dataprovider failed"); + } + + public static class TestCaseFailedException extends RuntimeException { + + public TestCaseFailedException(String message) { + super(message); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue2638/DummyInvokedMethodListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2638/DummyInvokedMethodListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue2638/DummyInvokedMethodListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2638/DummyInvokedMethodListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,30 @@ +package test.listeners.issue2638; + +import java.util.Collections; +import java.util.List; +import java.util.Map; +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.ITestResult; +import org.testng.collections.Lists; +import org.testng.collections.Maps; + +public class DummyInvokedMethodListener implements IInvokedMethodListener { + private static final Map> methods = Maps.newHashMap(); + + @Override + public void beforeInvocation(IInvokedMethod method, ITestResult testResult) { + String suiteName = testResult.getTestContext().getSuite().getName(); + methods + .computeIfAbsent(suiteName, k -> Lists.newArrayList()) + .add(method.getTestMethod().getQualifiedName()); + } + + public static List getMethods(String suiteName) { + return methods.getOrDefault(suiteName, Collections.emptyList()); + } + + public static void reset() { + methods.clear(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue2638/TestClassASample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2638/TestClassASample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue2638/TestClassASample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2638/TestClassASample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.listeners.issue2638; + +import org.testng.annotations.Test; + +public class TestClassASample { + + @Test + public void testMethod() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue2638/TestClassBSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2638/TestClassBSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/issue2638/TestClassBSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/issue2638/TestClassBSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.listeners.issue2638; + +import org.testng.annotations.Test; + +public class TestClassBSample { + + @Test + public void testMethod() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ordering/Constants.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ordering/Constants.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ordering/Constants.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ordering/Constants.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,70 @@ +package test.listeners.ordering; + +public interface Constants { + + String IALTERSUITELISTENER_ALTER = "org.testng.IAlterSuiteListener.alter(List suites)"; + String IANNOTATIONTRANSFORMER_TRANSFORM_3_ARGS = + "org.testng.IAnnotationTransformer.transform(ITestAnnotation annotation, Class testClass, Constructor testConstructor, Method testMethod)"; + String IANNOTATIONTRANSFORMER_TRANSFORM_4_ARGS = + "org.testng.IAnnotationTransformer.transform(IConfigurationAnnotation annotation, Class testClass, Constructor testConstructor, Method testMethod)"; + String IANNOTATIONTRANSFORMER_DATAPROVIDER = + "org.testng.IAnnotationTransformer.transform(IDataProviderAnnotation annotation, Method method)"; + String IANNOTATIONTRANSFORMER_FACTORY = + "org.testng.IAnnotationTransformer.transform(IFactoryAnnotation annotation, Method method)"; + String METHODINTERCEPTOR_INTERCEPT = + "org.testng.IMethodInterceptor.intercept(List methods, ITestContext context)"; + String IEXECUTION_VISUALISER_CONSUME_DOT_DEFINITION = + "org.testng.IExecutionVisualiser.consumeDotDefinition(String dotDefinition)"; + String IREPORTER_GENERATE_REPORT = + "org.testng.IReporter.generateReport(List xmlSuites, List suites, String outputDirectory)"; + + String ISUITELISTENER_ON_START = "org.testng.ISuiteListener.onStart()"; + String ISUITELISTENER_ON_FINISH = "org.testng.ISuiteListener.onFinish()"; + + String ITESTLISTENER_ON_START_TEST_METHOD = + "org.testng.ITestListener.onTestStart(ITestResult result)"; + String ITESTLISTENER_ON_TEST_FAILURE_TEST_METHOD = + "org.testng.ITestListener.onTestFailure(ITestResult result)"; + String ITESTLISTENER_ON_TEST_TIMEOUT_TEST_METHOD = + "org.testng.ITestListener.onTestFailedWithTimeout(ITestResult result)"; + String ITESTLISTENER_ON_TEST_SUCCESS_TEST_METHOD = + "org.testng.ITestListener.onTestSuccess(ITestResult result)"; + String ITESTLISTENER_ON_TEST_SKIPPED_TEST_METHOD = + "org.testng.ITestListener.onTestSkipped(ITestResult result)"; + + String ITESTLISTENER_ON_START_TEST_TAG = "org.testng.ITestListener.onStart(ITestContext context)"; + String ITESTLISTENER_ON_FINISH_TEST_TAG = + "org.testng.ITestListener.onFinish(ITestContext context)"; + + String ICLASSLISTENER_ON_BEFORE_CLASS = + "org.testng.IClassListener.onBeforeClass(ITestClass testClass)"; + String ICLASSLISTENER_ON_AFTER_CLASS = + "org.testng.IClassListener.onAfterClass(ITestClass testClass)"; + + String IINVOKEDMETHODLISTENER_BEFORE_INVOCATION = + "org.testng.IInvokedMethodListener.beforeInvocation(IInvokedMethod method, ITestResult testResult)"; + String IINVOKEDMETHODLISTENER_BEFORE_INVOCATION_WITH_CONTEXT = + "org.testng.IInvokedMethodListener.beforeInvocation(IInvokedMethod method, ITestResult testResult, ITestContext context)"; + String IINVOKEDMETHODLISTENER_AFTER_INVOCATION = + "org.testng.IInvokedMethodListener.afterInvocation(IInvokedMethod method, ITestResult testResult)"; + String IINVOKEDMETHODLISTENER_AFTER_INVOCATION_WITH_CONTEXT = + "org.testng.IInvokedMethodListener.afterInvocation(IInvokedMethod method, ITestResult testResult, ITestContext context)"; + + String IEXECUTIONLISTENER_ON_EXECUTION_START = "org.testng.IExecutionListener.onExecutionStart()"; + String IEXECUTIONLISTENER_ON_EXECUTION_FINISH = + "org.testng.IExecutionListener.onExecutionFinish()"; + + String IDATAPROVIDERLISTENER_BEFORE_DATA_PROVIDER_EXECUTION = + "org.testng.IDataProviderListener.beforeDataProviderExecution(IDataProviderMethod dataProviderMethod, ITestNGMethod method, ITestContext iTestContext)"; + String IDATAPROVIDERLISTENER_AFTER_DATA_PROVIDER_EXECUTION = + "org.testng.IDataProviderListener.afterDataProviderExecution(IDataProviderMethod dataProviderMethod, ITestNGMethod method, ITestContext iTestContext)"; + + String ICONFIGURATIONLISTENER_BEFORE_CONFIGURATION = + "org.testng.IConfigurationListener.beforeConfiguration(ITestResult tr)"; + String ICONFIGURATIONLISTENER_ON_CONFIGURATION_SUCCESS = + "org.testng.IConfigurationListener.onConfigurationSuccess(ITestResult itr)"; + String ICONFIGURATIONLISTENER_ON_CONFIGURATION_FAILURE = + "org.testng.IConfigurationListener.onConfigurationFailure(ITestResult itr)"; + String ICONFIGURATIONLISTENER_ON_CONFIGURATION_SKIP = + "org.testng.IConfigurationListener.onConfigurationSkip(ITestResult itr)"; +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ordering/ListenerInvocationDefaultBehaviorTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ordering/ListenerInvocationDefaultBehaviorTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ordering/ListenerInvocationDefaultBehaviorTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ordering/ListenerInvocationDefaultBehaviorTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,477 @@ +package test.listeners.ordering; + +import static test.listeners.ordering.Constants.*; + +import java.util.Arrays; +import java.util.List; +import org.assertj.core.api.Assertions; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; +import test.listeners.issue1952.TestclassSample; + +public class ListenerInvocationDefaultBehaviorTest extends SimpleBaseTest { + + // Test methods along with configurations + + @Test(description = "Test class has only 1 passed config and test method") + public void testOrderHasOnlyPassedConfigAndTestMethod() { + List expected = + Arrays.asList( + IEXECUTIONLISTENER_ON_EXECUTION_START, + IALTERSUITELISTENER_ALTER, + IANNOTATIONTRANSFORMER_TRANSFORM_3_ARGS, + IANNOTATIONTRANSFORMER_TRANSFORM_4_ARGS, + ISUITELISTENER_ON_START, + ITESTLISTENER_ON_START_TEST_TAG, + METHODINTERCEPTOR_INTERCEPT, + METHODINTERCEPTOR_INTERCEPT, + ICLASSLISTENER_ON_BEFORE_CLASS, + ICONFIGURATIONLISTENER_BEFORE_CONFIGURATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION_WITH_CONTEXT, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION_WITH_CONTEXT, + ICONFIGURATIONLISTENER_ON_CONFIGURATION_SUCCESS, + ITESTLISTENER_ON_START_TEST_METHOD, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION_WITH_CONTEXT, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION_WITH_CONTEXT, + ITESTLISTENER_ON_TEST_SUCCESS_TEST_METHOD, + ICLASSLISTENER_ON_AFTER_CLASS, + IEXECUTION_VISUALISER_CONSUME_DOT_DEFINITION, + ITESTLISTENER_ON_FINISH_TEST_TAG, + ISUITELISTENER_ON_FINISH, + IREPORTER_GENERATE_REPORT, + IEXECUTIONLISTENER_ON_EXECUTION_FINISH); + runTest(expected, SimpleTestClassWithPassConfigAndMethod.class); + } + + @Test(description = "Test class has only 1 failed config and skipped test method") + public void testOrderHasOnlyFailedConfigAndSkippedTestMethod() { + List expected = + Arrays.asList( + IEXECUTIONLISTENER_ON_EXECUTION_START, + IALTERSUITELISTENER_ALTER, + IANNOTATIONTRANSFORMER_TRANSFORM_3_ARGS, + IANNOTATIONTRANSFORMER_TRANSFORM_4_ARGS, + ISUITELISTENER_ON_START, + ITESTLISTENER_ON_START_TEST_TAG, + METHODINTERCEPTOR_INTERCEPT, + METHODINTERCEPTOR_INTERCEPT, + ICLASSLISTENER_ON_BEFORE_CLASS, + ICONFIGURATIONLISTENER_BEFORE_CONFIGURATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION_WITH_CONTEXT, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION_WITH_CONTEXT, + ICONFIGURATIONLISTENER_ON_CONFIGURATION_FAILURE, + ITESTLISTENER_ON_START_TEST_METHOD, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION_WITH_CONTEXT, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION_WITH_CONTEXT, + ITESTLISTENER_ON_TEST_SKIPPED_TEST_METHOD, + ICLASSLISTENER_ON_AFTER_CLASS, + IEXECUTION_VISUALISER_CONSUME_DOT_DEFINITION, + ITESTLISTENER_ON_FINISH_TEST_TAG, + ISUITELISTENER_ON_FINISH, + IREPORTER_GENERATE_REPORT, + IEXECUTIONLISTENER_ON_EXECUTION_FINISH); + runTest(expected, SimpleTestClassWithFailedConfigAndSkippedTestMethod.class); + } + + @Test(description = "Test class has only 1 failed test method due to a timeout") + public void testOrderHasTimedoutTestMethod() { + List expected = + Arrays.asList( + IEXECUTIONLISTENER_ON_EXECUTION_START, + IALTERSUITELISTENER_ALTER, + IANNOTATIONTRANSFORMER_TRANSFORM_3_ARGS, + ISUITELISTENER_ON_START, + ITESTLISTENER_ON_START_TEST_TAG, + METHODINTERCEPTOR_INTERCEPT, + METHODINTERCEPTOR_INTERCEPT, + ICLASSLISTENER_ON_BEFORE_CLASS, + ITESTLISTENER_ON_START_TEST_METHOD, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION_WITH_CONTEXT, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION_WITH_CONTEXT, + ITESTLISTENER_ON_TEST_TIMEOUT_TEST_METHOD, + ICLASSLISTENER_ON_AFTER_CLASS, + IEXECUTION_VISUALISER_CONSUME_DOT_DEFINITION, + ITESTLISTENER_ON_FINISH_TEST_TAG, + ISUITELISTENER_ON_FINISH, + IREPORTER_GENERATE_REPORT, + IEXECUTIONLISTENER_ON_EXECUTION_FINISH); + runTest(expected, TestclassSample.class); + } + + @Test( + description = "Test class has only 1 failed config, 1 skipped config and skipped test method") + public void testOrderHasOnlyFailedAndSkippedConfigAndSkippedTestMethod() { + List expected = + Arrays.asList( + IEXECUTIONLISTENER_ON_EXECUTION_START, + IALTERSUITELISTENER_ALTER, + IANNOTATIONTRANSFORMER_TRANSFORM_3_ARGS, + IANNOTATIONTRANSFORMER_TRANSFORM_4_ARGS, + ISUITELISTENER_ON_START, + ITESTLISTENER_ON_START_TEST_TAG, + METHODINTERCEPTOR_INTERCEPT, + METHODINTERCEPTOR_INTERCEPT, + ICLASSLISTENER_ON_BEFORE_CLASS, + ICONFIGURATIONLISTENER_BEFORE_CONFIGURATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION_WITH_CONTEXT, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION_WITH_CONTEXT, + ICONFIGURATIONLISTENER_ON_CONFIGURATION_FAILURE, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION_WITH_CONTEXT, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION_WITH_CONTEXT, + ICONFIGURATIONLISTENER_ON_CONFIGURATION_SKIP, + ITESTLISTENER_ON_START_TEST_METHOD, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION_WITH_CONTEXT, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION_WITH_CONTEXT, + ITESTLISTENER_ON_TEST_SKIPPED_TEST_METHOD, + ICLASSLISTENER_ON_AFTER_CLASS, + IEXECUTION_VISUALISER_CONSUME_DOT_DEFINITION, + ITESTLISTENER_ON_FINISH_TEST_TAG, + ISUITELISTENER_ON_FINISH, + IREPORTER_GENERATE_REPORT, + IEXECUTIONLISTENER_ON_EXECUTION_FINISH); + runTest(expected, SimpleTestClassWithFailedAndSkippedConfigAndSkippedTestMethod.class); + } + + // All Data driven scenarios + + @Test(description = "Test class has only 1 passed test method powered by a data provider") + public void testOrderHasOnlyDataDrivenPassedMethod() { + List expected = + Arrays.asList( + IEXECUTIONLISTENER_ON_EXECUTION_START, + IALTERSUITELISTENER_ALTER, + IANNOTATIONTRANSFORMER_TRANSFORM_3_ARGS, + IANNOTATIONTRANSFORMER_DATAPROVIDER, + ISUITELISTENER_ON_START, + ITESTLISTENER_ON_START_TEST_TAG, + METHODINTERCEPTOR_INTERCEPT, + METHODINTERCEPTOR_INTERCEPT, + ICLASSLISTENER_ON_BEFORE_CLASS, + IDATAPROVIDERLISTENER_BEFORE_DATA_PROVIDER_EXECUTION, + IDATAPROVIDERLISTENER_AFTER_DATA_PROVIDER_EXECUTION, + ITESTLISTENER_ON_START_TEST_METHOD, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION_WITH_CONTEXT, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION_WITH_CONTEXT, + ITESTLISTENER_ON_TEST_SUCCESS_TEST_METHOD, + ITESTLISTENER_ON_START_TEST_METHOD, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION_WITH_CONTEXT, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION_WITH_CONTEXT, + ITESTLISTENER_ON_TEST_SUCCESS_TEST_METHOD, + ICLASSLISTENER_ON_AFTER_CLASS, + IEXECUTION_VISUALISER_CONSUME_DOT_DEFINITION, + ITESTLISTENER_ON_FINISH_TEST_TAG, + ISUITELISTENER_ON_FINISH, + IREPORTER_GENERATE_REPORT, + IEXECUTIONLISTENER_ON_EXECUTION_FINISH); + runTest(expected, SimpleTestClassWithDataDrivenPassMethod.class); + } + + @Test( + description = + "Test class has only 1 data provider driven test method with 1 passed and 1 failed iteration.") + public void testOrderHasOnlyDataDrivenMethodWithPassedAndFailedIteration() { + List expected = + Arrays.asList( + IEXECUTIONLISTENER_ON_EXECUTION_START, + IALTERSUITELISTENER_ALTER, + IANNOTATIONTRANSFORMER_TRANSFORM_3_ARGS, + IANNOTATIONTRANSFORMER_DATAPROVIDER, + ISUITELISTENER_ON_START, + ITESTLISTENER_ON_START_TEST_TAG, + METHODINTERCEPTOR_INTERCEPT, + METHODINTERCEPTOR_INTERCEPT, + ICLASSLISTENER_ON_BEFORE_CLASS, + IDATAPROVIDERLISTENER_BEFORE_DATA_PROVIDER_EXECUTION, + IDATAPROVIDERLISTENER_AFTER_DATA_PROVIDER_EXECUTION, + ITESTLISTENER_ON_START_TEST_METHOD, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION_WITH_CONTEXT, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION_WITH_CONTEXT, + ITESTLISTENER_ON_TEST_FAILURE_TEST_METHOD, + ITESTLISTENER_ON_START_TEST_METHOD, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION_WITH_CONTEXT, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION_WITH_CONTEXT, + ITESTLISTENER_ON_TEST_SUCCESS_TEST_METHOD, + ICLASSLISTENER_ON_AFTER_CLASS, + IEXECUTION_VISUALISER_CONSUME_DOT_DEFINITION, + ITESTLISTENER_ON_FINISH_TEST_TAG, + ISUITELISTENER_ON_FINISH, + IREPORTER_GENERATE_REPORT, + IEXECUTIONLISTENER_ON_EXECUTION_FINISH); + runTest(expected, SimpleTestClassWithDataDrivenMethodPassAndFailedIterations.class); + } + + // Regular test methods without any configuration methods. + + @Test(description = "Test class has only 1 passed test method") + public void testOrderHasOnlyPassedMethod() { + List expected = + Arrays.asList( + IEXECUTIONLISTENER_ON_EXECUTION_START, + IALTERSUITELISTENER_ALTER, + IANNOTATIONTRANSFORMER_TRANSFORM_3_ARGS, + ISUITELISTENER_ON_START, + ITESTLISTENER_ON_START_TEST_TAG, + METHODINTERCEPTOR_INTERCEPT, + METHODINTERCEPTOR_INTERCEPT, + ICLASSLISTENER_ON_BEFORE_CLASS, + ITESTLISTENER_ON_START_TEST_METHOD, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION_WITH_CONTEXT, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION_WITH_CONTEXT, + ITESTLISTENER_ON_TEST_SUCCESS_TEST_METHOD, + ICLASSLISTENER_ON_AFTER_CLASS, + IEXECUTION_VISUALISER_CONSUME_DOT_DEFINITION, + ITESTLISTENER_ON_FINISH_TEST_TAG, + ISUITELISTENER_ON_FINISH, + IREPORTER_GENERATE_REPORT, + IEXECUTIONLISTENER_ON_EXECUTION_FINISH); + runTest(expected, SimpleTestClassWithPassMethod.class); + } + + @Test(description = "Test class has only 1 failed test method") + public void testOrderHasOnlyFailedMethod() { + List expected = + Arrays.asList( + IEXECUTIONLISTENER_ON_EXECUTION_START, + IALTERSUITELISTENER_ALTER, + IANNOTATIONTRANSFORMER_TRANSFORM_3_ARGS, + ISUITELISTENER_ON_START, + ITESTLISTENER_ON_START_TEST_TAG, + METHODINTERCEPTOR_INTERCEPT, + METHODINTERCEPTOR_INTERCEPT, + ICLASSLISTENER_ON_BEFORE_CLASS, + ITESTLISTENER_ON_START_TEST_METHOD, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION_WITH_CONTEXT, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION_WITH_CONTEXT, + ITESTLISTENER_ON_TEST_FAILURE_TEST_METHOD, + ICLASSLISTENER_ON_AFTER_CLASS, + IEXECUTION_VISUALISER_CONSUME_DOT_DEFINITION, + ITESTLISTENER_ON_FINISH_TEST_TAG, + ISUITELISTENER_ON_FINISH, + IREPORTER_GENERATE_REPORT, + IEXECUTIONLISTENER_ON_EXECUTION_FINISH); + runTest(expected, SimpleTestClassWithFailedMethod.class); + } + + @Test(description = "Test class has only 1 failed test method and uses invocation counts") + public void testOrderHasOnlyFailedMethodMultipleInvocations() { + List expected = + Arrays.asList( + IEXECUTIONLISTENER_ON_EXECUTION_START, + IALTERSUITELISTENER_ALTER, + IANNOTATIONTRANSFORMER_TRANSFORM_3_ARGS, + ISUITELISTENER_ON_START, + ITESTLISTENER_ON_START_TEST_TAG, + METHODINTERCEPTOR_INTERCEPT, + METHODINTERCEPTOR_INTERCEPT, + ICLASSLISTENER_ON_BEFORE_CLASS, + ITESTLISTENER_ON_START_TEST_METHOD, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION_WITH_CONTEXT, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION_WITH_CONTEXT, + ITESTLISTENER_ON_TEST_FAILURE_TEST_METHOD, + ITESTLISTENER_ON_START_TEST_METHOD, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION_WITH_CONTEXT, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION_WITH_CONTEXT, + ITESTLISTENER_ON_TEST_FAILURE_TEST_METHOD, + ICLASSLISTENER_ON_AFTER_CLASS, + IEXECUTION_VISUALISER_CONSUME_DOT_DEFINITION, + ITESTLISTENER_ON_FINISH_TEST_TAG, + ISUITELISTENER_ON_FINISH, + IREPORTER_GENERATE_REPORT, + IEXECUTIONLISTENER_ON_EXECUTION_FINISH); + runTest(expected, SimpleTestClassWithFailedMethodMultipleInvocations.class); + } + + @Test( + description = + "Test class has only 1 failed test method and uses invocation counts but configured" + + "to skip failed invocations") + public void testOrderHasOnlyFailedMethodMultipleInvocationsAndSkipFailedInvocations() { + List expected = + Arrays.asList( + IEXECUTIONLISTENER_ON_EXECUTION_START, + IALTERSUITELISTENER_ALTER, + IANNOTATIONTRANSFORMER_TRANSFORM_3_ARGS, + ISUITELISTENER_ON_START, + ITESTLISTENER_ON_START_TEST_TAG, + METHODINTERCEPTOR_INTERCEPT, + METHODINTERCEPTOR_INTERCEPT, + ICLASSLISTENER_ON_BEFORE_CLASS, + ITESTLISTENER_ON_START_TEST_METHOD, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION_WITH_CONTEXT, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION_WITH_CONTEXT, + ITESTLISTENER_ON_TEST_FAILURE_TEST_METHOD, + ITESTLISTENER_ON_START_TEST_METHOD, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION_WITH_CONTEXT, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION_WITH_CONTEXT, + ITESTLISTENER_ON_TEST_SKIPPED_TEST_METHOD, + ICLASSLISTENER_ON_AFTER_CLASS, + IEXECUTION_VISUALISER_CONSUME_DOT_DEFINITION, + ITESTLISTENER_ON_FINISH_TEST_TAG, + ISUITELISTENER_ON_FINISH, + IREPORTER_GENERATE_REPORT, + IEXECUTIONLISTENER_ON_EXECUTION_FINISH); + runTest(expected, SimpleTestClassWithFailedMethodMultipleInvocations.class, true); + } + + @Test(description = "Test class has passed/failed/skipped test methods") + public void testOrderHasPassedFailedSkippedMethods() { + List expected = + Arrays.asList( + IEXECUTIONLISTENER_ON_EXECUTION_START, + IALTERSUITELISTENER_ALTER, + IANNOTATIONTRANSFORMER_TRANSFORM_3_ARGS, + ISUITELISTENER_ON_START, + ITESTLISTENER_ON_START_TEST_TAG, + METHODINTERCEPTOR_INTERCEPT, + METHODINTERCEPTOR_INTERCEPT, + ICLASSLISTENER_ON_BEFORE_CLASS, + ITESTLISTENER_ON_START_TEST_METHOD, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION_WITH_CONTEXT, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION_WITH_CONTEXT, + ITESTLISTENER_ON_TEST_FAILURE_TEST_METHOD, + IEXECUTION_VISUALISER_CONSUME_DOT_DEFINITION, + ITESTLISTENER_ON_START_TEST_METHOD, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION_WITH_CONTEXT, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION_WITH_CONTEXT, + ITESTLISTENER_ON_TEST_SUCCESS_TEST_METHOD, + IEXECUTION_VISUALISER_CONSUME_DOT_DEFINITION, + ITESTLISTENER_ON_START_TEST_METHOD, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION_WITH_CONTEXT, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION_WITH_CONTEXT, + ITESTLISTENER_ON_TEST_SKIPPED_TEST_METHOD, + ICLASSLISTENER_ON_AFTER_CLASS, + IEXECUTION_VISUALISER_CONSUME_DOT_DEFINITION, + ITESTLISTENER_ON_FINISH_TEST_TAG, + ISUITELISTENER_ON_FINISH, + IREPORTER_GENERATE_REPORT, + IEXECUTIONLISTENER_ON_EXECUTION_FINISH); + runTest(expected, SimpleTestClassWithPassFailMethods.class); + } + + @Test(description = "Test class has only 1 failed test method and is powered by factory") + public void testOrderHasOnlyFailedMethodPoweredByFactory() { + List expected = + Arrays.asList( + IEXECUTIONLISTENER_ON_EXECUTION_START, + IALTERSUITELISTENER_ALTER, + IANNOTATIONTRANSFORMER_TRANSFORM_3_ARGS, + IANNOTATIONTRANSFORMER_FACTORY, + ISUITELISTENER_ON_START, + ITESTLISTENER_ON_START_TEST_TAG, + METHODINTERCEPTOR_INTERCEPT, + METHODINTERCEPTOR_INTERCEPT, + ICLASSLISTENER_ON_BEFORE_CLASS, + ITESTLISTENER_ON_START_TEST_METHOD, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION_WITH_CONTEXT, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION_WITH_CONTEXT, + ITESTLISTENER_ON_TEST_FAILURE_TEST_METHOD, + ICLASSLISTENER_ON_AFTER_CLASS, + IEXECUTION_VISUALISER_CONSUME_DOT_DEFINITION, + ICLASSLISTENER_ON_BEFORE_CLASS, + ITESTLISTENER_ON_START_TEST_METHOD, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION_WITH_CONTEXT, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION_WITH_CONTEXT, + ITESTLISTENER_ON_TEST_FAILURE_TEST_METHOD, + ICLASSLISTENER_ON_AFTER_CLASS, + IEXECUTION_VISUALISER_CONSUME_DOT_DEFINITION, + ITESTLISTENER_ON_FINISH_TEST_TAG, + ISUITELISTENER_ON_FINISH, + IREPORTER_GENERATE_REPORT, + IEXECUTIONLISTENER_ON_EXECUTION_FINISH); + runTest(expected, SimpleTestClassPoweredByFactoryWithFailedMethod.class); + } + + @Test(description = "Test class has only 1 failed test method with retry analyzer") + public void testOrderHasOnlyFailedMethodWithRetryMechanism() { + List expected = + Arrays.asList( + IEXECUTIONLISTENER_ON_EXECUTION_START, + IALTERSUITELISTENER_ALTER, + IANNOTATIONTRANSFORMER_TRANSFORM_3_ARGS, + ISUITELISTENER_ON_START, + ITESTLISTENER_ON_START_TEST_TAG, + METHODINTERCEPTOR_INTERCEPT, + METHODINTERCEPTOR_INTERCEPT, + ICLASSLISTENER_ON_BEFORE_CLASS, + ITESTLISTENER_ON_START_TEST_METHOD, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION_WITH_CONTEXT, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION_WITH_CONTEXT, + ITESTLISTENER_ON_TEST_SKIPPED_TEST_METHOD, + ITESTLISTENER_ON_START_TEST_METHOD, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION_WITH_CONTEXT, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION_WITH_CONTEXT, + ITESTLISTENER_ON_TEST_FAILURE_TEST_METHOD, + ICLASSLISTENER_ON_AFTER_CLASS, + IEXECUTION_VISUALISER_CONSUME_DOT_DEFINITION, + ITESTLISTENER_ON_FINISH_TEST_TAG, + ISUITELISTENER_ON_FINISH, + IREPORTER_GENERATE_REPORT, + IEXECUTIONLISTENER_ON_EXECUTION_FINISH); + runTest(expected, SimpleTestClassWithFailedMethodHasRetryAnalyzer.class, true); + } + + private static void runTest(List expected, Class clazz) { + runTest(expected, clazz, false); + } + + private static void runTest(List expected, Class clazz, boolean skipInvocationCount) { + TestNG testng = create(clazz); + testng.setSkipFailedInvocationCounts(skipInvocationCount); + UniversalListener listener = new UniversalListener(); + testng.addListener(listener); + testng.alwaysRunListeners(true); + testng.run(); + Assertions.assertThat(listener.getMessages()).containsExactlyElementsOf(expected); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ordering/ListenerInvocationListenerInvocationDisabledBehaviorTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ordering/ListenerInvocationListenerInvocationDisabledBehaviorTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ordering/ListenerInvocationListenerInvocationDisabledBehaviorTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ordering/ListenerInvocationListenerInvocationDisabledBehaviorTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,462 @@ +package test.listeners.ordering; + +import static test.listeners.ordering.Constants.IALTERSUITELISTENER_ALTER; +import static test.listeners.ordering.Constants.IANNOTATIONTRANSFORMER_DATAPROVIDER; +import static test.listeners.ordering.Constants.IANNOTATIONTRANSFORMER_FACTORY; +import static test.listeners.ordering.Constants.IANNOTATIONTRANSFORMER_TRANSFORM_3_ARGS; +import static test.listeners.ordering.Constants.IANNOTATIONTRANSFORMER_TRANSFORM_4_ARGS; +import static test.listeners.ordering.Constants.ICLASSLISTENER_ON_AFTER_CLASS; +import static test.listeners.ordering.Constants.ICLASSLISTENER_ON_BEFORE_CLASS; +import static test.listeners.ordering.Constants.ICONFIGURATIONLISTENER_BEFORE_CONFIGURATION; +import static test.listeners.ordering.Constants.ICONFIGURATIONLISTENER_ON_CONFIGURATION_FAILURE; +import static test.listeners.ordering.Constants.ICONFIGURATIONLISTENER_ON_CONFIGURATION_SKIP; +import static test.listeners.ordering.Constants.ICONFIGURATIONLISTENER_ON_CONFIGURATION_SUCCESS; +import static test.listeners.ordering.Constants.IDATAPROVIDERLISTENER_AFTER_DATA_PROVIDER_EXECUTION; +import static test.listeners.ordering.Constants.IDATAPROVIDERLISTENER_BEFORE_DATA_PROVIDER_EXECUTION; +import static test.listeners.ordering.Constants.IEXECUTIONLISTENER_ON_EXECUTION_FINISH; +import static test.listeners.ordering.Constants.IEXECUTIONLISTENER_ON_EXECUTION_START; +import static test.listeners.ordering.Constants.IEXECUTION_VISUALISER_CONSUME_DOT_DEFINITION; +import static test.listeners.ordering.Constants.IINVOKEDMETHODLISTENER_AFTER_INVOCATION; +import static test.listeners.ordering.Constants.IINVOKEDMETHODLISTENER_AFTER_INVOCATION_WITH_CONTEXT; +import static test.listeners.ordering.Constants.IINVOKEDMETHODLISTENER_BEFORE_INVOCATION; +import static test.listeners.ordering.Constants.IINVOKEDMETHODLISTENER_BEFORE_INVOCATION_WITH_CONTEXT; +import static test.listeners.ordering.Constants.IREPORTER_GENERATE_REPORT; +import static test.listeners.ordering.Constants.ISUITELISTENER_ON_FINISH; +import static test.listeners.ordering.Constants.ISUITELISTENER_ON_START; +import static test.listeners.ordering.Constants.ITESTLISTENER_ON_FINISH_TEST_TAG; +import static test.listeners.ordering.Constants.ITESTLISTENER_ON_START_TEST_METHOD; +import static test.listeners.ordering.Constants.ITESTLISTENER_ON_START_TEST_TAG; +import static test.listeners.ordering.Constants.ITESTLISTENER_ON_TEST_FAILURE_TEST_METHOD; +import static test.listeners.ordering.Constants.ITESTLISTENER_ON_TEST_SKIPPED_TEST_METHOD; +import static test.listeners.ordering.Constants.ITESTLISTENER_ON_TEST_SUCCESS_TEST_METHOD; +import static test.listeners.ordering.Constants.METHODINTERCEPTOR_INTERCEPT; + +import java.util.Arrays; +import java.util.List; +import org.assertj.core.api.Assertions; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class ListenerInvocationListenerInvocationDisabledBehaviorTest extends SimpleBaseTest { + + // Test methods along with configurations + + @Test(description = "Test class has only 1 passed config and test method") + public void testOrderHasOnlyPassedConfigAndTestMethod() { + List expected = + Arrays.asList( + IEXECUTIONLISTENER_ON_EXECUTION_START, + IALTERSUITELISTENER_ALTER, + IANNOTATIONTRANSFORMER_TRANSFORM_3_ARGS, + IANNOTATIONTRANSFORMER_TRANSFORM_4_ARGS, + ISUITELISTENER_ON_START, + ITESTLISTENER_ON_START_TEST_TAG, + METHODINTERCEPTOR_INTERCEPT, + METHODINTERCEPTOR_INTERCEPT, + ICLASSLISTENER_ON_BEFORE_CLASS, + ICONFIGURATIONLISTENER_BEFORE_CONFIGURATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION_WITH_CONTEXT, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION_WITH_CONTEXT, + ICONFIGURATIONLISTENER_ON_CONFIGURATION_SUCCESS, + ITESTLISTENER_ON_START_TEST_METHOD, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION_WITH_CONTEXT, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION_WITH_CONTEXT, + ITESTLISTENER_ON_TEST_SUCCESS_TEST_METHOD, + ICLASSLISTENER_ON_AFTER_CLASS, + IEXECUTION_VISUALISER_CONSUME_DOT_DEFINITION, + ITESTLISTENER_ON_FINISH_TEST_TAG, + ISUITELISTENER_ON_FINISH, + IREPORTER_GENERATE_REPORT, + IEXECUTIONLISTENER_ON_EXECUTION_FINISH); + runTest(expected, SimpleTestClassWithPassConfigAndMethod.class); + } + + @Test(description = "Test class has only 1 failed config and skipped test method") + public void testOrderHasOnlyFailedConfigAndSkippedTestMethod() { + List expected = + Arrays.asList( + IEXECUTIONLISTENER_ON_EXECUTION_START, + IALTERSUITELISTENER_ALTER, + IANNOTATIONTRANSFORMER_TRANSFORM_3_ARGS, + IANNOTATIONTRANSFORMER_TRANSFORM_4_ARGS, + ISUITELISTENER_ON_START, + ITESTLISTENER_ON_START_TEST_TAG, + METHODINTERCEPTOR_INTERCEPT, + METHODINTERCEPTOR_INTERCEPT, + ICLASSLISTENER_ON_BEFORE_CLASS, + ICONFIGURATIONLISTENER_BEFORE_CONFIGURATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION_WITH_CONTEXT, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION_WITH_CONTEXT, + ICONFIGURATIONLISTENER_ON_CONFIGURATION_FAILURE, + ITESTLISTENER_ON_START_TEST_METHOD, + ITESTLISTENER_ON_TEST_SKIPPED_TEST_METHOD, + ICLASSLISTENER_ON_AFTER_CLASS, + IEXECUTION_VISUALISER_CONSUME_DOT_DEFINITION, + ITESTLISTENER_ON_FINISH_TEST_TAG, + ISUITELISTENER_ON_FINISH, + IREPORTER_GENERATE_REPORT, + IEXECUTIONLISTENER_ON_EXECUTION_FINISH); + runTest(expected, SimpleTestClassWithFailedConfigAndSkippedTestMethod.class); + } + + @Test( + description = "Test class has only 1 failed config, 1 skipped config and skipped test method") + public void testOrderHasOnlyFailedAndSkippedConfigAndSkippedTestMethod() { + List expected = + Arrays.asList( + IEXECUTIONLISTENER_ON_EXECUTION_START, + IALTERSUITELISTENER_ALTER, + IANNOTATIONTRANSFORMER_TRANSFORM_3_ARGS, + IANNOTATIONTRANSFORMER_TRANSFORM_4_ARGS, + ISUITELISTENER_ON_START, + ITESTLISTENER_ON_START_TEST_TAG, + METHODINTERCEPTOR_INTERCEPT, + METHODINTERCEPTOR_INTERCEPT, + ICLASSLISTENER_ON_BEFORE_CLASS, + ICONFIGURATIONLISTENER_BEFORE_CONFIGURATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION_WITH_CONTEXT, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION_WITH_CONTEXT, + ICONFIGURATIONLISTENER_ON_CONFIGURATION_FAILURE, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION_WITH_CONTEXT, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION_WITH_CONTEXT, + ICONFIGURATIONLISTENER_ON_CONFIGURATION_SKIP, + ITESTLISTENER_ON_START_TEST_METHOD, + ITESTLISTENER_ON_TEST_SKIPPED_TEST_METHOD, + ICLASSLISTENER_ON_AFTER_CLASS, + IEXECUTION_VISUALISER_CONSUME_DOT_DEFINITION, + ITESTLISTENER_ON_FINISH_TEST_TAG, + ISUITELISTENER_ON_FINISH, + IREPORTER_GENERATE_REPORT, + IEXECUTIONLISTENER_ON_EXECUTION_FINISH); + runTest(expected, SimpleTestClassWithFailedAndSkippedConfigAndSkippedTestMethod.class); + } + + // All Data driven scenarios + + @Test(description = "Test class has only 1 passed test method powered by a data provider") + public void testOrderHasOnlyDataDrivenPassedMethod() { + List expected = + Arrays.asList( + IEXECUTIONLISTENER_ON_EXECUTION_START, + IALTERSUITELISTENER_ALTER, + IANNOTATIONTRANSFORMER_TRANSFORM_3_ARGS, + IANNOTATIONTRANSFORMER_DATAPROVIDER, + ISUITELISTENER_ON_START, + ITESTLISTENER_ON_START_TEST_TAG, + METHODINTERCEPTOR_INTERCEPT, + METHODINTERCEPTOR_INTERCEPT, + ICLASSLISTENER_ON_BEFORE_CLASS, + IDATAPROVIDERLISTENER_BEFORE_DATA_PROVIDER_EXECUTION, + IDATAPROVIDERLISTENER_AFTER_DATA_PROVIDER_EXECUTION, + ITESTLISTENER_ON_START_TEST_METHOD, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION_WITH_CONTEXT, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION_WITH_CONTEXT, + ITESTLISTENER_ON_TEST_SUCCESS_TEST_METHOD, + ITESTLISTENER_ON_START_TEST_METHOD, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION_WITH_CONTEXT, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION_WITH_CONTEXT, + ITESTLISTENER_ON_TEST_SUCCESS_TEST_METHOD, + ICLASSLISTENER_ON_AFTER_CLASS, + IEXECUTION_VISUALISER_CONSUME_DOT_DEFINITION, + ITESTLISTENER_ON_FINISH_TEST_TAG, + ISUITELISTENER_ON_FINISH, + IREPORTER_GENERATE_REPORT, + IEXECUTIONLISTENER_ON_EXECUTION_FINISH); + runTest(expected, SimpleTestClassWithDataDrivenPassMethod.class); + } + + @Test( + description = + "Test class has only 1 data provider driven test method with 1 passed and 1 failed iteration.") + public void testOrderHasOnlyDataDrivenMethodWithPassedAndFailedIteration() { + List expected = + Arrays.asList( + IEXECUTIONLISTENER_ON_EXECUTION_START, + IALTERSUITELISTENER_ALTER, + IANNOTATIONTRANSFORMER_TRANSFORM_3_ARGS, + IANNOTATIONTRANSFORMER_DATAPROVIDER, + ISUITELISTENER_ON_START, + ITESTLISTENER_ON_START_TEST_TAG, + METHODINTERCEPTOR_INTERCEPT, + METHODINTERCEPTOR_INTERCEPT, + ICLASSLISTENER_ON_BEFORE_CLASS, + IDATAPROVIDERLISTENER_BEFORE_DATA_PROVIDER_EXECUTION, + IDATAPROVIDERLISTENER_AFTER_DATA_PROVIDER_EXECUTION, + ITESTLISTENER_ON_START_TEST_METHOD, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION_WITH_CONTEXT, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION_WITH_CONTEXT, + ITESTLISTENER_ON_TEST_FAILURE_TEST_METHOD, + ITESTLISTENER_ON_START_TEST_METHOD, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION_WITH_CONTEXT, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION_WITH_CONTEXT, + ITESTLISTENER_ON_TEST_SUCCESS_TEST_METHOD, + ICLASSLISTENER_ON_AFTER_CLASS, + IEXECUTION_VISUALISER_CONSUME_DOT_DEFINITION, + ITESTLISTENER_ON_FINISH_TEST_TAG, + ISUITELISTENER_ON_FINISH, + IREPORTER_GENERATE_REPORT, + IEXECUTIONLISTENER_ON_EXECUTION_FINISH); + runTest(expected, SimpleTestClassWithDataDrivenMethodPassAndFailedIterations.class); + } + + // Regular test methods without any configuration methods. + + @Test(description = "Test class has only 1 passed test method") + public void testOrderHasOnlyPassedMethod() { + List expected = + Arrays.asList( + IEXECUTIONLISTENER_ON_EXECUTION_START, + IALTERSUITELISTENER_ALTER, + IANNOTATIONTRANSFORMER_TRANSFORM_3_ARGS, + ISUITELISTENER_ON_START, + ITESTLISTENER_ON_START_TEST_TAG, + METHODINTERCEPTOR_INTERCEPT, + METHODINTERCEPTOR_INTERCEPT, + ICLASSLISTENER_ON_BEFORE_CLASS, + ITESTLISTENER_ON_START_TEST_METHOD, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION_WITH_CONTEXT, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION_WITH_CONTEXT, + ITESTLISTENER_ON_TEST_SUCCESS_TEST_METHOD, + ICLASSLISTENER_ON_AFTER_CLASS, + IEXECUTION_VISUALISER_CONSUME_DOT_DEFINITION, + ITESTLISTENER_ON_FINISH_TEST_TAG, + ISUITELISTENER_ON_FINISH, + IREPORTER_GENERATE_REPORT, + IEXECUTIONLISTENER_ON_EXECUTION_FINISH); + runTest(expected, SimpleTestClassWithPassMethod.class); + } + + @Test(description = "Test class has only 1 failed test method") + public void testOrderHasOnlyFailedMethod() { + List expected = + Arrays.asList( + IEXECUTIONLISTENER_ON_EXECUTION_START, + IALTERSUITELISTENER_ALTER, + IANNOTATIONTRANSFORMER_TRANSFORM_3_ARGS, + ISUITELISTENER_ON_START, + ITESTLISTENER_ON_START_TEST_TAG, + METHODINTERCEPTOR_INTERCEPT, + METHODINTERCEPTOR_INTERCEPT, + ICLASSLISTENER_ON_BEFORE_CLASS, + ITESTLISTENER_ON_START_TEST_METHOD, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION_WITH_CONTEXT, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION_WITH_CONTEXT, + ITESTLISTENER_ON_TEST_FAILURE_TEST_METHOD, + ICLASSLISTENER_ON_AFTER_CLASS, + IEXECUTION_VISUALISER_CONSUME_DOT_DEFINITION, + ITESTLISTENER_ON_FINISH_TEST_TAG, + ISUITELISTENER_ON_FINISH, + IREPORTER_GENERATE_REPORT, + IEXECUTIONLISTENER_ON_EXECUTION_FINISH); + runTest(expected, SimpleTestClassWithFailedMethod.class); + } + + @Test(description = "Test class has only 1 failed test method and uses invocation counts") + public void testOrderHasOnlyFailedMethodMultipleInvocations() { + List expected = + Arrays.asList( + IEXECUTIONLISTENER_ON_EXECUTION_START, + IALTERSUITELISTENER_ALTER, + IANNOTATIONTRANSFORMER_TRANSFORM_3_ARGS, + ISUITELISTENER_ON_START, + ITESTLISTENER_ON_START_TEST_TAG, + METHODINTERCEPTOR_INTERCEPT, + METHODINTERCEPTOR_INTERCEPT, + ICLASSLISTENER_ON_BEFORE_CLASS, + ITESTLISTENER_ON_START_TEST_METHOD, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION_WITH_CONTEXT, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION_WITH_CONTEXT, + ITESTLISTENER_ON_TEST_FAILURE_TEST_METHOD, + ITESTLISTENER_ON_START_TEST_METHOD, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION_WITH_CONTEXT, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION_WITH_CONTEXT, + ITESTLISTENER_ON_TEST_FAILURE_TEST_METHOD, + ICLASSLISTENER_ON_AFTER_CLASS, + IEXECUTION_VISUALISER_CONSUME_DOT_DEFINITION, + ITESTLISTENER_ON_FINISH_TEST_TAG, + ISUITELISTENER_ON_FINISH, + IREPORTER_GENERATE_REPORT, + IEXECUTIONLISTENER_ON_EXECUTION_FINISH); + runTest(expected, SimpleTestClassWithFailedMethodMultipleInvocations.class); + } + + @Test( + description = + "Test class has only 1 failed test method and uses invocation counts but configured" + + "to skip failed invocations") + public void testOrderHasOnlyFailedMethodMultipleInvocationsAndSkipFailedInvocations() { + List expected = + Arrays.asList( + IEXECUTIONLISTENER_ON_EXECUTION_START, + IALTERSUITELISTENER_ALTER, + IANNOTATIONTRANSFORMER_TRANSFORM_3_ARGS, + ISUITELISTENER_ON_START, + ITESTLISTENER_ON_START_TEST_TAG, + METHODINTERCEPTOR_INTERCEPT, + METHODINTERCEPTOR_INTERCEPT, + ICLASSLISTENER_ON_BEFORE_CLASS, + ITESTLISTENER_ON_START_TEST_METHOD, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION_WITH_CONTEXT, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION_WITH_CONTEXT, + ITESTLISTENER_ON_TEST_FAILURE_TEST_METHOD, + ITESTLISTENER_ON_START_TEST_METHOD, + ITESTLISTENER_ON_TEST_SKIPPED_TEST_METHOD, + ICLASSLISTENER_ON_AFTER_CLASS, + IEXECUTION_VISUALISER_CONSUME_DOT_DEFINITION, + ITESTLISTENER_ON_FINISH_TEST_TAG, + ISUITELISTENER_ON_FINISH, + IREPORTER_GENERATE_REPORT, + IEXECUTIONLISTENER_ON_EXECUTION_FINISH); + runTest(expected, SimpleTestClassWithFailedMethodMultipleInvocations.class, true); + } + + @Test(description = "Test class has passed/failed/skipped test methods") + public void testOrderHasPassedFailedSkippedMethods() { + List expected = + Arrays.asList( + IEXECUTIONLISTENER_ON_EXECUTION_START, + IALTERSUITELISTENER_ALTER, + IANNOTATIONTRANSFORMER_TRANSFORM_3_ARGS, + ISUITELISTENER_ON_START, + ITESTLISTENER_ON_START_TEST_TAG, + METHODINTERCEPTOR_INTERCEPT, + METHODINTERCEPTOR_INTERCEPT, + ICLASSLISTENER_ON_BEFORE_CLASS, + ITESTLISTENER_ON_START_TEST_METHOD, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION_WITH_CONTEXT, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION_WITH_CONTEXT, + ITESTLISTENER_ON_TEST_FAILURE_TEST_METHOD, + IEXECUTION_VISUALISER_CONSUME_DOT_DEFINITION, + ITESTLISTENER_ON_START_TEST_METHOD, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION_WITH_CONTEXT, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION_WITH_CONTEXT, + ITESTLISTENER_ON_TEST_SUCCESS_TEST_METHOD, + IEXECUTION_VISUALISER_CONSUME_DOT_DEFINITION, + ITESTLISTENER_ON_START_TEST_METHOD, + ITESTLISTENER_ON_TEST_SKIPPED_TEST_METHOD, + ICLASSLISTENER_ON_AFTER_CLASS, + IEXECUTION_VISUALISER_CONSUME_DOT_DEFINITION, + ITESTLISTENER_ON_FINISH_TEST_TAG, + ISUITELISTENER_ON_FINISH, + IREPORTER_GENERATE_REPORT, + IEXECUTIONLISTENER_ON_EXECUTION_FINISH); + runTest(expected, SimpleTestClassWithPassFailMethods.class); + } + + @Test(description = "Test class has only 1 failed test method and is powered by factory") + public void testOrderHasOnlyFailedMethodPoweredByFactory() { + List expected = + Arrays.asList( + IEXECUTIONLISTENER_ON_EXECUTION_START, + IALTERSUITELISTENER_ALTER, + IANNOTATIONTRANSFORMER_TRANSFORM_3_ARGS, + IANNOTATIONTRANSFORMER_FACTORY, + ISUITELISTENER_ON_START, + ITESTLISTENER_ON_START_TEST_TAG, + METHODINTERCEPTOR_INTERCEPT, + METHODINTERCEPTOR_INTERCEPT, + ICLASSLISTENER_ON_BEFORE_CLASS, + ITESTLISTENER_ON_START_TEST_METHOD, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION_WITH_CONTEXT, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION_WITH_CONTEXT, + ITESTLISTENER_ON_TEST_FAILURE_TEST_METHOD, + ICLASSLISTENER_ON_AFTER_CLASS, + IEXECUTION_VISUALISER_CONSUME_DOT_DEFINITION, + ICLASSLISTENER_ON_BEFORE_CLASS, + ITESTLISTENER_ON_START_TEST_METHOD, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION_WITH_CONTEXT, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION_WITH_CONTEXT, + ITESTLISTENER_ON_TEST_FAILURE_TEST_METHOD, + ICLASSLISTENER_ON_AFTER_CLASS, + IEXECUTION_VISUALISER_CONSUME_DOT_DEFINITION, + ITESTLISTENER_ON_FINISH_TEST_TAG, + ISUITELISTENER_ON_FINISH, + IREPORTER_GENERATE_REPORT, + IEXECUTIONLISTENER_ON_EXECUTION_FINISH); + runTest(expected, SimpleTestClassPoweredByFactoryWithFailedMethod.class); + } + + @Test(description = "Test class has only 1 failed test method with retry analyzer") + public void testOrderHasOnlyFailedMethodWithRetryMechanism() { + List expected = + Arrays.asList( + IEXECUTIONLISTENER_ON_EXECUTION_START, + IALTERSUITELISTENER_ALTER, + IANNOTATIONTRANSFORMER_TRANSFORM_3_ARGS, + ISUITELISTENER_ON_START, + ITESTLISTENER_ON_START_TEST_TAG, + METHODINTERCEPTOR_INTERCEPT, + METHODINTERCEPTOR_INTERCEPT, + ICLASSLISTENER_ON_BEFORE_CLASS, + ITESTLISTENER_ON_START_TEST_METHOD, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION_WITH_CONTEXT, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION_WITH_CONTEXT, + ITESTLISTENER_ON_TEST_SKIPPED_TEST_METHOD, + ITESTLISTENER_ON_START_TEST_METHOD, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION, + IINVOKEDMETHODLISTENER_BEFORE_INVOCATION_WITH_CONTEXT, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION, + IINVOKEDMETHODLISTENER_AFTER_INVOCATION_WITH_CONTEXT, + ITESTLISTENER_ON_TEST_FAILURE_TEST_METHOD, + ICLASSLISTENER_ON_AFTER_CLASS, + IEXECUTION_VISUALISER_CONSUME_DOT_DEFINITION, + ITESTLISTENER_ON_FINISH_TEST_TAG, + ISUITELISTENER_ON_FINISH, + IREPORTER_GENERATE_REPORT, + IEXECUTIONLISTENER_ON_EXECUTION_FINISH); + runTest(expected, SimpleTestClassWithFailedMethodHasRetryAnalyzer.class, true); + } + + private static void runTest(List expected, Class clazz) { + runTest(expected, clazz, false); + } + + private static void runTest(List expected, Class clazz, boolean skipInvocationCount) { + TestNG testng = create(clazz); + testng.setSkipFailedInvocationCounts(skipInvocationCount); + UniversalListener listener = new UniversalListener(); + testng.addListener(listener); + testng.alwaysRunListeners(false); + testng.run(); + Assertions.assertThat(listener.getMessages()).containsExactlyElementsOf(expected); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassPoweredByFactoryWithFailedMethod.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassPoweredByFactoryWithFailedMethod.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassPoweredByFactoryWithFailedMethod.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassPoweredByFactoryWithFailedMethod.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,21 @@ +package test.listeners.ordering; + +import org.testng.Assert; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +public class SimpleTestClassPoweredByFactoryWithFailedMethod { + + @Factory + public static Object[] create() { + return new Object[] { + new SimpleTestClassPoweredByFactoryWithFailedMethod(), + new SimpleTestClassPoweredByFactoryWithFailedMethod(), + }; + } + + @Test + public void testWillFail() { + Assert.fail(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithDataDrivenMethodPassAndFailedIterations.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithDataDrivenMethodPassAndFailedIterations.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithDataDrivenMethodPassAndFailedIterations.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithDataDrivenMethodPassAndFailedIterations.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.listeners.ordering; + +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class SimpleTestClassWithDataDrivenMethodPassAndFailedIterations { + + @Test(dataProvider = "dp") + public void testWillPass(int i) { + if (i == 1) { + Assert.fail(); + } + } + + @DataProvider(name = "dp") + public Object[][] getData() { + return new Object[][] {{1}, {2}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithDataDrivenPassMethod.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithDataDrivenPassMethod.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithDataDrivenPassMethod.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithDataDrivenPassMethod.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.listeners.ordering; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class SimpleTestClassWithDataDrivenPassMethod { + + @Test(dataProvider = "dp") + public void testWillPass(int i) {} + + @DataProvider(name = "dp") + public Object[][] getData() { + return new Object[][] {{1}, {2}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithFailedAndSkippedConfigAndSkippedTestMethod.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithFailedAndSkippedConfigAndSkippedTestMethod.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithFailedAndSkippedConfigAndSkippedTestMethod.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithFailedAndSkippedConfigAndSkippedTestMethod.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.listeners.ordering; + +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class SimpleTestClassWithFailedAndSkippedConfigAndSkippedTestMethod { + @BeforeClass + public void beforeClass() { + Assert.fail(); + } + + @BeforeMethod + public void beforeMethod() {} + + @Test + public void testWillPass() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithFailedConfigAndSkippedTestMethod.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithFailedConfigAndSkippedTestMethod.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithFailedConfigAndSkippedTestMethod.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithFailedConfigAndSkippedTestMethod.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.listeners.ordering; + +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +public class SimpleTestClassWithFailedConfigAndSkippedTestMethod { + @BeforeClass + public void beforeClass() { + Assert.fail(); + } + + @Test + public void testWillPass() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithFailedMethod.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithFailedMethod.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithFailedMethod.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithFailedMethod.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.listeners.ordering; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class SimpleTestClassWithFailedMethod { + + @Test + public void testWillFail() { + Assert.fail(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithFailedMethodHasRetryAnalyzer.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithFailedMethodHasRetryAnalyzer.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithFailedMethodHasRetryAnalyzer.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithFailedMethodHasRetryAnalyzer.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package test.listeners.ordering; + +import org.testng.Assert; +import org.testng.IRetryAnalyzer; +import org.testng.ITestResult; +import org.testng.annotations.Test; + +public class SimpleTestClassWithFailedMethodHasRetryAnalyzer { + + @Test(retryAnalyzer = OnceMore.class) + public void testWillFail() { + Assert.fail(); + } + + public static class OnceMore implements IRetryAnalyzer { + private int counter = 1; + + @Override + public boolean retry(ITestResult result) { + return counter++ != 2; + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithFailedMethodMultipleInvocations.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithFailedMethodMultipleInvocations.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithFailedMethodMultipleInvocations.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithFailedMethodMultipleInvocations.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.listeners.ordering; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class SimpleTestClassWithFailedMethodMultipleInvocations { + + @Test(invocationCount = 2) + public void testWillFail() { + Assert.fail(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithPassConfigAndMethod.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithPassConfigAndMethod.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithPassConfigAndMethod.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithPassConfigAndMethod.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.listeners.ordering; + +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +public class SimpleTestClassWithPassConfigAndMethod { + @BeforeClass + public void beforeClass() {} + + @Test + public void testWillPass() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithPassFailMethods.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithPassFailMethods.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithPassFailMethods.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithPassFailMethods.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ +package test.listeners.ordering; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class SimpleTestClassWithPassFailMethods { + + @Test + public void testWillPass() {} + + @Test + public void testWillFail() { + Assert.fail(); + } + + @Test(dependsOnMethods = "testWillFail") + public void testWillSkip() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithPassMethod.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithPassMethod.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithPassMethod.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ordering/SimpleTestClassWithPassMethod.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.listeners.ordering; + +import org.testng.annotations.Test; + +public class SimpleTestClassWithPassMethod { + + @Test + public void testWillPass() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ordering/UniversalListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ordering/UniversalListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/listeners/ordering/UniversalListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/listeners/ordering/UniversalListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,254 @@ +package test.listeners.ordering; + +import java.lang.reflect.Constructor; +import java.lang.reflect.Method; +import java.util.List; +import org.testng.IAlterSuiteListener; +import org.testng.IAnnotationTransformer; +import org.testng.IClassListener; +import org.testng.IConfigurationListener; +import org.testng.IDataProviderListener; +import org.testng.IDataProviderMethod; +import org.testng.IExecutionListener; +import org.testng.IExecutionVisualiser; +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.IMethodInstance; +import org.testng.IMethodInterceptor; +import org.testng.IReporter; +import org.testng.ISuite; +import org.testng.ISuiteListener; +import org.testng.ITestClass; +import org.testng.ITestContext; +import org.testng.ITestListener; +import org.testng.ITestNGMethod; +import org.testng.ITestResult; +import org.testng.annotations.IConfigurationAnnotation; +import org.testng.annotations.IDataProviderAnnotation; +import org.testng.annotations.IFactoryAnnotation; +import org.testng.annotations.IListenersAnnotation; +import org.testng.annotations.ITestAnnotation; +import org.testng.collections.Lists; +import org.testng.xml.XmlSuite; + +public class UniversalListener + implements IExecutionListener, + IAlterSuiteListener, + ISuiteListener, + ITestListener, + IClassListener, + IInvokedMethodListener, + IDataProviderListener, + IReporter, + IExecutionVisualiser, + IMethodInterceptor, + IAnnotationTransformer, + IConfigurationListener { + + private List messages = Lists.newLinkedList(); + + public List getMessages() { + return messages; + } + + public void onConfigurationSuccess(ITestResult itr) { + messages.add("org.testng.IConfigurationListener.onConfigurationSuccess(ITestResult itr)"); + } + + public void onConfigurationFailure(ITestResult itr) { + messages.add("org.testng.IConfigurationListener.onConfigurationFailure(ITestResult itr)"); + } + + public void onConfigurationSkip(ITestResult itr) { + messages.add("org.testng.IConfigurationListener.onConfigurationSkip(ITestResult itr)"); + } + + public void beforeConfiguration(ITestResult tr) { + messages.add("org.testng.IConfigurationListener.beforeConfiguration(ITestResult tr)"); + } + + @Override + public void generateReport( + List xmlSuites, List suites, String outputDirectory) { + messages.add( + "org.testng.IReporter.generateReport(List xmlSuites, List suites, String outputDirectory)"); + } + + @Override + public void beforeDataProviderExecution( + IDataProviderMethod dataProviderMethod, ITestNGMethod method, ITestContext iTestContext) { + messages.add( + "org.testng.IDataProviderListener.beforeDataProviderExecution(IDataProviderMethod dataProviderMethod, ITestNGMethod method, ITestContext iTestContext)"); + } + + @Override + public void afterDataProviderExecution( + IDataProviderMethod dataProviderMethod, ITestNGMethod method, ITestContext iTestContext) { + messages.add( + "org.testng.IDataProviderListener.afterDataProviderExecution(IDataProviderMethod dataProviderMethod, ITestNGMethod method, ITestContext iTestContext)"); + } + + @Override + public void beforeInvocation(IInvokedMethod method, ITestResult testResult) { + messages.add( + "org.testng.IInvokedMethodListener.beforeInvocation(IInvokedMethod method, ITestResult testResult)"); + } + + @Override + public void beforeInvocation( + IInvokedMethod method, ITestResult testResult, ITestContext context) { + messages.add( + "org.testng.IInvokedMethodListener.beforeInvocation(IInvokedMethod method, ITestResult testResult, ITestContext context)"); + } + + @Override + public void afterInvocation(IInvokedMethod method, ITestResult testResult) { + messages.add( + "org.testng.IInvokedMethodListener.afterInvocation(IInvokedMethod method, ITestResult testResult)"); + } + + @Override + public void afterInvocation(IInvokedMethod method, ITestResult testResult, ITestContext context) { + messages.add( + "org.testng.IInvokedMethodListener.afterInvocation(IInvokedMethod method, ITestResult testResult, ITestContext context)"); + } + + @Override + public void onAfterClass(ITestClass testClass) { + messages.add("org.testng.IClassListener.onAfterClass(ITestClass testClass)"); + } + + @Override + public void onBeforeClass(ITestClass testClass) { + messages.add("org.testng.IClassListener.onBeforeClass(ITestClass testClass)"); + } + + @Override + public void alter(List suites) { + messages.add("org.testng.IAlterSuiteListener.alter(List suites)"); + } + + @Override + public void onExecutionStart() { + messages.add("org.testng.IExecutionListener.onExecutionStart()"); + } + + @Override + public void onExecutionFinish() { + messages.add("org.testng.IExecutionListener.onExecutionFinish()"); + } + + @Override + public void onStart(ISuite suite) { + messages.add("org.testng.ISuiteListener.onStart()"); + } + + @Override + public void onFinish(ISuite suite) { + messages.add("org.testng.ISuiteListener.onFinish()"); + } + + @Override + public void onStart(ITestContext context) { + messages.add("org.testng.ITestListener.onStart(ITestContext context)"); + } + + @Override + public void onFinish(ITestContext context) { + messages.add("org.testng.ITestListener.onFinish(ITestContext context)"); + } + + @Override + public void onTestStart(ITestResult result) { + messages.add("org.testng.ITestListener.onTestStart(ITestResult result)"); + } + + @Override + public void onTestSuccess(ITestResult result) { + messages.add("org.testng.ITestListener.onTestSuccess(ITestResult result)"); + } + + @Override + public void onTestFailure(ITestResult result) { + messages.add("org.testng.ITestListener.onTestFailure(ITestResult result)"); + } + + @Override + public void onTestFailedWithTimeout(ITestResult result) { + messages.add("org.testng.ITestListener.onTestFailedWithTimeout(ITestResult result)"); + } + + @Override + public void onTestSkipped(ITestResult result) { + messages.add("org.testng.ITestListener.onTestSkipped(ITestResult result)"); + } + + @Override + public void onTestFailedButWithinSuccessPercentage(ITestResult result) { + messages.add( + "org.testng.ITestListener.onTestFailedButWithinSuccessPercentage(ITestResult result)"); + } + + @Override + public void consumeDotDefinition(String dotDefinition) { + messages.add("org.testng.IExecutionVisualiser.consumeDotDefinition(String dotDefinition)"); + } + + @Override + public List intercept(List methods, ITestContext context) { + String text = + "org.testng.IMethodInterceptor.intercept(List methods, ITestContext context)"; + messages.add(text); + return methods; + } + + @Override + public void transform(IFactoryAnnotation annotation, Method method) { + String text = + "org.testng.IAnnotationTransformer.transform(IFactoryAnnotation annotation, Method method)"; + if (!messages.contains(text)) { + messages.add(text); + } + } + + @Override + public void transform(IListenersAnnotation annotation, Class testClass) { + String text = + "org.testng.IAnnotationTransformer.transform(IListenersAnnotation annotation, Class testClass)"; + if (!messages.contains(text)) { + messages.add(text); + } + } + + @Override + public void transform(IDataProviderAnnotation annotation, Method method) { + String text = + "org.testng.IAnnotationTransformer.transform(IDataProviderAnnotation annotation, Method method)"; + if (!messages.contains(text)) { + messages.add(text); + } + } + + @Override + public void transform( + ITestAnnotation annotation, Class testClass, Constructor testConstructor, Method testMethod) { + String text = + "org.testng.IAnnotationTransformer.transform(ITestAnnotation annotation, Class testClass, Constructor testConstructor, Method testMethod)"; + if (!messages.contains(text)) { + messages.add(text); + } + } + + @Override + public void transform( + IConfigurationAnnotation annotation, + Class testClass, + Constructor testConstructor, + Method testMethod) { + String text = + "org.testng.IAnnotationTransformer.transform(IConfigurationAnnotation annotation, Class testClass, Constructor testConstructor, Method testMethod)"; + if (!messages.contains(text)) { + messages.add(text); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/mannotation/MAnnotation2SampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/mannotation/MAnnotation2SampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/mannotation/MAnnotation2SampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/mannotation/MAnnotation2SampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,90 @@ +package test.mannotation; + +import java.lang.reflect.Method; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.IConfigurationAnnotation; +import org.testng.annotations.ITestAnnotation; +import org.testng.annotations.Test; +import org.testng.internal.IConfiguration; +import org.testng.internal.annotations.IAnnotationFinder; +import org.testng.internal.annotations.IBeforeSuite; + +public class MAnnotation2SampleTest { + private IConfiguration m_configuration = new org.testng.internal.Configuration(); + private IAnnotationFinder m_finder; + + @BeforeClass(enabled = true, groups = "current") + public void init() { + m_finder = m_configuration.getAnnotationFinder(); + } + + @Test + public void verifyTestGroupsInheritance() throws SecurityException, NoSuchMethodException { + Map> dataset = new HashMap<>(); + dataset.put("groups1", Arrays.asList("method-test3", "child-class-test3", "base-class")); + dataset.put("groups2", Arrays.asList("child-class-test3", "base-class")); + + for (Map.Entry> data : dataset.entrySet()) { + Method method = MTest3.class.getMethod(data.getKey()); + ITestAnnotation test1 = m_finder.findAnnotation(method, ITestAnnotation.class); + List expected = data.getValue(); + Assert.assertEqualsNoOrder(expected.toArray(new String[expected.size()]), test1.getGroups()); + } + } + + @Test + public void verifyTestDependsOnGroupsInheritance() + throws SecurityException, NoSuchMethodException { + Map> dataset = new HashMap<>(); + dataset.put("dependsOnGroups1", Arrays.asList("dog2", "dog1", "dog3")); + dataset.put("dependsOnGroups2", Arrays.asList("dog1", "dog3")); + + for (Map.Entry> data : dataset.entrySet()) { + Method method = MTest3.class.getMethod(data.getKey()); + ITestAnnotation test1 = m_finder.findAnnotation(method, ITestAnnotation.class); + List expected = data.getValue(); + Assert.assertEqualsNoOrder( + expected.toArray(new String[expected.size()]), test1.getDependsOnGroups()); + } + } + + @Test + public void verifyTestDependsOnMethodsInheritance() + throws SecurityException, NoSuchMethodException { + Map> dataset = new HashMap<>(); + dataset.put("dependsOnMethods1", Arrays.asList("dom2", "dom3", "dom1")); + dataset.put("dependsOnMethods2", Arrays.asList("dom1", "dom3")); + for (Map.Entry> data : dataset.entrySet()) { + Method method = MTest3.class.getMethod(data.getKey()); + ITestAnnotation test1 = m_finder.findAnnotation(method, ITestAnnotation.class); + List expected = data.getValue(); + Assert.assertEqualsNoOrder( + expected.toArray(new String[expected.size()]), test1.getDependsOnMethods()); + } + } + + @Test + public void verifyConfigurationGroupsInheritance() + throws SecurityException, NoSuchMethodException { + Method method = MTest3.class.getMethod("beforeSuite"); + IConfigurationAnnotation test1 = + (IConfigurationAnnotation) m_finder.findAnnotation(method, IBeforeSuite.class); + Assert.assertEqualsNoOrder(new String[] {"method-test3"}, test1.getGroups()); + } + + @Test(groups = "current") + public void verifyTestEnabledInheritance() throws SecurityException, NoSuchMethodException { + String[] methods = new String[] {"enabled1", "enabled2"}; + Boolean[] expected = new Boolean[] {false, true}; + for (int i = 0; i < methods.length; i++) { + Method method = MTest3.class.getMethod(methods[i]); + ITestAnnotation test1 = m_finder.findAnnotation(method, ITestAnnotation.class); + Assert.assertEquals(test1.getEnabled(), expected[i].booleanValue()); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/mannotation/MAnnotationSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/mannotation/MAnnotationSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/mannotation/MAnnotationSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/mannotation/MAnnotationSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,130 @@ +package test.mannotation; + +import java.lang.reflect.Method; +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.IConfigurationAnnotation; +import org.testng.annotations.IDataProviderAnnotation; +import org.testng.annotations.IFactoryAnnotation; +import org.testng.annotations.IParametersAnnotation; +import org.testng.annotations.ITestAnnotation; +import org.testng.annotations.Test; +import org.testng.internal.IConfiguration; +import org.testng.internal.annotations.IAfterSuite; +import org.testng.internal.annotations.IAnnotationFinder; +import org.testng.internal.annotations.IBeforeSuite; + +@Test +public class MAnnotationSampleTest { + private IConfiguration m_configuration = new org.testng.internal.Configuration(); + private IAnnotationFinder m_finder; + + @BeforeClass + public void init() { + m_finder = m_configuration.getAnnotationFinder(); + } + + public void verifyTestClassLevel() { + // + // Tests on MTest1SampleTest + // + ITestAnnotation test1 = m_finder.findAnnotation(MTest1.class, ITestAnnotation.class); + Assert.assertTrue(test1.getEnabled()); + Assert.assertEquals(test1.getGroups(), new String[] {"group1", "group2"}); + Assert.assertTrue(test1.getAlwaysRun()); + Assert.assertEqualsNoOrder( + test1.getDependsOnGroups(), new String[] {"dg1", "dg2"}, "depends on groups"); + Assert.assertEqualsNoOrder(test1.getDependsOnMethods(), new String[] {"dm1", "dm2"}); + Assert.assertEquals(test1.getTimeOut(), 42); + Assert.assertEquals(test1.getInvocationCount(), 43); + Assert.assertEquals(test1.getSuccessPercentage(), 44); + Assert.assertEquals(test1.getThreadPoolSize(), 3); + Assert.assertEquals(test1.getDataProvider(), "dp"); + Assert.assertEquals(test1.getDescription(), "Class level description"); + + // + // Tests on MTest1SampleTest (test defaults) + // + ITestAnnotation test2 = m_finder.findAnnotation(MTest2.class, ITestAnnotation.class); + // test default for enabled + Assert.assertTrue(test2.getEnabled()); + Assert.assertFalse(test2.getAlwaysRun()); + Assert.assertEquals(test2.getTimeOut(), 0); + Assert.assertEquals(test2.getInvocationCount(), 1); + Assert.assertEquals(test2.getSuccessPercentage(), 100); + Assert.assertEquals(test2.getDataProvider(), ""); + } + + public void verifyTestMethodLevel() throws SecurityException, NoSuchMethodException { + // + // Tests on MTest1SampleTest + // + Method method = MTest1.class.getMethod("f"); + ITestAnnotation test1 = m_finder.findAnnotation(method, ITestAnnotation.class); + Assert.assertTrue(test1.getEnabled()); + Assert.assertEqualsNoOrder( + test1.getGroups(), new String[] {"group1", "group3", "group4", "group2"}); + Assert.assertTrue(test1.getAlwaysRun()); + Assert.assertEqualsNoOrder( + test1.getDependsOnGroups(), new String[] {"dg1", "dg2", "dg3", "dg4"}); + Assert.assertEqualsNoOrder( + test1.getDependsOnMethods(), new String[] {"dm1", "dm2", "dm3", "dm4"}); + Assert.assertEquals(test1.getTimeOut(), 142); + Assert.assertEquals(test1.getInvocationCount(), 143); + Assert.assertEquals(test1.getSuccessPercentage(), 61); + Assert.assertEquals(test1.getDataProvider(), "dp2"); + Assert.assertEquals(test1.getDescription(), "Method description"); + Class[] exceptions = test1.getExpectedExceptions(); + Assert.assertEquals(exceptions.length, 1); + Assert.assertEquals(exceptions[0], NullPointerException.class); + } + + public void verifyDataProvider() throws SecurityException, NoSuchMethodException { + Method method = MTest1.class.getMethod("otherConfigurations"); + IDataProviderAnnotation dataProvider = + m_finder.findAnnotation(method, IDataProviderAnnotation.class); + Assert.assertNotNull(dataProvider); + Assert.assertEquals(dataProvider.getName(), "dp4"); + } + + public void verifyFactory() throws SecurityException, NoSuchMethodException { + Method method = MTest1.class.getMethod("factory"); + IFactoryAnnotation factory = m_finder.findAnnotation(method, IFactoryAnnotation.class); + + Assert.assertNotNull(factory); + } + + public void verifyParameters() throws SecurityException, NoSuchMethodException { + Method method = MTest1.class.getMethod("parameters"); + IParametersAnnotation parameters = m_finder.findAnnotation(method, IParametersAnnotation.class); + + Assert.assertNotNull(parameters); + Assert.assertEquals(parameters.getValue(), new String[] {"pp1", "pp2", "pp3"}); + } + + public void verifyNewConfigurationBefore() throws SecurityException, NoSuchMethodException { + Method method = MTest1.class.getMethod("newBefore"); + IConfigurationAnnotation configuration = + (IConfigurationAnnotation) m_finder.findAnnotation(method, IBeforeSuite.class); + Assert.assertNotNull(configuration); + Assert.assertTrue(configuration.getBeforeSuite()); + + // Default values + Assert.assertTrue(configuration.getEnabled()); + Assert.assertTrue(configuration.getInheritGroups()); + Assert.assertFalse(configuration.getAlwaysRun()); + } + + public void verifyNewConfigurationAfter() throws SecurityException, NoSuchMethodException { + Method method = MTest1.class.getMethod("newAfter"); + IConfigurationAnnotation configuration = + (IConfigurationAnnotation) m_finder.findAnnotation(method, IAfterSuite.class); + Assert.assertNotNull(configuration); + Assert.assertTrue(configuration.getAfterSuite()); + + // Default values + Assert.assertTrue(configuration.getEnabled()); + Assert.assertTrue(configuration.getInheritGroups()); + Assert.assertFalse(configuration.getAlwaysRun()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/mannotation/MBase.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/mannotation/MBase.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/mannotation/MBase.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/mannotation/MBase.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.mannotation; + +import org.testng.annotations.Test; + +@Test(groups = "base-class", dependsOnGroups = "dog3", dependsOnMethods = "dom3", enabled = true) +public class MBase { + + public void baseTest() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/mannotation/MBaseCapture.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/mannotation/MBaseCapture.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/mannotation/MBaseCapture.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/mannotation/MBaseCapture.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.mannotation; + +import org.testng.annotations.Test; + +/** + * Make sure that if a method is declared in the base class and a child class adds a class-scoped + * group to it, that method receives it as well. + * + * @author cbeust + * @date Mar 22, 2006 + */ +public class MBaseCapture { + + @Test + public void shouldBelongToGroupChild() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/mannotation/MChildCaptureTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/mannotation/MChildCaptureTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/mannotation/MChildCaptureTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/mannotation/MChildCaptureTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.mannotation; + +import org.testng.annotations.Test; + +@Test(groups = "child") +public class MChildCaptureTest extends MBaseCapture { + + public void f() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/mannotation/MTest1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/mannotation/MTest1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/mannotation/MTest1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/mannotation/MTest1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,94 @@ +package test.mannotation; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.AfterGroups; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.AfterSuite; +import org.testng.annotations.AfterTest; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeGroups; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.BeforeSuite; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; + +@Test( + enabled = true, + groups = {"group1", "group2"}, + alwaysRun = true, + dependsOnGroups = {"dg1", "dg2"}, + dependsOnMethods = {"dm1", "dm2"}, + timeOut = 42, + invocationCount = 43, + successPercentage = 44, + threadPoolSize = 3, + dataProvider = "dp", + description = "Class level description") +public class MTest1 { + + public MTest1() {} + + @Test( + enabled = true, + groups = {"group3", "group4"}, + alwaysRun = true, + dependsOnGroups = {"dg3", "dg4"}, + dependsOnMethods = {"dm3", "dm4"}, + timeOut = 142, + invocationCount = 143, + successPercentage = 61, + dataProvider = "dp2", + description = "Method description", + expectedExceptions = NullPointerException.class) + public void f() {} + + @BeforeSuite + @BeforeTest + @BeforeGroups({"b1", "b2"}) + @BeforeClass + @BeforeMethod + public void before() {} + + @AfterSuite + @AfterTest + @AfterGroups({"a1", "a2"}) + @AfterClass + @AfterMethod + public void after() {} + + @Test( + groups = {"ogroup1", "ogroup2"}, + dependsOnGroups = {"odg1", "odg2"}, + dependsOnMethods = {"odm1", "odm2"}, + description = "beforeSuite description", + enabled = false, + alwaysRun = true, + expectedExceptions = {MTest1.class, MTest2.class}) + @DataProvider(name = "dp4") + public Object[][] otherConfigurations() { + return null; + } + + @Factory + public void factory() {} + + @Parameters({"pp1", "pp2", "pp3"}) + public void parameters() {} + + @BeforeSuite + @BeforeTest + @BeforeGroups + @BeforeClass + @BeforeMethod + public void newBefore() {} + + @AfterSuite + @AfterTest + @AfterGroups + @AfterClass + @AfterMethod + public void newAfter() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/mannotation/MTest2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/mannotation/MTest2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/mannotation/MTest2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/mannotation/MTest2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,6 @@ +package test.mannotation; + +import org.testng.annotations.Test; + +@Test(alwaysRun = false) +public class MTest2 {} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/mannotation/MTest3.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/mannotation/MTest3.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/mannotation/MTest3.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/mannotation/MTest3.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,35 @@ +package test.mannotation; + +import org.testng.annotations.BeforeSuite; +import org.testng.annotations.Test; + +@Test(groups = "child-class-test3", dependsOnGroups = "dog1", dependsOnMethods = "dom1") +public class MTest3 extends MBase { + + @Test(groups = "method-test3") + public void groups1() {} + + @Test + public void groups2() {} + + @Test(dependsOnGroups = "dog2") + public void dependsOnGroups1() {} + + @Test + public void dependsOnGroups2() {} + + @Test(dependsOnMethods = "dom2") + public void dependsOnMethods1() {} + + @Test + public void dependsOnMethods2() {} + + @Test(enabled = false) + public void enabled1() {} + + @Test + public void enabled2() {} + + @BeforeSuite(groups = "method-test3") + public void beforeSuite() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/mannotation/issue1976/IssueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/mannotation/issue1976/IssueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/mannotation/issue1976/IssueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/mannotation/issue1976/IssueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,139 @@ +package test.mannotation.issue1976; + +import java.io.File; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import org.testng.TestNG; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import org.testng.collections.Lists; +import testhelper.CompiledCode; +import testhelper.SimpleCompiler; +import testhelper.SourceCode; + +public class IssueTest extends ClassLoader { + + private static final File dir = SimpleCompiler.createTempDir(); + + private static final class MyClassLoader extends ClassLoader { + + public Class injectByteCode(CompiledCode byteCode) throws ClassNotFoundException { + Class clazz = + defineClass(byteCode.getName(), byteCode.getByteCode(), 0, byteCode.getByteCode().length); + return loadClass(clazz.getName()); + } + } + + @Test( + dataProvider = "dp", + expectedExceptions = TypeNotPresentException.class, + description = "GITHUB-1976") + public void testMethod(SourceCode... sources) throws IOException, ClassNotFoundException { + TestNG tng = new TestNG(false); + MyClassLoader classLoader = new MyClassLoader(); + tng.addClassLoader(classLoader); + List byteCodes = SimpleCompiler.compileSourceCode(sources); + List> classes = Lists.newArrayList(); + for (CompiledCode byteCode : byteCodes) { + if (byteCode.isSkipLoading()) { + continue; + } + classes.add(classLoader.injectByteCode(byteCode)); + } + tng.setTestClasses(classes.toArray(new Class[0])); + tng.run(); + Arrays.stream(sources).forEach(sourceCode -> sourceCode.getLocation().delete()); + } + + @DataProvider(name = "dp") + public Object[][] getTestData() throws IOException { + return new Object[][] { + {new SourceCode[] {missingTypeAtMethodLevel(), exception1()}}, + {new SourceCode[] {missingTypeAtClassLevel(), exception2()}}, + {new SourceCode[] {missingTypeAtConstructor(), dataProvider()}}, + // TODO fix test {new SourceCode[]{missingTypeAtListenerAnnotation(), listener()}}, + {new SourceCode[] {missingTypeAtBaseClass(), childClass(), exception3()}}, + }; + } + + private static SourceCode missingTypeAtMethodLevel() throws IOException { + String source = "import org.testng.annotations.Test\n;"; + source += "public class Sample1 {\n"; + source += " @Test(expectedExceptions = MyFancyException.class)\n"; + source += " public void testMethod() {\n"; + source += " }\n"; + source += "}\n"; + return new SourceCode("Sample1", source, dir, false); + } + + private static SourceCode exception1() throws IOException { + String source = "public class MyFancyException extends RuntimeException {}"; + return new SourceCode("MyFancyException", source, dir, true); + } + + private static SourceCode missingTypeAtClassLevel() throws IOException { + String source = "import org.testng.annotations.Test\n;"; + source += "@Test(expectedExceptions = AnotherException.class)\n"; + source += "public class Sample2 {\n"; + source += " public void testMethod() {\n"; + source += " }\n"; + source += "}\n"; + return new SourceCode("Sample2", source, dir, false); + } + + private static SourceCode missingTypeAtBaseClass() throws IOException { + String source = "@org.testng.annotations.Test(expectedExceptions = ThirdException.class)\n"; + source += "public class MyBaseClass {}\n"; + return new SourceCode("MyBaseClass", source, dir, false); + } + + private static SourceCode childClass() throws IOException { + String source = "public class ChildClass extends MyBaseClass {\n;"; + source += "public void testMethod() {}\n"; + source += "}\n"; + return new SourceCode("ChildClass", source, dir, false); + } + + private static SourceCode exception2() throws IOException { + String source = "public class AnotherException extends RuntimeException {}"; + return new SourceCode("AnotherException", source, dir, true); + } + + private static SourceCode exception3() throws IOException { + String source = "public class ThirdException extends RuntimeException {}"; + return new SourceCode("ThirdException", source, dir, true); + } + + private static SourceCode missingTypeAtConstructor() throws IOException { + String source = "import org.testng.annotations.Factory;\n"; + source += "public class FactorySample {\n"; + source += " @Factory(dataProviderClass = ExampleDP.class)\n"; + source += " public FactorySample(Object object) { }\n"; + source += "}\n"; + return new SourceCode("FactorySample", source, dir, false); + } + + private static SourceCode dataProvider() throws IOException { + String source = "import org.testng.annotations.DataProvider;\n"; + source += "public class ExampleDP {\n"; + source += " @DataProvider\n"; + source += " public Object[][] dp() {\n"; + source += " return new Object[][] {{}};"; + source += " }\n"; + source += "}"; + return new SourceCode("ExampleDP", source, dir, true); + } + + private static SourceCode missingTypeAtListenerAnnotation() throws IOException { + String source = "import org.testng.annotations.Listeners\n"; + source += "@Listeners(SampleListener.class)\n"; + source += "public class Sample4 {}\n"; + return new SourceCode("Sample4", source, dir, false); + } + + private static SourceCode listener() throws IOException { + String source = "public class SampleListener implements org.testng.ITestListener {}"; + return new SourceCode("SampleListener", source, dir, true); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodinterceptors/FastTestsFirstInterceptor.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/FastTestsFirstInterceptor.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodinterceptors/FastTestsFirstInterceptor.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/FastTestsFirstInterceptor.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,30 @@ +package test.methodinterceptors; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import org.testng.IMethodInstance; +import org.testng.IMethodInterceptor; +import org.testng.ITestContext; +import org.testng.annotations.Test; + +public class FastTestsFirstInterceptor implements IMethodInterceptor { + @Override + public List intercept(List methods, ITestContext context) { + List result = new ArrayList<>(); + for (IMethodInstance m : methods) { + Test test = m.getMethod().getConstructorOrMethod().getMethod().getAnnotation(Test.class); + Set groups = new HashSet<>(); + for (String group : test.groups()) { + groups.add(group); + } + if (groups.contains("fast")) { + result.add(0, m); + } else { + result.add(m); + } + } + return result; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodinterceptors/FooTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/FooTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodinterceptors/FooTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/FooTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.methodinterceptors; + +import org.testng.annotations.Test; + +public class FooTest { + + @Test(groups = "fast") + public void zzzfast() {} + + @Test + public void slow() {} + + @Test + public void a() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodinterceptors/Issue392.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/Issue392.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodinterceptors/Issue392.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/Issue392.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.methodinterceptors; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.Test; + +public class Issue392 { + + @AfterClass + public void afterClass() {} + + @Test + public void test1() {} + + @Test + public void test2() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodinterceptors/Issue392Test.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/Issue392Test.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodinterceptors/Issue392Test.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/Issue392Test.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,39 @@ +package test.methodinterceptors; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.ArrayList; +import java.util.List; +import org.testng.*; +import org.testng.annotations.Test; +import test.InvokedMethodNameListener; +import test.SimpleBaseTest; + +public class Issue392Test extends SimpleBaseTest { + + @Test(description = "test for https://github.com/cbeust/testng/issues/392") + public void AfterClass_method_should_be_fired_when_IMethodInterceptor_removes_test_methods() { + TestNG tng = create(Issue392.class); + tng.setMethodInterceptor( + new IMethodInterceptor() { + @Override + public List intercept( + List methods, ITestContext context) { + List instances = new ArrayList<>(); + for (IMethodInstance instance : methods) { + if (!instance.getMethod().getMethodName().equals("test1")) { + instances.add(instance); + } + } + return instances; + } + }); + + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener((ITestNGListener) listener); + + tng.run(); + + assertThat(listener.getInvokedMethodNames()).containsExactly("test2", "afterClass"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodinterceptors/Issue521.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/Issue521.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodinterceptors/Issue521.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/Issue521.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.methodinterceptors; + +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +public class Issue521 { + + @BeforeClass + public void beforeClass() {} + + @Test + public void test1() {} + + @Test + public void test2() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodinterceptors/Issue521Test.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/Issue521Test.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodinterceptors/Issue521Test.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/Issue521Test.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,39 @@ +package test.methodinterceptors; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.ArrayList; +import java.util.List; +import org.testng.*; +import org.testng.annotations.Test; +import test.InvokedMethodNameListener; +import test.SimpleBaseTest; + +public class Issue521Test extends SimpleBaseTest { + + @Test(description = "test for https://github.com/cbeust/testng/issues/521") + public void BeforeClass_method_should_be_fired_when_IMethodInterceptor_removes_test_methods() { + TestNG tng = create(Issue521.class); + tng.setMethodInterceptor( + new IMethodInterceptor() { + @Override + public List intercept( + List methods, ITestContext context) { + List instances = new ArrayList<>(); + for (IMethodInstance instance : methods) { + if (!instance.getMethod().getMethodName().equals("test1")) { + instances.add(instance); + } + } + return instances; + } + }); + + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener((ITestNGListener) listener); + + tng.run(); + + assertThat(listener.getInvokedMethodNames()).containsExactly("beforeClass", "test2"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodinterceptors/LockUpInterceptorSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/LockUpInterceptorSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodinterceptors/LockUpInterceptorSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/LockUpInterceptorSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +package test.methodinterceptors; + +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +@Listeners({RemoveAMethodInterceptor.class}) +public class LockUpInterceptorSampleTest { + + @Test + public void one() { + log("one"); + } + + @Test + public void two() { + log("two"); + } + + @Test + public void three() { + log("three"); + } + + private static void log(String s) { + // System.out.println("[MITest] " + s); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodinterceptors/MethodInterceptorTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/MethodInterceptorTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodinterceptors/MethodInterceptorTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/MethodInterceptorTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,116 @@ +package test.methodinterceptors; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.util.List; +import javax.xml.parsers.ParserConfigurationException; +import org.testng.Assert; +import org.testng.ITestNGListener; +import org.testng.ITestResult; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import org.testng.xml.internal.Parser; +import org.xml.sax.SAXException; +import test.SimpleBaseTest; +import test.TestHelper; + +public class MethodInterceptorTest extends SimpleBaseTest { + + private String XML = + TestHelper.SUITE_XML_HEADER + + "" + + "" + + "" + + " " + + "" + + "" + + " " + + " " + + " " + + " " + + " " + + "" + + ""; + + @Test + public void noMethodsShouldRun() { + TestNG tng = create(); + tng.setTestClasses(new Class[] {FooTest.class}); + testNullInterceptor(tng); + } + + private void testNullInterceptor(TestNG tng) { + tng.setMethodInterceptor(new NullMethodInterceptor()); + TestListenerAdapter tla = new TestListenerAdapter(); + tng.addListener((ITestNGListener) tla); + tng.run(); + + Assert.assertEquals(tla.getPassedTests().size(), 0); + Assert.assertEquals(tla.getFailedTests().size(), 0); + Assert.assertEquals(tla.getSkippedTests().size(), 0); + } + + private void testFast(boolean useInterceptor) { + TestNG tng = create(); + tng.setTestClasses(new Class[] {FooTest.class}); + if (useInterceptor) { + tng.setMethodInterceptor(new FastTestsFirstInterceptor()); + } + TestListenerAdapter tla = new TestListenerAdapter(); + // tng.setParallel("methods"); + tng.addListener((ITestNGListener) tla); + tng.run(); + + Assert.assertEquals(tla.getPassedTests().size(), 3); + ITestResult first = tla.getPassedTests().get(0); + + String method = "zzzfast"; + if (useInterceptor) { + Assert.assertEquals(first.getMethod().getMethodName(), method); + } else { + Assert.assertNotSame(first.getMethod().getMethodName(), method); + } + } + + @Test + public void fastShouldRunFirst() { + testFast(true /* use interceptor */); + } + + @Test + public void fastShouldNotRunFirst() { + testFast(false /* don't use interceptor */); + } + + @Test + public void nullMethodInterceptorWorksInTestngXml() + throws IOException, ParserConfigurationException, SAXException { + + File f = File.createTempFile("testng-tests-", ""); + f.deleteOnExit(); + BufferedWriter bw = new BufferedWriter(new FileWriter(f)); + bw.write(XML); + bw.close(); + + try { + List xmlSuites = new Parser(f.getAbsolutePath()).parseToList(); + + TestNG tng = create(); + tng.setXmlSuites(xmlSuites); + testNullInterceptor(tng); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + + @Test(timeOut = 1000) + public void shouldNotLockUpWithInterceptorThatRemovesMethods() { + TestNG tng = create(LockUpInterceptorSampleTest.class); + tng.setParallel(XmlSuite.ParallelMode.METHODS); + tng.run(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodinterceptors/NullMethodInterceptor.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/NullMethodInterceptor.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodinterceptors/NullMethodInterceptor.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/NullMethodInterceptor.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package test.methodinterceptors; + +import java.util.ArrayList; +import java.util.List; +import org.testng.IMethodInstance; +import org.testng.IMethodInterceptor; +import org.testng.ITestContext; + +public class NullMethodInterceptor implements IMethodInterceptor { + @Override + public List intercept(List methods, ITestContext context) { + return new ArrayList<>(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodinterceptors/RemoveAMethodInterceptor.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/RemoveAMethodInterceptor.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodinterceptors/RemoveAMethodInterceptor.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/RemoveAMethodInterceptor.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,57 @@ +package test.methodinterceptors; + +import java.util.ArrayList; +import java.util.List; +import org.testng.IMethodInstance; +import org.testng.IMethodInterceptor; +import org.testng.ITestContext; + +/** An interceptor that removes the method called "two". */ +public class RemoveAMethodInterceptor implements IMethodInterceptor { + + @Override + public List intercept(List methods, ITestContext context) { + List result = new ArrayList<>(); + + for (IMethodInstance method : methods) { + String name = method.getMethod().getMethodName(); + if (!name.equals("two")) { + result.add(method); + } + } + + log(this, methods, result); + + return result; + } + + public static void log( + IMethodInterceptor listener, List input, List output) { + StringBuilder msg = + new StringBuilder() + .append(listener.getClass().getName()) + .append(" - Input:") + .append(getMethodNames(input)) + .append(" ") + .append(input.size()) + .append(" methods.") + .append(" Output:") + .append(getMethodNames(output)) + .append(" ") + .append(output.size()) + .append(" methods"); + log(msg.toString()); + } + + public static List getMethodNames(List methods) { + List names = new ArrayList<>(); + for (IMethodInstance m : methods) { + names.add(m.getMethod().getMethodName()); + } + return names; + } + + private static void log(String s) { + // System.out.println("[MI2] " + s); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodinterceptors/issue1726/CustomInterceptorTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/issue1726/CustomInterceptorTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodinterceptors/issue1726/CustomInterceptorTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/issue1726/CustomInterceptorTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,51 @@ +package test.methodinterceptors.issue1726; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.ITestNGListener; +import org.testng.ITestResult; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.SimpleBaseTest; + +public class CustomInterceptorTest extends SimpleBaseTest { + + @Test + public void testOrderingWhenInvolvingCustomInterceptors() { + XmlSuite suite = createXmlSuite("suite"); + suite.setPreserveOrder(false); + XmlTest xmlTest = createXmlTest(suite, "test", TestClassSample1.class, TestClassSample2.class); + xmlTest.setPreserveOrder(false); + TestNG testng = create(suite); + testng.addListener(new PriorityInterceptor()); + testng.addListener((ITestNGListener) new MethodOrderTracker()); + testng.run(); + List expected = + Arrays.asList( + "TestClassSample2.Test3", + "TestClassSample1.Test1", + "TestClassSample1.Test2", + "TestClassSample2.Test4"); + assertThat(MethodOrderTracker.ordered).containsExactlyElementsOf(expected); + } + + public static class MethodOrderTracker implements IInvokedMethodListener { + static List ordered = new ArrayList<>(); + + @Override + public void beforeInvocation(IInvokedMethod method, ITestResult testResult) {} + + @Override + public void afterInvocation(IInvokedMethod method, ITestResult testResult) { + String clazz = method.getTestMethod().getRealClass().getSimpleName() + "."; + ordered.add(clazz + method.getTestMethod().getMethodName()); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodinterceptors/issue1726/Priority.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/issue1726/Priority.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodinterceptors/issue1726/Priority.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/issue1726/Priority.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.methodinterceptors.issue1726; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +@Retention(java.lang.annotation.RetentionPolicy.RUNTIME) +@Target({ElementType.METHOD, ElementType.TYPE}) +public @interface Priority { + int value() default 0; +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodinterceptors/issue1726/PriorityInterceptor.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/issue1726/PriorityInterceptor.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodinterceptors/issue1726/PriorityInterceptor.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/issue1726/PriorityInterceptor.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,33 @@ +package test.methodinterceptors.issue1726; + +import java.lang.reflect.Method; +import java.util.Comparator; +import java.util.List; +import org.testng.IMethodInstance; +import org.testng.IMethodInterceptor; +import org.testng.ITestContext; + +public class PriorityInterceptor implements IMethodInterceptor { + + public List intercept(List methods, ITestContext context) { + Comparator comparator = + Comparator.comparingInt(PriorityInterceptor::getPriority); + methods.sort(comparator); + return methods; + } + + private static int getPriority(IMethodInstance mi) { + int result = 0; + Method method = mi.getMethod().getConstructorOrMethod().getMethod(); + Priority a1 = method.getAnnotation(Priority.class); + if (a1 != null) { + return a1.value(); + } + Class cls = method.getDeclaringClass(); + Priority classPriority = cls.getAnnotation(Priority.class); + if (classPriority != null) { + result = classPriority.value(); + } + return result; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodinterceptors/issue1726/TestClassSample1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/issue1726/TestClassSample1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodinterceptors/issue1726/TestClassSample1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/issue1726/TestClassSample1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,21 @@ +package test.methodinterceptors.issue1726; + +import org.testng.Reporter; +import org.testng.annotations.Test; + +public class TestClassSample1 { + + @Priority(4) + @Test(description = "Test Multiple Day Absence Request flow", groups = "Test") + public void Test1() { + Reporter.log(getClass().getName() + ".Test1", false); + } + + @Priority(8) + @Test( + description = "Test Single Day Absence Request Flow", + groups = {"Regression", "Test"}) + public void Test2() { + Reporter.log(getClass().getName() + ".Test2", false); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodinterceptors/issue1726/TestClassSample2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/issue1726/TestClassSample2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodinterceptors/issue1726/TestClassSample2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/issue1726/TestClassSample2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,21 @@ +package test.methodinterceptors.issue1726; + +import org.testng.Reporter; +import org.testng.annotations.Test; + +public class TestClassSample2 { + + @Priority(3) + @Test(description = "Test Multiple Day Absence Request flow", groups = "Test") + public void Test3() { + Reporter.log(getClass().getName() + ".Test3", false); + } + + @Priority(9) + @Test( + description = "Test Single Day Absence Request Flow", + groups = {"Regression", "Test"}) + public void Test4() { + Reporter.log(getClass().getName() + ".Test4", false); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodinterceptors/multipleinterceptors/FirstInterceptor.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/multipleinterceptors/FirstInterceptor.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodinterceptors/multipleinterceptors/FirstInterceptor.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/multipleinterceptors/FirstInterceptor.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ +package test.methodinterceptors.multipleinterceptors; + +public class FirstInterceptor extends MethodNameFilterInterceptor { + + public FirstInterceptor() { + super("a"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodinterceptors/multipleinterceptors/FooTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/multipleinterceptors/FooTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodinterceptors/multipleinterceptors/FooTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/multipleinterceptors/FooTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ +package test.methodinterceptors.multipleinterceptors; + +import org.testng.annotations.Test; + +public class FooTest { + + @Test + public void a() {} + + @Test + public void b() {} + + @Test + public void c() {} + + @Test + public void d() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodinterceptors/multipleinterceptors/MethodNameFilterInterceptor.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/multipleinterceptors/MethodNameFilterInterceptor.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodinterceptors/multipleinterceptors/MethodNameFilterInterceptor.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/multipleinterceptors/MethodNameFilterInterceptor.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,36 @@ +package test.methodinterceptors.multipleinterceptors; + +import java.util.ArrayList; +import java.util.List; +import org.testng.IMethodInstance; +import org.testng.IMethodInterceptor; +import org.testng.ITestContext; +import org.testng.ITestNGMethod; + +public abstract class MethodNameFilterInterceptor implements IMethodInterceptor { + + private final String methodName; + + protected MethodNameFilterInterceptor(String methodName) { + this.methodName = methodName; + } + + @Override + public List intercept(List methods, ITestContext context) { + List result = new ArrayList<>(); + for (IMethodInstance methodInstance : methods) { + ITestNGMethod method = methodInstance.getMethod(); + String name = method.getMethodName(); + if (!name.equals(methodName)) { + result.add(methodInstance); + String currentDescription = method.getDescription(); + if (currentDescription == null) { + method.setDescription(methodName); + } else { + method.setDescription(currentDescription + methodName); + } + } + } + return result; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodinterceptors/multipleinterceptors/MultipleInterceptorsTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/multipleinterceptors/MultipleInterceptorsTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodinterceptors/multipleinterceptors/MultipleInterceptorsTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/multipleinterceptors/MultipleInterceptorsTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,38 @@ +package test.methodinterceptors.multipleinterceptors; + +import java.util.Collections; +import org.testng.Assert; +import org.testng.ITestNGListener; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class MultipleInterceptorsTest extends SimpleBaseTest { + + @Test + public void testMultipleInterceptors() { + TestNG tng = create(FooTest.class); + tng.setMethodInterceptor(new FirstInterceptor()); + tng.setMethodInterceptor(new SecondInterceptor()); + tng.setMethodInterceptor(new ThirdInterceptor()); + TestListenerAdapter tla = new TestListenerAdapter(); + tng.addListener((ITestNGListener) tla); + tng.run(); + Assert.assertEquals(tla.getPassedTests().size(), 1); + Assert.assertEquals(tla.getPassedTests().get(0).getName(), "d"); + } + + @Test + public void testMultipleInterceptorsWithPreserveOrder() { + TestNG tng = create(); + tng.setTestSuites( + Collections.singletonList( + getPathToResource( + "/methodinterceptors/multipleinterceptors/multiple-interceptors.xml"))); + TestListenerAdapter tla = new TestListenerAdapter(); + tng.addListener((ITestNGListener) tla); + tng.run(); + Assert.assertEquals(tla.getPassedTests().get(0).getMethod().getDescription(), "abc"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodinterceptors/multipleinterceptors/SecondInterceptor.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/multipleinterceptors/SecondInterceptor.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodinterceptors/multipleinterceptors/SecondInterceptor.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/multipleinterceptors/SecondInterceptor.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ +package test.methodinterceptors.multipleinterceptors; + +public class SecondInterceptor extends MethodNameFilterInterceptor { + + public SecondInterceptor() { + super("b"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodinterceptors/multipleinterceptors/ThirdInterceptor.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/multipleinterceptors/ThirdInterceptor.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodinterceptors/multipleinterceptors/ThirdInterceptor.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodinterceptors/multipleinterceptors/ThirdInterceptor.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ +package test.methodinterceptors.multipleinterceptors; + +public class ThirdInterceptor extends MethodNameFilterInterceptor { + + public ThirdInterceptor() { + super("c"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methods/SampleMethod1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methods/SampleMethod1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methods/SampleMethod1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methods/SampleMethod1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,47 @@ +package test.methods; + +import org.testng.annotations.Test; + +/** + * This class is used to test invocation of methods + * + * @author cbeust + */ +public class SampleMethod1 { + private static boolean m_ok1 = false; + private static boolean m_ok2 = false; + private static boolean m_ok3 = true; + private static boolean m_ok4 = true; + + public static void reset() { + m_ok1 = false; + m_ok2 = false; + m_ok3 = true; + m_ok4 = true; + } + + @Test(groups = {"sample1"}) + public void shouldRun1() { + m_ok1 = true; + } + + @Test(groups = {"sample1"}) + public void shouldRun2() { + m_ok2 = true; + } + + @Test + public void shouldNotRun1() { + m_ok3 = false; + } + + @Test + public void shouldNotRun2() { + m_ok4 = false; + } + + public static void verify() { + assert m_ok1 && m_ok2 && m_ok3 && m_ok4 + : "All booleans should be true: " + m_ok1 + " " + m_ok2 + " " + m_ok3 + " " + m_ok4; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methods/VerifyMethod1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methods/VerifyMethod1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methods/VerifyMethod1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methods/VerifyMethod1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package test.methods; + +import org.testng.annotations.BeforeSuite; +import org.testng.annotations.Test; + +/** + * This class verifies that the correct methods were run + * + * @author cbeust + */ +@Test(dependsOnGroups = {"sample1"}) +public class VerifyMethod1 { + + @BeforeSuite + public void init() { + SampleMethod1.reset(); + } + + @Test + public void verify() { + SampleMethod1.verify(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodselection/DollarMethodSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselection/DollarMethodSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodselection/DollarMethodSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselection/DollarMethodSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,21 @@ +package test.methodselection; + +import org.testng.annotations.Test; + +public class DollarMethodSample { + + @Test + public void $() {} + + @Test + public void another_test() {} + + @Test + public void another$_test() {} + + @Test + public void another$_test$() {} + + @Test + public void $another$_test$() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodselection/MethodSelectionTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselection/MethodSelectionTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodselection/MethodSelectionTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselection/MethodSelectionTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,39 @@ +package test.methodselection; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import org.testng.xml.XmlClass; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.InvokedMethodNameListener; +import test.SimpleBaseTest; + +public class MethodSelectionTest extends SimpleBaseTest { + + @DataProvider(name = "dp") + public static Object[][] getData() { + return new Object[][] { + // Method name + {"$", "$"}, + {"another_test", "another_test"}, + {"another$_test", "another$_test"}, + {"another$_test$", "another$_test$"}, + // Regex + {"another\\$_test\\$$", "another$_test$"}, + {"\\$.*", new String[] {"$", "$another$_test$"}}, + {"\\$.*$", new String[] {"$", "$another$_test$"}} + }; + } + + @Test(dataProvider = "dp") + public void testDollarMethodSelection(String methodName, String... expected) { + XmlSuite xmlSuite = createXmlSuite("Dollar method Suite"); + XmlTest xmlTest = createXmlTest(xmlSuite, "Dollar method Test"); + XmlClass xmlClass = createXmlClass(xmlTest, DollarMethodSample.class); + createXmlInclude(xmlClass, methodName); + InvokedMethodNameListener listener = run(xmlSuite); + assertThat(listener.getInvokedMethodNames()).containsExactly(expected); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodselectors/AllTestsMethodSelector.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselectors/AllTestsMethodSelector.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodselectors/AllTestsMethodSelector.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselectors/AllTestsMethodSelector.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,22 @@ +package test.methodselectors; + +import java.util.List; +import org.testng.IMethodSelector; +import org.testng.IMethodSelectorContext; +import org.testng.ITestNGMethod; + +public class AllTestsMethodSelector implements IMethodSelector { + + @Override + public boolean includeMethod( + IMethodSelectorContext context, ITestNGMethod method, boolean isTestMethod) { + context.setStopped(true); + return true; + } + + @Override + public void setTestMethods(List testMethods) { + // TODO Auto-generated method stub + + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodselectors/ClassWithManyMethodsSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselectors/ClassWithManyMethodsSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodselectors/ClassWithManyMethodsSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselectors/ClassWithManyMethodsSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,24 @@ +package test.methodselectors; + +import org.testng.Assert; +import org.testng.annotations.Test; + +@Test(description = "GITHUB-1507") +public class ClassWithManyMethodsSample { + + public void testa() { + Assert.assertTrue(true); + } + + public void testb() { + Assert.assertTrue(true); + } + + public void testc() { + Assert.assertTrue(true); + } + + public void testd() { + Assert.assertTrue(true); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodselectors/CommandLineTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselectors/CommandLineTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodselectors/CommandLineTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselectors/CommandLineTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,179 @@ +package test.methodselectors; + +import java.util.List; +import org.assertj.core.api.Assertions; +import org.testng.ITestResult; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; +import test.SimpleBaseTest; +import testhelper.OutputDirectoryPatch; + +public class CommandLineTest extends SimpleBaseTest { + + private final String[] ARG_WITHOUT_CLASSES = + new String[] { + "-log", "0", "-d", OutputDirectoryPatch.getOutputDirectory(), "-methodselectors", "", "" + }; + + private final String[] ARG_WITH_GROUPS = + new String[] { + "-log", "0", + "-d", OutputDirectoryPatch.getOutputDirectory(), + "-testclass", "test.methodselectors.SampleTest", + "-methodselectors", "", + "-groups", "" + }; + + private final String[] ARG_WITHOUT_GROUPS = + new String[] { + "-log", "0", + "-d", OutputDirectoryPatch.getOutputDirectory(), + "-testclass", "test.methodselectors.SampleTest", + "-methodselectors", "", + }; + + private TestListenerAdapter tla; + + @BeforeMethod + public void setup() { + tla = new TestListenerAdapter(); + } + + @Test + public void commandLineNegativePriorityAllGroups() { + ARG_WITHOUT_GROUPS[7] = "test.methodselectors.AllTestsMethodSelector:-1"; + TestNG.privateMain(ARG_WITHOUT_GROUPS, tla); + String[] passed = {"test1", "test2", "test3"}; + String[] failed = {}; + verifyTests("Passed", passed, tla.getPassedTests()); + verifyTests("Failed", failed, tla.getFailedTests()); + } + + @Test + public void commandLineNegativePriorityGroup2() { + ARG_WITHOUT_GROUPS[7] = "test.methodselectors.Test2MethodSelector:-1"; + TestNG.privateMain(ARG_WITHOUT_GROUPS, tla); + String[] passed = {"test2"}; + String[] failed = {}; + verifyTests("Passed", passed, tla.getPassedTests()); + verifyTests("Failed", failed, tla.getFailedTests()); + } + + @Test + public void commandLineLessThanPriorityTest1Test() { + ARG_WITH_GROUPS[7] = "test.methodselectors.Test2MethodSelector:5"; + ARG_WITH_GROUPS[9] = "test1"; + TestNG.privateMain(ARG_WITH_GROUPS, tla); + String[] passed = {"test1", "test2"}; + String[] failed = {}; + verifyTests("Passed", passed, tla.getPassedTests()); + verifyTests("Failed", failed, tla.getFailedTests()); + } + + @Test + public void commandLineGreaterThanPriorityTest1Test2() { + ARG_WITH_GROUPS[7] = "test.methodselectors.Test2MethodSelector:15"; + ARG_WITH_GROUPS[9] = "test1"; + TestNG.privateMain(ARG_WITH_GROUPS, tla); + String[] passed = {"test2"}; + String[] failed = {}; + verifyTests("Passed", passed, tla.getPassedTests()); + verifyTests("Failed", failed, tla.getFailedTests()); + } + + @Test + public void commandLineLessThanPriorityAllTests() { + ARG_WITH_GROUPS[7] = "test.methodselectors.AllTestsMethodSelector:5"; + ARG_WITH_GROUPS[9] = "test1"; + TestNG.privateMain(ARG_WITH_GROUPS, tla); + String[] passed = {"test1", "test2", "test3"}; + String[] failed = {}; + verifyTests("Passed", passed, tla.getPassedTests()); + verifyTests("Failed", failed, tla.getFailedTests()); + } + + @Test + public void commandLineMultipleSelectors() { + ARG_WITH_GROUPS[7] = + "test.methodselectors.NoTestSelector:7,test.methodselectors.Test2MethodSelector:5"; + ARG_WITH_GROUPS[9] = "test1"; + TestNG.privateMain(ARG_WITH_GROUPS, tla); + String[] passed = {"test1", "test2"}; + String[] failed = {}; + verifyTests("Passed", passed, tla.getPassedTests()); + verifyTests("Failed", failed, tla.getFailedTests()); + } + + @Test + public void commandLineNoTest1Selector() { + ARG_WITHOUT_GROUPS[7] = "test.methodselectors.NoTest1MethodSelector:5"; + TestNG.privateMain(ARG_WITHOUT_GROUPS, tla); + String[] passed = {"test2", "test3"}; + String[] failed = {}; + verifyTests("Passed", passed, tla.getPassedTests()); + verifyTests("Failed", failed, tla.getFailedTests()); + } + + @Test + public void commandLineTestWithXmlFile() { + ARG_WITHOUT_CLASSES[5] = "test.methodselectors.NoTest1MethodSelector:5"; + ARG_WITHOUT_CLASSES[6] = getPathToResource("testng-methodselectors.xml"); + TestNG.privateMain(ARG_WITHOUT_CLASSES, tla); + String[] passed = {"test2", "test3"}; + String[] failed = {}; + verifyTests("Passed", passed, tla.getPassedTests()); + verifyTests("Failed", failed, tla.getFailedTests()); + } + + @Test(description = "GITHUB-2407") + public void testOverrideExcludedMethodsCommandLineExclusions() { + String[] args = + new String[] { + "src/test/resources/test/methodselectors/sampleTest.xml", + "-log", + "0", + "-d", + OutputDirectoryPatch.getOutputDirectory(), + "-excludegroups", + "test1", + "-overrideincludedmethods" + }; + + TestNG.privateMain(args, tla); + + // test1 is excluded, so only test2 is left in the passed list + String[] passed = {"test2"}; + String[] failed = {}; + verifyTests("Passed", passed, tla.getPassedTests()); + verifyTests("Failed", failed, tla.getFailedTests()); + } + + @Test(description = "GITHUB-2407") + public void testOverrideExcludedMethodsSuiteExclusions() { + String[] args = + new String[] { + "src/test/resources/test/methodselectors/sampleTestExclusions.xml", + "-log", + "0", + "-d", + OutputDirectoryPatch.getOutputDirectory(), + "-overrideincludedmethods" + }; + + TestNG.privateMain(args, tla); + + String[] passed = {}; + String[] failed = {}; + verifyTests("Passed", passed, tla.getPassedTests()); + verifyTests("Failed", failed, tla.getFailedTests()); + } + + private void verifyTests(String title, String[] expected, List found) { + + Assertions.assertThat(found.stream().map(ITestResult::getName).toArray(String[]::new)) + .describedAs(title) + .isEqualTo(expected); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodselectors/MethodSelectorInSuiteTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselectors/MethodSelectorInSuiteTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodselectors/MethodSelectorInSuiteTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselectors/MethodSelectorInSuiteTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,80 @@ +package test.methodselectors; + +import java.util.Collections; +import java.util.List; +import org.testng.Assert; +import org.testng.ITestNGListener; +import org.testng.ITestResult; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; +import org.testng.collections.Lists; +import org.testng.xml.XmlClass; +import org.testng.xml.XmlMethodSelector; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.SimpleBaseTest; +import testhelper.OutputDirectoryPatch; + +public class MethodSelectorInSuiteTest extends SimpleBaseTest { + + private TestListenerAdapter m_tla; + + @BeforeMethod + public void setup() { + m_tla = new TestListenerAdapter(); + } + + @Test + public void programmaticXmlSuite() { + TestNG tng = create(); + XmlSuite suite = new XmlSuite(); + XmlMethodSelector methodSelector = new XmlMethodSelector(); + methodSelector.setName("test.methodselectors.Test2MethodSelector"); + methodSelector.setPriority(-1); + List methodSelectors = Lists.newArrayList(); + methodSelectors.add(methodSelector); + suite.setMethodSelectors(methodSelectors); + XmlTest test = new XmlTest(suite); + XmlClass testClass = new XmlClass(test.methodselectors.SampleTest.class); + test.setXmlClasses(Collections.singletonList(testClass)); + tng.setXmlSuites(Collections.singletonList(suite)); + tng.addListener((ITestNGListener) m_tla); + tng.run(); + + validate(new String[] {"test2"}); + } + + @Test + public void xmlXmlSuite() { + TestNG tng = create(); + tng.setTestSuites(Collections.singletonList(getPathToResource("methodselector-in-xml.xml"))); + tng.addListener((ITestNGListener) m_tla); + tng.run(); + + validate(new String[] {"test2"}); + } + + @Test + public void fileOnCommandLine() { + String[] args = + new String[] { + "-d", + OutputDirectoryPatch.getOutputDirectory(), + getPathToResource("methodselector-in-xml.xml") + }; + TestNG.privateMain(args, m_tla); + + validate(new String[] {"test2"}); + } + + private void validate(String[] expectPassed) { + List passed = m_tla.getPassedTests(); + Assert.assertEquals(passed.size(), expectPassed.length); + // doing this index based is probably not the best + for (int i = 0; i < expectPassed.length; i++) { + Assert.assertEquals(passed.get(i).getName(), expectPassed[i]); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodselectors/MethodSelectorTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselectors/MethodSelectorTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodselectors/MethodSelectorTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselectors/MethodSelectorTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,100 @@ +package test.methodselectors; + +import org.testng.Assert; +import org.testng.annotations.Test; +import test.BaseTest; +import test.methodselectors.issue1985.FilteringMethodSelector; +import test.methodselectors.issue1985.TestClassSample; + +public class MethodSelectorTest extends BaseTest { + + @Test + public void negativePriorityAllGroups() { + addClass("test.methodselectors.SampleTest"); + addMethodSelector("test.methodselectors.AllTestsMethodSelector", -1); + run(); + String[] passed = { + "test1", "test2", "test3", + }; + String[] failed = {}; + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Failed", failed, getFailedTests()); + } + + @Test + public void negativePriorityGroup2() { + addClass("test.methodselectors.SampleTest"); + addMethodSelector("test.methodselectors.Test2MethodSelector", -1); + run(); + String[] passed = { + "test2", + }; + String[] failed = {}; + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Failed", failed, getFailedTests()); + } + + @Test + public void lessThanPriorityTest1Test() { + addClass("test.methodselectors.SampleTest"); + addIncludedGroup("test1"); + addMethodSelector("test.methodselectors.Test2MethodSelector", 5); + run(); + String[] passed = { + "test1", "test2", + }; + String[] failed = {}; + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Failed", failed, getFailedTests()); + } + + @Test + public void greaterThanPriorityTest1Test2() { + addClass("test.methodselectors.SampleTest"); + addIncludedGroup("test1"); + addMethodSelector("test.methodselectors.Test2MethodSelector", 15); + run(); + String[] passed = { + "test2", + }; + String[] failed = {}; + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Failed", failed, getFailedTests()); + } + + @Test + public void lessThanPriorityAllTests() { + addClass("test.methodselectors.SampleTest"); + addIncludedGroup("test1"); + addMethodSelector("test.methodselectors.AllTestsMethodSelector", 5); + run(); + String[] passed = {"test1", "test2", "test3"}; + String[] failed = {}; + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Failed", failed, getFailedTests()); + } + + @Test(description = "GITHUB-1507") + public void testNoMethodsAreExecutedWithNoMatchFound() { + String className = ClassWithManyMethodsSample.class.getName(); + addClass(className); + addIncludedMethod(className, "cars_sedan"); + addIncludedMethod(className, "train_Local"); + addIncludedMethod(className, "flight_Domestic"); + run(); + Assert.assertTrue(getPassedTests().isEmpty()); + Assert.assertTrue(getFailedTests().isEmpty()); + Assert.assertTrue(getSkippedTests().isEmpty()); + } + + @Test(description = "GITHUB-1985") + public void testFilteringOfMethodsWork() { + System.setProperty(FilteringMethodSelector.GROUP, "bat"); + String className = TestClassSample.class.getName(); + addClass(className); + addMethodSelector(FilteringMethodSelector.class.getName(), 0); + run(); + String[] passed = {"batTest"}; + verifyTests("Passed", passed, getPassedTests()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodselectors/NoTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselectors/NoTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodselectors/NoTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselectors/NoTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,3 @@ +package test.methodselectors; + +public @interface NoTest {} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodselectors/NoTest1MethodSelector.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselectors/NoTest1MethodSelector.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodselectors/NoTest1MethodSelector.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselectors/NoTest1MethodSelector.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,24 @@ +package test.methodselectors; + +import java.util.List; +import org.testng.IMethodSelector; +import org.testng.IMethodSelectorContext; +import org.testng.ITestNGMethod; + +public class NoTest1MethodSelector implements IMethodSelector { + + @Override + public boolean includeMethod( + IMethodSelectorContext context, ITestNGMethod method, boolean isTestMethod) { + for (String group : method.getGroups()) { + if (group.equals("test1")) { + context.setStopped(true); + return false; + } + } + return true; + } + + @Override + public void setTestMethods(List testMethods) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodselectors/NoTestSelector.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselectors/NoTestSelector.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodselectors/NoTestSelector.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselectors/NoTestSelector.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ +package test.methodselectors; + +import java.util.List; +import org.testng.IMethodSelector; +import org.testng.IMethodSelectorContext; +import org.testng.ITestNGMethod; + +public class NoTestSelector implements IMethodSelector { + + @Override + public boolean includeMethod( + IMethodSelectorContext context, ITestNGMethod method, boolean isTestMethod) { + return false; + } + + @Override + public void setTestMethods(List testMethods) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodselectors/PrioritySampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselectors/PrioritySampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodselectors/PrioritySampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselectors/PrioritySampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,13 @@ +package test.methodselectors; + +import org.testng.annotations.Test; + +public class PrioritySampleTest { + + @Test + public void alwaysRun() {} + + @Test + @NoTest + public void neverRun() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodselectors/PriorityTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselectors/PriorityTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodselectors/PriorityTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselectors/PriorityTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,49 @@ +package test.methodselectors; + +import java.util.List; +import org.testng.Assert; +import org.testng.ITestNGListener; +import org.testng.ITestResult; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; + +public class PriorityTest { + + private void runTest(int priority, String[] passedTests) { + TestNG tng = new TestNG(); + tng.setTestClasses(new Class[] {PrioritySampleTest.class}); + tng.addMethodSelector("test.methodselectors.NoTestSelector", priority); + TestListenerAdapter tla = new TestListenerAdapter(); + tng.addListener((ITestNGListener) tla); + tng.run(); + + List passed = tla.getPassedTests(); + Assert.assertEquals(passedTests.length, passed.size()); + if (passedTests.length == 1) { + String passed0 = passed.get(0).getName(); + Assert.assertEquals(passed0, passedTests[0]); + } + if (passedTests.length == 2) { + String passed0 = passed.get(0).getName(); + String passed1 = passed.get(1).getName(); + Assert.assertTrue(passed0.equals(passedTests[0]) || passed0.equals(passedTests[1])); + Assert.assertTrue(passed1.equals(passedTests[0]) || passed1.equals(passedTests[1])); + } + } + + // @Test + public void negativePriority() { + runTest(-5, new String[] {}); + } + + @Test + public void lessThanTenPriority() { + runTest(5, new String[] {"alwaysRun"}); + } + + // @Test + public void greaterThanTenPriority() { + runTest(15, new String[] {"alwaysRun", "neverRun"}); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodselectors/SampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselectors/SampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodselectors/SampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselectors/SampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.methodselectors; + +import org.testng.annotations.Test; + +public class SampleTest { + + @Test(groups = {"test1"}) + public void test1() {} + + @Test(groups = {"test2"}) + public void test2() {} + + @Test(groups = {"test3"}) + public void test3() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodselectors/ScriptNegativeTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselectors/ScriptNegativeTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodselectors/ScriptNegativeTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselectors/ScriptNegativeTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,44 @@ +package test.methodselectors; + +import java.util.Collections; +import org.testng.TestNG; +import org.testng.TestNGException; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; +import org.testng.xml.XmlMethodSelector; +import org.testng.xml.XmlScript; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.SimpleBaseTest; + +public class ScriptNegativeTest extends SimpleBaseTest { + + private static final String LANGUAGE_NAME = "MissingLanguage"; + + @BeforeMethod + public void setup() { + System.setProperty("skip.caller.clsLoader", Boolean.TRUE.toString()); + } + + @AfterMethod + public void cleanup() { + System.setProperty("skip.caller.clsLoader", Boolean.FALSE.toString()); + } + + @Test( + expectedExceptions = TestNGException.class, + expectedExceptionsMessageRegExp = ".*No engine found for language: " + LANGUAGE_NAME + ".*") + public void testNegativeScenario() { + XmlSuite suite = createXmlSuite("suite"); + XmlTest test = createXmlTest(suite, "test", "test.methodselectors.SampleTest"); + XmlScript script = new XmlScript(); + script.setLanguage(LANGUAGE_NAME); + script.setExpression("expression"); + XmlMethodSelector selector = new XmlMethodSelector(); + selector.setScript(script); + test.setMethodSelectors(Collections.singletonList(selector)); + TestNG tng = create(suite); + tng.run(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodselectors/ScriptTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselectors/ScriptTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodselectors/ScriptTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselectors/ScriptTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,30 @@ +package test.methodselectors; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import test.BaseTest; + +public class ScriptTest extends BaseTest { + + @DataProvider + public static Object[][] dataProvider() { + return new Object[][] { + new Object[] { + "beanshell", "groups.\n containsKey \t (\"test1\")", new String[] {"test1"} + }, + new Object[] { + "groovy", "groups.\n containsKey \t (\"test2\")", new String[] {"test2"} + }, + }; + } + + @Test(dataProvider = "dataProvider") + public void onlyGroup1(String language, String expression, String[] passed) { + addClass(test.methodselectors.SampleTest.class); + setScript(language, expression); + run(); + String[] failed = {}; + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Failed", failed, getFailedTests()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodselectors/Test2MethodSelector.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselectors/Test2MethodSelector.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodselectors/Test2MethodSelector.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselectors/Test2MethodSelector.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,28 @@ +package test.methodselectors; + +import java.util.List; +import org.testng.IMethodSelector; +import org.testng.IMethodSelectorContext; +import org.testng.ITestNGMethod; + +public class Test2MethodSelector implements IMethodSelector { + + @Override + public boolean includeMethod( + IMethodSelectorContext context, ITestNGMethod method, boolean isTestMethod) { + for (String group : method.getGroups()) { + if (group.equals("test2")) { + context.setStopped(true); + return true; + } + } + + return false; + } + + @Override + public void setTestMethods(List testMethods) { + // TODO Auto-generated method stub + + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodselectors/issue1985/FilteringMethodSelector.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselectors/issue1985/FilteringMethodSelector.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodselectors/issue1985/FilteringMethodSelector.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselectors/issue1985/FilteringMethodSelector.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,34 @@ +package test.methodselectors.issue1985; + +import java.util.Arrays; +import java.util.List; +import org.testng.IMethodSelector; +import org.testng.IMethodSelectorContext; +import org.testng.ITestNGMethod; + +public class FilteringMethodSelector implements IMethodSelector { + + private static final String ALL = "all"; + public static final String GROUP = "group"; + private String whichGroup; + + public FilteringMethodSelector() { + whichGroup = System.getProperty(GROUP, ALL); + } + + @Override + public boolean includeMethod( + IMethodSelectorContext context, ITestNGMethod method, boolean isTestMethod) { + if (ALL.equalsIgnoreCase(whichGroup)) { + return true; + } + boolean isEqual = Arrays.equals(new String[] {whichGroup}, method.getGroups()); + if (context != null) { + context.setStopped(true); + } + return isEqual; + } + + @Override + public void setTestMethods(List testMethods) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodselectors/issue1985/TestClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselectors/issue1985/TestClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/methodselectors/issue1985/TestClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/methodselectors/issue1985/TestClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ +package test.methodselectors.issue1985; + +import org.testng.annotations.Test; + +public class TestClassSample { + + @Test(groups = {"bat"}) + public void batTest() {} + + @Test(groups = {"p1"}) + public void p1Test() {} + + @Test(groups = {"p2"}) + public void p2Test() {} + + @Test(groups = {"bat", "p3"}) + public void batp3Test() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/mixed/JUnit3Test1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/mixed/JUnit3Test1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/mixed/JUnit3Test1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/mixed/JUnit3Test1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.mixed; + +import junit.framework.TestCase; + +/** @author lukas */ +public class JUnit3Test1 extends TestCase { + + public JUnit3Test1(String name) { + super(name); + } + + public void testA() {} + + public void testB() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/mixed/JUnit4Test1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/mixed/JUnit4Test1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/mixed/JUnit4Test1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/mixed/JUnit4Test1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,13 @@ +package test.mixed; + +import org.junit.Test; + +/** @author lukas */ +public class JUnit4Test1 { + + @Test + public void atest() {} + + @Test + public void bTest() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/mixed/MixedTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/mixed/MixedTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/mixed/MixedTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/mixed/MixedTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,72 @@ +package test.mixed; + +import org.testng.Assert; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.BaseTest; +import testhelper.OutputDirectoryPatch; + +/** @author lukas */ +public class MixedTest extends BaseTest { + @Test + public void mixedWithExcludedGroups() { + String[] argv = { + "-d", + OutputDirectoryPatch.getOutputDirectory(), + "-log", + "0", + "-mixed", + "-groups", + "unit", + "-excludegroups", + "ignore", + "-testclass", + "test.mixed.JUnit3Test1,test.mixed.JUnit4Test1,test.mixed.TestNGTest1,test.mixed.TestNGGroups" + }; + TestListenerAdapter tla = new TestListenerAdapter(); + TestNG.privateMain(argv, tla); + + Assert.assertEquals( + tla.getPassedTests().size(), + 5); // 2 from junit3test1, 2 from junit4test1, 0 from testngtest1 (no groups), 1 from + // testnggroups (1 is included, 1 is excluded) + Assert.assertEquals(tla.getFailedTests().size(), 0); + } + + @Test + public void mixedClasses() { + String[] argv = { + "-d", + OutputDirectoryPatch.getOutputDirectory(), + "-log", + "0", + "-mixed", + "-testclass", + "test.mixed.JUnit3Test1,test.mixed.JUnit4Test1,test.mixed.TestNGTest1" + }; + TestListenerAdapter tla = new TestListenerAdapter(); + TestNG.privateMain(argv, tla); + + Assert.assertEquals(tla.getPassedTests().size(), 6); + Assert.assertEquals(tla.getFailedTests().size(), 0); + } + + @Test + public void mixedMethods() { + String[] argv = { + "-d", + OutputDirectoryPatch.getOutputDirectory(), + "-mixed", + "-log", + "0", + "-methods", + "test.mixed.JUnit3Test1.testB,test.mixed.JUnit4Test1.atest,test.mixed.TestNGTest1.tngCustomTest1" + }; + TestListenerAdapter tla = new TestListenerAdapter(); + TestNG.privateMain(argv, tla); + + Assert.assertEquals(tla.getPassedTests().size(), 3); + Assert.assertEquals(tla.getFailedTests().size(), 0); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/mixed/TestNGGroups.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/mixed/TestNGGroups.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/mixed/TestNGGroups.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/mixed/TestNGGroups.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.mixed; + +import org.testng.annotations.Test; + +@Test(groups = {"unit"}) +public class TestNGGroups { + @Test + public void tngTest1() {} + + @Test(groups = {"ignore"}) + public void tngShouldBeIgnored() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/mixed/TestNGTest1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/mixed/TestNGTest1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/mixed/TestNGTest1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/mixed/TestNGTest1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,13 @@ +package test.mixed; + +import org.testng.annotations.Test; + +/** @author lukas */ +public class TestNGTest1 { + + @Test + public void tngTest1() {} + + @Test + public void tngCustomTest1() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/morten/SampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/morten/SampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/morten/SampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/morten/SampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,35 @@ +package test.morten; + +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +public class SampleTest { + private int capacity = 10; + private float loadFactor = 0.3f; + + public class SampleTestTestFactory { + public SampleTestTestFactory() {} // CTR necessary ? + + @Factory + public Object[] createInstances() { + return new SampleTest[] { + new SampleTest(1, 0.1f), new SampleTest(10, 0.5f), + }; + } + } + + public SampleTest() {} + + public SampleTest(int capacity, float loadFactor) { + System.out.println("CREATING TEST WITH " + capacity); + this.capacity = capacity; + this.loadFactor = loadFactor; + } + + @Test + public void testPut() { + // FIXME: This test does nothing + // HashMap hashTable = new HashMap(capacity, loadFactor); + // ... + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/morten/SampleTestFactory.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/morten/SampleTestFactory.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/morten/SampleTestFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/morten/SampleTestFactory.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package test.morten; + +import org.testng.annotations.Factory; + +public class SampleTestFactory { + public SampleTestFactory() {} // CTR necessary ? + + @Factory + public Object[] createInstances() { + return new SampleTest[] { + new SampleTest(1, 0.1f), new SampleTest(10, 0.5f), + }; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/multiple/Test1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/multiple/Test1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/multiple/Test1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/multiple/Test1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,21 @@ +package test.multiple; + +import static org.testng.Assert.assertTrue; + +import org.testng.annotations.AfterTest; +import org.testng.annotations.Test; + +public class Test1 { + private static int m_count = 0; + + @Test + public void f1() { + assertTrue(m_count < 1, "FAILING"); + m_count++; + } + + @AfterTest + public void cleanUp() { + m_count = 0; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/multiple/TestMultiple.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/multiple/TestMultiple.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/multiple/TestMultiple.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/multiple/TestMultiple.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package test.multiple; + +import org.testng.annotations.Test; +import test.BaseTest; + +public class TestMultiple extends BaseTest { + + private static final String CLASS_NAME = "test.multiple.ThisFactory"; + + @Test(groups = {"current"}) + public void multiple() { + addClass(CLASS_NAME); + run(); + String[] passed = { + "f1", + }; + String[] failed = { + "f1", "f1", "f1", "f1", "f1", "f1", "f1", "f1", "f1", + }; + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Failed", failed, getFailedTests()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/multiple/ThisFactory.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/multiple/ThisFactory.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/multiple/ThisFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/multiple/ThisFactory.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package test.multiple; + +import java.util.ArrayList; +import java.util.List; +import org.testng.annotations.Factory; + +/** + * This class + * + * @author cbeust + */ +public class ThisFactory { + + @Factory + public Object[] create() { + List result = new ArrayList(); + for (int i = 0; i < 10; i++) { + result.add(new Test1()); + } + + return result.toArray(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/multiplelisteners/SimpleReporter.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/multiplelisteners/SimpleReporter.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/multiplelisteners/SimpleReporter.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/multiplelisteners/SimpleReporter.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,29 @@ +package test.multiplelisteners; + +import java.lang.reflect.Field; +import java.util.List; +import org.testng.IReporter; +import org.testng.ISuite; +import org.testng.SuiteRunner; +import org.testng.TestListenerAdapter; +import org.testng.internal.IConfiguration; +import org.testng.xml.XmlSuite; +import test.listeners.ListenerAssert; + +public class SimpleReporter implements IReporter { + @Override + public void generateReport( + final List xmlSuites, final List suites, final String outputDirectory) { + for (final ISuite iSuite : suites) { + try { + final Field field = SuiteRunner.class.getDeclaredField("configuration"); + field.setAccessible(true); + final IConfiguration conf = (IConfiguration) field.get(iSuite); + ListenerAssert.assertListenerType( + conf.getConfigurationListeners(), TestListenerAdapter.class); + } catch (final Exception e) { + throw new RuntimeException(e); + } + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/multiplelisteners/Test1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/multiplelisteners/Test1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/multiplelisteners/Test1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/multiplelisteners/Test1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,10 @@ +package test.multiplelisteners; + +import org.testng.annotations.Test; + +@Test +public class Test1 { + public void test() { + // Reporter.log("test1", true); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/multiplelisteners/TestMaker.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/multiplelisteners/TestMaker.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/multiplelisteners/TestMaker.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/multiplelisteners/TestMaker.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,46 @@ +package test.multiplelisteners; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.collections.Lists; +import org.testng.xml.XmlClass; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; + +public class TestMaker { + @Test(description = "Make sure only one listener is created and not 2^3") + public void run() { + final TestNG tng = new TestNG(); + tng.setUseDefaultListeners(false); + tng.setListenerClasses(Arrays.asList(TestListenerAdapter.class, SimpleReporter.class)); + final List suites = createSuites(); + tng.setXmlSuites(suites); + tng.run(); + + // Reporter.log(tng.getSuiteListeners().size() + "", true); + // for (final XmlSuite xmlSuite : suites) + // { + // Reporter.log(xmlSuite.getName() + ": " + xmlSuite.getListeners().size(), true); + // } + } + + private List createSuites() { + final List ret = Lists.newArrayList(); + for (int i = 0; i < 3; i++) { + ret.add(createSuite(i)); + } + return ret; + } + + private XmlSuite createSuite(final int nr) { + final XmlSuite suite = new XmlSuite(); + suite.setName("Suite_" + nr); + + new XmlTest(suite).setXmlClasses(Collections.singletonList(new XmlClass(Test1.class))); + return suite; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/name/BlankNameSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/name/BlankNameSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/name/BlankNameSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/name/BlankNameSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ +package test.name; + +import org.testng.Assert; +import org.testng.ITest; +import org.testng.annotations.Test; + +public class BlankNameSample implements ITest { + + @Test + public void test() { + Assert.assertTrue(true); + } + + @Override + public String getTestName() { + return ""; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/name/ITestSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/name/ITestSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/name/ITestSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/name/ITestSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,45 @@ +package test.name; + +import org.testng.Assert; +import org.testng.ITest; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +// From https://stackoverflow.com/q/33404335/4234729 +public class ITestSample implements ITest { + + public ThreadLocal testName = new ThreadLocal<>(); + + @DataProvider(name = "dp", parallel = true) + public Object[][] getTests() { + return new Object[][] { + new Object[] {"test1"}, + new Object[] {"test2"}, + new Object[] {"test3"}, + new Object[] {"test4"}, + new Object[] {"test5"} + }; + } + + @Test(dataProvider = "dp") + public void run(String testName) { + Assert.assertEquals(testName, this.testName.get()); + } + + @BeforeMethod + public void init(Object[] testArgs) { + testName.set((String) testArgs[0]); + } + + @AfterMethod + public void tearDown(Object[] testArgs) { + Assert.assertEquals((String) testArgs[0], this.testName.get()); + } + + @Override + public String getTestName() { + return testName.get(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/name/NameSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/name/NameSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/name/NameSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/name/NameSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,13 @@ +package test.name; + +import org.testng.Assert; +import org.testng.annotations.Test; + +@Test(testName = "NAME") +public class NameSample { + + @Test + public void test() { + Assert.assertTrue(true); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/name/NameTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/name/NameTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/name/NameTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/name/NameTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,196 @@ +package test.name; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import org.testng.Assert; +import org.testng.ITestResult; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class NameTest extends SimpleBaseTest { + + @Test + public void itestTest() { + TestNG tng = create(SimpleITestSample.class); + TestListenerAdapter adapter = new TestListenerAdapter(); + tng.addListener(adapter); + + tng.run(); + + Assert.assertTrue(adapter.getFailedTests().isEmpty()); + Assert.assertTrue(adapter.getSkippedTests().isEmpty()); + Assert.assertEquals(adapter.getPassedTests().size(), 1); + ITestResult result = adapter.getPassedTests().get(0); + Assert.assertEquals(result.getMethod().getMethodName(), "test"); + Assert.assertEquals(result.getName(), "NAME"); + Assert.assertEquals(result.getTestName(), "NAME"); + } + + @Test + public void itestTestWithXml() { + TestNG tng = createTests("suite", SimpleITestSample.class); + TestListenerAdapter adapter = new TestListenerAdapter(); + tng.addListener(adapter); + + tng.run(); + + Assert.assertTrue(adapter.getFailedTests().isEmpty()); + Assert.assertTrue(adapter.getSkippedTests().isEmpty()); + Assert.assertEquals(adapter.getPassedTests().size(), 1); + ITestResult result = adapter.getPassedTests().get(0); + Assert.assertEquals(result.getMethod().getMethodName(), "test"); + Assert.assertEquals(result.getName(), "NAME"); + Assert.assertEquals(result.getTestName(), "NAME"); + } + + @Test + public void testNameTest() { + TestNG tng = create(NameSample.class); + TestListenerAdapter adapter = new TestListenerAdapter(); + tng.addListener(adapter); + + tng.run(); + + Assert.assertTrue(adapter.getFailedTests().isEmpty()); + Assert.assertTrue(adapter.getSkippedTests().isEmpty()); + Assert.assertEquals(adapter.getPassedTests().size(), 1); + ITestResult result = adapter.getPassedTests().get(0); + Assert.assertEquals(result.getMethod().getMethodName(), "test"); + Assert.assertEquals(result.getName(), "NAME"); + Assert.assertEquals(result.getTestName(), "NAME"); + } + + @Test + public void testNameTestWithXml() { + TestNG tng = createTests("suite", NameSample.class); + TestListenerAdapter adapter = new TestListenerAdapter(); + tng.addListener(adapter); + + tng.run(); + + Assert.assertTrue(adapter.getFailedTests().isEmpty()); + Assert.assertTrue(adapter.getSkippedTests().isEmpty()); + Assert.assertEquals(adapter.getPassedTests().size(), 1); + ITestResult result = adapter.getPassedTests().get(0); + Assert.assertEquals(result.getMethod().getMethodName(), "test"); + Assert.assertEquals(result.getName(), "NAME"); + Assert.assertEquals(result.getTestName(), "NAME"); + } + + @Test + public void noNameTest() { + TestNG tng = create(NoNameSample.class); + TestListenerAdapter adapter = new TestListenerAdapter(); + tng.addListener(adapter); + + tng.run(); + + Assert.assertTrue(adapter.getFailedTests().isEmpty()); + Assert.assertTrue(adapter.getSkippedTests().isEmpty()); + Assert.assertEquals(adapter.getPassedTests().size(), 1); + ITestResult result = adapter.getPassedTests().get(0); + Assert.assertEquals(result.getMethod().getMethodName(), "test"); + Assert.assertEquals(result.getName(), "test"); + Assert.assertNull(result.getTestName()); + } + + @Test + public void noNameTestWithXml() { + TestNG tng = createTests("suite", NoNameSample.class); + TestListenerAdapter adapter = new TestListenerAdapter(); + tng.addListener(adapter); + + tng.run(); + + Assert.assertTrue(adapter.getFailedTests().isEmpty()); + Assert.assertTrue(adapter.getSkippedTests().isEmpty()); + Assert.assertEquals(adapter.getPassedTests().size(), 1); + ITestResult result = adapter.getPassedTests().get(0); + Assert.assertEquals(result.getMethod().getMethodName(), "test"); + Assert.assertEquals(result.getName(), "test"); + Assert.assertNull(result.getTestName()); + } + + @Test + public void complexITestTest() { + TestNG tng = create(ITestSample.class); + TestListenerAdapter adapter = new TestListenerAdapter(); + tng.addListener(adapter); + + tng.run(); + + Assert.assertTrue(adapter.getFailedTests().isEmpty()); + Assert.assertTrue(adapter.getSkippedTests().isEmpty()); + Assert.assertEquals(adapter.getPassedTests().size(), 5); + List testNames = + new ArrayList<>(Arrays.asList("test1", "test2", "test3", "test4", "test5")); + for (ITestResult testResult : adapter.getPassedTests()) { + Assert.assertTrue( + testNames.remove(testResult.getName()), + "Duplicate test names " + getNames(adapter.getPassedTests())); + } + Assert.assertEquals(testNames, Collections.emptyList()); + } + + private static List getNames(List results) { + List names = new ArrayList<>(results.size()); + for (ITestResult result : results) { + names.add(result.getName()); + } + return names; + } + + @Test(description = "GITHUB-922: ITestResult doesn't contain name if a class has @Test") + public void testOnClassFromReporter() { + TestNG tng = create(TestOnClassSample.class); + TestOnClassListener listener = new TestOnClassListener(); + tng.addListener(listener); + + tng.run(); + + Assert.assertEquals(listener.getNames().size(), 1); + Assert.assertEquals(listener.getNames().get(0), "test"); + + // testName should be ignored if not specified + Assert.assertEquals(listener.getTestNames().size(), 1); + Assert.assertNull(listener.getTestNames().get(0)); + } + + @Test + public void blankNameTest() { + TestNG tng = create(BlankNameSample.class); + TestListenerAdapter adapter = new TestListenerAdapter(); + tng.addListener(adapter); + + tng.run(); + + Assert.assertTrue(adapter.getFailedTests().isEmpty()); + Assert.assertTrue(adapter.getSkippedTests().isEmpty()); + Assert.assertEquals(adapter.getPassedTests().size(), 1); + ITestResult result = adapter.getPassedTests().get(0); + Assert.assertEquals(result.getMethod().getMethodName(), "test"); + Assert.assertEquals(result.getName(), ""); + Assert.assertEquals(result.getTestName(), ""); + } + + @Test + public void blankNameTestWithXml() { + TestNG tng = createTests("suite", BlankNameSample.class); + TestListenerAdapter adapter = new TestListenerAdapter(); + tng.addListener(adapter); + + tng.run(); + + Assert.assertTrue(adapter.getFailedTests().isEmpty()); + Assert.assertTrue(adapter.getSkippedTests().isEmpty()); + Assert.assertEquals(adapter.getPassedTests().size(), 1); + ITestResult result = adapter.getPassedTests().get(0); + Assert.assertEquals(result.getMethod().getMethodName(), "test"); + Assert.assertEquals(result.getName(), ""); + Assert.assertEquals(result.getTestName(), ""); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/name/NoNameSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/name/NoNameSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/name/NoNameSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/name/NoNameSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.name; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class NoNameSample { + + @Test + public void test() { + Assert.assertTrue(true); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/name/SimpleITestSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/name/SimpleITestSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/name/SimpleITestSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/name/SimpleITestSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ +package test.name; + +import org.testng.Assert; +import org.testng.ITest; +import org.testng.annotations.Test; + +public class SimpleITestSample implements ITest { + + @Test + public void test() { + Assert.assertTrue(true); + } + + @Override + public String getTestName() { + return "NAME"; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/name/TestOnClassListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/name/TestOnClassListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/name/TestOnClassListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/name/TestOnClassListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,33 @@ +package test.name; + +import java.util.ArrayList; +import java.util.List; +import org.testng.IInvokedMethod; +import org.testng.IReporter; +import org.testng.ISuite; +import org.testng.xml.XmlSuite; + +public class TestOnClassListener implements IReporter { + + private final List names = new ArrayList<>(); + private final List testNames = new ArrayList<>(); + + @Override + public void generateReport( + List xmlSuites, List suites, String outputDirectory) { + for (ISuite suite : suites) { + for (IInvokedMethod method : suite.getAllInvokedMethods()) { + names.add(method.getTestResult().getName()); + testNames.add(method.getTestResult().getTestName()); + } + } + } + + public List getNames() { + return names; + } + + public List getTestNames() { + return testNames; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/name/TestOnClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/name/TestOnClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/name/TestOnClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/name/TestOnClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,10 @@ +package test.name; + +import org.testng.annotations.Test; + +@Test +public class TestOnClassSample { + + @Test + public void test() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/name/github1046/LocalTestNameGatherer.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/name/github1046/LocalTestNameGatherer.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/name/github1046/LocalTestNameGatherer.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/name/github1046/LocalTestNameGatherer.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,35 @@ +package test.name.github1046; + +import java.util.List; +import java.util.Set; +import org.testng.IReporter; +import org.testng.ISuite; +import org.testng.ISuiteResult; +import org.testng.ITestResult; +import org.testng.collections.Lists; +import org.testng.collections.Sets; +import org.testng.xml.XmlSuite; + +public class LocalTestNameGatherer implements IReporter { + private Set testnames = Sets.newHashSet(); + + @Override + public void generateReport( + List xmlSuites, List suites, String outputDirectory) { + for (ISuite suite : suites) { + for (ISuiteResult suiteResult : suite.getResults().values()) { + List testResults = Lists.newArrayList(); + testResults.addAll(suiteResult.getTestContext().getPassedTests().getAllResults()); + testResults.addAll(suiteResult.getTestContext().getFailedTests().getAllResults()); + testResults.addAll(suiteResult.getTestContext().getSkippedTests().getAllResults()); + for (ITestResult result : testResults) { + testnames.add(result.getName()); + } + } + } + } + + public Set getTestnames() { + return testnames; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/name/github1046/TestClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/name/github1046/TestClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/name/github1046/TestClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/name/github1046/TestClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,51 @@ +package test.name.github1046; + +import static org.testng.Assert.assertNotEquals; + +import org.testng.IHookCallBack; +import org.testng.IHookable; +import org.testng.ITestResult; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class TestClassSample implements IHookable { + + @DataProvider(name = "dp", parallel = true) + public Object[][] getTestData() { + return new Object[][] {{1}, {2}, {3}, {4}, {5}}; + } + + @Test(dataProvider = "dp") + public void testSample1(int num) { + assertNotEquals(num, 0); + } + + @Test(dataProvider = "dp") + public void testSample2(int num) { + assertNotEquals(num, 0); + } + + @Test + public void ordinaryTestMethod() {} + + @Test + public void dontChangeName() {} + + @Override + public void run(IHookCallBack callBack, ITestResult testResult) { + if (!("dontChangeName".equals(testResult.getMethod().getMethodName()))) { + Object param = "999"; + Object[] parameters = callBack.getParameters(); + if (parameters.length != 0) { + param = parameters[0]; + } + String testName = name(testResult.getMethod().getMethodName(), param); + testResult.setTestName(testName); + } + callBack.runTestMethod(testResult); + } + + private static String name(String prefix, Object count) { + return prefix + "_TestNG_TestCase_" + count.toString(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/name/github1046/TestCustomNamesForTests.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/name/github1046/TestCustomNamesForTests.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/name/github1046/TestCustomNamesForTests.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/name/github1046/TestCustomNamesForTests.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,30 @@ +package test.name.github1046; + +import java.util.Arrays; +import java.util.Set; +import org.testng.Assert; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.collections.Sets; +import org.testng.xml.XmlSuite; +import test.SimpleBaseTest; + +public class TestCustomNamesForTests extends SimpleBaseTest { + @Test + public void testCustomTestNames() { + XmlSuite xmlSuite = createXmlSuite("Suite", "Test", TestClassSample.class); + TestNG tng = create(xmlSuite); + LocalTestNameGatherer reporter = new LocalTestNameGatherer(); + tng.addListener(reporter); + tng.run(); + Set expectedNames = Sets.newHashSet(); + for (String method : Arrays.asList("testSample1", "testSample2")) { + for (int i = 1; i <= 5; i++) { + expectedNames.add(method + "_TestNG_TestCase_" + i); + } + } + expectedNames.add("ordinaryTestMethod_TestNG_TestCase_999"); + expectedNames.add("dontChangeName"); + Assert.assertEqualsNoOrder(reporter.getTestnames(), expectedNames); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/nested/GarfTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/nested/GarfTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/nested/GarfTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/nested/GarfTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package test.nested; + +import org.testng.Assert; +import org.testng.annotations.Test; +import test.nested.foo.AccountTypeEnum; + +@Test( + groups = {"unittest"}, + enabled = true) +public class GarfTest { + + @Test() + public void testGarf() { + AccountTypeEnum foo = AccountTypeEnum.ClearingMember; + Assert.assertEquals(foo, AccountTypeEnum.ClearingMember); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/nested/foo/AccountTypeEnum.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/nested/foo/AccountTypeEnum.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/nested/foo/AccountTypeEnum.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/nested/foo/AccountTypeEnum.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,6 @@ +package test.nested.foo; + +public class AccountTypeEnum { + + public static final AccountTypeEnum ClearingMember = null; +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/nested2/TmpA.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/nested2/TmpA.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/nested2/TmpA.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/nested2/TmpA.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,25 @@ +package test.nested2; + +import org.testng.annotations.Test; + +public class TmpA { + public static class NestedAWithTest { + @Test + public void nestedA() {} + } + + public static class NestedAWithoutTest { + public NestedAWithoutTest() { + throw new RuntimeException("TestNG should not instantiate me"); + } + + public void nestedA() {} + } + + @Test + public static class DummyBase {} + + public static class NestedAWithInheritedTest extends DummyBase { + public void nestedWithInheritedTest() {} + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/objectfactory/BadMethodObjectFactoryFactory.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/BadMethodObjectFactoryFactory.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/objectfactory/BadMethodObjectFactoryFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/BadMethodObjectFactoryFactory.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.objectfactory; + +import org.testng.annotations.ObjectFactory; + +public class BadMethodObjectFactoryFactory { + + @ObjectFactory + public Object create() { + return new LoggingObjectFactory(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/objectfactory/ClassObjectFactory.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/ClassObjectFactory.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/objectfactory/ClassObjectFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/ClassObjectFactory.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.objectfactory; + +import java.lang.reflect.Constructor; +import org.testng.ITestObjectFactory; +import org.testng.internal.objects.InstanceCreator; + +public class ClassObjectFactory implements ITestObjectFactory { + + public T newInstance(Constructor constructor, Object... parameters) { + T object = InstanceCreator.newInstance(constructor, parameters); + if (object instanceof ISetValue) { + ((ISetValue) object).setValue(42); + } + return object; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/objectfactory/ClassObjectFactorySampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/ClassObjectFactorySampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/objectfactory/ClassObjectFactorySampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/ClassObjectFactorySampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.objectfactory; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class ClassObjectFactorySampleTest implements ISetValue { + + public static int m_n = 0; + + @Test + public void f() { + Assert.assertEquals(m_n, 42); + } + + @Override + public void setValue(int i) { + m_n = i; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/objectfactory/CombinedTestAndObjectFactorySample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/CombinedTestAndObjectFactorySample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/objectfactory/CombinedTestAndObjectFactorySample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/CombinedTestAndObjectFactorySample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,37 @@ +package test.objectfactory; + +import java.lang.reflect.Constructor; +import org.testng.Assert; +import org.testng.ITestObjectFactory; +import org.testng.annotations.ObjectFactory; +import org.testng.annotations.Test; +import org.testng.internal.objects.InstanceCreator; + +public class CombinedTestAndObjectFactorySample implements ITestObjectFactory { + + private boolean configured = false; + + @ObjectFactory + public ITestObjectFactory create() { + return new CombinedTestAndObjectFactorySample(); + } + + @Test + public void isConfigured() { + Assert.assertTrue(configured, "Should have been configured by object factory"); + } + + @Override + public T newInstance(Constructor constructor, Object... params) { + try { + T o = InstanceCreator.newInstance(constructor, params); + if (o instanceof CombinedTestAndObjectFactorySample) { + CombinedTestAndObjectFactorySample s = (CombinedTestAndObjectFactorySample) o; + s.configured = true; + } + return o; + } catch (Exception e) { + throw new RuntimeException(e); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/objectfactory/CombinedTestAndObjectFactoryTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/CombinedTestAndObjectFactoryTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/objectfactory/CombinedTestAndObjectFactoryTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/CombinedTestAndObjectFactoryTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,26 @@ +package test.objectfactory; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.ITestNGListener; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.InvokedMethodNameListener; +import test.SimpleBaseTest; + +public class CombinedTestAndObjectFactoryTest extends SimpleBaseTest { + + @Test + void combinedTestAndObjectFactory() { + TestNG tng = create(CombinedTestAndObjectFactorySample.class); + + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener((ITestNGListener) listener); + + tng.run(); + + assertThat(listener.getFailedMethodNames()).isEmpty(); + assertThat(listener.getSkippedMethodNames()).isEmpty(); + assertThat(listener.getSucceedMethodNames()).containsExactly("isConfigured"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/objectfactory/ContextAwareObjectFactoryFactory.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/ContextAwareObjectFactoryFactory.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/objectfactory/ContextAwareObjectFactoryFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/ContextAwareObjectFactoryFactory.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ +package test.objectfactory; + +import org.testng.ITestContext; +import org.testng.ITestObjectFactory; +import org.testng.annotations.ObjectFactory; +import org.testng.internal.objects.ObjectFactoryImpl; + +public class ContextAwareObjectFactoryFactory { + + public static int invoked; + + @ObjectFactory + public ITestObjectFactory create(ITestContext context) { + assert context != null; + invoked++; + return new ObjectFactoryImpl(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/objectfactory/CustomFactoryTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/CustomFactoryTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/objectfactory/CustomFactoryTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/CustomFactoryTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,68 @@ +package test.objectfactory; + +import org.testng.Assert; +import org.testng.TestNG; +import org.testng.TestNGException; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import test.SimpleBaseTest; + +public class CustomFactoryTest extends SimpleBaseTest { + + @BeforeMethod + public void resetCount() { + LoggingObjectFactory.invoked = 0; + } + + @Test + public void setFactoryOnTestNG() { + TestNG tng = create(SimpleSample.class); + tng.setObjectFactory(LoggingObjectFactory.class); + tng.run(); + + Assert.assertEquals(LoggingObjectFactory.invoked, 1); + } + + @Test + public void setFactoryOnSuite() { + XmlSuite suite = createXmlSuite("objectfactory", "TmpTest", SimpleSample.class); + suite.setObjectFactoryClass(LoggingObjectFactory.class); + TestNG tng = create(suite); + tng.run(); + + Assert.assertEquals(LoggingObjectFactory.invoked, 1); + } + + @Test(description = "This broke after I made the change to enable AbstractTest") + public void setFactoryByAnnotation() { + XmlSuite suite = + createXmlSuite( + "objectfactory", "TmpTest", SimpleSample.class, MyObjectFactoryFactory.class); + TestNG tng = create(suite); + tng.run(); + + Assert.assertEquals(LoggingObjectFactory.invoked, 1); + } + + @Test + public void factoryReceivesContext() { + XmlSuite suite = + createXmlSuite( + "objectfactory", "TmpTest", SimpleSample.class, ContextAwareObjectFactoryFactory.class); + suite.setObjectFactoryClass(LoggingObjectFactory.class); + TestNG tng = create(suite); + tng.run(); + + Assert.assertEquals(ContextAwareObjectFactoryFactory.invoked, 1); + } + + @Test(expectedExceptions = TestNGException.class) + public void setInvalidMethodFactoryByAnnotation() { + XmlSuite suite = + createXmlSuite( + "objectfactory", "TmpTest", SimpleSample.class, BadMethodObjectFactoryFactory.class); + TestNG tng = create(suite); + tng.run(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/objectfactory/ISetValue.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/ISetValue.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/objectfactory/ISetValue.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/ISetValue.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,5 @@ +package test.objectfactory; + +public interface ISetValue { + void setValue(int i); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/objectfactory/LoggingObjectFactory.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/LoggingObjectFactory.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/objectfactory/LoggingObjectFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/LoggingObjectFactory.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.objectfactory; + +import java.lang.reflect.Constructor; +import org.testng.internal.objects.ObjectFactoryImpl; + +public class LoggingObjectFactory extends ObjectFactoryImpl { + + public static int invoked; + + @Override + public T newInstance(Constructor constructor, Object... params) { + invoked++; + return super.newInstance(constructor, params); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/objectfactory/MyObjectFactoryFactory.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/MyObjectFactoryFactory.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/objectfactory/MyObjectFactoryFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/MyObjectFactoryFactory.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.objectfactory; + +import org.testng.ITestObjectFactory; +import org.testng.annotations.ObjectFactory; + +public class MyObjectFactoryFactory { + + @ObjectFactory + public ITestObjectFactory create() { + return new LoggingObjectFactory(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/objectfactory/ObjectFactory2Test.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/ObjectFactory2Test.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/objectfactory/ObjectFactory2Test.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/ObjectFactory2Test.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,39 @@ +package test.objectfactory; + +import org.testng.Assert; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import test.SimpleBaseTest; + +/** Test IObjectFactory2, which is an object factory that receives just the Class in parameter. */ +public class ObjectFactory2Test extends SimpleBaseTest { + + private void testFactory(boolean onSuite) { + ClassObjectFactorySampleTest.m_n = 0; + + XmlSuite suite = + createXmlSuite("Test IObjectFactory2", "TmpTest", ClassObjectFactorySampleTest.class); + TestNG tng = create(suite); + + if (onSuite) { + suite.setObjectFactoryClass(ClassObjectFactory.class); + } else { + tng.setObjectFactory(ClassObjectFactory.class); + } + + tng.run(); + + Assert.assertEquals(ClassObjectFactorySampleTest.m_n, 42); + } + + @Test + public void factoryOnSuiteShouldWork() { + testFactory(true /* on suite object */); + } + + @Test + public void factoryOnTestNGShouldWork() { + testFactory(false /* on TestNG object */); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/objectfactory/ObjectFactoryTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/ObjectFactoryTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/objectfactory/ObjectFactoryTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/ObjectFactoryTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,78 @@ +package test.objectfactory; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.TestNG; +import org.testng.TestNGException; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import test.SimpleBaseTest; +import test.objectfactory.github1131.EmptyConstructorSample; +import test.objectfactory.github1131.IntConstructorSample; +import test.objectfactory.github1131.MyObjectFactory; +import test.objectfactory.github1131.StringConstructorSample; +import test.objectfactory.github1827.GitHub1827Sample; +import test.objectfactory.issue2676.LocalSuiteAlteringListener; +import test.objectfactory.issue2676.LoggingObjectFactorySample; +import test.objectfactory.issue2676.TestClassSample; + +public class ObjectFactoryTest extends SimpleBaseTest { + + @Test(description = "GITHUB-2676") + public void ensureObjectFactoryIsInvokedWhenAddedViaListeners() { + TestNG testng = create(TestClassSample.class); + testng.addListener(new LocalSuiteAlteringListener()); + testng.run(); + assertThat(LoggingObjectFactorySample.wasInvoked).isTrue(); + } + + @Test( + expectedExceptions = TestNGException.class, + expectedExceptionsMessageRegExp = ".*Check to make sure it can be instantiated", + description = "GITHUB-1827") + public void ensureExceptionThrownWhenNoSuitableConstructorFound() { + + TestNG testng = create(GitHub1827Sample.class); + testng.run(); + } + + @Test(dataProvider = "dp", description = "GITHUB-1131") + public void factoryWithEmptyConstructorShouldWork(boolean bool) { + testFactory(bool, EmptyConstructorSample.class); + assertThat(MyObjectFactory.allParams).containsExactly(new Object[] {}, new Object[] {}); + } + + @Test(dataProvider = "dp", description = "GITHUB-1131") + public void factoryWithIntConstructorShouldWork(boolean bool) { + testFactory(bool, IntConstructorSample.class); + assertThat(MyObjectFactory.allParams).containsExactly(new Object[] {1}, new Object[] {2}); + } + + @Test(dataProvider = "dp", description = "GITHUB-1131") + public void factoryWithStringConstructorShouldWork(boolean bool) { + testFactory(bool, StringConstructorSample.class); + assertThat(MyObjectFactory.allParams) + .containsExactly(new Object[] {"foo"}, new Object[] {"bar"}); + } + + private void testFactory(boolean onSuite, Class sample) { + MyObjectFactory.allParams.clear(); + + XmlSuite suite = createXmlSuite("Test IObjectFactory2", "TmpTest", sample); + TestNG tng = create(suite); + + if (onSuite) { + suite.setObjectFactoryClass(MyObjectFactory.class); + } else { + tng.setObjectFactory(MyObjectFactory.class); + } + + tng.run(); + } + + @DataProvider + public static Object[][] dp() { + return new Object[][] {new Object[] {true}, new Object[] {false}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/objectfactory/SimpleSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/SimpleSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/objectfactory/SimpleSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/SimpleSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.objectfactory; + +import org.testng.annotations.Test; + +public class SimpleSample { + + @Test + public void dummy() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/objectfactory/github1131/EmptyConstructorSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/github1131/EmptyConstructorSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/objectfactory/github1131/EmptyConstructorSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/github1131/EmptyConstructorSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package test.objectfactory.github1131; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +public class EmptyConstructorSample { + + public static int count = 0; + + @Factory(dataProvider = "dataProvider") + public EmptyConstructorSample() { + count++; + } + + @Test + public void test() {} + + @DataProvider + public static Object[][] dataProvider() { + return new Object[][] {new Object[] {}, new Object[] {}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/objectfactory/github1131/IntConstructorSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/github1131/IntConstructorSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/objectfactory/github1131/IntConstructorSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/github1131/IntConstructorSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,25 @@ +package test.objectfactory.github1131; + +import java.util.ArrayList; +import java.util.List; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +public class IntConstructorSample { + + public static final List parameters = new ArrayList<>(); + + @Factory(dataProvider = "dataProvider") + public IntConstructorSample(int parameter) { + parameters.add(parameter); + } + + @Test + public void test() {} + + @DataProvider + public static Object[][] dataProvider() { + return new Object[][] {new Object[] {1}, new Object[] {2}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/objectfactory/github1131/MyObjectFactory.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/github1131/MyObjectFactory.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/objectfactory/github1131/MyObjectFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/github1131/MyObjectFactory.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,24 @@ +package test.objectfactory.github1131; + +import java.lang.reflect.Constructor; +import java.util.ArrayList; +import java.util.List; +import org.testng.ITestObjectFactory; +import org.testng.annotations.ObjectFactory; +import org.testng.internal.objects.ObjectFactoryImpl; + +public class MyObjectFactory extends ObjectFactoryImpl { + + public static final List allParams = new ArrayList<>(); + + @Override + public T newInstance(Constructor constructor, Object... params) { + allParams.add(params); + return super.newInstance(constructor, params); + } + + @ObjectFactory + public ITestObjectFactory newInstance() { + return new MyObjectFactory(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/objectfactory/github1131/StringConstructorSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/github1131/StringConstructorSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/objectfactory/github1131/StringConstructorSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/github1131/StringConstructorSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,25 @@ +package test.objectfactory.github1131; + +import java.util.ArrayList; +import java.util.List; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +public class StringConstructorSample { + + public static final List parameters = new ArrayList<>(); + + @Factory(dataProvider = "dataProvider") + public StringConstructorSample(String parameter) { + parameters.add(parameter); + } + + @Test + public void test() {} + + @DataProvider + public static Object[][] dataProvider() { + return new Object[][] {new Object[] {"foo"}, new Object[] {"bar"}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/objectfactory/github1827/GitHub1827Sample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/github1827/GitHub1827Sample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/objectfactory/github1827/GitHub1827Sample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/github1827/GitHub1827Sample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.objectfactory.github1827; + +import static org.testng.Assert.assertEquals; + +import org.testng.annotations.Test; + +public class GitHub1827Sample { + + private final int value; + + public GitHub1827Sample(int value) { + this.value = value; + } + + @Test + public void test() { + assertEquals(value, 1); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/objectfactory/issue2676/LocalSuiteAlteringListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/issue2676/LocalSuiteAlteringListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/objectfactory/issue2676/LocalSuiteAlteringListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/issue2676/LocalSuiteAlteringListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,13 @@ +package test.objectfactory.issue2676; + +import java.util.List; +import org.testng.IAlterSuiteListener; +import org.testng.xml.XmlSuite; + +public class LocalSuiteAlteringListener implements IAlterSuiteListener { + + @Override + public void alter(List suites) { + suites.forEach(each -> each.setObjectFactoryClass(LoggingObjectFactorySample.class)); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/objectfactory/issue2676/LoggingObjectFactorySample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/issue2676/LoggingObjectFactorySample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/objectfactory/issue2676/LoggingObjectFactorySample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/issue2676/LoggingObjectFactorySample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.objectfactory.issue2676; + +import java.lang.reflect.Constructor; +import org.testng.ITestObjectFactory; +import org.testng.internal.objects.InstanceCreator; + +public class LoggingObjectFactorySample implements ITestObjectFactory { + + public static boolean wasInvoked = false; + + @Override + public T newInstance(Constructor constructor, Object... parameters) { + wasInvoked = true; + return InstanceCreator.newInstance(constructor, parameters); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/objectfactory/issue2676/TestClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/issue2676/TestClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/objectfactory/issue2676/TestClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/objectfactory/issue2676/TestClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.objectfactory.issue2676; + +import org.testng.annotations.Test; + +public class TestClassSample { + + @Test + public void sampleTestMethod() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/order/OrderTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/order/OrderTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/order/OrderTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/order/OrderTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,34 @@ +package test.order; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.annotations.Test; +import test.InvokedMethodNameListener; +import test.SimpleBaseTest; +import test.order.github288.Actual1Sample; +import test.order.github288.Actual2Sample; + +public class OrderTest extends SimpleBaseTest { + + @Test(description = "GITHUB-288") + public void interleavingMethodsInDifferentClasses() { + InvokedMethodNameListener listener = run(Actual1Sample.class, Actual2Sample.class); + assertThat(listener.getFailedMethodNames()).isEmpty(); + assertThat(listener.getSkippedMethodNames()).isEmpty(); + assertThat(listener.getSucceedMethodNames()) + .containsExactly( + "beforeClass", + "test1", + // "test3", // The result is not exactly the one from #288 (prior 6.8) + // but it respects the class separation + "test4(one)", + "test4(two)", + "test4(three)", + "test4(four)", + "test3", + "afterClass", + "beforeClass", + "test2", + "afterClass"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/order/github288/Actual1Sample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/order/github288/Actual1Sample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/order/github288/Actual1Sample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/order/github288/Actual1Sample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package test.order.github288; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class Actual1Sample extends BaseSample { + + @DataProvider + public Object[][] parameters() { + return new Object[][] { + new Object[] {"one"}, new Object[] {"two"}, new Object[] {"three"}, new Object[] {"four"} + }; + } + + @Test + public void test1() {} + + @Test(dependsOnMethods = "test1") + public void test3() {} + + @Test(dataProvider = "parameters") + public void test4(String parameter) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/order/github288/Actual2Sample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/order/github288/Actual2Sample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/order/github288/Actual2Sample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/order/github288/Actual2Sample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.order.github288; + +import org.testng.annotations.Test; + +public class Actual2Sample extends BaseSample { + + @Test + public void test2() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/order/github288/BaseSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/order/github288/BaseSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/order/github288/BaseSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/order/github288/BaseSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,13 @@ +package test.order.github288; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; + +public class BaseSample { + + @BeforeClass + protected void beforeClass() {} + + @AfterClass(alwaysRun = true) + protected void afterClass() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/override/OverrideSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/override/OverrideSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/override/OverrideSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/override/OverrideSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package test.override; + +import org.testng.annotations.Test; + +public class OverrideSampleTest { + + @Test(groups = "goodGroup") + public void good() {} + + @Test(groups = "badGroup") + public void bad() { + throw new RuntimeException("Should not happen"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/override/OverrideTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/override/OverrideTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/override/OverrideTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/override/OverrideTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,73 @@ +package test.override; + +import java.io.File; +import java.io.IOException; +import java.util.Collections; +import org.testng.Assert; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.TestNGException; +import org.testng.annotations.Test; +import org.testng.reporters.Files; +import test.SimpleBaseTest; +import test.TestHelper; + +/** + * Verify that command line switches override parameters in testng.xml. + * + * @author Cedric Beust + */ +public class OverrideTest extends SimpleBaseTest { + + private static File createTempFile(String content) { + try { + // Create temp file. + File result = File.createTempFile("testng-tmp", ""); + + // Delete temp file when program exits. + result.deleteOnExit(); + Files.writeFile(content, result); + + return result; + } catch (IOException e) { + throw new TestNGException(e); + } + } + + private void runTest(String include, String exclude) { + File f = + createTempFile( + TestHelper.SUITE_XML_HEADER + + "" + + " " + + " " + + " " + + " " + + " " + + ""); + TestNG tng = create(); + TestListenerAdapter tla = new TestListenerAdapter(); + tng.addListener(tla); + if (include != null) tng.setGroups(include); + if (exclude != null) tng.setExcludedGroups(exclude); + tng.setTestSuites(Collections.singletonList(f.getAbsolutePath())); + tng.run(); + + Assert.assertEquals(tla.getPassedTests().size(), 1); + } + + @Test(description = "Override -groups") + public void overrideIncludeShouldWork() { + runTest("goodGroup", null); + } + + @Test(description = "Override -excludegroups") + public void overrideExcludeShouldWork() { + runTest(null, "badGroup"); + } + + @Test(description = "Override -groups and -excludegroups") + public void overrideIncludeAndExcludeShouldWork() { + runTest("goodGroup", "badGroup"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/parameters/BeforeWithParameterSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/BeforeWithParameterSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/parameters/BeforeWithParameterSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/BeforeWithParameterSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +package test.parameters; + +import org.testng.Assert; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; + +public class BeforeWithParameterSample { + + @BeforeMethod + @Parameters("parameter") + public static void beforeMethod(String parameter) { + Assert.assertEquals(parameter, "parameter value"); + } + + @DataProvider(name = "dataProvider") + public static Object[][] dataProvider() { + return new Object[][] {{"abc", "def"}}; + } + + @Test(dataProvider = "dataProvider") + public static void testExample(String a, String b) { + Assert.assertEquals(a, "abc"); + Assert.assertEquals(b, "def"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/parameters/EnumParameterSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/EnumParameterSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/parameters/EnumParameterSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/EnumParameterSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.parameters; + +import org.testng.Assert; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; + +public class EnumParameterSample { + + public enum MyEnum { + VALUE_1, + VALUE_2 + } + + @Test + @Parameters("parameter") + public void testMethod(MyEnum parameter) { + Assert.assertNotNull(parameter); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/parameters/InheritFromSuiteChild1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/InheritFromSuiteChild1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/parameters/InheritFromSuiteChild1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/InheritFromSuiteChild1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,22 @@ +package test.parameters; + +import org.testng.Assert; +import org.testng.annotations.Optional; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; + +/** + * Checks to see if the parameters from parent suite are passed onto the child suite (referred by + * ) + */ +public class InheritFromSuiteChild1 { + + @Test + @Parameters({"parameter1", "parameter2", "parameter3", "parameter4"}) + public void inheritedParameter(String p1, String p2, @Optional("foobar") String p3, String p4) { + Assert.assertEquals(p1, "p1"); + Assert.assertEquals(p2, "c1p2"); + Assert.assertEquals(p3, "foobar"); + Assert.assertEquals(p4, "c1p4"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/parameters/InheritFromSuiteChild2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/InheritFromSuiteChild2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/parameters/InheritFromSuiteChild2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/InheritFromSuiteChild2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,21 @@ +package test.parameters; + +import org.testng.Assert; +import org.testng.annotations.Optional; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; + +/** + * Checks to see if the parameters from parent suite are passed onto the child suite (referred by + * ) + */ +public class InheritFromSuiteChild2 { + @Test + @Parameters({"parameter1", "parameter2", "parameter3", "parameter4"}) + public void inheritedParameter(String p1, String p2, String p3, @Optional("abc") String p4) { + Assert.assertEquals(p1, "p1"); + Assert.assertEquals(p2, "c2p2"); + Assert.assertEquals(p3, "c2p3"); + Assert.assertEquals(p4, "abc"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/parameters/InheritFromSuiteChild3.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/InheritFromSuiteChild3.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/parameters/InheritFromSuiteChild3.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/InheritFromSuiteChild3.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.parameters; + +import org.testng.Assert; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; + +/** + * Checks to see if the parameters from parent suite are passed onto the child suite (referred by + * ) + */ +public class InheritFromSuiteChild3 { + @Test + @Parameters({"parameter1", "parameter2", "parameter3", "parameter4"}) + public void inheritedParameter(String p1, String p2, String p3, String p4) { + Assert.assertEquals(p1, "p1"); + Assert.assertEquals(p2, "c3p2"); + Assert.assertEquals(p3, "c2p3"); + Assert.assertEquals(p4, "c3p4"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/parameters/Issue1061Sample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/Issue1061Sample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/parameters/Issue1061Sample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/Issue1061Sample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,36 @@ +package test.parameters; + +import org.testng.ITestResult; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +public class Issue1061Sample { + private final long timeout; + private final long waitTime; + + @DataProvider + public static Object[][] dp() { + return new Object[][] { + new Object[] {1_000, 2_000}, + new Object[] {3_000, 6_000} + }; + } + + @Factory(dataProvider = "dp") + public Issue1061Sample(long timeout, long waitTime) { + this.timeout = timeout; + this.waitTime = waitTime; + } + + @BeforeMethod + public void setup(ITestResult result) { + result.getMethod().setTimeOut(timeout); + } + + @Test + public void test() throws InterruptedException { + Thread.sleep(waitTime); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/parameters/Issue1554TestClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/Issue1554TestClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/parameters/Issue1554TestClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/Issue1554TestClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,25 @@ +package test.parameters; + +import org.testng.Assert; +import org.testng.ITestContext; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; + +public class Issue1554TestClassSample { + private String browser; + private ITestContext context; + + @Parameters({"browser"}) + @BeforeTest + public void setUpTest(String browser, ITestContext context) { + this.browser = browser; + this.context = context; + } + + @Test() + public void aTest() { + Assert.assertNotNull(browser); + Assert.assertNotNull(context); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/parameters/OptionalParameterTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/OptionalParameterTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/parameters/OptionalParameterTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/OptionalParameterTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package test.parameters; + +import org.testng.annotations.Optional; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; + +public class OptionalParameterTest { + + @Parameters("optional") + public OptionalParameterTest(@Optional String optional) {} + + @Test(description = "GITHUB-564") + public void testWithParameterOnlyOptionalAnnotation(@Optional String unUsedParameter) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/parameters/Override1Sample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/Override1Sample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/parameters/Override1Sample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/Override1Sample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package test.parameters; + +import org.testng.Assert; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; + +@Test +public class Override1Sample { + + @Parameters({"InheritedFromSuite", "InheritedFromTest", "InheritedFromClass"}) + public void g(String suite, String test, String cls) { + Assert.assertEquals(suite, "InheritedFromSuite"); + Assert.assertEquals(test, "InheritedFromTest"); + Assert.assertEquals(cls, "InheritedFromClass"); + } + + public void h() {} + + @Parameters("a") + public void f(String p) { + Assert.assertEquals(p, "Correct"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/parameters/ParamInheritanceTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/ParamInheritanceTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/parameters/ParamInheritanceTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/ParamInheritanceTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,68 @@ +package test.parameters; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.io.PrintStream; +import java.util.Arrays; +import org.testng.Assert; +import org.testng.ITestNGListener; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class ParamInheritanceTest extends SimpleBaseTest { + + @Test( + description = + "When verbose is set to >1, TNG prints test results on CLI which are printed " + + "using SuiteResultCounts.calculateResultCounts(). This method has been throwing NPE " + + "because it's unable to find SuiteRunner in HashMap, because the list of parameters in " + + "SuiteRunner changed" + + " during execution. This test makes sure we dont run into any NPEs") + public void noNPEInCountingResults() { + TestNG tng = create(); + tng.setTestSuites(Arrays.asList(getPathToResource("param-inheritance/parent-suite.xml"))); + + TestListenerAdapter tla = new TestListenerAdapter(); + tng.addListener((ITestNGListener) tla); + + OutputStream os = new ByteArrayOutputStream(); + PrintStream out = System.out; + PrintStream err = System.err; + try { + /* + * Changing system print streams so that exception or results stmt is not logged + * while running test (avoid confusing person running tests) + */ + System.setOut(new PrintStream(os)); + System.setErr(new PrintStream(os)); + + tng.run(); + + Assert.assertEquals(tla.getPassedTests().size(), 1); + } finally { + try { + os.close(); + } catch (IOException e) { + // no need to handle this + } + System.setOut(out); + System.setErr(err); + } + } + + @Test(description = "Checks to make sure parameters are inherited and overridden properly") + public void parameterInheritanceAndOverriding() { + TestNG tng = create(); + tng.setTestSuites(Arrays.asList(getPathToResource("parametertest/parent-suite.xml"))); + + TestListenerAdapter tla = new TestListenerAdapter(); + tng.addListener((ITestNGListener) tla); + + tng.run(); + + Assert.assertEquals(tla.getPassedTests().size(), 3); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/parameters/ParameterInjectAndOptionSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/ParameterInjectAndOptionSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/parameters/ParameterInjectAndOptionSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/ParameterInjectAndOptionSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,25 @@ +package test.parameters; + +import org.testng.Assert; +import org.testng.ITestContext; +import org.testng.annotations.BeforeSuite; +import org.testng.annotations.Optional; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; +import org.testng.xml.XmlTest; + +public class ParameterInjectAndOptionSample { + + @BeforeSuite + @Parameters({"beforesuitedata"}) + public void beforeSuite( + ITestContext context, @Optional("optionalbeforesuitedata") String beforesuitedata) { + Assert.assertEquals(beforesuitedata, "optionalbeforesuitedata"); + } + + @Test + @Parameters({"testdata"}) + public void test(XmlTest xmlTest, @Optional("optionaltestdata") String testdata) { + Assert.assertEquals(testdata, "optionaltestdata"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/parameters/ParameterInjectAndOptionTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/ParameterInjectAndOptionTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/parameters/ParameterInjectAndOptionTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/ParameterInjectAndOptionTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.parameters; + +import org.testng.Assert; +import org.testng.ITestNGListener; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class ParameterInjectAndOptionTest extends SimpleBaseTest { + + @Test + public void test() { + TestNG tng = create(ParameterInjectAndOptionSample.class); + TestListenerAdapter tla = new TestListenerAdapter(); + tng.addListener((ITestNGListener) tla); + tng.run(); + Assert.assertEquals(tla.getPassedTests().size(), 1); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/parameters/ParameterOverrideTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/ParameterOverrideTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/parameters/ParameterOverrideTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/ParameterOverrideTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,71 @@ +package test.parameters; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.ITestNGListener; +import org.testng.TestNG; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import org.testng.xml.XmlClass; +import org.testng.xml.XmlInclude; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.InvokedMethodNameListener; +import test.SimpleBaseTest; + +public class ParameterOverrideTest extends SimpleBaseTest { + + enum Status { + PASS_TEST, + PASS_CLASS, + PASS_INCLUDE + } + + @DataProvider + public static Object[][] dp() { + return new Object[][] { + new Object[] {"testOverrideSuite", Status.PASS_TEST}, + new Object[] {"classOverrideSuite", Status.PASS_CLASS}, + new Object[] {"includeOverrideClass", Status.PASS_INCLUDE}, + }; + } + + @Test(dataProvider = "dp") + public void testOverrideParameter(String name, Status status) { + XmlSuite suite = createXmlSuite("suite"); + suite.getParameters().put("a", "Incorrect"); + suite.getParameters().put("InheritedFromSuite", "InheritedFromSuite"); + + XmlTest test = createXmlTest(suite, "test"); + test.getLocalParameters().put("InheritedFromTest", "InheritedFromTest"); + + XmlClass clazz = createXmlClass(test, Override1Sample.class); + clazz.getLocalParameters().put("InheritedFromClass", "InheritedFromClass"); + + XmlInclude includeF = createXmlInclude(clazz, "f"); + XmlInclude includeG = createXmlInclude(clazz, "g"); + + switch (status) { + case PASS_TEST: + test.getLocalParameters().put("a", "Correct"); + break; + case PASS_CLASS: + clazz.getLocalParameters().put("a", "Correct"); + break; + case PASS_INCLUDE: + includeF.getLocalParameters().put("a", "Correct"); + break; + } + + TestNG tng = create(suite); + + InvokedMethodNameListener tla = new InvokedMethodNameListener(); + tng.addListener((ITestNGListener) tla); + + tng.run(); + + assertThat(tla.getSucceedMethodNames()) + .containsExactly( + "f(Correct)", "g(InheritedFromSuite,InheritedFromTest,InheritedFromClass)"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/parameters/ParameterSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/ParameterSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/parameters/ParameterSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/ParameterSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,26 @@ +package test.parameters; + +import org.testng.Assert; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Optional; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; + +public class ParameterSample { + + @Parameters({"first-name"}) + @BeforeMethod + public void beforeTest(String firstName) { + Assert.assertEquals(firstName, "Cedric"); + } + + @Parameters({"first-name"}) + @Test(groups = {"singleString"}) + public void testSingleString(String firstName) { + Assert.assertEquals(firstName, "Cedric"); + } + + @Parameters({"this parameter doesn't exist"}) + @Test + public void testNonExistentParameter(@Optional String foo) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/parameters/ParameterTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/ParameterTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/parameters/ParameterTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/ParameterTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,134 @@ +package test.parameters; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.testng.ITestResult; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.TestNGException; +import org.testng.annotations.Test; +import org.testng.collections.Lists; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.InvokedMethodNameListener; +import test.SimpleBaseTest; + +public class ParameterTest extends SimpleBaseTest { + + @Test + public void stringSingle() { + XmlSuite suite = createXmlSuite("stringSingle"); + XmlTest test = createXmlTest(suite, "Before with parameter sample", ParameterSample.class); + test.addParameter("first-name", "Cedric"); + + TestNG tng = create(suite); + + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener(listener); + + tng.run(); + + assertThat(listener.getFailedMethodNames()).isEmpty(); + assertThat(listener.getSkippedMethodNames()).isEmpty(); + assertThat(listener.getSucceedMethodNames()) + .containsExactly( + "beforeTest(Cedric)", "testNonExistentParameter(null)", + "beforeTest(Cedric)", "testSingleString(Cedric)"); + } + + @Test + public void beforeMethodWithParameters() { + XmlSuite suite = createXmlSuite("beforeMethodWithParameters"); + XmlTest test = + createXmlTest(suite, "Before with parameter sample", BeforeWithParameterSample.class); + test.addParameter("parameter", "parameter value"); + + TestNG tng = create(suite); + + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener(listener); + + tng.run(); + + assertThat(listener.getFailedMethodNames()).isEmpty(); + assertThat(listener.getSkippedMethodNames()).isEmpty(); + assertThat(listener.getSucceedMethodNames()) + .containsExactly("beforeMethod(parameter value)", "testExample(abc,def)"); + } + + @Test + public void enumParameters() { + XmlSuite suite = createXmlSuite("enumParameters"); + XmlTest test = createXmlTest(suite, "Enum parameter sample", EnumParameterSample.class); + test.addParameter("parameter", "VALUE_1"); + + TestNG tng = create(suite); + + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener(listener); + + tng.run(); + + assertThat(listener.getFailedMethodNames()).isEmpty(); + assertThat(listener.getSkippedMethodNames()).isEmpty(); + assertThat(listener.getSucceedMethodNames()).containsExactly("testMethod(VALUE_1)"); + } + + @Test(description = "GITHUB-1105: Test skipped instead failed if incorrect enum value") + public void invalidEnumParameters() { + XmlSuite suite = createXmlSuite("enumParameters"); + XmlTest test = createXmlTest(suite, "Enum parameter sample", EnumParameterSample.class); + test.addParameter("parameter", "INVALID_VALUE"); + + TestNG tng = create(suite); + + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener(listener); + + tng.run(); + + assertThat(listener.getSucceedMethodNames()).isEmpty(); + assertThat(listener.getSkippedMethodNames()).isEmpty(); + assertThat(listener.getFailedBeforeInvocationMethodNames()).containsExactly("testMethod"); + Throwable exception = listener.getResult("testMethod").getThrowable(); + assertThat(exception) + .isInstanceOf(TestNGException.class) + .hasCauseInstanceOf(IllegalArgumentException.class); + } + + @Test(description = "GITHUB-1061") + public void testNativeInjection() { + TestNG testng = create(Issue1061Sample.class); + TestListenerAdapter listener = new TestListenerAdapter(); + testng.addListener(listener); + testng.run(); + assertThat(listener.getFailedTests().size()).isEqualTo(2); + String[] expectedMsgs = + new String[] { + "Method test.parameters.Issue1061Sample.test() didn't finish within the time-out 1000", + "Method test.parameters.Issue1061Sample.test() didn't finish within the time-out 3000" + }; + List actualMsgs = Lists.newArrayList(); + for (ITestResult result : listener.getFailedTests()) { + actualMsgs.add(result.getThrowable().getMessage()); + } + assertThat(actualMsgs).containsExactlyInAnyOrder(expectedMsgs); + } + + @Test(description = "GITHUB-1554") + public void testNativeInjectionAndParamsInjection() { + XmlSuite suite = createXmlSuite("suite"); + XmlTest test = createXmlTest(suite, "test", Issue1554TestClassSample.class); + Map params = new HashMap<>(); + params.put("browser", "chrome"); + test.setParameters(params); + TestNG testng = create(suite); + TestListenerAdapter listener = new TestListenerAdapter(); + testng.addListener(listener); + testng.run(); + assertThat(listener.getPassedTests().isEmpty()).isFalse(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/parameters/ParametersPackageLevelMethodTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/ParametersPackageLevelMethodTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/parameters/ParametersPackageLevelMethodTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/ParametersPackageLevelMethodTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,21 @@ +package test.parameters; + +import org.testng.Assert; +import org.testng.ITestNGListener; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.internal.ParametersTest; +import test.SimpleBaseTest; + +public class ParametersPackageLevelMethodTest extends SimpleBaseTest { + + @Test + public void test() { + TestNG tng = create(ParametersTest.class); + TestListenerAdapter tla = new TestListenerAdapter(); + tng.addListener((ITestNGListener) tla); + tng.run(); + Assert.assertEquals(tla.getPassedTests().size(), 1); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/parameters/Sample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/Sample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/parameters/Sample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/Sample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.parameters; + +import org.testng.annotations.Test; + +public class Sample { + + @Test + public void foo() { + // purposefully does nothing + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/parameters/Shadow1Sample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/Shadow1Sample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/parameters/Shadow1Sample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/Shadow1Sample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package test.parameters; + +import org.testng.Assert; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; + +public class Shadow1Sample { + + @Parameters("a") + @Test + public void test1(String a) { + Assert.assertEquals(a, "First"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/parameters/Shadow2Sample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/Shadow2Sample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/parameters/Shadow2Sample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/Shadow2Sample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package test.parameters; + +import org.testng.Assert; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; + +public class Shadow2Sample { + + @Parameters("a") + @Test + public void test2(String a) { + Assert.assertEquals(a, "Second"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/parameters/ShadowTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/ShadowTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/parameters/ShadowTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/ShadowTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,39 @@ +package test.parameters; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.ITestNGListener; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlClass; +import org.testng.xml.XmlInclude; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.InvokedMethodNameListener; +import test.SimpleBaseTest; + +public class ShadowTest extends SimpleBaseTest { + + @Test + public void parametersShouldNotBeShadowed() { + XmlSuite suite = createXmlSuite("suite"); + XmlTest test = createXmlTest(suite, "test"); + + XmlClass class1 = createXmlClass(test, Shadow1Sample.class); + class1.getLocalParameters().put("a", "First"); + XmlInclude include1 = createXmlInclude(class1, "test1"); + + XmlClass class2 = createXmlClass(test, Shadow2Sample.class); + class2.getLocalParameters().put("a", "Second"); + XmlInclude include2 = createXmlInclude(class2, "test2"); + + TestNG tng = create(suite); + + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener((ITestNGListener) listener); + + tng.run(); + + assertThat(listener.getSucceedMethodNames()).containsExactly("test1(First)", "test2(Second)"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/parameters/issue2238/ExampleTestCase.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/issue2238/ExampleTestCase.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/parameters/issue2238/ExampleTestCase.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/issue2238/ExampleTestCase.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.parameters.issue2238; + +import org.testng.Assert; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; + +public class ExampleTestCase { + + @Test + @Parameters("value") + public void testMethod(int value) { + int expected = Integer.parseInt(System.getProperty("value")); + Assert.assertEquals(value, expected); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/parameters/issue2238/IssueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/issue2238/IssueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/parameters/issue2238/IssueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/parameters/issue2238/IssueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,60 @@ +package test.parameters.issue2238; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlClass; +import org.testng.xml.XmlInclude; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.SimpleBaseTest; + +public class IssueTest extends SimpleBaseTest { + + @Test + public void ensureParametersCanBeOverriddenAtSuiteLevel() { + XmlSuite xmlSuite = createXmlSuite("suite", "test", ExampleTestCase.class); + xmlSuite.getParameters().put("value", "100"); + runTest(xmlSuite); + } + + @Test + public void ensureParametersCanBeOverriddenAtTestLevel() { + XmlSuite xmlSuite = createXmlSuite("suite"); + XmlTest xmltest = createXmlTest(xmlSuite, "test", ExampleTestCase.class); + xmltest.getLocalParameters().put("value", "100"); + runTest(xmlSuite); + } + + @Test + public void ensureParametersCanBeOverriddenAtClassLevel() { + XmlSuite xmlSuite = createXmlSuite("suite"); + XmlTest xmlTest = createXmlTest(xmlSuite, "test"); + XmlClass xmlclass = createXmlClass(xmlTest, ExampleTestCase.class); + xmlclass.getLocalParameters().put("value", "100"); + runTest(xmlSuite); + } + + @Test + public void ensureParametersCanBeOverriddenAtMethodLevel() { + XmlSuite xmlSuite = createXmlSuite("suite"); + XmlTest xmlTest = createXmlTest(xmlSuite, "test"); + XmlClass xmlclass = createXmlClass(xmlTest, ExampleTestCase.class); + XmlInclude xmlInclude = new XmlInclude(); + xmlInclude.setName("testMethod"); + xmlInclude.getLocalParameters().put("value", "100"); + xmlclass.getIncludedMethods().add(xmlInclude); + runTest(xmlSuite); + } + + private void runTest(XmlSuite xmlSuite) { + System.setProperty("value", "200"); + TestNG testng = create(xmlSuite); + TestListenerAdapter listener = new TestListenerAdapter(); + testng.addListener(listener); + testng.run(); + assertThat(listener.getFailedTests()).isEmpty(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/pholser/Captor.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/pholser/Captor.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/pholser/Captor.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/pholser/Captor.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,35 @@ +package test.pholser; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +/** + * @author Paul Holser + * @version $Id: Captor.java,v 1.3 2004/08/26 22:25:22 cedric Exp $ + */ +public class Captor { + private static Captor instance = null; + private List captives; + + public static Captor instance() { + if (null == instance) { + instance = new Captor(); + } + return instance; + } + + public static void reset() { + // System.out.println("@@PHOLSER RESETTING CAPTOR"); + instance().captives = new ArrayList<>(); + } + + public void capture(String aString) { + // System.out.println("@@PHOLSER CAPTURING " + aString); + captives.add(aString); + } + + public List captives() { + return Collections.unmodifiableList(captives); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/pholser/Demo.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/pholser/Demo.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/pholser/Demo.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/pholser/Demo.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,62 @@ +package test.pholser; + +import java.util.Arrays; +import java.util.List; +import org.testng.annotations.AfterClass; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +/** + * @author Paul Holser + * @version $Id: Demo.java,v 1.5 2006/06/22 13:45:01 cedric Exp $ + */ +public class Demo { + @BeforeClass + public void setUpFixture() { + Captor.reset(); + Captor.instance().capture("Demo.setUpFixture"); + } + + @BeforeMethod + public void setUp() { + Captor.instance().capture("Demo.setUp"); + } + + @AfterMethod + public void tearDown() { + Captor.instance().capture("Demo.tearDown"); + } + + @AfterClass + public void tearDownFixture() { + final List expected = + Arrays.asList(new String[] {"Demo.setUpFixture", "Demo.setUp", "Demo.tearDown"}); + final List actual = Captor.instance().captives(); + verify(expected, actual); + } + + @Test + public void go() { + final List expected = Arrays.asList(new String[] {"Demo.setUpFixture", "Demo.setUp"}); + final List actual = Captor.instance().captives(); + verify(expected, actual); + } + + private void verify(List expected, List actual) { + if (!expected.equals(actual)) { + throw new AssertionError( + "\nExpected:" + dumpList(expected) + "\n Got:" + dumpList(actual)); + } + } + + private String dumpList(List list) { + StringBuffer result = new StringBuffer(); + for (String l : list) { + result.append(" " + l); + } + + return result.toString(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/pholser/Saboteur.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/pholser/Saboteur.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/pholser/Saboteur.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/pholser/Saboteur.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,37 @@ +package test.pholser; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +/** + * @author Paul Holser + * @version $Id: Saboteur.java,v 1.4 2006/06/22 13:45:01 cedric Exp $ + */ +public class Saboteur { + @BeforeClass + public void setUpFixture() { + Captor.reset(); + Captor.instance().capture("Saboteur.setUpFixture"); + } + + @BeforeMethod + public void setUp() { + Captor.instance().capture("Saboteur.setUp"); + } + + @AfterMethod + public void tearDown() { + Captor.instance().capture("Saboteur.tearDown"); + } + + @AfterClass + public void tearDownFixture() { + Captor.instance().capture("Saboteur.tearDownFixture"); + } + + @Test + public void go() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/pkg/PackageTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/pkg/PackageTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/pkg/PackageTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/pkg/PackageTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,93 @@ +package test.pkg; + +import static org.testng.Assert.assertTrue; + +import org.testng.annotations.Test; +import test.BaseTest; +import test.pkg2.Test2; + +/** + * Tests that in testng.xml works. + * + *

Created on Aug 2, 2005 + * + * @author cbeust + */ +public class PackageTest extends BaseTest { + public static boolean NON_TEST_CONSTRUCTOR = false; + + @Test + public void stringSingle() { + addPackage("test.pkg2", new String[0], new String[0]); + run(); + String[] passed = { + "method11", "method12", "method31", + }; + String[] failed = {}; + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Failed", failed, getFailedTests()); + } + + @Test + public void packageWithNonTestClasses() { + addPackage("test.pkg2", new String[0], new String[0]); + run(); + assertTrue(!NON_TEST_CONSTRUCTOR, Test2.class.getName() + " should not be considered"); + } + + @Test + public void packageWithRegExp1() { + addPackage("test.pkg2", new String[] {".*1.*"}, new String[0]); + run(); + String[] passed = { + "method11", "method12", + }; + String[] failed = {}; + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Failed", failed, getFailedTests()); + } + + @Test + public void packageWithRegExp2() { + addPackage("test.pkg2", new String[0], new String[] {".*1.*"}); + run(); + String[] passed = { + "method31", + }; + String[] failed = {}; + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Failed", failed, getFailedTests()); + } + + @Test + public void packageWithRegExp3() { + addPackage("test.pkg2", new String[] {".*3.*"}, new String[] {".*1.*"}); + run(); + String[] passed = { + "method31", + }; + String[] failed = {}; + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Failed", failed, getFailedTests()); + } + + @Test + public void packageWithRegExp4() { + addPackage("test.pkg2", new String[] {".*1.*"}, new String[] {".*3.*"}); + run(); + String[] passed = {"method11", "method12"}; + String[] failed = {}; + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Failed", failed, getFailedTests()); + } + + @Test + public void packageWithRegExp5() { + addPackage("test.pkg2", new String[0], new String[] {"Test.*"}); + run(); + String[] passed = {}; + String[] failed = {}; + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Failed", failed, getFailedTests()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/pkg2/Test1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/pkg2/Test1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/pkg2/Test1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/pkg2/Test1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.pkg2; + +import org.testng.annotations.Test; + +public class Test1 { + + @Test + public void method11() {} + + @Test + public void method12() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/pkg2/Test2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/pkg2/Test2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/pkg2/Test2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/pkg2/Test2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.pkg2; + +import test.pkg.PackageTest; + +public class Test2 { + private Test2(float afloat) { + PackageTest.NON_TEST_CONSTRUCTOR = true; + } + + public void nonTestMethod() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/pkg2/Test3.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/pkg2/Test3.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/pkg2/Test3.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/pkg2/Test3.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.pkg2; + +import org.testng.annotations.Test; + +public class Test3 { + + @Test + public void method31() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/preserveorder/A.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/preserveorder/A.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/preserveorder/A.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/preserveorder/A.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.preserveorder; + +import org.testng.annotations.Test; + +public class A { + + @Test + public void a1() {} + + @Test + public void a2() {} + + @Test + public void a3() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/preserveorder/B.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/preserveorder/B.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/preserveorder/B.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/preserveorder/B.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.preserveorder; + +import org.testng.annotations.Test; + +public class B { + + @Test + public void b1() {} + + @Test + public void b2() {} + + @Test + public void b3() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/preserveorder/C.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/preserveorder/C.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/preserveorder/C.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/preserveorder/C.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.preserveorder; + +import org.testng.annotations.Test; + +public class C { + + @Test + public void c1() {} + + @Test + public void c2() {} + + @Test + public void c3() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/preserveorder/Chuck3Sample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/preserveorder/Chuck3Sample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/preserveorder/Chuck3Sample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/preserveorder/Chuck3Sample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.preserveorder; + +import org.testng.annotations.Test; + +public class Chuck3Sample { + + @Test( + groups = {"functional"}, + dependsOnMethods = {"c3TestTwo"}) + public void c3TestThree() {} + + @Test(groups = {"functional"}) + public static void c3TestOne() {} + + @Test( + groups = {"functional"}, + dependsOnMethods = {"c3TestOne"}) + public static void c3TestTwo() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/preserveorder/Chuck4Sample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/preserveorder/Chuck4Sample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/preserveorder/Chuck4Sample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/preserveorder/Chuck4Sample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.preserveorder; + +import org.testng.annotations.Test; + +public class Chuck4Sample { + + @Test( + groups = {"functional"}, + dependsOnMethods = {"c4TestTwo"}) + public void c4TestThree() {} + + @Test(groups = {"functional"}) + public static void c4TestOne() {} + + @Test( + groups = {"functional"}, + dependsOnMethods = {"c4TestOne"}) + public static void c4TestTwo() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/preserveorder/ClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/preserveorder/ClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/preserveorder/ClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/preserveorder/ClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,26 @@ +/* + * @(#) TestClass.java + * Created: Aug 10, 2011 + * By: Wolfgang & Monika Baltes + * Copyright 2011 Wolfgang Baltes + * WOLFGANG & MONIKA BALTES PROPRIETARY/CONFIDENTIAL. + * Use is subject to license terms. + */ +package test.preserveorder; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class ClassSample { + + private final int val; + + public ClassSample(int val) { + this.val = val; + } + + @Test + public void checkVal() { + Assert.assertTrue(this.val != 0); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/preserveorder/ClassSampleFactory.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/preserveorder/ClassSampleFactory.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/preserveorder/ClassSampleFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/preserveorder/ClassSampleFactory.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.preserveorder; + +import org.testng.annotations.Factory; + +public class ClassSampleFactory { + + @Factory + public Object[] f() { + final Object[] res = new Object[4]; + for (int i = 0; i < res.length; i++) { + res[i] = new ClassSample(i + 1); + } + return res; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/preserveorder/Issue1122Sample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/preserveorder/Issue1122Sample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/preserveorder/Issue1122Sample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/preserveorder/Issue1122Sample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.preserveorder; + +import org.testng.Assert; +import org.testng.ITestContext; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; + +public class Issue1122Sample { + + @Test + public void test(ITestContext context) { + Assert.assertEquals( + context.getCurrentXmlTest().getPreserveOrder(), XmlSuite.DEFAULT_PRESERVE_ORDER); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/preserveorder/PreserveOrderTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/preserveorder/PreserveOrderTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/preserveorder/PreserveOrderTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/preserveorder/PreserveOrderTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,124 @@ +package test.preserveorder; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Arrays; +import java.util.Iterator; +import org.testng.Assert; +import org.testng.ITestNGListener; +import org.testng.TestNG; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.InvokedMethodNameListener; +import test.SimpleBaseTest; + +public class PreserveOrderTest extends SimpleBaseTest { + + @DataProvider + public static Object[][] dpTests() { + return new Class[][] { + new Class[] {A.class, B.class, C.class}, + new Class[] {A.class, C.class, B.class}, + new Class[] {B.class, A.class, C.class}, + new Class[] {B.class, C.class, A.class}, + new Class[] {C.class, B.class, A.class}, + new Class[] {C.class, A.class, B.class} + }; + } + + @Test(dataProvider = "dpTests") + public void preserveClassOrder(Class[] tests) { + TestNG tng = create(); + XmlSuite suite = createXmlSuite("Suite"); + XmlTest test = createXmlTest(suite, "Test", tests); + test.setPreserveOrder(true); + tng.setXmlSuites(Arrays.asList(suite)); + + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener((ITestNGListener) listener); + + tng.run(); + + assertThat(listener.getInvokedMethodNames()).hasSize(9); + Iterator methods = listener.getInvokedMethodNames().iterator(); + for (Class testClass : tests) { + for (int i = 1; i <= 3; i++) { + String methodName = methods.next(); + Assert.assertEquals(methodName, testClass.getSimpleName().toLowerCase() + i); + } + } + } + + @DataProvider + public static Object[][] dpMethods() { + return new String[][] { + new String[] {"a1", "a2", "a3"}, + new String[] {"a1", "a3", "a2"}, + new String[] {"a2", "a1", "a3"}, + new String[] {"a2", "a3", "a1"}, + new String[] {"a3", "a2", "a1"}, + new String[] {"a3", "a1", "a2"} + }; + } + + @Test(dataProvider = "dpMethods") + public void preserveMethodOrder(String[] methods) { + TestNG tng = create(); + XmlSuite suite = createXmlSuite("Suite"); + XmlTest test = createXmlTest(suite, "Test", A.class); + addMethods(test.getXmlClasses().get(0), methods); + test.setPreserveOrder(true); + tng.setXmlSuites(Arrays.asList(suite)); + + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener((ITestNGListener) listener); + + tng.run(); + + assertThat(listener.getInvokedMethodNames()).containsExactly(methods); + } + + @Test + public void orderShouldBePreservedWithDependencies() { + TestNG tng = create(); + XmlSuite suite = createXmlSuite("PreserveOrder"); + XmlTest test = createXmlTest(suite, "Test", Chuck4Sample.class, Chuck3Sample.class); + test.setPreserveOrder(true); + tng.setXmlSuites(Arrays.asList(suite)); + + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener((ITestNGListener) listener); + + tng.run(); + + assertThat(listener.getSucceedMethodNames()) + .containsExactly( + "c4TestOne", "c4TestTwo", "c4TestThree", "c3TestOne", "c3TestTwo", "c3TestThree"); + } + + @Test(description = "preserve-order on a factory doesn't cause an NPE") + public void factoryPreserve() { + TestNG tng = create(); + XmlSuite suite = createXmlSuite("FactoryPreserve"); + XmlTest test = createXmlTest(suite, "Test", ClassSampleFactory.class); + test.setPreserveOrder(true); + tng.setXmlSuites(Arrays.asList(suite)); + + tng.run(); + } + + @Test(description = "GITHUB-1122 Use default value for preserve-order") + public void preserveOrderValueShouldBeTheDefaultOne() { + TestNG tng = create(Issue1122Sample.class); + + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener((ITestNGListener) listener); + + tng.run(); + + assertThat(listener.getFailedMethodNames()).isEmpty(); + assertThat(listener.getSkippedMethodNames()).isEmpty(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/priority/PriorityTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/priority/PriorityTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/priority/PriorityTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/priority/PriorityTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,116 @@ +package test.priority; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import test.InvokedMethodNameListener; +import test.SimpleBaseTest; +import test.priority.issue2075.InterruptTest; +import test.priority.issue2137.IssueTest; +import test.priority.issue2137.OrderListener; + +public class PriorityTest extends SimpleBaseTest { + + private void runTest(Class cls, boolean parallel, String... methods) { + TestNG tng = create(cls); + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener(listener); + if (parallel) { + tng.setParallel(XmlSuite.ParallelMode.METHODS); + } + tng.run(); + if (parallel) { + // If tests are being executed in parallel, then order of methods is non-deterministic. + assertThat(listener.getInvokedMethodNames()).containsExactlyInAnyOrder(methods); + } else { + assertThat(listener.getInvokedMethodNames()).containsExactly(methods); + } + } + + @Test(enabled = false, description = "Make sure priorities work in parallel mode") + public void priorityInParallel1() { + runTest(WithPrioritySampleTest.class, true /* parallel */, "first", "second"); + } + + @Test(enabled = false, description = "Make sure priorities work in parallel mode") + public void priorityInParallel2() { + runTest(WithPrioritySample2Test.class, true /* parallel */, "second", "first"); + } + + @Test(description = "Make sure priorities work in sequential mode") + public void priorityInSequential1() { + runTest(WithPrioritySampleTest.class, false /* sequential */, "first", "second"); + } + + @Test(description = "Make sure priorities work in sequential mode") + public void priorityInSequential2() { + runTest(WithPrioritySample2Test.class, false /* sequential */, "second", "first"); + } + + @Test( + description = + "GITHUB #793: Test suite with tests using dependency and priority has wrong behavior") + public void priorityWithDependsOnMethods() { + runTest( + WithPriorityAndDependsMethodsSample.class, + false /* sequential */, + "first", + "second", + "third"); + } + + @Test( + description = + "Test suite with tests using dependency, priority, and parallel has wrong behavior") + public void priorityWithDependsOnMethodsParallel() { + runTest( + WithPriorityAndDependsMethodsSample.class, true /* parallel */, "first", "third", "second"); + } + + @Test( + description = + "GITHUB #1334: Order by priority gets messed up when there are failures and dependsOnMethods") + public void priorityWithDependencyAndFailures() { + TestNG tng = create(SampleTest01.class, SampleTest02.class); + tng.setParallel(XmlSuite.ParallelMode.CLASSES); + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener(listener); + tng.run(); + List expected = + Arrays.asList("test0010_createAction", "test0030_advancedSearch", "test0060_deleteAction"); + List allSkipped = listener.getSkippedMethodNames(); + // Remove skipped methods from SampleTest01's invoked methods. + List actual = + listener.getMethodsForTestClass(SampleTest01.class).stream() + .filter(each -> !allSkipped.contains(each)) + .collect(Collectors.toList()); + assertThat(actual).containsExactlyElementsOf(expected); + } + + @Test(description = "GITHUB-2075") + public void testInterruptStatusWithMethodsThatHavePriorities() { + XmlSuite xmlSuite = createXmlSuite("my_suite", "my_test", InterruptTest.class); + TestNG tng = create(xmlSuite); + TestListenerAdapter listener = new TestListenerAdapter(); + tng.addListener(listener); + tng.run(); + assertThat(listener.getFailedTests()).isEmpty(); + } + + @Test(description = "GITHUB-2137") + public void testPriorityOrdering() { + TestNG testNG = create(IssueTest.class); + OrderListener listener = new OrderListener(); + testNG.addListener(listener); + testNG.run(); + String[] expected = + new String[] {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "z"}; + assertThat(listener.getLogs()).containsExactly(expected); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/priority/SampleTest01.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/priority/SampleTest01.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/priority/SampleTest01.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/priority/SampleTest01.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,42 @@ +package test.priority; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class SampleTest01 extends SampleTestBase { + @Test(priority = 1) + public void test0010_createAction() { + throw new RuntimeException("Simulating failure"); + } + + @Test( + priority = 2, + dependsOnMethods = {"test0010_createAction"}) + public void test0020_simpleSearch() { + Assert.assertTrue(true); + } + + @Test(priority = 3) + public void test0030_advancedSearch() { + Assert.assertTrue(true); + } + + @Test( + priority = 4, + dependsOnMethods = {"test0010_createAction"}) + public void test0040_viewAction() { + Assert.assertTrue(true); + } + + @Test( + priority = 5, + dependsOnMethods = {"test0010_createAction"}) + public void test0050_modifyAction() { + Assert.assertTrue(true); + } + + @Test(priority = 6) + public void test0060_deleteAction() { + Assert.assertTrue(true); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/priority/SampleTest02.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/priority/SampleTest02.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/priority/SampleTest02.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/priority/SampleTest02.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,43 @@ +package test.priority; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class SampleTest02 extends SampleTestBase { + + @Test(priority = 1) + public void test0210_createAction() { + Assert.assertTrue(true); + } + + @Test( + priority = 2, + dependsOnMethods = {"test0210_createAction"}) + public void test0220_simpleSearch() { + Assert.assertTrue(true); + } + + @Test(priority = 3) + public void test0230_advancedSearch() { + Assert.assertTrue(true); + } + + @Test( + priority = 4, + dependsOnMethods = {"test0210_createAction"}) + public void test0240_viewAction() { + Assert.assertTrue(true); + } + + @Test( + priority = 5, + dependsOnMethods = {"test0210_createAction"}) + public void test0250_modifyAction() { + Assert.assertTrue(true); + } + + @Test(priority = 6) + public void test0260_deleteAction() { + Assert.assertTrue(true); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/priority/SampleTestBase.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/priority/SampleTestBase.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/priority/SampleTestBase.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/priority/SampleTestBase.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.priority; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; + +public abstract class SampleTestBase { + @BeforeClass + public void setUp() {} + + @AfterClass + public void closeBrowser() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/priority/WithPriorityAndDependsMethodsSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/priority/WithPriorityAndDependsMethodsSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/priority/WithPriorityAndDependsMethodsSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/priority/WithPriorityAndDependsMethodsSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.priority; + +import org.testng.annotations.Test; + +public class WithPriorityAndDependsMethodsSample { + + @Test + public void first() {} + + @Test(dependsOnMethods = {"first"}) + public void second() {} + + @Test(priority = 1) + public void third() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/priority/WithPrioritySample2Test.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/priority/WithPrioritySample2Test.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/priority/WithPrioritySample2Test.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/priority/WithPrioritySample2Test.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.priority; + +import org.testng.annotations.Test; + +public class WithPrioritySample2Test { + @Test(priority = -2) + public void first() {} + + @Test(priority = -3) + public void second() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/priority/WithPrioritySampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/priority/WithPrioritySampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/priority/WithPrioritySampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/priority/WithPrioritySampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.priority; + +import org.testng.annotations.Test; + +public class WithPrioritySampleTest { + @Test(priority = -2) + public void first() {} + + @Test(priority = -1) + public void second() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/priority/WithoutPrioritySampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/priority/WithoutPrioritySampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/priority/WithoutPrioritySampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/priority/WithoutPrioritySampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.priority; + +import org.testng.annotations.Test; + +public class WithoutPrioritySampleTest { + + @Test + public void first() {} + + @Test + public void second() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/priority/issue2075/InterruptTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/priority/issue2075/InterruptTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/priority/issue2075/InterruptTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/priority/issue2075/InterruptTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.priority.issue2075; + +import org.testng.annotations.Test; + +public class InterruptTest { + @Test(priority = 1) + public void interruptsTheCurrentThread() { + Thread.currentThread().interrupt(); + } + + @Test(priority = 2) + public void shouldntGetInterruptedButDoes() throws InterruptedException { + Thread.sleep(0); // this will throw an exception + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/priority/issue2137/IssueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/priority/issue2137/IssueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/priority/issue2137/IssueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/priority/issue2137/IssueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,48 @@ +package test.priority.issue2137; + +import org.testng.annotations.Test; + +public class IssueTest { + + @Test(priority = Integer.MIN_VALUE) + public void a() {} + + @Test(priority = 1) + public void b() {} + + @Test(priority = 2) + public void c() {} + + @Test(priority = 3) + public void d() {} + + @Test(priority = 4) + public void e() {} + + @Test(priority = 5) + public void f() {} + + @Test(priority = 6) + public void g() {} + + @Test(priority = 7) + public void h() {} + + @Test(priority = 8) + public void i() {} + + @Test(priority = 9) + public void j() {} + + @Test(priority = 10) + public void k() {} + + @Test(priority = 11) + public void l() {} + + @Test(priority = 12) + public void m() {} + + @Test(priority = Integer.MAX_VALUE) + public void z() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/priority/issue2137/OrderListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/priority/issue2137/OrderListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/priority/issue2137/OrderListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/priority/issue2137/OrderListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.priority.issue2137; + +import java.util.ArrayList; +import java.util.List; +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.ITestResult; + +public class OrderListener implements IInvokedMethodListener { + private List logs = new ArrayList<>(); + + public List getLogs() { + return logs; + } + + @Override + public void beforeInvocation(IInvokedMethod method, ITestResult testResult) { + logs.add(method.getTestMethod().getMethodName()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/priority/parallel/EfficientPriorityParallelizationTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/priority/parallel/EfficientPriorityParallelizationTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/priority/parallel/EfficientPriorityParallelizationTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/priority/parallel/EfficientPriorityParallelizationTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,286 @@ +package test.priority.parallel; + +import static org.testng.Assert.assertEquals; +import static test.thread.parallelization.TestNgRunStateTracker.*; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.testng.ITestNGListener; +import org.testng.TestNG; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import org.testng.log4testng.Logger; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.thread.parallelization.BaseParallelizationTest; +import test.thread.parallelization.TestNgRunStateListener; +import test.thread.parallelization.TestNgRunStateTracker.EventLog; + +public class EfficientPriorityParallelizationTest extends BaseParallelizationTest { + private static final Logger log = Logger.getLogger(EfficientPriorityParallelizationTest2.class); + private static final String SUITE_A = "TestSuiteA"; + + private static final String SUITE_A_TEST_A = "TestSuiteA-HighPriorityTestClassTest"; + private static final String SUITE_A_TEST_B = "TestSuiteA-LowPriorityTestClassTest"; + + private static final int THREAD_POOL_SIZE = 2; + + private Map> testEventLogsMap = new HashMap<>(); + + private List suiteLevelEventLogs; + private List testLevelEventLogs; + private List testMethodLevelEventLogs; + + private List suiteOneSuiteAndTestLevelEventLogs; + private List suiteOneSuiteLevelEventLogs; + private List suiteOneTestLevelEventLogs; + private List suiteOneTestMethodLevelEventLogs; + + private List suiteOneTestOneTestMethodLevelEventLogs; + private List suiteOneTestTwoTestMethodLevelEventLogs; + + private EventLog suiteOneSuiteListenerOnStartEventLog; + private EventLog suiteOneSuiteListenerOnFinishEventLog; + + private EventLog suiteOneTestOneListenerOnStartEventLog; + private EventLog suiteOneTestOneListenerOnFinishEventLog; + + private EventLog suiteOneTestTwoListenerOnStartEventLog; + private EventLog suiteOneTestTwoListenerOnFinishEventLog; + + @BeforeClass + public void setUp() { + reset(); + + XmlSuite suiteOne = createXmlSuite(SUITE_A); + + XmlTest testA = createXmlTest(suiteOne, SUITE_A_TEST_A, HighPriorityTestSample.class); + XmlTest testB = createXmlTest(suiteOne, SUITE_A_TEST_B, LowPriorityTestSample.class); + + suiteOne.setParallel(XmlSuite.ParallelMode.TESTS); + suiteOne.setThreadCount(THREAD_POOL_SIZE); + + testA.setParallel(XmlSuite.ParallelMode.METHODS); + testA.setThreadCount(THREAD_POOL_SIZE); + testB.setParallel(XmlSuite.ParallelMode.METHODS); + testB.setThreadCount(THREAD_POOL_SIZE); + + // High priority but slow test does slowness on its own. + addParams(suiteOne, SUITE_A, SUITE_A_TEST_A, "50"); + // Low priority but quick + addParams(suiteOne, SUITE_A, SUITE_A_TEST_B, "50"); + + TestNG tng = create(suiteOne); + tng.setSuiteThreadPoolSize(THREAD_POOL_SIZE); + tng.addListener((ITestNGListener) new TestNgRunStateListener()); + + log.debug( + "Beginning EfficientPriorityParallelizationTest. This test scenario consists of 1 suite " + + "with 2 tests. Parallel is set to TESTS at the suite level, METHODS at the test level, and the thread pool size is 2. One test shall consist of a " + + "single test class with a single, high-priority, slow-running method, while the other test shall " + + "consist of a single test class with several low-priority, quick-running methods. There are no " + + "dependencies, data providers or factories."); + + log.debug( + "Suite: " + + SUITE_A + + ", Test: " + + SUITE_A_TEST_A + + ", Test classes: " + + HighPriorityTestSample.class.getCanonicalName() + + ". Thread count: 2"); + + log.debug( + "Suite: " + + SUITE_A + + ", Test: " + + SUITE_A_TEST_B + + ", Test class: " + + LowPriorityTestSample.class.getCanonicalName() + + ". Thread count: 2"); + + tng.run(); + + suiteLevelEventLogs = getAllSuiteLevelEventLogs(); + testLevelEventLogs = getAllTestLevelEventLogs(); + testMethodLevelEventLogs = getAllTestMethodLevelEventLogs(); + + suiteOneSuiteAndTestLevelEventLogs = getSuiteAndTestLevelEventLogsForSuite(SUITE_A); + suiteOneSuiteLevelEventLogs = getSuiteLevelEventLogsForSuite(SUITE_A); + suiteOneTestLevelEventLogs = getTestLevelEventLogsForSuite(SUITE_A); + + suiteOneTestMethodLevelEventLogs = getTestMethodLevelEventLogsForSuite(SUITE_A); + + suiteOneTestOneTestMethodLevelEventLogs = + getTestMethodLevelEventLogsForTest(SUITE_A, SUITE_A_TEST_A); + suiteOneTestTwoTestMethodLevelEventLogs = + getTestMethodLevelEventLogsForTest(SUITE_A, SUITE_A_TEST_B); + + testEventLogsMap.put(SUITE_A_TEST_A, getTestLevelEventLogsForTest(SUITE_A, SUITE_A_TEST_A)); + testEventLogsMap.put(SUITE_A_TEST_B, getTestLevelEventLogsForTest(SUITE_A, SUITE_A_TEST_B)); + + suiteOneSuiteListenerOnStartEventLog = getSuiteListenerStartEventLog(SUITE_A); + suiteOneSuiteListenerOnFinishEventLog = getSuiteListenerFinishEventLog(SUITE_A); + + suiteOneTestOneListenerOnStartEventLog = getTestListenerStartEventLog(SUITE_A, SUITE_A_TEST_A); + suiteOneTestOneListenerOnFinishEventLog = + getTestListenerFinishEventLog(SUITE_A, SUITE_A_TEST_A); + + suiteOneTestTwoListenerOnStartEventLog = getTestListenerStartEventLog(SUITE_A, SUITE_A_TEST_B); + suiteOneTestTwoListenerOnFinishEventLog = + getTestListenerFinishEventLog(SUITE_A, SUITE_A_TEST_B); + } + + // Verifies that the expected number of suite, test and test method level events were logged for + // each of the three + // suites. + @Test + public void sanityCheck() { + assertEquals( + suiteLevelEventLogs.size(), + 2, + "There should be 2 suite level events logged for " + SUITE_A + ": " + suiteLevelEventLogs); + assertEquals( + testLevelEventLogs.size(), + 4, + "There should be 4 test level events logged for " + SUITE_A + ": " + testLevelEventLogs); + + assertEquals( + testMethodLevelEventLogs.size(), + 12, + "There should 12 test method level events logged for " + + SUITE_A + + ": " + + testMethodLevelEventLogs); + + assertEquals( + suiteOneSuiteLevelEventLogs.size(), + 2, + "There should be 2 suite level events logged for " + + SUITE_A + + ": " + + suiteOneSuiteLevelEventLogs); + assertEquals( + suiteOneTestLevelEventLogs.size(), + 4, + "There should be 4 test level events logged for " + + SUITE_A + + ": " + + suiteOneTestLevelEventLogs); + assertEquals( + suiteOneTestMethodLevelEventLogs.size(), + 12, + "There should be 12 test method level events " + + "logged for " + + SUITE_A + + ": " + + suiteOneTestMethodLevelEventLogs); + } + + // Verify that the suites run in parallel by checking that the suite and test level events for + // both suites have + // overlapping timestamps. Verify that there are two separate threads executing the suite-level + // and test-level + // events for each suite. + @Test + public void verifyThatSuitesRunInParallelThreads() { + verifyParallelSuitesWithUnequalExecutionTimes(suiteLevelEventLogs, THREAD_POOL_SIZE); + } + + @Test + public void verifyOnlyOneInstanceOfTestClassForAllTestMethodsForAllSuites() { + + verifyNumberOfInstancesOfTestClassForMethods( + SUITE_A, SUITE_A_TEST_A, HighPriorityTestSample.class, 1); + + verifySameInstancesOfTestClassAssociatedWithMethods( + SUITE_A, SUITE_A_TEST_A, HighPriorityTestSample.class); + + verifyNumberOfInstancesOfTestClassForMethods( + SUITE_A, SUITE_A_TEST_B, LowPriorityTestSample.class, 1); + + verifySameInstancesOfTestClassAssociatedWithMethods( + SUITE_A, SUITE_A_TEST_B, LowPriorityTestSample.class); + } + + // Verify that the test method listener's onTestStart method runs after the test listener's + // onStart method for + // all the test methods in all tests and suites. + @Test + public void + verifyTestLevelMethodLevelEventLogsOccurBetweenAfterTestListenerStartAndFinishEventLogs() { + verifyEventsOccurBetween( + suiteOneTestOneListenerOnStartEventLog, + suiteOneTestOneTestMethodLevelEventLogs, + suiteOneTestOneListenerOnFinishEventLog, + "All of the test method level event logs for " + + SUITE_A_TEST_A + + " should have timestamps between the test listener's onStart and onFinish " + + "event logs for " + + SUITE_A_TEST_A + + ". Test listener onStart event log: " + + suiteOneTestOneListenerOnStartEventLog + + ". Test listener onFinish event log: " + + suiteOneTestOneListenerOnFinishEventLog + + ". Test method level event logs: " + + suiteOneTestOneTestMethodLevelEventLogs); + + verifyEventsOccurBetween( + suiteOneTestTwoListenerOnStartEventLog, + suiteOneTestTwoTestMethodLevelEventLogs, + suiteOneTestTwoListenerOnFinishEventLog, + "All of the test method level event logs for " + + SUITE_A_TEST_B + + " should have timestamps between the test listener's onStart and onFinish " + + "event logs for " + + SUITE_A_TEST_B + + ". Test listener onStart event log: " + + suiteOneTestTwoListenerOnStartEventLog + + ". Test listener onFinish event log: " + + suiteOneTestTwoListenerOnFinishEventLog + + ". Test method level event logs: " + + suiteOneTestTwoTestMethodLevelEventLogs); + } + + // Verifies that the method level events all run in different threads from the test and suite + // level events. + // Verifies that the test method listener and execution events for a given test method all run in + // the same thread. + @Test + public void verifyThatMethodLevelEventsRunInDifferentThreadsFromSuiteAndTestLevelEvents() { + + verifyEventThreadsSpawnedAfter( + getAllSuiteListenerStartEventLogs().get(0).getThreadId(), + testMethodLevelEventLogs, + "All the thread IDs for the test method level events should be greater than the thread ID for the " + + "suite and test level events. The expectation is that since the suite and test level events " + + "are running sequentially, and all the test methods are running in parallel, new threads " + + "will be spawned after the thread executing the suite and test level events when new methods " + + "begin executing. Suite and test level events thread ID: " + + getAllSuiteListenerStartEventLogs().get(0).getThreadId() + + ". Test method level event logs: " + + testMethodLevelEventLogs); + + verifyEventsForTestMethodsRunInTheSameThread( + HighPriorityTestSample.class, SUITE_A, SUITE_A_TEST_A); + verifyEventsForTestMethodsRunInTheSameThread( + LowPriorityTestSample.class, SUITE_A, SUITE_A_TEST_B); + } + + // Verifies that the slow, high-priority method started before and ended after the faster, + // low-priority methods. + @Test + public void verifyThatSlowMethodStartedFirstAndEndedLast() { + verifyEventsOccurBetween( + suiteOneTestOneListenerOnStartEventLog, + suiteOneTestTwoTestMethodLevelEventLogs, + suiteOneTestOneListenerOnFinishEventLog, + "All the test two methods should run between when test one starts and ends. Start Event: " + + suiteOneTestOneListenerOnStartEventLog + + ". In between events: " + + suiteOneTestTwoTestMethodLevelEventLogs + + ". Final event: " + + suiteOneTestOneListenerOnFinishEventLog); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/priority/parallel/EfficientPriorityParallelizationTest2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/priority/parallel/EfficientPriorityParallelizationTest2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/priority/parallel/EfficientPriorityParallelizationTest2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/priority/parallel/EfficientPriorityParallelizationTest2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,294 @@ +package test.priority.parallel; + +import static org.testng.Assert.assertEquals; +import static test.thread.parallelization.TestNgRunStateTracker.*; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import org.testng.ITestNGListener; +import org.testng.TestNG; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import org.testng.log4testng.Logger; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.thread.parallelization.BaseParallelizationTest; +import test.thread.parallelization.TestNgRunStateListener; +import test.thread.parallelization.TestNgRunStateTracker.EventLog; + +public class EfficientPriorityParallelizationTest2 extends BaseParallelizationTest { + private static final Logger log = Logger.getLogger(EfficientPriorityParallelizationTest2.class); + private static final String SUITE_A = "TestSuiteA"; + + private static final String SUITE_A_TEST_A = "TestSuiteA-HighPriorityTestClassTest"; + + private static final int THREAD_POOL_SIZE = 2; + + private Map> testEventLogsMap = new HashMap<>(); + + private List suiteLevelEventLogs; + private List testLevelEventLogs; + private List testMethodLevelEventLogs; + + private List suiteOneSuiteAndTestLevelEventLogs; + private List suiteOneSuiteLevelEventLogs; + private List suiteOneTestLevelEventLogs; + private List suiteOneTestMethodLevelEventLogs; + + private List suiteOneTestOneTestMethodLevelEventLogs; + + private EventLog suiteOneSuiteListenerOnStartEventLog; + private EventLog suiteOneSuiteListenerOnFinishEventLog; + + private EventLog suiteOneTestOneListenerOnStartEventLog; + private EventLog suiteOneTestOneListenerOnFinishEventLog; + + @BeforeClass + public void setUp() { + reset(); + + XmlSuite suiteOne = createXmlSuite(SUITE_A); + + XmlTest testA = + createXmlTest( + suiteOne, SUITE_A_TEST_A, HighPriorityTestSample.class, LowPriorityTestSample.class); + + suiteOne.setParallel(XmlSuite.ParallelMode.NONE); + suiteOne.setThreadCount(1); + + testA.setParallel(XmlSuite.ParallelMode.METHODS); + testA.setThreadCount(THREAD_POOL_SIZE); + + // High priority test takes care of itself + addParams(suiteOne, SUITE_A, SUITE_A_TEST_A, "50"); + + TestNG tng = create(suiteOne); + tng.setSuiteThreadPoolSize(THREAD_POOL_SIZE); + tng.addListener((ITestNGListener) new TestNgRunStateListener()); + + // TODO: modify this + log.debug( + "Beginning EfficientPriorityParallelizationTest. This test scenario consists of 1 suite " + + "with 2 tests. Parallel is set to METHODS and the thread pool size is 2. One test shall consist of a " + + "single test class with a single, high-priority, slow-running method, while the other test shall " + + "consist of a single test class with several low-priority, quick-running methods. There are no " + + "dependencies, data providers or factories."); + + log.debug( + "Suite: " + + SUITE_A + + ", Test: " + + SUITE_A_TEST_A + + ", Test classes: " + + HighPriorityTestSample.class.getCanonicalName() + + ", " + + LowPriorityTestSample.class.getCanonicalName() + + ". Thread count: 2"); + + tng.run(); + + suiteLevelEventLogs = getAllSuiteLevelEventLogs(); + testLevelEventLogs = getAllTestLevelEventLogs(); + testMethodLevelEventLogs = getAllTestMethodLevelEventLogs(); + + suiteOneSuiteAndTestLevelEventLogs = getSuiteAndTestLevelEventLogsForSuite(SUITE_A); + suiteOneSuiteLevelEventLogs = getSuiteLevelEventLogsForSuite(SUITE_A); + suiteOneTestLevelEventLogs = getTestLevelEventLogsForSuite(SUITE_A); + + suiteOneTestMethodLevelEventLogs = getTestMethodLevelEventLogsForSuite(SUITE_A); + + suiteOneTestOneTestMethodLevelEventLogs = + getTestMethodLevelEventLogsForTest(SUITE_A, SUITE_A_TEST_A); + suiteOneTestOneTestMethodLevelEventLogs.stream() + .filter(e -> e.getEvent() == TestNgRunEvent.LISTENER_TEST_METHOD_START); + + testEventLogsMap.put(SUITE_A_TEST_A, getTestLevelEventLogsForTest(SUITE_A, SUITE_A_TEST_A)); + + suiteOneSuiteListenerOnStartEventLog = getSuiteListenerStartEventLog(SUITE_A); + suiteOneSuiteListenerOnFinishEventLog = getSuiteListenerFinishEventLog(SUITE_A); + + suiteOneTestOneListenerOnStartEventLog = getTestListenerStartEventLog(SUITE_A, SUITE_A_TEST_A); + suiteOneTestOneListenerOnFinishEventLog = + getTestListenerFinishEventLog(SUITE_A, SUITE_A_TEST_A); + } + + // Verifies that the expected number of suite, test and test method level events were logged for + // each of the three + // suites. + @Test + public void sanityCheck() { + assertEquals( + suiteLevelEventLogs.size(), + 2, + "There should be 2 suite level events logged for " + SUITE_A + ": " + suiteLevelEventLogs); + assertEquals( + testLevelEventLogs.size(), + 2, + "There should be 2 test level events logged for " + SUITE_A + ": " + testLevelEventLogs); + + assertEquals( + testMethodLevelEventLogs.size(), + 12, + "There should 12 test method level events logged for " + + SUITE_A + + ": " + + testMethodLevelEventLogs); + + assertEquals( + suiteOneSuiteLevelEventLogs.size(), + 2, + "There should be 2 suite level events logged for " + + SUITE_A + + ": " + + suiteOneSuiteLevelEventLogs); + assertEquals( + suiteOneTestLevelEventLogs.size(), + 2, + "There should be 2 test level events logged for " + + SUITE_A + + ": " + + suiteOneTestLevelEventLogs); + assertEquals( + suiteOneTestMethodLevelEventLogs.size(), + 12, + "There should be 12 test method level events " + + "logged for " + + SUITE_A + + ": " + + suiteOneTestMethodLevelEventLogs); + } + + // Verify that the suites run in parallel by checking that the suite and test level events for + // both suites have + // overlapping timestamps. Verify that there are two separate threads executing the suite-level + // and test-level + // events for each suite. + @Test + public void verifyThatSuitesRunInParallelThreads() { + verifyParallelSuitesWithUnequalExecutionTimes(suiteLevelEventLogs, THREAD_POOL_SIZE); + } + + @Test + public void verifyTestLevelEventsRunInSequentialOrderForIndividualSuites() { + verifySequentialTests( + suiteOneSuiteAndTestLevelEventLogs, + suiteOneTestLevelEventLogs, + suiteOneSuiteListenerOnStartEventLog, + suiteOneSuiteListenerOnFinishEventLog); + } + + @Test + public void verifyOnlyOneInstanceOfTestClassForAllTestMethodsForAllSuites() { + + verifyNumberOfInstancesOfTestClassForMethods( + SUITE_A, SUITE_A_TEST_A, HighPriorityTestSample.class, 1); + + verifySameInstancesOfTestClassAssociatedWithMethods( + SUITE_A, SUITE_A_TEST_A, HighPriorityTestSample.class); + + verifyNumberOfInstancesOfTestClassForMethods( + SUITE_A, SUITE_A_TEST_A, LowPriorityTestSample.class, 1); + + verifySameInstancesOfTestClassAssociatedWithMethods( + SUITE_A, SUITE_A_TEST_A, LowPriorityTestSample.class); + } + + // Verify that the test method listener's onTestStart method runs after the test listener's + // onStart method for + // all the test methods in all tests and suites. + @Test + public void + verifyTestLevelMethodLevelEventLogsOccurBetweenAfterTestListenerStartAndFinishEventLogs() { + verifyEventsOccurBetween( + suiteOneTestOneListenerOnStartEventLog, + suiteOneTestOneTestMethodLevelEventLogs, + suiteOneTestOneListenerOnFinishEventLog, + "All of the test method level event logs for " + + SUITE_A_TEST_A + + " should have timestamps between the test listener's onStart and onFinish " + + "event logs for " + + SUITE_A_TEST_A + + ". Test listener onStart event log: " + + suiteOneTestOneListenerOnStartEventLog + + ". Test listener onFinish event log: " + + suiteOneTestOneListenerOnFinishEventLog + + ". Test method level event logs: " + + suiteOneTestOneTestMethodLevelEventLogs); + } + + // Verifies that the method level events all run in different threads from the test and suite + // level events. + // Verifies that the test method listener and execution events for a given test method all run in + // the same thread. + @Test + public void verifyThatMethodLevelEventsRunInDifferentThreadsFromSuiteAndTestLevelEvents() { + + verifyEventThreadsSpawnedAfter( + getAllSuiteListenerStartEventLogs().get(0).getThreadId(), + testMethodLevelEventLogs, + "All the thread IDs for the test method level events should be greater than the thread ID for the " + + "suite and test level events. The expectation is that since the suite and test level events " + + "are running sequentially, and all the test methods are running in parallel, new threads " + + "will be spawned after the thread executing the suite and test level events when new methods " + + "begin executing. Suite and test level events thread ID: " + + getAllSuiteListenerStartEventLogs().get(0).getThreadId() + + ". Test method level event logs: " + + testMethodLevelEventLogs); + + verifyEventsForTestMethodsRunInTheSameThread( + HighPriorityTestSample.class, SUITE_A, SUITE_A_TEST_A); + verifyEventsForTestMethodsRunInTheSameThread( + LowPriorityTestSample.class, SUITE_A, SUITE_A_TEST_A); + } + + // Verifies that the slow, high-priority method started before and ended after the faster, + // low-priority methods. + @Test + public void verifyThatSlowMethodStartedFirstAndEndedLast() { + EventLog highPriStart = + suiteOneTestOneTestMethodLevelEventLogs.stream() + .filter( + e -> { + String classData = (String) e.getData(EventInfo.CLASS_NAME); + boolean rightClass = + classData.contains(HighPriorityTestSample.class.getSimpleName()); + return e.getEvent() == TestNgRunEvent.LISTENER_TEST_METHOD_START && rightClass; + }) + .findFirst() + .get(); + EventLog highPriEnd = + suiteOneTestOneTestMethodLevelEventLogs.stream() + .filter( + e -> { + String classData = (String) e.getData(EventInfo.CLASS_NAME); + boolean rightClass = + classData.contains(HighPriorityTestSample.class.getSimpleName()); + return e.getEvent() == TestNgRunEvent.LISTENER_TEST_METHOD_PASS && rightClass; + }) + .findFirst() + .get(); + ; + List lowPriEvents = + suiteOneTestOneTestMethodLevelEventLogs.stream() + .filter( + e -> { + String classData = (String) e.getData(EventInfo.CLASS_NAME); + boolean rightClass = + classData.contains(LowPriorityTestSample.class.getSimpleName()); + return rightClass; + }) + .collect(Collectors.toList()); + verifyEventsOccurBetween( + highPriStart, + lowPriEvents, + highPriEnd, + "All the test two methods should run between when test one starts and ends.\nStart Event: " + + highPriStart + + ".\nIn between events: " + + lowPriEvents + + ".\nFinal event: " + + highPriEnd); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/priority/parallel/HighPriorityTestSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/priority/parallel/HighPriorityTestSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/priority/parallel/HighPriorityTestSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/priority/parallel/HighPriorityTestSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,37 @@ +package test.priority.parallel; + +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.*; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.TEST_METHOD_EXECUTION; + +import java.util.concurrent.TimeUnit; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; +import test.thread.parallelization.TestNgRunStateTracker; + +public class HighPriorityTestSample { + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test(priority = -10) + public void slowMethod(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "slowMethod") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + // This is supposed to be the slow one, so multiply by 80 so we sleep extra long. + TimeUnit.MILLISECONDS.sleep(80 * Integer.parseInt(sleepFor)); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/priority/parallel/LowPriorityTestSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/priority/parallel/LowPriorityTestSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/priority/parallel/LowPriorityTestSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/priority/parallel/LowPriorityTestSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,84 @@ +package test.priority.parallel; + +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.*; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.TEST_METHOD_EXECUTION; + +import java.util.concurrent.TimeUnit; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; +import test.thread.parallelization.TestNgRunStateTracker; + +public class LowPriorityTestSample { + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test(priority = 10) + public void testMethodA(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodA") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test(priority = 10) + public void testMethodB(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodB") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test(priority = 10) + public void testMethodC(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodC") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/privatemethod/PrivateMethodTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/privatemethod/PrivateMethodTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/privatemethod/PrivateMethodTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/privatemethod/PrivateMethodTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,22 @@ +package test.privatemethod; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class PrivateMethodTest { + public PrivateMethodTest(String name, int value) {} + + private int privateMethod() { + return 1; + } + + public static class PrivateMethodInnerTest { + @Test + public void testPrivateMethod() { + PrivateMethodTest pmt = new PrivateMethodTest("aname", 1); + int returnValue = pmt.privateMethod(); + + Assert.assertEquals(returnValue, 1); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reflect/ReflectionRecipesTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reflect/ReflectionRecipesTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reflect/ReflectionRecipesTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reflect/ReflectionRecipesTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,361 @@ +package test.reflect; + +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.sql.Connection; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.testng.Assert; +import org.testng.ITestContext; +import org.testng.ITestResult; +import org.testng.TestRunner; +import org.testng.annotations.DataProvider; +import org.testng.annotations.NoInjection; +import org.testng.annotations.Test; +import org.testng.internal.reflect.InjectableParameter; +import org.testng.internal.reflect.Parameter; +import org.testng.internal.reflect.ReflectionRecipes; +import org.testng.log4testng.Logger; +import org.testng.xml.XmlTest; + +/** @author Nitin Verma */ +public class ReflectionRecipesTest { + private static final Logger log = Logger.getLogger(ReflectionRecipesTest.class); + + private static final Object[] A0 = new Object[] {343, true}; + private static final Parameter[] S0 = getMethodParameters(T.class, "s0"); + private static final Parameter[] S1 = getMethodParameters(T.class, "s1"); + private static final Parameter[] S2 = getMethodParameters(T.class, "s2"); + private static final Parameter[] S3 = getMethodParameters(T.class, "s3"); + + private static Parameter[] getMethodParameters(final Class clazz, final String methodName) { + Method method = null; + Parameter[] parameters = null; + for (final Method m : clazz.getMethods()) { + if (m.getName().equals(methodName)) { + method = m; + } + } + if (method != null) { + parameters = ReflectionRecipes.getMethodParameters(method); + } + return parameters; + } + + @DataProvider + public Object[][] methodInputParameters() { + return new Object[][] {S0, S1, S2, S3}; + } + + @DataProvider + public Object[][] methodInputParamArgsPair() { + return new Object[][] { + new Object[] {S0, A0}, + new Object[] {S1, A0}, + new Object[] {S2, A0}, + new Object[] {S3, A0}, + }; + } + + @DataProvider + public Object[][] exactMatchDP() + throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { + final Method[] methods = ExactMatchTest.class.getDeclaredMethods(); + final List objects = new ArrayList<>(); + log.debug("exactMatchDP:"); + for (int i = 0; i < methods.length; i++) { + final Method method = methods[i]; + final ExactMatchTest.Expectation annotation = + method.getAnnotation(ExactMatchTest.Expectation.class); + if (annotation != null) { + final String provider = annotation.expectationProvider(); + final int flag = annotation.flag(); + Assert.assertNotNull(provider); + final Method providerMethod = ExactMatchTest.class.getMethod(provider, int.class); + final Object out = providerMethod.invoke(ExactMatchTest.class, flag); + Assert.assertTrue(out instanceof Object[][]); + log.debug(method.getName() + ", " + out); + objects.add(new Object[] {out, method}); + } + } + return objects.toArray(new Object[objects.size()][]); + } + + @DataProvider + public Object[][] matchArrayEndingDP() + throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { + final Method[] methods = MatchArrayEndingTest.class.getDeclaredMethods(); + final List objects = new ArrayList<>(); + log.debug("matchArrayEndingDP:"); + for (int i = 0; i < methods.length; i++) { + final Method method = methods[i]; + final MatchArrayEndingTest.Expectation annotation = + method.getAnnotation(MatchArrayEndingTest.Expectation.class); + if (annotation != null) { + final String provider = annotation.expectationProvider(); + final int flag = annotation.flag(); + Assert.assertNotNull(provider); + final Method providerMethod = MatchArrayEndingTest.class.getMethod(provider, int.class); + final Object out = providerMethod.invoke(MatchArrayEndingTest.class, flag); + Assert.assertTrue(out instanceof Object[][]); + log.debug(method.getName() + ", " + out); + objects.add(new Object[] {out, method}); + } + } + return objects.toArray(new Object[objects.size()][]); + } + + @DataProvider + public Object[][] testContexts() { + return new Object[][] { + {TestRunner.class}, {ITestContext.class}, {TestContextJustForTesting.class} + }; + } + + @DataProvider + public Object[][] notTestContexts() { + return new Object[][] {{Object.class}, {Class.class}, {Connection.class}}; + } + + @Test(dataProvider = "matchArrayEndingDP") + public void matchArrayEndingTest(final Object[][] expected, @NoInjection final Method method) { + if (expected != null) { + final Parameter[] methodParameters = ReflectionRecipes.getMethodParameters(method); + Assert.assertNotNull(methodParameters); + final Parameter[] filteredParameters = + ReflectionRecipes.filter(methodParameters, InjectableParameter.Assistant.ALL_INJECTS); + Assert.assertNotNull(filteredParameters); + + for (final Object[] expect : expected) { + Assert.assertNotNull(expect); + Assert.assertEquals(expect.length, 2); + Assert.assertNotNull(expect[0]); + Assert.assertTrue(expect[0] instanceof Object[]); + Assert.assertNotNull(expect[1]); + Assert.assertTrue(expect[1] instanceof Boolean); + Assert.assertEquals( + ReflectionRecipes.matchArrayEnding(filteredParameters, (Object[]) expect[0]), + expect[1]); + } + } + } + + @Test(dataProvider = "exactMatchDP") + public void exactMatchTest(final Object[][] expected, @NoInjection final Method method) { + if (expected != null) { + final Parameter[] methodParameters = ReflectionRecipes.getMethodParameters(method); + Assert.assertNotNull(methodParameters); + final Parameter[] filteredParameters = + ReflectionRecipes.filter(methodParameters, InjectableParameter.Assistant.ALL_INJECTS); + Assert.assertNotNull(filteredParameters); + + for (final Object[] expect : expected) { + Assert.assertNotNull(expect); + Assert.assertEquals(expect.length, 2); + Assert.assertNotNull(expect[0]); + Assert.assertTrue(expect[0] instanceof Object[]); + Assert.assertNotNull(expect[1]); + Assert.assertTrue(expect[1] instanceof Boolean); + Assert.assertEquals( + ReflectionRecipes.exactMatch(filteredParameters, (Object[]) expect[0]), expect[1]); + } + } + } + + @Test(dataProvider = "methodInputParameters") + public void testFilters(final Parameter[] parameters) { + log.debug("In: " + Arrays.asList(parameters)); + final Parameter[] parameters1 = + ReflectionRecipes.filter(parameters, InjectableParameter.Assistant.ALL_INJECTS); + log.debug("Out: " + Arrays.asList(parameters1)); + Assert.assertEquals(parameters1.length, 2); + Assert.assertEquals(parameters1[0].getType(), int.class); + Assert.assertEquals(parameters1[1].getType(), Boolean.class); + } + + @Test(dataProvider = "methodInputParamArgsPair") + public void testInject(final Parameter[] parameters, final Object[] args) { + log.debug("In: " + Arrays.asList(parameters)); + log.debug("args: " + Arrays.asList(args)); + final Object[] injectedArgs = + ReflectionRecipes.inject( + parameters, InjectableParameter.Assistant.ALL_INJECTS, args, (Method) null, null, null); + log.debug("injectedArgs: " + Arrays.asList(injectedArgs)); + Assert.assertEquals(injectedArgs.length, parameters.length); + } + + @Test(dataProvider = "testContexts") + public void testIsOrImplementsInterface(final Class clazz) { + Assert.assertTrue(ReflectionRecipes.isOrImplementsInterface(ITestContext.class, clazz)); + } + + @Test(dataProvider = "notTestContexts") + public void testNegativeCaseIsOrImplementsInterface(final Class clazz) { + Assert.assertFalse(ReflectionRecipes.isOrImplementsInterface(ITestContext.class, clazz)); + } + + private static interface T { + public void s0(TestContextJustForTesting testContext, int i, Boolean b); + + public void s1(int i, ITestContext iTestContext, Boolean b); + + public void s2(int i, Boolean b, ITestContext iTestContext); + + public void s3(ITestContext iTestContext1, int i, Boolean b, ITestContext iTestContext2); + } + + public abstract static class ExactMatchTest { + public static Object[][] exactMatchData(final int flag) { + switch (flag) { + case 0: + return new Object[][] { + new Object[] {new Object[] {}, true}, + new Object[] {new Object[] {1}, false}, + new Object[] {new Object[] {""}, false}, + new Object[] {new Object[] {1, ""}, false}, + }; + case 1: + return new Object[][] { + new Object[] {new Object[] {1}, true}, + new Object[] {new Object[] {}, false}, + new Object[] {new Object[] {""}, false}, + new Object[] {new Object[] {1, ""}, false}, + new Object[] {new Object[] {"", 1}, false}, + }; + default: + return null; + } + } + + @Expectation(expectationProvider = "exactMatchData", flag = 0) + public abstract void s0(); + + @Expectation(expectationProvider = "exactMatchData", flag = 0) + public abstract void s0(final ITestContext a0); + + @Expectation(expectationProvider = "exactMatchData", flag = 0) + public abstract void s0(final ITestContext a0, final ITestResult a1); + + @Expectation(expectationProvider = "exactMatchData", flag = 0) + public abstract void s0(final ITestContext a0, final ITestResult a1, final XmlTest a2); + + @Expectation(expectationProvider = "exactMatchData", flag = 0) + public abstract void s0( + final ITestContext a0, final ITestResult a1, final XmlTest a2, final Method a3); + + @Expectation(expectationProvider = "exactMatchData", flag = 1) + public abstract void s1(final int a0); + + @Expectation(expectationProvider = "exactMatchData", flag = 1) + public abstract void s1(final ITestContext a0, final int a1); + + @Expectation(expectationProvider = "exactMatchData", flag = 1) + public abstract void s1(final ITestContext a0, final Integer a1, final ITestResult a2); + + @Expectation(expectationProvider = "exactMatchData", flag = 1) + public abstract void s1( + final int a0, final ITestContext a1, final ITestResult a2, final XmlTest a3); + + @Expectation(expectationProvider = "exactMatchData", flag = 1) + public abstract void s1( + final ITestContext a0, + final ITestResult a1, + final int a2, + final XmlTest a3, + final Method a4); + + @Retention(RUNTIME) + @Target({METHOD}) + public static @interface Expectation { + public String expectationProvider(); + + public int flag(); + } + } + + public abstract static class MatchArrayEndingTest { + public static Object[][] matchArrayEndingData(final int flag) { + switch (flag) { + case 0: + return new Object[][] { + new Object[] {new Object[] {10f, 2.1f}, true}, + new Object[] {new Object[] {10}, true}, + new Object[] {new Object[] {10d, ""}, false}, + new Object[] {new Object[] {1, ""}, false}, + }; + case 1: + return new Object[][] { + new Object[] {new Object[] {1, 10f, 2.1f}, true}, + new Object[] {new Object[] {}, false}, + new Object[] {new Object[] {""}, false}, + new Object[] {new Object[] {10f, "", 2.1f}, false}, + new Object[] {new Object[] {"", 10f, 2.1f}, false}, + }; + default: + return null; + } + } + + @Expectation(expectationProvider = "matchArrayEndingData", flag = 0) + public abstract void s0(final float... f); + + @Expectation(expectationProvider = "matchArrayEndingData", flag = 0) + public abstract void s0(final float[] f, final ITestContext a0); + + @Expectation(expectationProvider = "matchArrayEndingData", flag = 0) + public abstract void s0(final ITestContext a0, final float[] f, final ITestResult a1); + + @Expectation(expectationProvider = "matchArrayEndingData", flag = 0) + public abstract void s0( + final ITestContext a0, final ITestResult a1, final XmlTest a2, final float... f); + + @Expectation(expectationProvider = "matchArrayEndingData", flag = 0) + public abstract void s0( + final ITestContext a0, + final ITestResult a1, + final XmlTest a2, + final float[] f, + final Method a3); + + @Expectation(expectationProvider = "matchArrayEndingData", flag = 1) + public abstract void s1(final int a0, final float... f); + + @Expectation(expectationProvider = "matchArrayEndingData", flag = 1) + public abstract void s1(final ITestContext a0, final int a1, final float... f); + + @Expectation(expectationProvider = "matchArrayEndingData", flag = 1) + public abstract void s1( + final ITestContext a0, final Integer a1, final ITestResult a2, final float... f); + + @Expectation(expectationProvider = "matchArrayEndingData", flag = 1) + public abstract void s1( + final int a0, + final ITestContext a1, + final ITestResult a2, + final float[] f, + final XmlTest a3); + + @Expectation(expectationProvider = "matchArrayEndingData", flag = 1) + public abstract void s1( + final ITestContext a0, + final ITestResult a1, + final int a2, + final XmlTest a3, + final float[] f, + final Method a4); + + @Retention(RUNTIME) + @Target({METHOD}) + public static @interface Expectation { + public String expectationProvider(); + + public int flag(); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reflect/TestContextJustForTesting.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reflect/TestContextJustForTesting.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reflect/TestContextJustForTesting.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reflect/TestContextJustForTesting.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,122 @@ +package test.reflect; + +import java.util.Collection; +import java.util.Date; +import java.util.Set; +import org.testng.IResultMap; +import org.testng.ISuite; +import org.testng.ITestContext; +import org.testng.ITestNGMethod; +import org.testng.xml.XmlTest; + +/** */ +public class TestContextJustForTesting implements ITestContext { + + @Override + public String getName() { + return null; + } + + @Override + public Date getStartDate() { + return null; + } + + @Override + public Date getEndDate() { + return null; + } + + @Override + public IResultMap getPassedTests() { + return null; + } + + @Override + public IResultMap getSkippedTests() { + return null; + } + + @Override + public IResultMap getFailedButWithinSuccessPercentageTests() { + return null; + } + + @Override + public IResultMap getFailedTests() { + return null; + } + + @Override + public String[] getIncludedGroups() { + return new String[0]; + } + + @Override + public String[] getExcludedGroups() { + return new String[0]; + } + + @Override + public String getOutputDirectory() { + return null; + } + + @Override + public ISuite getSuite() { + return null; + } + + @Override + public ITestNGMethod[] getAllTestMethods() { + return new ITestNGMethod[0]; + } + + @Override + public String getHost() { + return null; + } + + @Override + public Collection getExcludedMethods() { + return null; + } + + @Override + public IResultMap getPassedConfigurations() { + return null; + } + + @Override + public IResultMap getSkippedConfigurations() { + return null; + } + + @Override + public IResultMap getFailedConfigurations() { + return null; + } + + @Override + public XmlTest getCurrentXmlTest() { + return null; + } + + @Override + public Object getAttribute(String name) { + return null; + } + + @Override + public void setAttribute(String name, Object value) {} + + @Override + public Set getAttributeNames() { + return null; + } + + @Override + public Object removeAttribute(String name) { + return null; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reflect/TestMethodMatcher.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reflect/TestMethodMatcher.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reflect/TestMethodMatcher.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reflect/TestMethodMatcher.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,251 @@ +package test.reflect; + +import static org.assertj.core.api.Assertions.assertThatThrownBy; + +import java.lang.reflect.Method; +import org.testng.Assert; +import org.testng.ITestContext; +import org.testng.ITestResult; +import org.testng.annotations.DataProvider; +import org.testng.annotations.NoInjection; +import org.testng.annotations.Test; +import org.testng.internal.reflect.DataProviderMethodMatcher; +import org.testng.internal.reflect.MethodMatcher; +import org.testng.internal.reflect.MethodMatcherContext; +import org.testng.internal.reflect.MethodMatcherException; +import org.testng.log4testng.Logger; +import org.testng.xml.XmlTest; + +/** + * Created on 12/24/15 + * + * @author Nitin Verma + */ +public class TestMethodMatcher { + private static final Logger log = Logger.getLogger(TestMethodMatcher.class); + + private static Method getMethod(final String methodName) { + Method method = null; + for (final Method m : TestMethodMatcher.class.getMethods()) { + if (m.getName().equals(methodName)) { + method = m; + } + } + return method; + } + + @DataProvider + public Object[][] methodParamPairs() { + return new Object[][] { + new Object[] {"goodTestIssue122", new Object[] {"3", new String[] {"three", "four"}}}, + new Object[] {"badTestIssue122", new Object[] {"3", new String[] {"three", "four"}}}, + new Object[] {"goodTestIssue122", new Object[] {"3", "three", "four"}}, + new Object[] {"badTestIssue122", new Object[] {"3", "three", "four"}}, + new Object[] {"mixedArgs", new Object[] {3, true, new String[] {"three"}, "four"}}, + new Object[] { + "mixedArgs", new Object[] {3, true, new String[] {"three"}, new String[] {"four"}} + }, + new Object[] { + "potpourri0", + new Object[] { + getMethod("mixedArgs"), + new XmlTestJustForTesting(), + 3, + getMethod("badTestIssue122"), + new TestContextJustForTesting(), + true, + new TestResultJustForTesting(), + new String[] {"three"}, + new String[] {"four"} + } + }, + new Object[] { + "potpourri1", + new Object[] { + getMethod("mixedArgs"), + new XmlTestJustForTesting(), + 3, + getMethod("badTestIssue122"), + new TestContextJustForTesting(), + true, + new TestResultJustForTesting(), + new String[] {"three"}, + new String[] {"four"} + } + }, + }; + } + + @DataProvider + public Object[][] methodParamFailingPairs() { + return new Object[][] { + new Object[] {"goodTestIssue122", new Object[] {3, "three", "four"}}, + new Object[] {"badTestIssue122", new Object[] {3, "three", "four"}}, + new Object[] {"mixedArgs", new Object[] {3, true, "three", "four"}}, + }; + } + + @Test(dataProvider = "methodParamPairs") + public void testMatcher( + final String methodName, + final Object[] params, + final ITestContext iTestContext, + final ITestResult iTestResult) + throws Throwable { + final Method method = getMethod(methodName); + final MethodMatcher matcher = + new DataProviderMethodMatcher( + new MethodMatcherContext(method, params, iTestContext, iTestResult)); + method.invoke(new TestMethodMatcher(), matcher.getConformingArguments()); + } + + @Test(dataProvider = "methodParamFailingPairs") + public void testNegativeCaseMatcher( + final String methodName, + final Object[] params, + final ITestContext iTestContext, + final ITestResult iTestResult) { + final Method method = getMethod(methodName); + final MethodMatcher matcher = + new DataProviderMethodMatcher( + new MethodMatcherContext(method, params, iTestContext, iTestResult)); + Assert.assertFalse(matcher.conforms()); + assertThatThrownBy( + () -> { + method.invoke(new TestMethodMatcher(), matcher.getConformingArguments()); + }) + .isInstanceOf(MethodMatcherException.class) + // separate lines are used here to avoid \n vs \r\n if running tests in Windows + .hasMessageContaining( + "has no parameters defined but was found to be using a data provider (either explicitly specified or inherited from class level annotation") + .hasMessageContaining("Method: ") + .hasMessageContaining("Arguments: "); + } + + public void goodTestIssue122(String s, String[] strings) { + for (String item : strings) { + log.debug("An item is \"" + item + "\""); + } + Assert.assertEquals(s, "3"); + } + + public void badTestIssue122(String s, String... strings) { + for (String item : strings) { + log.debug("An item is \"" + item + "\""); + } + Assert.assertEquals(s, "3"); + } + + public void mixedArgs(final int i, final Boolean b, final String[] s1, final String... strings) { + for (String item : strings) { + log.debug("An item is \"" + item + "\""); + } + Assert.assertEquals(i, 3); + Assert.assertNotNull(b); + Assert.assertTrue(b); + Assert.assertNotNull(s1); + Assert.assertEquals(s1.length, 1); + Assert.assertEquals(s1[0], "three"); + Assert.assertNotNull(strings); + Assert.assertEquals(strings.length, 1); + Assert.assertEquals(strings[0], "four"); + } + + public void potpourri0( + @NoInjection final Method myMethod1, + @NoInjection final XmlTest myXmlTest, + final Method currentTestMethod, + final int i, + final Method myMethod2, + final ITestContext iTestContext, + @NoInjection final ITestContext myTestContext, + final Boolean b, + @NoInjection final ITestResult myTestResult, + final ITestResult iTestResult, + final String[] s1, + final XmlTest xmlTest, + final String... strings) { + log.debug("MyMethod1 is \"" + myMethod1 + "\""); + log.debug("MyMethod2 is \"" + myMethod2 + "\""); + log.debug("CurrentTestMethod is \"" + currentTestMethod + "\""); + log.debug("MyITestContext is \"" + myTestContext + "\""); + log.debug("ITestContext is \"" + iTestContext + "\""); + log.debug("ITestResult is \"" + iTestResult + "\""); + log.debug("MyTestResult is \"" + myTestResult + "\""); + log.debug("XmlTest is \"" + xmlTest + "\""); + log.debug("MyXmlTest is \"" + myXmlTest + "\""); + for (String item : strings) { + log.debug("An item is \"" + item + "\""); + } + Assert.assertNotNull(myTestContext); + Assert.assertTrue(myTestContext instanceof TestContextJustForTesting); + Assert.assertNotNull(myTestResult); + Assert.assertTrue(myTestResult instanceof TestResultJustForTesting); + Assert.assertNotNull(myXmlTest); + Assert.assertTrue(myXmlTest instanceof XmlTestJustForTesting); + Assert.assertNotNull(currentTestMethod); + Assert.assertEquals("potpourri0", currentTestMethod.getName()); + Assert.assertNotNull(myMethod1); + Assert.assertEquals("mixedArgs", myMethod1.getName()); + Assert.assertNotNull(myMethod2); + Assert.assertEquals("badTestIssue122", myMethod2.getName()); + Assert.assertEquals(i, 3); + Assert.assertNotNull(b); + Assert.assertTrue(b); + Assert.assertNotNull(s1); + Assert.assertEquals(s1.length, 1); + Assert.assertEquals(s1[0], "three"); + Assert.assertNotNull(strings); + Assert.assertEquals(strings.length, 1); + Assert.assertEquals(strings[0], "four"); + } + + public void potpourri1( + @NoInjection final Method myMethod1, + @NoInjection final XmlTest myXmlTest, + final Method currentTestMethod, + final int i, + final Method myMethod2, + final ITestContext iTestContext, + @NoInjection final ITestContext myTestContext, + final Boolean b, + @NoInjection final ITestResult myTestResult, + final ITestResult iTestResult, + final String[] s1, + final XmlTest xmlTest, + final String[] strings) { + log.debug("MyMethod1 is \"" + myMethod1 + "\""); + log.debug("MyMethod2 is \"" + myMethod2 + "\""); + log.debug("CurrentTestMethod is \"" + currentTestMethod + "\""); + log.debug("MyITestContext is \"" + myTestContext + "\""); + log.debug("ITestContext is \"" + iTestContext + "\""); + log.debug("ITestResult is \"" + iTestResult + "\""); + log.debug("MyTestResult is \"" + myTestResult + "\""); + log.debug("XmlTest is \"" + xmlTest + "\""); + log.debug("MyXmlTest is \"" + myXmlTest + "\""); + for (String item : strings) { + log.debug("An item is \"" + item + "\""); + } + Assert.assertNotNull(myTestContext); + Assert.assertTrue(myTestContext instanceof TestContextJustForTesting); + Assert.assertNotNull(myTestResult); + Assert.assertTrue(myTestResult instanceof TestResultJustForTesting); + Assert.assertNotNull(myXmlTest); + Assert.assertTrue(myXmlTest instanceof XmlTestJustForTesting); + Assert.assertNotNull(currentTestMethod); + Assert.assertEquals("potpourri1", currentTestMethod.getName()); + Assert.assertNotNull(myMethod1); + Assert.assertEquals("mixedArgs", myMethod1.getName()); + Assert.assertNotNull(myMethod2); + Assert.assertEquals("badTestIssue122", myMethod2.getName()); + Assert.assertEquals(i, 3); + Assert.assertNotNull(b); + Assert.assertTrue(b); + Assert.assertNotNull(s1); + Assert.assertEquals(s1.length, 1); + Assert.assertEquals(s1[0], "three"); + Assert.assertNotNull(strings); + Assert.assertEquals(strings.length, 1); + Assert.assertEquals(strings[0], "four"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reflect/TestResultJustForTesting.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reflect/TestResultJustForTesting.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reflect/TestResultJustForTesting.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reflect/TestResultJustForTesting.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,150 @@ +package test.reflect; + +import java.util.List; +import java.util.Set; +import java.util.UUID; +import org.testng.IClass; +import org.testng.ITestContext; +import org.testng.ITestNGMethod; +import org.testng.ITestResult; + +/** + * Created on 12/30/15. + * + * @author Nitin Verma + */ +public class TestResultJustForTesting implements ITestResult { + + private final String id = UUID.randomUUID().toString(); + + @Override + public int getStatus() { + return 0; + } + + @Override + public void setStatus(int status) {} + + @Override + public ITestNGMethod getMethod() { + return null; + } + + @Override + public Object[] getParameters() { + return new Object[0]; + } + + @Override + public void setParameters(Object[] parameters) {} + + @Override + public IClass getTestClass() { + return null; + } + + @Override + public Throwable getThrowable() { + return null; + } + + @Override + public void setThrowable(Throwable throwable) {} + + @Override + public long getStartMillis() { + return 0; + } + + @Override + public long getEndMillis() { + return 0; + } + + @Override + public void setEndMillis(long millis) {} + + @Override + public String getName() { + return null; + } + + @Override + public boolean isSuccess() { + return false; + } + + @Override + public String getHost() { + return null; + } + + @Override + public Object getInstance() { + return null; + } + + @Override + public Object[] getFactoryParameters() { + return new Object[0]; + } + + @Override + public String getTestName() { + return null; + } + + @Override + public void setTestName(String name) {} + + @Override + public boolean wasRetried() { + return false; + } + + @Override + public void setWasRetried(boolean wasRetried) {} + + @Override + public List getSkipCausedBy() { + return null; + } + + @Override + public String getInstanceName() { + return null; + } + + @Override + public ITestContext getTestContext() { + return null; + } + + @Override + public int compareTo(ITestResult o) { + return 0; + } + + @Override + public Object getAttribute(String name) { + return null; + } + + @Override + public void setAttribute(String name, Object value) {} + + @Override + public Set getAttributeNames() { + return null; + } + + @Override + public Object removeAttribute(String name) { + return null; + } + + @Override + public String id() { + return id; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reflect/XmlTestJustForTesting.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reflect/XmlTestJustForTesting.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reflect/XmlTestJustForTesting.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reflect/XmlTestJustForTesting.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,10 @@ +package test.reflect; + +import org.testng.xml.XmlTest; + +/** + * Created on 12/30/15. + * + * @author Nitin Verma + */ +public class XmlTestJustForTesting extends XmlTest {} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/regression/BeforeTestFailingTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/regression/BeforeTestFailingTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/regression/BeforeTestFailingTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/regression/BeforeTestFailingTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,22 @@ +package test.regression; + +import org.testng.Assert; +import org.testng.ITestNGListener; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class BeforeTestFailingTest extends SimpleBaseTest { + + @Test + public void beforeTestFailingShouldCauseSkips() { + TestNG tng = create(MyTestngTest2.class); + TestListenerAdapter tla = new TestListenerAdapter(); + tng.addListener((ITestNGListener) tla); + tng.run(); + + Assert.assertEquals(tla.getSkippedTests().size(), 1); + Assert.assertEquals(tla.getPassedTests().size(), 0); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/regression/MyTestngTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/regression/MyTestngTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/regression/MyTestngTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/regression/MyTestngTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.regression; + +import org.testng.ITestContext; +import org.testng.annotations.BeforeSuite; +import org.testng.annotations.BeforeTest; + +public class MyTestngTest { + + @BeforeSuite() + public void beforeSuite(ITestContext tc) throws Exception {} + + @BeforeTest() + public void beforeTest(ITestContext tc) throws Exception { + throw new RuntimeException("barfing now"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/regression/MyTestngTest2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/regression/MyTestngTest2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/regression/MyTestngTest2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/regression/MyTestngTest2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.regression; + +import org.testng.ITestContext; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class MyTestngTest2 extends MyTestngTest { + + @BeforeClass() + public void beforeClass(ITestContext tc) throws Exception {} + + @BeforeMethod() + public void beforeMethod(ITestContext tc) throws Exception { + // throw new Exception("fail me"); + } + + @Test() + public void test(ITestContext tc) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/regression/groupsordering/A.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/regression/groupsordering/A.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/regression/groupsordering/A.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/regression/groupsordering/A.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.regression.groupsordering; + +import org.testng.annotations.Test; + +public class A extends Base { + + @Test(groups = "a") + public void testA() { + s_childAWasRun = true; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/regression/groupsordering/B.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/regression/groupsordering/B.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/regression/groupsordering/B.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/regression/groupsordering/B.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.regression.groupsordering; + +import org.testng.annotations.Test; + +public class B extends Base { + + @Test(groups = "a") + public void testB() throws Exception { + Base.s_childBWasRun = true; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/regression/groupsordering/Base.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/regression/groupsordering/Base.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/regression/groupsordering/Base.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/regression/groupsordering/Base.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,25 @@ +package test.regression.groupsordering; + +import org.testng.Assert; +import org.testng.annotations.AfterGroups; +import org.testng.annotations.BeforeGroups; + +public abstract class Base { + protected static boolean s_childAWasRun; + protected static boolean s_childBWasRun; + + @BeforeGroups(value = "a", groups = "a") + public void setUp() { + Assert.assertFalse( + s_childAWasRun || s_childBWasRun, + "Static field was not reset: @AfterGroup method not invoked"); + } + + @AfterGroups(value = "a", groups = "a") + public void tearDown() { + Assert.assertTrue(s_childAWasRun, "Child A was not run"); + Assert.assertTrue(s_childBWasRun, "Child B was not run"); + s_childAWasRun = false; + s_childBWasRun = false; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/regression/groupsordering/testng.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/regression/groupsordering/testng.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/regression/groupsordering/testng.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/regression/groupsordering/testng.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/EmailableReporterTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/EmailableReporterTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/EmailableReporterTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/EmailableReporterTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,155 @@ +package test.reports; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.io.File; +import java.lang.reflect.Method; +import java.security.Permission; +import org.testng.IReporter; +import org.testng.ITestNGListener; +import org.testng.TestNG; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import org.testng.reporters.EmailableReporter; +import org.testng.reporters.EmailableReporter2; +import test.SimpleBaseTest; + +public class EmailableReporterTest extends SimpleBaseTest { + private SecurityManager manager; + + @BeforeClass(alwaysRun = true) + public void setup() { + manager = System.getSecurityManager(); + System.setSecurityManager(new MySecurityManager(manager)); + } + + @AfterClass(alwaysRun = true) + public void cleanup() { + System.setSecurityManager(manager); + } + + @Test(dataProvider = "getReporterInstances", priority = 1) + public void testReportsNameCustomizationViaRunMethodInvocationAndJVMArguments( + IReporter reporter, String jvm) { + runTestViaRunMethod(reporter, jvm); + } + + @Test(dataProvider = "getReporterInstances", priority = 2) + public void testReportsNameCustomizationViaRunMethodInvocation(IReporter reporter) { + runTestViaRunMethod(reporter, null /* no jvm arguments */); + } + + @Test(dataProvider = "getReporterNames", priority = 3) + public void testReportsNameCustomizationViaMainMethodInvocation(String clazzName) { + runTestViaMainMethod(clazzName, null /* no jvm arguments */); + } + + @Test(dataProvider = "getReporterNames", priority = 4) + public void testReportsNameCustomizationViaMainMethodInvocationAndJVMArguments( + String clazzName, String jvm) { + runTestViaMainMethod(clazzName, jvm); + } + + @DataProvider(name = "getReporterInstances") + public Object[][] getReporterInstances(Method method) { + if (method.getName().toLowerCase().contains("jvmarguments")) { + return new Object[][] { + {new EmailableReporter(), "emailable.report.name"}, + {new EmailableReporter2(), "emailable.report2.name"} + }; + } + return new Object[][] {{new EmailableReporter()}, {new EmailableReporter2()}}; + } + + @DataProvider(name = "getReporterNames") + public Object[][] getReporterNames(Method method) { + if (method.getName().toLowerCase().contains("jvmarguments")) { + return new Object[][] { + {EmailableReporter.class.getName(), "emailable.report.name"}, + {EmailableReporter2.class.getName(), "emailable.report2.name"} + }; + } + return new Object[][] { + {EmailableReporter.class.getName()}, {EmailableReporter2.class.getName()} + }; + } + + private void runTestViaMainMethod(String clazzName, String jvm) { + String name = Long.toString(System.currentTimeMillis()); + File output = createDirInTempDir(name); + String filename = "report" + name + ".html"; + String[] args = { + "-d", + output.getAbsolutePath(), + "-reporter", + clazzName + ":fileName=" + filename, + "src/test/resources/1332.xml" + }; + try { + if (jvm != null) { + System.setProperty(jvm, filename); + } + TestNG.main(args); + } catch (SecurityException t) { + // Gobble Security exception + } finally { + if (jvm != null) { + // reset the jvm arguments + System.setProperty(jvm, ""); + } + } + File actual = new File(output.getAbsolutePath(), filename); + assertThat(actual).exists(); + } + + private void runTestViaRunMethod(IReporter reporter, String jvm) { + String name = Long.toString(System.currentTimeMillis()); + File output = createDirInTempDir(name); + String filename = "report" + name + ".html"; + if (jvm != null) { + System.setProperty(jvm, filename); + } + try { + TestNG testNG = create(); + testNG.setOutputDirectory(output.getAbsolutePath()); + if (reporter instanceof EmailableReporter2) { + ((EmailableReporter2) reporter).setFileName(filename); + } + if (reporter instanceof EmailableReporter) { + ((EmailableReporter) reporter).setFileName(filename); + } + testNG.addListener((ITestNGListener) reporter); + testNG.setTestClasses(new Class[] {ReporterSample.class}); + testNG.run(); + } finally { + if (jvm != null) { + // reset the jvm argument if it was set + System.setProperty(jvm, ""); + } + } + + File actual = new File(output.getAbsolutePath(), filename); + assertThat(actual).exists(); + } + + public static class MySecurityManager extends SecurityManager { + + private SecurityManager baseSecurityManager; + + MySecurityManager(SecurityManager baseSecurityManager) { + this.baseSecurityManager = baseSecurityManager; + } + + @Override + public void checkPermission(Permission permission) { + if (permission.getName().startsWith("exitVM")) { + throw new SecurityException("System exit not allowed"); + } + if (baseSecurityManager != null) { + baseSecurityManager.checkPermission(permission); + } + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/FailedReporterTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/FailedReporterTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/FailedReporterTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/FailedReporterTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,215 @@ +package test.reports; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.io.FileInputStream; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.stream.Collectors; +import org.testng.Assert; +import org.testng.TestNG; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import org.testng.reporters.FailedReporter; +import org.testng.xml.SuiteXmlParser; +import org.testng.xml.XmlClass; +import org.testng.xml.XmlInclude; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import org.testng.xml.internal.Parser; +import org.xmlunit.builder.DiffBuilder; +import org.xmlunit.builder.Input; +import org.xmlunit.diff.Diff; +import test.SimpleBaseTest; +import test.reports.issue2611.TestClassFailsAtBeforeGroupsWithBeforeGroupsSuiteTestSample; +import test.reports.issue2611.TestClassFailsAtBeforeSuiteWithBeforeGroupsSuiteTestSample; +import test.reports.issue2611.TestClassFailsAtBeforeTestWithBeforeGroupsSuiteTestSample; +import test.reports.issue2611.TestClassWithBeforeGroupsSample; +import test.reports.issue2611.TestClassWithBeforeSuiteSample; +import test.reports.issue2611.TestClassWithBeforeTestSample; +import test.reports.issue2611.TestClassWithJustTestMethodsSample; + +public class FailedReporterTest extends SimpleBaseTest { + + @Test + public void failedFile() throws IOException { + XmlSuite xmlSuite = createXmlSuite("Suite"); + xmlSuite.getParameters().put("n", "42"); + + XmlTest xmlTest = createXmlTest(xmlSuite, "Test"); + xmlTest.addParameter("o", "43"); + + XmlClass xmlClass = createXmlClass(xmlTest, SimpleFailedSample.class); + xmlClass.getLocalParameters().put("p", "44"); + + TestNG tng = create(xmlSuite); + + Path temp = Files.createTempDirectory("tmp"); + tng.setOutputDirectory(temp.toAbsolutePath().toString()); + tng.addListener(new FailedReporter()); + tng.run(); + + Collection failedSuites = + new Parser(temp.resolve(FailedReporter.TESTNG_FAILED_XML).toAbsolutePath().toString()) + .parse(); + XmlSuite failedSuite = failedSuites.iterator().next(); + Assert.assertEquals("42", failedSuite.getParameter("n")); + + XmlTest failedTest = failedSuite.getTests().get(0); + Assert.assertEquals("43", failedTest.getParameter("o")); + + XmlClass failedClass = failedTest.getClasses().get(0); + Assert.assertEquals("44", failedClass.getAllParameters().get("p")); + } + + @Test(description = "ISSUE-2445") + public void testParameterPreservationWithFactory() throws IOException { + final SuiteXmlParser parser = new SuiteXmlParser(); + final String testSuite = "src/test/resources/xml/github2445/test-suite.xml"; + final String expectedResult = "src/test/resources/xml/github2445/expected-failed-report.xml"; + final XmlSuite xmlSuite = parser.parse(testSuite, new FileInputStream(testSuite), true); + final TestNG tng = create(xmlSuite); + + final Path temp = Files.createTempDirectory("tmp"); + tng.setOutputDirectory(temp.toAbsolutePath().toString()); + tng.addListener(new FailedReporter()); + tng.run(); + + final Diff myDiff = + DiffBuilder.compare(Input.fromFile(expectedResult)) + .withTest( + Input.fromFile( + temp.resolve(FailedReporter.TESTNG_FAILED_XML).toAbsolutePath().toString())) + .checkForSimilar() + .ignoreWhitespace() + .build(); + + assertThat(myDiff).matches((it) -> !it.hasDifferences(), "!it.hasDifferences()"); + } + + @Test(dataProvider = "getTestData") + public void testToEnsureConfigFailuresAreIncluded(ClassMethodInfo pairA, ClassMethodInfo pairB) + throws IOException { + XmlSuite xmlSuite = createXmlSuite("kungfu-panda-suite"); + XmlTest xmlTest = + createXmlTest(xmlSuite, "kungfu-panda-test", pairA.getTestClass(), pairB.getTestClass()); + xmlTest.addIncludedGroup("dragon-warrior"); + TestNG tng = create(xmlSuite); + final Path temp = Files.createTempDirectory("tmp"); + tng.setOutputDirectory(temp.toAbsolutePath().toString()); + tng.addListener(new FailedReporter()); + tng.run(); + Collection failedSuites = + new Parser(temp.resolve(FailedReporter.TESTNG_FAILED_XML).toAbsolutePath().toString()) + .parse(); + XmlSuite failedSuite = failedSuites.iterator().next(); + assertThat(failedSuite.getName()) + .withFailMessage("The failed suite should have had the prefix of [Failed suite]") + .isEqualTo("Failed suite [kungfu-panda-suite]"); + XmlTest failedTest = failedSuite.getTests().iterator().next(); + assertThat(failedTest.getName()) + .withFailMessage("The failed test should have had the suffix of [(failed)]") + .isEqualTo("kungfu-panda-test(failed)"); + runIncludedMethodsAssertion( + failedTest.getClasses(), pairA.getTestClass(), pairA.getTestMethods()); + runIncludedMethodsAssertion( + failedTest.getClasses(), pairB.getTestClass(), pairB.getTestMethods()); + } + + @DataProvider(name = "getTestData") + public Object[][] getTestData() { + return new Object[][] { + { + new ClassMethodInfo(TestClassWithBeforeTestSample.class, "beforeTest", "afterTest"), + new ClassMethodInfo(TestClassWithJustTestMethodsSample.class, "test2Method") + }, + { + new ClassMethodInfo(TestClassWithBeforeSuiteSample.class, "beforeSuite", "afterSuite"), + new ClassMethodInfo(TestClassWithJustTestMethodsSample.class, "test2Method") + }, + { + new ClassMethodInfo(TestClassWithBeforeGroupsSample.class, "beforeGroups", "afterGroups"), + new ClassMethodInfo(TestClassWithJustTestMethodsSample.class, "test2Method") + }, + { + new ClassMethodInfo( + TestClassFailsAtBeforeGroupsWithBeforeGroupsSuiteTestSample.class, + "beforeGroups", + "afterGroups", + "beforeTest", + "afterTest", + "beforeSuite", + "afterSuite"), + new ClassMethodInfo(TestClassWithJustTestMethodsSample.class, "test2Method") + }, + { + new ClassMethodInfo( + TestClassFailsAtBeforeSuiteWithBeforeGroupsSuiteTestSample.class, + "beforeGroups", + "afterGroups", + "beforeTest", + "afterTest", + "beforeSuite", + "afterSuite"), + new ClassMethodInfo(TestClassWithJustTestMethodsSample.class, "test2Method") + }, + { + new ClassMethodInfo( + TestClassFailsAtBeforeTestWithBeforeGroupsSuiteTestSample.class, + "beforeGroups", + "afterGroups", + "beforeTest", + "afterTest", + "beforeSuite", + "afterSuite"), + new ClassMethodInfo(TestClassWithJustTestMethodsSample.class, "test2Method") + } + }; + } + + private static void runIncludedMethodsAssertion( + List failedClasses, Class cls, String... methods) { + XmlClass xmlClass = + failedClasses.stream() + .filter(each -> each.getName().equals(cls.getName())) + .findFirst() + .orElseThrow(() -> new IllegalStateException("Failed to locate " + cls.getName())); + List includedMethods = + xmlClass.getIncludedMethods().stream() + .map(XmlInclude::getName) + .collect(Collectors.toList()); + assertThat(includedMethods) + .withFailMessage( + String.format( + "Included methods:\n%s\n in class\n%s\n should match\n%s", + String.join("\n", includedMethods), cls.getName(), String.join("\n", methods))) + .containsExactlyInAnyOrder(methods); + } + + public static class ClassMethodInfo { + private final Class clazz; + private final String[] testMethods; + + public ClassMethodInfo(Class clazz, String... testMethods) { + this.clazz = clazz; + this.testMethods = testMethods; + } + + public Class getTestClass() { + return clazz; + } + + public String[] getTestMethods() { + return testMethods; + } + + @Override + public String toString() { + return String.format("%s->%s", clazz.toString(), Arrays.toString(testMethods)); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/GitHub1148Sample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/GitHub1148Sample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/GitHub1148Sample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/GitHub1148Sample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ +package test.reports; + +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class GitHub1148Sample { + + @DataProvider + public Object[][] dp() { + return new Object[][] {{"Cedric"}, {"Anne"}}; + } + + @Test(dataProvider = "dp") + public void verifyData(String n1) { + Assert.assertEquals(n1, "Cedric"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/GitHub148Sample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/GitHub148Sample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/GitHub148Sample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/GitHub148Sample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.reports; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class GitHub148Sample { + + @DataProvider + public Object[][] dp() { + return new Object[][] {{1}, {2}, {3}}; + } + + @Test(dataProvider = "dp") + public void testMethod(int test) { + if (test == 3) { + throw new RuntimeException("Test Case: " + test + " failed!"); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/GitHub447Listener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/GitHub447Listener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/GitHub447Listener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/GitHub447Listener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,39 @@ +package test.reports; + +import java.util.ArrayList; +import java.util.List; +import org.testng.ITestContext; +import org.testng.ITestListener; +import org.testng.ITestResult; + +public class GitHub447Listener implements ITestListener { + + private final List parameters = new ArrayList<>(); + + @Override + public void onTestStart(ITestResult result) {} + + @Override + public void onTestSuccess(ITestResult result) { + parameters.add(result.getParameters()); + } + + @Override + public void onTestFailure(ITestResult result) {} + + @Override + public void onTestSkipped(ITestResult result) {} + + @Override + public void onTestFailedButWithinSuccessPercentage(ITestResult result) {} + + @Override + public void onStart(ITestContext context) {} + + @Override + public void onFinish(ITestContext context) {} + + public List getParameters() { + return parameters; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/GitHub447Sample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/GitHub447Sample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/GitHub447Sample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/GitHub447Sample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,33 @@ +package test.reports; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertTrue; + +import java.util.ArrayList; +import java.util.List; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class GitHub447Sample { + + @Test(dataProvider = "add") + public void add(List list, Object e, String expected) { + assertTrue(list.add(e)); + assertEquals(list.toString(), expected); + } + + @DataProvider(name = "add") + protected static final Object[][] addTestData() { + List list = new ArrayList<>(5); + + Object[][] testData = + new Object[][] { + {list, null, "[null]"}, + {list, "dup", "[null, dup]"}, + {list, "dup", "[null, dup, dup]"}, + {list, "str", "[null, dup, dup, str]"}, + {list, null, "[null, dup, dup, str, null]"}, + }; + return testData; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/Issue1566Sample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/Issue1566Sample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/Issue1566Sample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/Issue1566Sample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package test.reports; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class Issue1566Sample { + @DataProvider + public Object[][] dataProvider() { + return new Object[][] {{"test \u000C"}}; + } + + @Test(dataProvider = "dataProvider") + public void test(String argument) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/Issue1659Sample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/Issue1659Sample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/Issue1659Sample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/Issue1659Sample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package test.reports; + +import org.testng.annotations.Test; + +public class Issue1659Sample { + @Test + public void testMethod() { + triggerExceptions(); + } + + private void triggerExceptions() { + throw new RuntimeException("simulating test failure"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/ListenerReporterSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/ListenerReporterSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/ListenerReporterSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/ListenerReporterSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,25 @@ +package test.reports; + +import org.testng.ITestContext; +import org.testng.Reporter; +import org.testng.TestListenerAdapter; +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +@Listeners(ListenerReporterSample.class) +public class ListenerReporterSample extends TestListenerAdapter { + + @Override + public void onStart(ITestContext testContext) { + Reporter.log("foo"); + super.onStart(testContext); + } + + @Test + public void testMethod() { + Reporter.log( + "bar"); // This line is required. Else the log that was triggered from onStart() would never + // be + // persisted at all. + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/ReportTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/ReportTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/ReportTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/ReportTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,308 @@ +package test.reports; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.PrintStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.List; +import org.testng.*; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import org.testng.reporters.FailedReporter; +import org.testng.reporters.TestHTMLReporter; +import org.testng.reporters.TextReporter; +import org.testng.xml.XmlSuite; +import org.testng.xml.internal.Parser; +import test.InvokedMethodNameListener; +import test.SimpleBaseTest; +import test.TestHelper; +import test.reports.issue1756.CustomTestNGReporter; +import test.reports.issue1756.SampleTestClass; +import test.simple.SimpleSample; + +public class ReportTest extends SimpleBaseTest { + + @Test + public void verifyIndex() throws IOException { + Path outputDir = TestHelper.createRandomDirectory(); + + String suiteName = "VerifyIndexSuite"; + String testName = "TmpTest"; + XmlSuite suite = createXmlSuite(suiteName, testName, SimpleSample.class); + + TestNG tng = create(outputDir, suite); + tng.addListener(new TestHTMLReporter()); + + Path f = getHtmlReportFile(outputDir, suiteName, testName); + + tng.run(); + + Assert.assertTrue(Files.exists(f), f.toString()); + } + + @Test + public void directoryShouldBeSuiteName() throws IOException { + Path outputDirectory = TestHelper.createRandomDirectory(); + + String suiteName = "ReportTestSuite1"; + String testName = "Test1"; + String testName2 = "Test2"; + XmlSuite xmlSuite = createXmlSuite(suiteName); + createXmlTest(xmlSuite, testName); + createXmlTest(xmlSuite, testName2); + + TestNG tng = create(outputDirectory, xmlSuite); + tng.addListener(new TestHTMLReporter()); + + Path f = getHtmlReportFile(outputDirectory, suiteName, testName); + Path f2 = getHtmlReportFile(outputDirectory, suiteName, testName2); + + tng.run(); + + Assert.assertTrue(Files.exists(f)); + Assert.assertTrue(Files.exists(f2)); + } + + @Test + public void oneDirectoryPerSuite() throws IOException { + Path outputDirectory = TestHelper.createRandomDirectory(); + + String suiteNameA = "ReportSuiteA"; + String suiteNameB = "ReportSuiteB"; + String testName = "TmpTest"; + XmlSuite xmlSuiteA = createXmlSuite(suiteNameA, testName, SampleA.class); + XmlSuite xmlSuiteB = createXmlSuite(suiteNameB, testName, SampleB.class); + + TestNG tng = create(outputDirectory, xmlSuiteA, xmlSuiteB); + tng.addListener(new TestHTMLReporter()); + + Path f1 = getHtmlReportFile(outputDirectory, suiteNameA, testName); + Path f2 = getHtmlReportFile(outputDirectory, suiteNameB, testName); + + tng.run(); + + Assert.assertTrue(Files.exists(f1)); + Assert.assertTrue(Files.exists(f2)); + } + + private static Path getHtmlReportFile(Path outputDir, String suiteName, String testName) + throws IOException { + Path f = outputDir.resolve(Paths.get(suiteName, testName + ".html")); + Files.deleteIfExists(f); + return f; + } + + @Test + public void shouldHonorSuiteName() throws IOException { + Path outputDirectory = TestHelper.createRandomDirectory(); + + TestNG tng = create(outputDirectory, SampleA.class, SampleB.class); + tng.addListener(new TestHTMLReporter()); + + Path fileA = outputDirectory.resolve("SuiteA-JDK5"); + Path fileB = outputDirectory.resolve("SuiteB-JDK5"); + Assert.assertTrue(Files.notExists(fileA)); + Assert.assertTrue(Files.notExists(fileB)); + + tng.run(); + + Assert.assertTrue(Files.exists(fileA)); + Assert.assertTrue(Files.exists(fileB)); + } + + private static boolean m_success; + + @Test + public void reportLogShouldBeAvailableEvenWithTimeOut() { + m_success = false; + TestNG tng = create(ReporterSample.class); + + ITestListener listener = + new TestListenerAdapter() { + @Override + public void onTestSuccess(ITestResult tr) { + super.onTestSuccess(tr); + List output = Reporter.getOutput(tr); + ReportTest.m_success = (output != null && output.size() > 0); + } + }; + tng.addListener(listener); + tng.run(); + + Assert.assertTrue(m_success); + } + + @Test + public void reportLogShouldBeAvailableWithListener() { + TestNG tng = create(ListenerReporterSample.class); + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener(listener); + + Reporter.clear(); + + tng.run(); + + assertThat(listener.getFailedMethodNames()).isEmpty(); + assertThat(listener.getSkippedMethodNames()).isEmpty(); + assertThat(listener.getSucceedMethodNames()).containsExactly("testMethod"); + assertThat(Reporter.getOutput()).hasSize(2); + } + + @Test(description = "GITHUB-1090") + public void github1090() { + TestNG tng = create(GitHub447Sample.class); + GitHub447Listener reporter = new GitHub447Listener(); + tng.addListener(reporter); + tng.run(); + + List parameters = reporter.getParameters(); + Assert.assertEquals(parameters.size(), 5); + Assert.assertEquals(parameters.get(0)[0].toString(), "[]"); + Assert.assertNull(parameters.get(0)[1]); + Assert.assertEquals(parameters.get(0)[2].toString(), "[null]"); + Assert.assertEquals(parameters.get(1)[0].toString(), "[null]"); + Assert.assertEquals(parameters.get(1)[1], "dup"); + Assert.assertEquals(parameters.get(1)[2].toString(), "[null, dup]"); + Assert.assertEquals(parameters.get(2)[0].toString(), "[null, dup]"); + Assert.assertEquals(parameters.get(2)[1], "dup"); + Assert.assertEquals(parameters.get(2)[2].toString(), "[null, dup, dup]"); + Assert.assertEquals(parameters.get(3)[0].toString(), "[null, dup, dup]"); + Assert.assertEquals(parameters.get(3)[1], "str"); + Assert.assertEquals(parameters.get(3)[2].toString(), "[null, dup, dup, str]"); + Assert.assertEquals(parameters.get(4)[0].toString(), "[null, dup, dup, str]"); + Assert.assertNull(parameters.get(4)[1]); + Assert.assertEquals(parameters.get(4)[2].toString(), "[null, dup, dup, str, null]"); + } + + @DataProvider + public static Object[][] dp() { + return new Object[][] { + { + GitHub1148Sample.class, + new String[] {"verifyData(Cedric)"}, + new String[] {"verifyData(Anne)"} + }, + { + GitHub148Sample.class, + new String[] {"testMethod(1)", "testMethod(2)"}, + new String[] {"testMethod(3)"} + } + }; + } + + @Test(dataProvider = "dp") + public void runFailedTestTwiceShouldBeConsistent( + Class testClass, String[] succeedMethods, String[] failedMethods) throws IOException { + Path outputDirectory = TestHelper.createRandomDirectory(); + + TestNG tng = create(outputDirectory, testClass); + + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener(listener); + tng.addListener(new FailedReporter()); + + tng.run(); + + assertThat(listener.getFailedMethodNames()).containsExactly(failedMethods); + assertThat(listener.getSucceedMethodNames()).containsExactly(succeedMethods); + assertThat(listener.getSkippedMethodNames()).isEmpty(); + + Path testngFailedXml = outputDirectory.resolve(FailedReporter.TESTNG_FAILED_XML); + assertThat(testngFailedXml).exists(); + + for (int i = 0; i < 5; i++) { + testngFailedXml = checkFailed(testngFailedXml, failedMethods); + } + } + + @Test(description = "GITHUB-1756") + public void testToEnsureSkippedTestsHaveProviderITestNameRetrieved() { + TestNG testng = create(SampleTestClass.class); + CustomTestNGReporter reporter = new CustomTestNGReporter(); + testng.addListener(reporter); + testng.run(); + assertThat(reporter.getLogs()) + .containsExactly(SampleTestClass.getUuid(), SampleTestClass.getUuid()); + } + + private static Path checkFailed(Path testngFailedXml, String... failedMethods) + throws IOException { + Path outputDirectory = TestHelper.createRandomDirectory(); + + List suites = new Parser(Files.newInputStream(testngFailedXml)).parseToList(); + TestNG tng = create(outputDirectory, suites); + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener(listener); + tng.addListener(new FailedReporter()); + + tng.run(); + + assertThat(listener.getSucceedMethodNames()).isEmpty(); + assertThat(listener.getSkippedMethodNames()).isEmpty(); + assertThat(listener.getFailedMethodNames()).containsExactly(failedMethods); + + Path testngFailedXml2 = outputDirectory.resolve(FailedReporter.TESTNG_FAILED_XML); + assertThat(testngFailedXml2).exists(); + + return testngFailedXml2; + } + + public static class DpArrays { + public enum Item { + ITEM1, + ITEM2 + } + + @DataProvider + public static Object[][] dpArrays() { + return new Object[][] {{new Item[] {Item.ITEM1}}, {new Item[] {Item.ITEM1, Item.ITEM2}}}; + } + + @Test(dataProvider = "dpArrays") + public void testMethod(Item[] strings) {} + } + + public static class NullParameter { + @DataProvider + public static Object[][] nullProvider() { + return new Object[][] {{null, "Bazinga!"}}; + } + + @Test(dataProvider = "nullProvider") + public void testMethod(Object nullReference, String bazinga) {} + } + + @Test + public void reportArraysToString() { + TestNG tng = create(DpArrays.class); + tng.addListener(new TextReporter("name", 2)); + + PrintStream previousOut = System.out; + ByteArrayOutputStream systemOutCapture = new ByteArrayOutputStream(); + System.setOut(new PrintStream(systemOutCapture)); + tng.run(); + System.setOut(previousOut); + + Assert.assertTrue(systemOutCapture.toString().contains("testMethod([ITEM1])")); + Assert.assertTrue(systemOutCapture.toString().contains("testMethod([ITEM1, ITEM2])")); + } + + @Test + public void reportCreatedWithNullParameter() { + TestNG tng = create(NullParameter.class); + tng.addListener(new TextReporter("name", 2)); + + PrintStream previousOut = System.out; + ByteArrayOutputStream systemOutCapture = new ByteArrayOutputStream(); + System.setOut(new PrintStream(systemOutCapture)); + tng.run(); + System.setOut(previousOut); + + Assert.assertTrue( + systemOutCapture.toString().contains("PASSED: testMethod(null, \"Bazinga!\")")); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/ReporterLogFailureSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/ReporterLogFailureSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/ReporterLogFailureSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/ReporterLogFailureSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.reports; + +import org.testng.Reporter; +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +@Listeners(ReporterLogListener.class) +public class ReporterLogFailureSample { + + @Test + public void test_onFailure() { + Reporter.log("Log from test_onFailure"); + throw new RuntimeException("Intentionally failed"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/ReporterLogListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/ReporterLogListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/ReporterLogListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/ReporterLogListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +package test.reports; + +import org.testng.ITestResult; +import org.testng.Reporter; +import org.testng.TestListenerAdapter; + +/** Listener that calls Reporter.log */ +public class ReporterLogListener extends TestListenerAdapter { + + @Override + public void onTestSuccess(ITestResult result) { + Reporter.log("Listener: onTestSuccess"); + super.onTestSuccess(result); + } + + @Override + public void onTestFailure(ITestResult result) { + Reporter.log("Listener: onTestFailure"); + super.onTestFailure(result); + } + + @Override + public void onTestSkipped(ITestResult result) { + Reporter.log("Listener: onTestSkipped"); + super.onTestSkipped(result); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/ReporterLogSkippedSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/ReporterLogSkippedSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/ReporterLogSkippedSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/ReporterLogSkippedSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.reports; + +import org.testng.Reporter; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +@Listeners(ReporterLogListener.class) +public class ReporterLogSkippedSample { + + @BeforeMethod + public void beforeMethod() { + throw new RuntimeException("Intentionally failed"); + } + + @Test + public void test_onSkip() { + Reporter.log("Log from test_onSkip"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/ReporterLogSuccessSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/ReporterLogSuccessSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/ReporterLogSuccessSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/ReporterLogSuccessSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package test.reports; + +import org.testng.Reporter; +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +@Listeners(ReporterLogListener.class) +public class ReporterLogSuccessSample { + + @Test + public void test_onSuccess() { + Reporter.log("Log from test_onSuccess"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/ReporterLogTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/ReporterLogTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/ReporterLogTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/ReporterLogTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,39 @@ +package test.reports; + +import java.util.List; +import org.testng.Assert; +import org.testng.Reporter; +import org.testng.TestNG; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +/** Make sure that Reporter.log() in listeners don't get discarded. */ +public class ReporterLogTest extends SimpleBaseTest { + + @DataProvider + public static Object[][] dp() { + return new Object[][] { + new Object[] {ReporterLogSuccessSample.class, "Listener: onTestSuccess"}, + new Object[] {ReporterLogSkippedSample.class, "Listener: onTestSkipped"}, + new Object[] {ReporterLogFailureSample.class, "Listener: onTestFailure"} + }; + } + + @Test(dataProvider = "dp") + public void shouldLogFromListener(Class testClass, String value) { + TestNG tng = create(testClass); + tng.run(); + List output = Reporter.getOutput(); + Assert.assertTrue(contains(output, value)); + } + + private static boolean contains(List output, String logMessage) { + for (String s : output) { + if (s.contains(logMessage)) { + return true; + } + } + return false; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/ReporterSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/ReporterSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/ReporterSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/ReporterSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.reports; + +import org.testng.Reporter; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +/** Regression test: if a timeOut is provided, getReporter(testResult) returns null. */ +public class ReporterSample { + + @DataProvider(name = "dp") + public Object[][] createParameters() { + return new Object[][] {new Object[] {"param1"}, new Object[] {"param2"}}; + } + + @Test(dataProvider = "dp", timeOut = 10000) + public void report(String p) { + Reporter.log("IN THE REPORTER: " + p); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/SampleA.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/SampleA.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/SampleA.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/SampleA.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.reports; + +import org.testng.annotations.Test; + +@Test(suiteName = "SuiteA-JDK5", testName = "TestA-JDK5") +public class SampleA { + + public void f() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/SampleB.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/SampleB.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/SampleB.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/SampleB.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.reports; + +import org.testng.annotations.Test; + +@Test(suiteName = "SuiteB-JDK5") +public class SampleB { + + public void f() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/SimpleFailedSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/SimpleFailedSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/SimpleFailedSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/SimpleFailedSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.reports; + +import org.testng.annotations.Test; + +public class SimpleFailedSample { + + @Test + public void failed() { + throw new RuntimeException("Failing intentionally"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/UniqueReporterInjectionSample1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/UniqueReporterInjectionSample1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/UniqueReporterInjectionSample1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/UniqueReporterInjectionSample1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,13 @@ +package test.reports; + +import org.testng.Assert; +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +@Listeners(UniqueReporterInjectionTest.ReporterListenerForIssue1227.class) +public class UniqueReporterInjectionSample1 { + @Test + public void testMethod() { + Assert.assertTrue(true); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/UniqueReporterInjectionSample2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/UniqueReporterInjectionSample2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/UniqueReporterInjectionSample2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/UniqueReporterInjectionSample2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,13 @@ +package test.reports; + +import org.testng.Assert; +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +@Listeners(UniqueReporterInjectionTest.ReporterListenerForIssue1227.class) +public class UniqueReporterInjectionSample2 { + @Test + public void testMethod() { + Assert.assertTrue(true); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/UniqueReporterInjectionTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/UniqueReporterInjectionTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/UniqueReporterInjectionTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/UniqueReporterInjectionTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,37 @@ +package test.reports; + +import java.util.List; +import org.testng.*; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.SimpleBaseTest; + +public class UniqueReporterInjectionTest extends SimpleBaseTest { + @Test + public void testPruningOfDuplicateReporter() { + XmlSuite xmlSuite = createXmlSuite("Suite"); + XmlTest xmlTest = createXmlTest(xmlSuite, "Test"); + createXmlClass(xmlTest, UniqueReporterInjectionSample1.class); + createXmlClass(xmlTest, UniqueReporterInjectionSample2.class); + TestNG tng = create(xmlSuite); + tng.setUseDefaultListeners(false); + tng.addListener((ITestNGListener) new ReporterListenerForIssue1227()); + tng.run(); + // Since we have another reporting listener that is injected via the service loader file + // reporting listeners size will now have to be three (because the ExitCodeListener is also a + // reporter backed listener). + Assert.assertEquals(tng.getReporters().size(), 3); + Assert.assertEquals(ReporterListenerForIssue1227.counter, 1); + } + + public static class ReporterListenerForIssue1227 implements IReporter { + static int counter = 0; + + @Override + public void generateReport( + List xmlSuites, List suites, String outputDirectory) { + counter++; + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/XmlReporterTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/XmlReporterTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/XmlReporterTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/XmlReporterTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,79 @@ +package test.reports; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.util.UUID; +import java.util.regex.Pattern; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathFactory; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.reporters.RuntimeBehavior; +import org.w3c.dom.Document; +import test.SimpleBaseTest; +import test.reports.issue2171.TestClassExample; + +public class XmlReporterTest extends SimpleBaseTest { + @Test(description = "GITHUB-1566") + public void testMethod() throws IOException { + File file = runTest(Issue1566Sample.class); + boolean flag = false; + Pattern pattern = Pattern.compile("\\p{Cc}"); + try (BufferedReader reader = new BufferedReader(new FileReader(file))) { + String line; + while ((line = reader.readLine()) != null) { + if (pattern.matcher(line).find()) { + flag = true; + } + } + } + assertThat(flag).as("Should not have found a control character").isFalse(); + } + + @Test(description = "GITHUB1659") + public void ensureStackTraceHasLineFeedsTest() throws Exception { + File file = runTest(Issue1659Sample.class); + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + DocumentBuilder builder = factory.newDocumentBuilder(); + Document doc = builder.parse(file); + XPath xPath = XPathFactory.newInstance().newXPath(); + String expression = "//full-stacktrace/text()"; + String data = (String) xPath.compile(expression).evaluate(doc, XPathConstants.STRING); + data = data.trim(); + assertThat(data.split("\n").length) + .as("Line feeds and carriage returns should not have been removed") + .isGreaterThan(1); + } + + @Test(description = "GITHUB-2171") + public void ensureCustomisationOfReportIsSupported() throws Exception { + File file = runTest(TestClassExample.class, "issue_2171.xml"); + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + DocumentBuilder builder = factory.newDocumentBuilder(); + Document doc = builder.parse(file); + XPath xPath = XPathFactory.newInstance().newXPath(); + String expression = "//test/class/test-method/file/@path"; + String data = (String) xPath.compile(expression).evaluate(doc, XPathConstants.STRING); + assertThat(data.trim()).isEqualTo("issue2171.html"); + } + + private static File runTest(Class clazz) { + return runTest(clazz, RuntimeBehavior.FILE_NAME); + } + + private static File runTest(Class clazz, String fileName) { + String suiteName = UUID.randomUUID().toString(); + File fileLocation = createDirInTempDir(suiteName); + TestNG testng = create(fileLocation.toPath(), clazz); + testng.setUseDefaultListeners(true); + testng.run(); + return new File(fileLocation, fileName); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/issue1756/CustomTestNGReporter.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue1756/CustomTestNGReporter.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/issue1756/CustomTestNGReporter.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue1756/CustomTestNGReporter.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,41 @@ +package test.reports.issue1756; + +import java.util.LinkedList; +import java.util.List; +import org.testng.IReporter; +import org.testng.IResultMap; +import org.testng.ISuite; +import org.testng.ITestContext; +import org.testng.xml.XmlSuite; + +public class CustomTestNGReporter implements IReporter { + private List logs = new LinkedList<>(); + + public List getLogs() { + return logs; + } + + public void generateReport( + List xmlSuites, List suites, String outputDirectory) { + getTestMehodSummary(suites); + } + + private void getTestMehodSummary(List suites) { + suites.forEach( + iSuite -> + iSuite + .getResults() + .values() + .forEach( + each -> { + ITestContext testObj = each.getTestContext(); + getTestMethodReport(testObj.getFailedTests()); + getTestMethodReport(testObj.getSkippedTests()); + getTestMethodReport(testObj.getPassedTests()); + })); + } + + private void getTestMethodReport(IResultMap testResultMap) { + testResultMap.getAllResults().forEach(iTestResult -> logs.add(iTestResult.getName())); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/issue1756/SampleTestClass.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue1756/SampleTestClass.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/issue1756/SampleTestClass.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue1756/SampleTestClass.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,33 @@ +package test.reports.issue1756; + +import java.util.UUID; +import org.testng.ITest; +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +@Listeners(CustomTestNGReporter.class) +public class SampleTestClass implements ITest { + private static String uuid = UUID.randomUUID().toString(); + + public static String getUuid() { + return uuid; + } + + private String uri; + + public SampleTestClass() { + this.uri = uuid; + } + + @Test + public void test1() { + throw new RuntimeException("failed"); + } + + @Test(dependsOnMethods = "test1") + public void test2() {} + + public String getTestName() { + return uri; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/issue2069/Dummy1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2069/Dummy1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/issue2069/Dummy1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2069/Dummy1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,13 @@ +package test.reports.issue2069; + +import junit.framework.Test; +import junit.framework.TestSuite; + +public class Dummy1 extends TestSuite { + + public static Test suite() { + final TestSuite suite = new TestSuite("Failing report"); + suite.addTestSuite(Dummy3.class); + return suite; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/issue2069/Dummy2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2069/Dummy2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/issue2069/Dummy2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2069/Dummy2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ +package test.reports.issue2069; + +import junit.framework.TestCase; + +public class Dummy2 extends TestCase { + + public void testScheduleDelete() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/issue2069/Dummy3.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2069/Dummy3.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/issue2069/Dummy3.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2069/Dummy3.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ +package test.reports.issue2069; + +import junit.framework.TestCase; +import org.junit.Assert; +import org.junit.Test; + +public class Dummy3 extends TestCase { + + @Test + public void testFails() { + Assert.assertEquals("test3 assertion that will fail", "1", "2"); + } + + @Test + public void testSucceeds() { + Assert.assertEquals("test3 assertion", "1", "1"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/issue2069/Dummy4.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2069/Dummy4.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/issue2069/Dummy4.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2069/Dummy4.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.reports.issue2069; + +import org.testng.annotations.Test; + +public class Dummy4 { + + @Test + public void testngTest() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/issue2069/IssueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2069/IssueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/issue2069/IssueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2069/IssueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,44 @@ +package test.reports.issue2069; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; +import java.io.UnsupportedEncodingException; +import java.nio.charset.StandardCharsets; +import org.testng.TestNG; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import test.SimpleBaseTest; + +public class IssueTest extends SimpleBaseTest { + + private PrintStream currentError = System.err; + private final ByteArrayOutputStream baos = new ByteArrayOutputStream(); + + @BeforeMethod + public void setup() throws UnsupportedEncodingException { + PrintStream ps = new PrintStream(baos, true, "UTF-8"); + System.setErr(ps); + } + + @AfterMethod(alwaysRun = true) + public void teardown() { + System.setErr(currentError); + } + + @Test + public void ensureNoExceptionsAriseFromReporters() { + XmlSuite xmlSuite = createXmlSuite("Not Failing TestSuite"); + createXmlTest(xmlSuite, "TestngTest", Dummy4.class); + createXmlTest(xmlSuite, "TestSuite", Dummy1.class).setJunit(true); + createXmlTest(xmlSuite, "TestCase", Dummy2.class).setJunit(true); + TestNG tng = create(xmlSuite); + tng.setUseDefaultListeners(true); + tng.run(); + String data = new String(baos.toByteArray(), StandardCharsets.UTF_8); + assertThat(data).doesNotContain("NullPointerException"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/issue2171/MyExampleListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2171/MyExampleListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/issue2171/MyExampleListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2171/MyExampleListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,24 @@ +package test.reports.issue2171; + +import java.util.Properties; +import org.testng.ITestResult; +import org.testng.reporters.XMLReporter; +import org.testng.reporters.XMLStringBuffer; + +public class MyExampleListener extends XMLReporter { + + @Override + public String fileName() { + return "issue_2171.xml"; + } + + @Override + public void addCustomTagsFor(XMLStringBuffer xmlBuffer, ITestResult testResult) { + Properties props = new Properties(); + for (String attributeName : testResult.getAttributeNames()) { + props.setProperty("path", testResult.getAttribute(attributeName).toString()); + xmlBuffer.push(attributeName, props); + xmlBuffer.pop(attributeName); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/issue2171/TestClassExample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2171/TestClassExample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/issue2171/TestClassExample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2171/TestClassExample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.reports.issue2171; + +import org.testng.ITestResult; +import org.testng.Reporter; +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +@Listeners(MyExampleListener.class) +public class TestClassExample { + + @Test + public void testMethod() { + ITestResult result = Reporter.getCurrentTestResult(); + result.setAttribute("file", "issue2171.html"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/issue2445/FailureTestFactory.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2445/FailureTestFactory.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/issue2445/FailureTestFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2445/FailureTestFactory.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,13 @@ +package test.reports.issue2445; + +import org.testng.annotations.Factory; + +public class FailureTestFactory { + @Factory + public Object[] getTestClasses() { + Object[] tests = new Object[2]; + tests[0] = new Test1(); + tests[1] = new Test2(); + return tests; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/issue2445/Test1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2445/Test1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/issue2445/Test1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2445/Test1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.reports.issue2445; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class Test1 { + @Test + public void test1() { + Assert.fail("Simulate failure"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/issue2445/Test2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2445/Test2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/issue2445/Test2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2445/Test2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.reports.issue2445; + +import org.junit.Assert; +import org.testng.annotations.Test; + +public class Test2 { + @Test + public void test2() { + Assert.assertEquals("Simulate success", "1", "1"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/issue2611/TestClassFailsAtBeforeGroupsWithBeforeGroupsSuiteTestSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2611/TestClassFailsAtBeforeGroupsWithBeforeGroupsSuiteTestSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/issue2611/TestClassFailsAtBeforeGroupsWithBeforeGroupsSuiteTestSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2611/TestClassFailsAtBeforeGroupsWithBeforeGroupsSuiteTestSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,32 @@ +package test.reports.issue2611; + +import org.testng.Assert; +import org.testng.annotations.AfterGroups; +import org.testng.annotations.AfterSuite; +import org.testng.annotations.AfterTest; +import org.testng.annotations.BeforeGroups; +import org.testng.annotations.BeforeSuite; +import org.testng.annotations.BeforeTest; + +public class TestClassFailsAtBeforeGroupsWithBeforeGroupsSuiteTestSample { + + @BeforeGroups(groups = {"dragon-warrior"}) + public void beforeGroups() { + Assert.fail(); + } + + @AfterGroups(groups = {"dragon-warrior"}) + public void afterGroups() {} + + @BeforeSuite(groups = {"dragon-warrior"}) + public void beforeSuite() {} + + @AfterSuite(groups = {"dragon-warrior"}) + public void afterSuite() {} + + @BeforeTest(groups = {"dragon-warrior"}) + public void beforeTest() {} + + @AfterTest(groups = {"dragon-warrior"}) + public void afterTest() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/issue2611/TestClassFailsAtBeforeSuiteWithBeforeGroupsSuiteTestSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2611/TestClassFailsAtBeforeSuiteWithBeforeGroupsSuiteTestSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/issue2611/TestClassFailsAtBeforeSuiteWithBeforeGroupsSuiteTestSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2611/TestClassFailsAtBeforeSuiteWithBeforeGroupsSuiteTestSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,32 @@ +package test.reports.issue2611; + +import org.testng.Assert; +import org.testng.annotations.AfterGroups; +import org.testng.annotations.AfterSuite; +import org.testng.annotations.AfterTest; +import org.testng.annotations.BeforeGroups; +import org.testng.annotations.BeforeSuite; +import org.testng.annotations.BeforeTest; + +public class TestClassFailsAtBeforeSuiteWithBeforeGroupsSuiteTestSample { + + @BeforeGroups(groups = {"dragon-warrior"}) + public void beforeGroups() {} + + @AfterGroups(groups = {"dragon-warrior"}) + public void afterGroups() {} + + @BeforeSuite(groups = {"dragon-warrior"}) + public void beforeSuite() { + Assert.fail(); + } + + @AfterSuite(groups = {"dragon-warrior"}) + public void afterSuite() {} + + @BeforeTest(groups = {"dragon-warrior"}) + public void beforeTest() {} + + @AfterTest(groups = {"dragon-warrior"}) + public void afterTest() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/issue2611/TestClassFailsAtBeforeTestWithBeforeGroupsSuiteTestSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2611/TestClassFailsAtBeforeTestWithBeforeGroupsSuiteTestSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/issue2611/TestClassFailsAtBeforeTestWithBeforeGroupsSuiteTestSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2611/TestClassFailsAtBeforeTestWithBeforeGroupsSuiteTestSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,32 @@ +package test.reports.issue2611; + +import org.testng.Assert; +import org.testng.annotations.AfterGroups; +import org.testng.annotations.AfterSuite; +import org.testng.annotations.AfterTest; +import org.testng.annotations.BeforeGroups; +import org.testng.annotations.BeforeSuite; +import org.testng.annotations.BeforeTest; + +public class TestClassFailsAtBeforeTestWithBeforeGroupsSuiteTestSample { + + @BeforeGroups(groups = {"dragon-warrior"}) + public void beforeGroups() {} + + @AfterGroups(groups = {"dragon-warrior"}) + public void afterGroups() {} + + @BeforeSuite(groups = {"dragon-warrior"}) + public void beforeSuite() {} + + @AfterSuite(groups = {"dragon-warrior"}) + public void afterSuite() {} + + @BeforeTest(groups = {"dragon-warrior"}) + public void beforeTest() { + Assert.fail(); + } + + @AfterTest(groups = {"dragon-warrior"}) + public void afterTest() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/issue2611/TestClassWithBeforeGroupsSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2611/TestClassWithBeforeGroupsSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/issue2611/TestClassWithBeforeGroupsSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2611/TestClassWithBeforeGroupsSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.reports.issue2611; + +import org.testng.Assert; +import org.testng.annotations.AfterGroups; +import org.testng.annotations.BeforeGroups; + +public class TestClassWithBeforeGroupsSample { + + @BeforeGroups(groups = {"dragon-warrior"}) + public void beforeGroups() { + Assert.fail(); + } + + @AfterGroups(groups = {"dragon-warrior"}) + public void afterGroups() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/issue2611/TestClassWithBeforeSuiteSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2611/TestClassWithBeforeSuiteSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/issue2611/TestClassWithBeforeSuiteSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2611/TestClassWithBeforeSuiteSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.reports.issue2611; + +import org.testng.Assert; +import org.testng.annotations.AfterSuite; +import org.testng.annotations.BeforeSuite; + +public class TestClassWithBeforeSuiteSample { + + @BeforeSuite(groups = {"dragon-warrior"}) + public void beforeSuite() { + Assert.fail(); + } + + @AfterSuite(groups = {"dragon-warrior"}) + public void afterSuite() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/issue2611/TestClassWithBeforeTestSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2611/TestClassWithBeforeTestSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/issue2611/TestClassWithBeforeTestSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2611/TestClassWithBeforeTestSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.reports.issue2611; + +import org.testng.Assert; +import org.testng.annotations.AfterTest; +import org.testng.annotations.BeforeTest; + +public class TestClassWithBeforeTestSample { + + @BeforeTest(groups = {"dragon-warrior"}) + public void beforeTest() { + Assert.fail(); + } + + @AfterTest(groups = {"dragon-warrior"}) + public void afterTest() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/issue2611/TestClassWithJustTestMethodsSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2611/TestClassWithJustTestMethodsSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/reports/issue2611/TestClassWithJustTestMethodsSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/reports/issue2611/TestClassWithJustTestMethodsSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.reports.issue2611; + +import org.testng.annotations.Test; + +public class TestClassWithJustTestMethodsSample { + + @Test(groups = {"dragon-warrior"}) + public void test2Method() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/EventualSuccess.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/EventualSuccess.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/EventualSuccess.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/EventualSuccess.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.retryAnalyzer; + +import java.util.concurrent.atomic.AtomicBoolean; +import org.testng.Assert; +import org.testng.annotations.Test; + +public class EventualSuccess { + private static final AtomicBoolean ranYet = new AtomicBoolean(false); + + @Test(retryAnalyzer = MyRetry.class) + public void test() { + if (!ranYet.getAndSet(true)) { + Assert.fail(); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/ExitCodeTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/ExitCodeTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/ExitCodeTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/ExitCodeTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,47 @@ +package test.retryAnalyzer; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertTrue; + +import org.testng.ITestNGListener; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class ExitCodeTest extends SimpleBaseTest { + @Test + public void exitsWithZeroOnSuccess() { + TestNG tng = create(ImmediateSuccess.class); + tng.run(); + assertEquals(tng.getStatus(), 0); + } + + @Test + public void exitsWithNonzeroOnFailure() { + TestNG tng = create(PersistentFailure.class); + tng.run(); + assertTrue(tng.getStatus() != 0); + } + + @Test + public void exitsWithZeroAfterSuccessfulRetry() { + TestNG tng = create(EventualSuccess.class); + tng.addListener((ITestNGListener) new TestResultPruner()); + tng.run(); + assertEquals(tng.getStatus(), 0); + } + + @Test(description = "GITHUB-217") + public void exitWithNonzeroOnSkips() { + TestNG tng = create(Issue217TestClassSample.class); + tng.run(); + assertEquals(tng.getStatus(), 2); + } + + @Test(description = "GITHUB-217") + public void exitWithNonzeroOnSkips1() { + TestNG tng = create(Issue217TestClassSampleWithOneDataProvider.class); + tng.run(); + assertEquals(tng.getStatus(), 2); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/FactoryTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/FactoryTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/FactoryTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/FactoryTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,32 @@ +package test.retryAnalyzer; + +import static org.testng.Assert.fail; + +import org.testng.ITest; +import org.testng.annotations.Test; +import org.testng.log4testng.Logger; + +public class FactoryTest implements ITest { + private static final Logger log = Logger.getLogger(FactoryTest.class); + public static int m_count = 0; + + private String name; + + public FactoryTest(String name) { + this.name = name; + } + + @Override + public String getTestName() { + return name; + } + + @Test(retryAnalyzer = MyRetry.class) + public void someTest1() { + log.debug("Test Called : " + this.name); + if (name.contains("5")) { + m_count++; + fail(); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/ImmediateSuccess.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/ImmediateSuccess.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/ImmediateSuccess.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/ImmediateSuccess.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ +package test.retryAnalyzer; + +import org.testng.annotations.Test; + +public class ImmediateSuccess { + @Test(retryAnalyzer = MyRetry.class) + public void test() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/InvocationCountTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/InvocationCountTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/InvocationCountTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/InvocationCountTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,179 @@ +package test.retryAnalyzer; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.fail; + +import com.google.common.collect.ConcurrentHashMultiset; +import com.google.common.collect.Multiset; +import java.util.concurrent.atomic.AtomicInteger; +import org.testng.IRetryAnalyzer; +import org.testng.ITestResult; +import org.testng.TestNG; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +/** + * retryAnalyzer parameter unit tests. + * + * @author tocman@gmail.com (Jeremie Lenfant-Engelmann) + */ +public final class InvocationCountTest implements IRetryAnalyzer { + static final Multiset invocations = ConcurrentHashMultiset.create(); + private static final AtomicInteger retriesRemaining = new AtomicInteger(100); + private static final int MAX_RETRY = 2; + + static int tcid1 = 0; + static int tcid2 = 0; + static int tcid3 = 0; + + private int r1 = 0; + private int r2 = 1; + private int r3 = 0; + private int r7 = 0; + private static int value = 42; + private int executionNumber = 0; + + @Test(retryAnalyzer = InvocationCountTest.class) + public void testAnnotationWithNoRetries() {} + + @Test(retryAnalyzer = InvocationCountTest.class) + public void testAnnotationWithOneRetry() { + if (r1++ < 1) { + fail(); + } + } + + @Test(retryAnalyzer = InvocationCountTest.class) + public void testAnnotationWithSevenRetries() { + if (r7++ < 7) { + fail(); + } + } + + @Test(retryAnalyzer = ThreeRetries.class, successPercentage = 0) + public void failAfterThreeRetries() { + fail(); + } + + @Test( + dependsOnMethods = { + "testAnnotationWithNoRetries", + "testAnnotationWithOneRetry", + "testAnnotationWithSevenRetries", + "failAfterThreeRetries" + }, + alwaysRun = true) + public void checkInvocationCounts() { + assertEquals(invocations.count("testAnnotationWithNoRetries"), 0); + assertEquals(invocations.count("testAnnotationWithOneRetry"), 1); + assertEquals(invocations.count("testAnnotationWithSevenRetries"), 7); + assertEquals(invocations.count("failAfterThreeRetries"), 4); + } + + @Test(retryAnalyzer = InvocationCountTest.class, dataProvider = "dataProvider3") + public void retryWithDataProvider(String tc) { + if ("tc1".equals(tc)) { + + if (tcid1++ < MAX_RETRY) { + fail(); + } + } + if ("tc2".equals(tc)) { + if (tcid2++ < MAX_RETRY) { + fail(); + } + } + if ("tc3".equals(tc)) { + if (tcid3++ < MAX_RETRY) { + fail(); + } + } + } + + @Test( + dependsOnMethods = {"retryWithDataProvider"}, + alwaysRun = true) + public void checkRetryCounts() { + assertEquals(tcid1, 3); + assertEquals(tcid2, 3); + assertEquals(tcid3, 3); + } + + @DataProvider(name = "dataProvider") + private Object[][] dataProvider() { + return new Object[][] {{1, true}, {2, false}, {3, true}, {4, false}}; + } + + @DataProvider(name = "dataProvider2") + private Object[][] dataProvider2() { + value = 42; + + return new Object[][] {{true}, {true}}; + } + + @DataProvider(name = "dataProvider3") + private Object[][] dataProvider3() { + return new Object[][] {{"tc1"}, {"tc2"}, {"tc3"}}; + } + + @Test(retryAnalyzer = InvocationCountTest.class, dataProvider = "dataProvider") + public void testAnnotationWithDataProvider(int paf, boolean test) { + executionNumber++; + if (paf == 2 && test == false) { + if (r2 >= 1) { + r2--; + fail(); + } + } + if (paf == 4) { + assertEquals(executionNumber, 5); + } + } + + @Test(retryAnalyzer = InvocationCountTest.class, dataProvider = "dataProvider2") + public void testAnnotationWithDataProviderAndRecreateParameters(boolean dummy) { + if (r3 == 1) { + this.value = 0; + r3--; + fail(); + } else if (r3 == 0) { + assertEquals(this.value, 42); + } + } + + @Test + public void withFactory() { + TestNG tng = new TestNG(); + tng.setTestClasses(new Class[] {MyFactory.class}); + FactoryTest.m_count = 0; + + tng.run(); + + assertEquals(FactoryTest.m_count, 4); + } + + @Override + public boolean retry(ITestResult result) { + invocations.add(result.getName()); + return retriesRemaining.getAndDecrement() >= 0; + } + + public static class ThreeRetries implements IRetryAnalyzer { + private final AtomicInteger remainingRetries = new AtomicInteger(3); + + @Override + public boolean retry(ITestResult result) { + invocations.add(result.getName()); + return remainingRetries.getAndDecrement() > 0; + } + } + + public static class RetryCountTest implements IRetryAnalyzer { + private final AtomicInteger remainingRetries = new AtomicInteger(12); + + @Override + public boolean retry(ITestResult result) { + return remainingRetries.getAndDecrement() > 0; + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/Issue217TestClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/Issue217TestClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/Issue217TestClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/Issue217TestClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.retryAnalyzer; + +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class Issue217TestClassSample { + @Test + public void a() {} + + @Test(dataProvider = "dp") + public void testMethod(int i) { + Assert.assertTrue(i > 0); + } + + @DataProvider(name = "dp") + public Object[][] getData() { + throw new RuntimeException("Simulating a failure"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/Issue217TestClassSampleWithOneDataProvider.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/Issue217TestClassSampleWithOneDataProvider.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/Issue217TestClassSampleWithOneDataProvider.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/Issue217TestClassSampleWithOneDataProvider.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package test.retryAnalyzer; + +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class Issue217TestClassSampleWithOneDataProvider { + @Test(dataProvider = "dp") + public void testMethod(int i) { + Assert.assertTrue(i > 0); + } + + @DataProvider(name = "dp") + public Object[][] getData() { + throw new RuntimeException("Simulating a failure"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/MyFactory.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/MyFactory.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/MyFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/MyFactory.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.retryAnalyzer; + +import org.testng.annotations.Factory; + +public class MyFactory { + @Factory + public Object[] createTests() { + int num = 10; + Object[] result = new Object[num]; + for (int i = 0; i < num; i++) { + FactoryTest obj = new FactoryTest("Test" + i); + result[i] = obj; + } + return result; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/MyRetry.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/MyRetry.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/MyRetry.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/MyRetry.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package test.retryAnalyzer; + +import org.testng.ITestResult; +import org.testng.util.RetryAnalyzerCount; + +public class MyRetry extends RetryAnalyzerCount { + + public MyRetry() { + setCount(3); + } + + @Override + public boolean retryMethod(ITestResult arg0) { + // TODO Auto-generated method stub + return true; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/PersistentFailure.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/PersistentFailure.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/PersistentFailure.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/PersistentFailure.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.retryAnalyzer; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class PersistentFailure { + @Test(retryAnalyzer = MyRetry.class) + public void test() { + Assert.fail(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/RetryAnalyzerTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/RetryAnalyzerTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/RetryAnalyzerTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/RetryAnalyzerTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,306 @@ +package test.retryAnalyzer; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; +import org.testng.Assert; +import org.testng.ITestResult; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import org.testng.collections.Maps; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.InvokedMethodNameListener; +import test.SimpleBaseTest; +import test.retryAnalyzer.dataprovider.issue2163.TestClassPoweredByDataProviderSample; +import test.retryAnalyzer.github1519.MyListener; +import test.retryAnalyzer.github1519.TestClassSample; +import test.retryAnalyzer.github1600.Github1600Listener; +import test.retryAnalyzer.github1600.Github1600TestSample; +import test.retryAnalyzer.github1706.DataDrivenSample; +import test.retryAnalyzer.github1706.NativeInjectionSample; +import test.retryAnalyzer.github1706.ParameterInjectionSample; +import test.retryAnalyzer.github2669.RetryTestSample; +import test.retryAnalyzer.issue1241.GitHub1241Sample; +import test.retryAnalyzer.issue1538.TestClassSampleWithTestMethodDependencies; +import test.retryAnalyzer.issue1697.DatadrivenSample; +import test.retryAnalyzer.issue1697.LocalReporter; +import test.retryAnalyzer.issue1697.SampleTestclass; +import test.retryAnalyzer.issue1946.RetryAnalyzer; +import test.retryAnalyzer.issue1946.TestclassSample1; +import test.retryAnalyzer.issue1946.TestclassSample2; +import test.retryAnalyzer.issue2684.SampleTestClassWithGroupConfigs; + +public class RetryAnalyzerTest extends SimpleBaseTest { + @Test + public void testInvocationCounts() { + TestNG tng = create(InvocationCountTest.class); + TestListenerAdapter tla = new TestListenerAdapter(); + tng.addListener(new TestResultPruner()); + tng.addListener(tla); + + tng.run(); + + assertThat(tla.getFailedTests()).isEmpty(); + + List fsp = tla.getFailedButWithinSuccessPercentageTests(); + assertThat(fsp).hasSize(1); + assertThat(fsp.get(0).getName()).isEqualTo("failAfterThreeRetries"); + + List skipped = tla.getSkippedTests(); + assertThat(skipped).hasSize(InvocationCountTest.invocations.size() - fsp.size()); + } + + @Test + public void testIfRetryIsInvokedBeforeListener() { + TestNG tng = create(TestClassSample.class); + tng.addListener(new MyListener()); + tng.run(); + assertThat(TestClassSample.messages) + .containsExactly("afterInvocation", "retry", "afterInvocation"); + } + + @Test(description = "GITHUB-1600") + public void testIfRetryIsInvokedBeforeListenerButHasToConsiderFailures() { + TestNG tng = create(Github1600TestSample.class); + Github1600Listener listener = new Github1600Listener(); + TestListenerAdapter tla = new TestListenerAdapter(); + tng.addListener(tla); + tng.addListener(listener); + tng.run(); + assertThat(tla.getFailedTests()).hasSize(1); + assertThat(tla.getSkippedTests()).hasSize(1); + } + + @Test(description = "GITHUB-1706", dataProvider = "1706") + public void testIfRetryIsInvokedWhenTestMethodHas( + Class clazz, int size, Map parameters) { + XmlSuite xmlsuite = createXmlSuite("suite"); + XmlTest xmlTest = createXmlTest(xmlsuite, "test", clazz); + if (!parameters.isEmpty()) { + xmlTest.setParameters(parameters); + } + TestNG tng = create(); + tng.setXmlSuites(Collections.singletonList(xmlsuite)); + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener(listener); + tng.run(); + assertThat(listener.getSkippedMethodNames().size()).isEqualTo(size); + } + + @DataProvider(name = "1706") + public Object[][] getData() { + return new Object[][] { + {NativeInjectionSample.class, 2, Maps.newHashMap()}, + {DataDrivenSample.class, 4, Maps.newHashMap()}, + {ParameterInjectionSample.class, 2, constructParameterMap()} + }; + } + + @Test(description = "GITHUB-1538") + public void testIfDependentMethodsAreInvokedWhenRetrySucceeds() { + TestNG testng = create(TestClassSampleWithTestMethodDependencies.class); + TestListenerAdapter tla = new TestListenerAdapter(); + testng.addListener(tla); + testng.run(); + assertThat( + tla.getPassedTests().stream() + .map(RetryAnalyzerTest::methodName) + .collect(Collectors.toList())) + .containsExactly("a", "b"); + assertThat(tla.getFailedTests()).isEmpty(); + assertThat( + tla.getSkippedTests().stream() + .map(RetryAnalyzerTest::methodName) + .collect(Collectors.toList())) + .containsExactly("a"); + } + + @Test(description = "GITHUB-1241") + public void testToEnsureNewRetryAnalyzerInstanceUsedPerTest() { + XmlSuite suite = createXmlSuite("Test Suite", "Test One", GitHub1241Sample.class); + createXmlTest(suite, "Test Two", GitHub1241Sample.class); + + TestNG tng = create(suite); + + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener(listener); + + tng.run(); + + assertThat(listener.getInvokedMethodNames()) + .containsExactly("test1", "test2", "test2", "test1", "test2", "test2"); + } + + @Test(description = "GITHUB-1697") + public void ensureRetriedMethodsAreDistinguishable() { + XmlSuite xmlsuite = createXmlSuite("1697_suite"); + createXmlTest(xmlsuite, "1697_test", SampleTestclass.class); + TestNG testng = create(xmlsuite); + LocalReporter reporter = new LocalReporter(); + testng.addListener(reporter); + testng.run(); + runAssertions(reporter.getRetried(), "dataDrivenTest"); + runAssertions(reporter.getSkipped(), "child"); + } + + @Test + public void ensureRetriedMethodsAreDistinguishableInDataDrivenTests() { + XmlSuite xmlsuite = createXmlSuite("1697_suite"); + createXmlTest(xmlsuite, "1697_test", DatadrivenSample.class); + TestNG testng = create(xmlsuite); + LocalReporter reporter = new LocalReporter(); + testng.addListener(reporter); + testng.run(); + ITestResult firstResult = runAssertions(reporter.getRetried(), "testMethod"); + assertThat(firstResult.getParameters()).containsAll(Collections.singletonList(1)); + } + + @Test(description = "GITHUB-1946") + public void ensureRetriesHappenForDataDrivenTests() { + List expected = + Arrays.asList( + "Attempt #0. Retry :true Test method : " + + TestclassSample1.class.getName() + + ".test1(), Parameters : [param1, value1]", + "Attempt #1. Retry :false Test method : " + + TestclassSample1.class.getName() + + ".test1(), Parameters : [param1, value1]", + "Attempt #0. Retry :true Test method : " + + TestclassSample1.class.getName() + + ".test1(), Parameters : [param2, value2]", + "Attempt #1. Retry :false Test method : " + + TestclassSample1.class.getName() + + ".test1(), Parameters : [param2, value2]", + "Attempt #0. Retry :true Test method : " + + TestclassSample1.class.getName() + + ".test2(), Parameters : [param1, value1]", + "Attempt #1. Retry :false Test method : " + + TestclassSample1.class.getName() + + ".test2(), Parameters : [param1, value1]", + "Attempt #0. Retry :true Test method : " + + TestclassSample1.class.getName() + + ".test2(), Parameters : [param2, value2]", + "Attempt #1. Retry :false Test method : " + + TestclassSample1.class.getName() + + ".test2(), Parameters : [param2, value2]", + "Attempt #0. Retry :true Test method : " + + TestclassSample2.class.getName() + + ".test1(), Parameters : [param1, value1]", + "Attempt #1. Retry :false Test method : " + + TestclassSample2.class.getName() + + ".test1(), Parameters : [param1, value1]", + "Attempt #0. Retry :true Test method : " + + TestclassSample2.class.getName() + + ".test1(), Parameters : [param2, value2]", + "Attempt #1. Retry :false Test method : " + + TestclassSample2.class.getName() + + ".test1(), Parameters : [param2, value2]", + "Attempt #0. Retry :true Test method : " + + TestclassSample2.class.getName() + + ".test3(), Parameters : [param1, value1]", + "Attempt #1. Retry :false Test method : " + + TestclassSample2.class.getName() + + ".test3(), Parameters : [param1, value1]", + "Attempt #0. Retry :true Test method : " + + TestclassSample2.class.getName() + + ".test3(), Parameters : [param2, value2]", + "Attempt #1. Retry :false Test method : " + + TestclassSample2.class.getName() + + ".test3(), Parameters : [param2, value2]", + "Attempt #0. Retry :true Test method : " + + TestclassSample2.class.getName() + + ".test4(), Parameters : [param1, value1]", + "Attempt #1. Retry :false Test method : " + + TestclassSample2.class.getName() + + ".test4(), Parameters : [param1, value1]", + "Attempt #0. Retry :true Test method : " + + TestclassSample2.class.getName() + + ".test4(), Parameters : [param2, value2]", + "Attempt #1. Retry :false Test method : " + + TestclassSample2.class.getName() + + ".test4(), Parameters : [param2, value2]"); + XmlSuite xmlsuite = createXmlSuite("1946_suite"); + createXmlTest(xmlsuite, "1946_test", TestclassSample1.class, TestclassSample2.class); + TestNG testng = create(xmlsuite); + testng.run(); + assertThat(RetryAnalyzer.logs).containsExactlyElementsOf(expected); + } + + @Test(description = "GITHUB-2163 & GITHUB-2280", timeOut = 5000) + public void ensureRetryDoesntRunEndlesslyForDataDrivenTests() { + XmlSuite xmlsuite = createXmlSuite("2163_suite"); + createXmlTest(xmlsuite, "2163_test", TestClassPoweredByDataProviderSample.class); + TestNG testng = create(xmlsuite); + testng.run(); + assertThat(test.retryAnalyzer.dataprovider.issue2163.RetryAnalyzer.logs).hasSize(21); + } + + @Test(description = "GITHUB-2669") + public void testFailedRetryWithParameters() { + Map params = new HashMap<>(); + params.put("id", "1111"); + params.put("name", "qa"); + params.put("age", "30"); + XmlSuite suite = createXmlSuite("GITHUB_2669", params); + + createXmlTest(suite, "2669_Test", RetryTestSample.class); + TestNG testng = create(suite); + testng.run(); + Assert.assertEquals(RetryTestSample.count, 3); + } + + @Test(description = "GITHUB-2684") + public void testAfterConfigurationsInvokedAfterRetriedMethod() { + XmlSuite xmlSuite = createXmlSuite("2684_suite"); + createXmlTest(xmlSuite, "2684_test", SampleTestClassWithGroupConfigs.class); + createXmlGroups(xmlSuite, "2684_group"); + TestNG testng = create(xmlSuite); + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + testng.addListener(listener); + testng.run(); + + String[] expected = { + "beforeSuite", + "beforeTest", + "beforeClass", + "beforeGroups", + "beforeMethod", + "testMethod", + "afterMethod", + "beforeMethod", + "testMethod", + "afterMethod", + "afterGroups", + "afterClass", + "afterTest", + "afterSuite" + }; + assertThat(listener.getInvokedMethodNames()).containsExactly(expected); + } + + private ITestResult runAssertions(Set results, String methodName) { + assertThat(results).hasSize(1); + ITestResult firstResult = results.iterator().next(); + assertThat(firstResult.getMethod().getMethodName()).isEqualToIgnoringCase(methodName); + return firstResult; + } + + private static String methodName(ITestResult result) { + return result.getMethod().getMethodName(); + } + + private static Map constructParameterMap() { + Map map = Maps.newHashMap(); + map.put("counter", "3"); + return map; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/TestResultPruner.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/TestResultPruner.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/TestResultPruner.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/TestResultPruner.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +package test.retryAnalyzer; + +import java.util.Set; +import org.testng.ITestContext; +import org.testng.ITestNGMethod; +import org.testng.ITestResult; +import org.testng.TestListenerAdapter; + +public class TestResultPruner extends TestListenerAdapter { + + @Override + public void onFinish(ITestContext context) { + for (ITestNGMethod method : context.getAllTestMethods()) { + Set passed = context.getPassedTests().getResults(method); + Set skipped = context.getSkippedTests().getResults(method); + Set failed = context.getFailedTests().getResults(method); + Set failedWithinSuccess = + context.getFailedButWithinSuccessPercentageTests().getResults(method); + if (!passed.isEmpty() && !skipped.isEmpty()) { + context.getSkippedTests().removeResult(method); + } + if (((!failedWithinSuccess.isEmpty()) || (!failed.isEmpty())) && !skipped.isEmpty()) { + context.getSkippedTests().removeResult(method); + } + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/ComplexDataProviderWithObjectAndArraySample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/ComplexDataProviderWithObjectAndArraySample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/ComplexDataProviderWithObjectAndArraySample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/ComplexDataProviderWithObjectAndArraySample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +package test.retryAnalyzer.dataprovider; + +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class ComplexDataProviderWithObjectAndArraySample { + private static int countWithObjectAndStringArrayForSuccess = 3; + + @DataProvider(name = "getObjectData") + public Object[][] getObjectData() { + return new Object[][] {new Object[] {false, "abc1", "cdf1"}}; + } + + // Test retry-analyzer with complex data-provider end result as passed after 3 successful retry + // attempts + @Test(dataProvider = "getObjectData", retryAnalyzer = DataProviderRetryAnalyzer.class) + public void test(boolean flag, String... values) { + Assert.assertTrue( + countWithObjectAndStringArrayForSuccess-- == 0, + "Test execution is not" + + "successful after 3 retry attempts configured in retryAnalyzer for this data " + + values + + "with boolean flag as " + + flag); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/DataProviderRetryAnalyzer.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/DataProviderRetryAnalyzer.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/DataProviderRetryAnalyzer.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/DataProviderRetryAnalyzer.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,31 @@ +package test.retryAnalyzer.dataprovider; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.atomic.AtomicInteger; +import org.testng.IRetryAnalyzer; +import org.testng.ITestResult; + +public class DataProviderRetryAnalyzer implements IRetryAnalyzer { + + private static final int MAX_RETRY_COUNT = 3; + + private final Map counts = new HashMap<>(); + + private AtomicInteger getCount(ITestResult result) { + int id = Arrays.hashCode(result.getParameters()); + AtomicInteger count = counts.get(id); + if (count == null) { + count = new AtomicInteger(MAX_RETRY_COUNT); + counts.put(id, count); + } + return count; + } + + @Override + public boolean retry(ITestResult result) { + int retriesRemaining = getCount(result).getAndDecrement(); + return retriesRemaining > 0; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/DataProviderWithRetryAttemptsFailure.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/DataProviderWithRetryAttemptsFailure.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/DataProviderWithRetryAttemptsFailure.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/DataProviderWithRetryAttemptsFailure.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,26 @@ +package test.retryAnalyzer.dataprovider; + +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class DataProviderWithRetryAttemptsFailure { + private static int countWithObjectAndStringArrayForFailure = 3; + + @DataProvider(name = "getObjectData") + public Object[][] getObjectData() { + return new Object[][] {new Object[] {false, "abc1", "cdf1"}}; + } + + // Test retry-analyzer with end result as failed after 3 successful retry attempts + @Test(dataProvider = "getObjectData", retryAnalyzer = DataProviderRetryAnalyzer.class) + public void test(boolean flag, String... values) { + Assert.assertTrue( + flag, + "Test execution is not" + + "successful after 3 retry attempts configured in retryAnalyzer for this data " + + values + + "with boolean flag as " + + flag); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/DataProviderWithSingleParam.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/DataProviderWithSingleParam.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/DataProviderWithSingleParam.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/DataProviderWithSingleParam.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,43 @@ +package test.retryAnalyzer.dataprovider; + +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class DataProviderWithSingleParam { + private static int countWithSingleParam1 = 3; + private static int countWithSingleParam2 = 3; + + @DataProvider(name = "getSingleParam", parallel = true) + public Object[][] getSingleParam() { + return new Integer[][] {new Integer[] {1}, new Integer[] {2}}; + } + + // Test retry-analyzer with end result as passed after 3 successful retry attempts while passing 2 + // integer array of objects individually with parallel as true. Since we have two integer arrays, + // the number of + // test-cases in this scenario are 2. Verify if tests are passing successfully after 3 successful + // attempts each. + @Test(dataProvider = "getSingleParam", retryAnalyzer = DataProviderRetryAnalyzer.class) + public void test(int param) { + // If the param is 1 then decrement the counter countWithSingleParam1 and assert true to check + // if it is 0. + if (param == 1) { + Assert.assertTrue( + countWithSingleParam1-- == 0, + "Test execution is not" + + "successful after 3 retry attempts configured in retryAnalyzer for this data " + + param); + } + + // If the param is 2 then decrement the counter countWithSingleParam2 and assert true to check + // if it is 0. + if (param == 2) { + Assert.assertTrue( + countWithSingleParam2-- == 0, + "Test execution is not" + + "successful after 3 retry attempts configured in retryAnalyzer for this data " + + param); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/DataProviderWithStringArraySample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/DataProviderWithStringArraySample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/DataProviderWithStringArraySample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/DataProviderWithStringArraySample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,25 @@ +package test.retryAnalyzer.dataprovider; + +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class DataProviderWithStringArraySample { + private static int countWithStringArray = 3; + + @DataProvider(name = "getTestData") + public Object[][] getTestData() { + return new String[][] {new String[] {"abc1", "cdf1"}}; + } + + // Test with string array of objects in data-provider with end result as true after 3 successful + // retry attempts + @Test(dataProvider = "getTestData", retryAnalyzer = DataProviderRetryAnalyzer.class) + public void test(String... values) { + Assert.assertTrue( + countWithStringArray-- == 0, + "Test execution is not" + + "successful after 3 retry attempts configured in retryAnalyzer for this data " + + values); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/RetryAnalyzerWithComplexDataProviderTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/RetryAnalyzerWithComplexDataProviderTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/RetryAnalyzerWithComplexDataProviderTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/RetryAnalyzerWithComplexDataProviderTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,77 @@ +package test.retryAnalyzer.dataprovider; + +import static org.testng.Assert.assertEquals; + +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class RetryAnalyzerWithComplexDataProviderTest extends SimpleBaseTest { + + // Test without data-provider with end result as success after 3 retry attempts + @Test(description = "GITHUB-2148") + public void testWithoutDataProvider() { + TestNG testng = create(RetryAnalyzerWithoutDataProvider.class); + TestListenerAdapter tla = new TestListenerAdapter(); + testng.addListener(tla); + testng.run(); + assertEquals(tla.getPassedTests().size(), 1); + assertEquals(tla.getFailedTests().size(), 0); + assertEquals(tla.getSkippedTests().size(), 3); + } + + // Test with string array of objects in data-provider with end result as success after 3 retry + // attempts + @Test(description = "GITHUB-2148") + public void testWithDataProviderStringArray() { + TestNG testng = create(DataProviderWithStringArraySample.class); + TestListenerAdapter tla = new TestListenerAdapter(); + testng.addListener(tla); + testng.run(); + assertEquals(tla.getPassedTests().size(), 1); + assertEquals(tla.getFailedTests().size(), 0); + assertEquals(tla.getSkippedTests().size(), 3); + } + + // Test with multiple integer arrays in data-provider when parallel mode on and end result as + // success + // after 3 retry attempts + @Test(description = "GITHUB-2148") + public void testWithSingleParam() { + TestNG testng = create(DataProviderWithSingleParam.class); + TestListenerAdapter tla = new TestListenerAdapter(); + testng.addListener(tla); + testng.run(); + // Since 2 integer arrays are passing inside data-provider, number of test cases should be 2 + assertEquals(tla.getPassedTests().size(), 2); + assertEquals(tla.getFailedTests().size(), 0); + assertEquals( + tla.getSkippedTests().size(), + 6); // Number of total skipped count should be 6, each for a test + } + + // Test with objects in data-provider with result as success after 3 retry attempts + @Test(description = "GITHUB-2148") + public void testWithDataProviderWithObjectAndArraySample() { + TestNG testng = create(ComplexDataProviderWithObjectAndArraySample.class); + TestListenerAdapter tla = new TestListenerAdapter(); + testng.addListener(tla); + testng.run(); + assertEquals(tla.getPassedTests().size(), 1); + assertEquals(tla.getFailedTests().size(), 0); + assertEquals(tla.getSkippedTests().size(), 3); + } + + // Test with objects in data-provider with result as failed after 3 retry attempts + @Test(description = "GITHUB-2148") + public void testDataProviderWithRetryAttemptsFailure() { + TestNG testng = create(DataProviderWithRetryAttemptsFailure.class); + TestListenerAdapter tla = new TestListenerAdapter(); + testng.addListener(tla); + testng.run(); + assertEquals(tla.getFailedTests().size(), 1); + assertEquals(tla.getPassedTests().size(), 0); + assertEquals(tla.getSkippedTests().size(), 3); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/RetryAnalyzerWithDataProviderTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/RetryAnalyzerWithDataProviderTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/RetryAnalyzerWithDataProviderTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/RetryAnalyzerWithDataProviderTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +package test.retryAnalyzer.dataprovider; + +import static org.testng.Assert.assertEquals; + +import org.testng.ITestNGListener; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class RetryAnalyzerWithDataProviderTest extends SimpleBaseTest { + + @Test + public void testRetryCounts() { + TestNG tng = create(RetryCountTest.class); + TestListenerAdapter tla = new TestListenerAdapter(); + tng.addListener((ITestNGListener) tla); + + tng.run(); + + assertEquals(tla.getPassedTests().size(), 1); + assertEquals(tla.getPassedTests().get(0).getParameters(), new String[] {"c"}); + + assertEquals(tla.getFailedTests().size(), 3); + assertEquals(tla.getSkippedTests().size(), 9); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/RetryAnalyzerWithoutDataProvider.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/RetryAnalyzerWithoutDataProvider.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/RetryAnalyzerWithoutDataProvider.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/RetryAnalyzerWithoutDataProvider.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.retryAnalyzer.dataprovider; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class RetryAnalyzerWithoutDataProvider { + private static int countWithoutDataProvider = 3; + + // Test retry-analyzer without data-provider with end result as passed after 3 successful retry + // attempts + @Test(retryAnalyzer = DataProviderRetryAnalyzer.class) + public void test() { + Assert.assertTrue(countWithoutDataProvider-- == 0); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/RetryCountTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/RetryCountTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/RetryCountTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/RetryCountTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.retryAnalyzer.dataprovider; + +import static org.testng.Assert.assertEquals; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public final class RetryCountTest { + + @DataProvider + public Object[][] provider() { + return new Object[][] {{"a"}, {"b"}, {"c"}, {"d"}}; + } + + @Test(dataProvider = "provider", retryAnalyzer = DataProviderRetryAnalyzer.class) + public void test1(String param) { + assertEquals(param, "c"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/issue2163/RetryAnalyzer.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/issue2163/RetryAnalyzer.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/issue2163/RetryAnalyzer.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/issue2163/RetryAnalyzer.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.retryAnalyzer.dataprovider.issue2163; + +import java.util.List; +import org.testng.IRetryAnalyzer; +import org.testng.ITestResult; +import org.testng.collections.Lists; + +public class RetryAnalyzer implements IRetryAnalyzer { + + private static final int DEFAULT_MAX_RETRY_COUNT = 3; + private int retryCount = 1; + public static List logs = Lists.newArrayList(); + + @Override + public boolean retry(ITestResult result) { + logs.add("Executing " + result.getMethod().getMethodName()); + return retryCount++ < DEFAULT_MAX_RETRY_COUNT; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/issue2163/TestClassPoweredByDataProviderSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/issue2163/TestClassPoweredByDataProviderSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/issue2163/TestClassPoweredByDataProviderSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/dataprovider/issue2163/TestClassPoweredByDataProviderSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,26 @@ +package test.retryAnalyzer.dataprovider.issue2163; + +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class TestClassPoweredByDataProviderSample { + + @Test(retryAnalyzer = RetryAnalyzer.class, dataProvider = "dpNewObject") + public void willNotStopAfter3Failures(Object... newObject) { + Assert.fail("Kaboom!"); + } + + @DataProvider + public Object[][] dpNewObject() { + return new Object[][] { + {"String as parameter"}, + {"int as parameter", 123}, + {"boolean as parameter", true}, + {"Boolean as parameter", true}, + {"null parameter", null}, + {new Object()}, // GITHUB-2163 + {"GITHUB-2280", new Object[] {new Object()}}, + }; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/github1519/MyAnalyzer.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/github1519/MyAnalyzer.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/github1519/MyAnalyzer.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/github1519/MyAnalyzer.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package test.retryAnalyzer.github1519; + +import org.testng.IRetryAnalyzer; +import org.testng.ITestResult; + +public class MyAnalyzer implements IRetryAnalyzer { + + @Override + public boolean retry(ITestResult iTestResult) { + TestClassSample.messages.add("retry"); + TestClassSample.retry = true; + return true; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/github1519/MyListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/github1519/MyListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/github1519/MyListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/github1519/MyListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.retryAnalyzer.github1519; + +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.ITestResult; + +public class MyListener implements IInvokedMethodListener { + @Override + public void beforeInvocation(IInvokedMethod iInvokedMethod, ITestResult iTestResult) {} + + @Override + public void afterInvocation(IInvokedMethod iInvokedMethod, ITestResult iTestResult) { + TestClassSample.messages.add("afterInvocation"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/github1519/TestClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/github1519/TestClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/github1519/TestClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/github1519/TestClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.retryAnalyzer.github1519; + +import java.util.List; +import org.testng.Assert; +import org.testng.annotations.Test; +import org.testng.collections.Lists; + +public class TestClassSample { + static boolean retry = false; + public static List messages = Lists.newArrayList(); + + @Test(retryAnalyzer = MyAnalyzer.class) + public void testMethod() { + Assert.assertTrue(retry); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/github1600/Github1600Analyzer.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/github1600/Github1600Analyzer.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/github1600/Github1600Analyzer.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/github1600/Github1600Analyzer.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,25 @@ +package test.retryAnalyzer.github1600; + +import org.testng.IRetryAnalyzer; +import org.testng.ITestResult; + +public class Github1600Analyzer implements IRetryAnalyzer { + + static final String RETRY = "RETRY"; + public static final String NO = "NO"; + static final String YES = "YES"; + private static int retryCount = 0; + private static final int MAX_RETRY_COUNT = 10; + + @Override + public boolean retry(ITestResult iTestResult) { + String attribute = (String) iTestResult.getAttribute(RETRY); + if (NO.equalsIgnoreCase(attribute)) { + return false; + } else if (YES.equalsIgnoreCase(attribute) || retryCount < MAX_RETRY_COUNT) { + retryCount++; + return true; + } + return false; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/github1600/Github1600Listener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/github1600/Github1600Listener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/github1600/Github1600Listener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/github1600/Github1600Listener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,37 @@ +package test.retryAnalyzer.github1600; + +import java.lang.reflect.Constructor; +import java.lang.reflect.Method; +import org.testng.IAnnotationTransformer; +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.IRetryAnalyzer; +import org.testng.ITestResult; +import org.testng.annotations.ITestAnnotation; +import org.testng.internal.annotations.DisabledRetryAnalyzer; + +public class Github1600Listener implements IInvokedMethodListener, IAnnotationTransformer { + @Override + public void beforeInvocation(IInvokedMethod iInvokedMethod, ITestResult iTestResult) {} + + @Override + public void afterInvocation(IInvokedMethod iInvokedMethod, ITestResult iTestResult) { + if (iInvokedMethod.isTestMethod()) { + String attribute = Github1600Analyzer.NO; + if (iTestResult.getStatus() == ITestResult.SUCCESS) { + iTestResult.setStatus(ITestResult.FAILURE); + attribute = Github1600Analyzer.YES; + } + iTestResult.setAttribute(Github1600Analyzer.RETRY, attribute); + } + } + + @Override + public void transform( + ITestAnnotation iTestAnnotation, Class aClass, Constructor constructor, Method method) { + Class retry = iTestAnnotation.getRetryAnalyzerClass(); + if (retry.equals(DisabledRetryAnalyzer.class)) { + iTestAnnotation.setRetryAnalyzer(Github1600Analyzer.class); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/github1600/Github1600TestSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/github1600/Github1600TestSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/github1600/Github1600TestSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/github1600/Github1600TestSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package test.retryAnalyzer.github1600; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class Github1600TestSample { + private static int a = 2; + + @Test + public void test1() { + Assert.assertEquals(a, 2); + a++; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/github1706/DataDrivenSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/github1706/DataDrivenSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/github1706/DataDrivenSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/github1706/DataDrivenSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,24 @@ +package test.retryAnalyzer.github1706; + +import java.util.concurrent.atomic.AtomicInteger; +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class DataDrivenSample { + private AtomicInteger counter = new AtomicInteger(0); + + @Test(retryAnalyzer = LocalRetry.class, dataProvider = "getdata") + public void testMethod(int i) { + Assert.assertTrue(i > 0); + if (counter.incrementAndGet() != 3) { + Assert.fail(); + } + counter = new AtomicInteger(0); + } + + @DataProvider(name = "getdata") + public Object[][] getData() { + return new Object[][] {{1}, {2}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/github1706/LocalRetry.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/github1706/LocalRetry.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/github1706/LocalRetry.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/github1706/LocalRetry.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.retryAnalyzer.github1706; + +import org.testng.IRetryAnalyzer; +import org.testng.ITestResult; + +public class LocalRetry implements IRetryAnalyzer { + @Override + public boolean retry(ITestResult result) { + return true; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/github1706/NativeInjectionSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/github1706/NativeInjectionSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/github1706/NativeInjectionSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/github1706/NativeInjectionSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ +package test.retryAnalyzer.github1706; + +import java.lang.reflect.Method; +import java.util.concurrent.atomic.AtomicInteger; +import org.testng.Assert; +import org.testng.annotations.Test; + +public class NativeInjectionSample { + private AtomicInteger counter = new AtomicInteger(0); + + @Test(retryAnalyzer = LocalRetry.class) + public void testMethod(Method method) { + Assert.assertNotNull(method); + if (counter.incrementAndGet() != 3) { + Assert.fail(); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/github1706/ParameterInjectionSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/github1706/ParameterInjectionSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/github1706/ParameterInjectionSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/github1706/ParameterInjectionSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.retryAnalyzer.github1706; + +import java.util.concurrent.atomic.AtomicInteger; +import org.testng.Assert; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; + +public class ParameterInjectionSample { + private AtomicInteger counter = new AtomicInteger(0); + + @Test(retryAnalyzer = LocalRetry.class) + @Parameters({"counter"}) + public void testMethod(int paramCounter) { + Assert.assertTrue(paramCounter > 0); + if (counter.incrementAndGet() != 3) { + Assert.fail(); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/github2669/FailedRetry.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/github2669/FailedRetry.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/github2669/FailedRetry.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/github2669/FailedRetry.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,21 @@ +package test.retryAnalyzer.github2669; + +import org.testng.IRetryAnalyzer; +import org.testng.ITestResult; + +public class FailedRetry implements IRetryAnalyzer { + public static int retryCount = 1; + private static final int maxRetryCount = 3; + + @Override + public boolean retry(ITestResult iTestResult) { + // If an exception is thrown, the failure case will be rerun. If it is an assertion error, try + // again + if (iTestResult.getThrowable() instanceof AssertionError && retryCount % maxRetryCount != 0) { + retryCount++; + return true; + } + retryCount = 1; + return false; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/github2669/RetryTestSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/github2669/RetryTestSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/github2669/RetryTestSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/github2669/RetryTestSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package test.retryAnalyzer.github2669; + +import org.testng.Assert; +import org.testng.ITestContext; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; + +public class RetryTestSample { + public static int count = 0; + + @Parameters({"id", "name", "age"}) + @Test(retryAnalyzer = FailedRetry.class) + public void create(String id, String name, String age, ITestContext context) { + count++; + Assert.fail(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/issue1241/GitHub1241Sample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue1241/GitHub1241Sample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/issue1241/GitHub1241Sample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue1241/GitHub1241Sample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package test.retryAnalyzer.issue1241; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class GitHub1241Sample { + @Test(retryAnalyzer = MyRetry.class) + public void test1() {} + + @Test(retryAnalyzer = MyRetry.class) + public void test2() { + Assert.fail(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/issue1241/MyRetry.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue1241/MyRetry.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/issue1241/MyRetry.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue1241/MyRetry.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.retryAnalyzer.issue1241; + +import org.testng.IRetryAnalyzer; +import org.testng.ITestResult; + +public class MyRetry implements IRetryAnalyzer { + + private int retryCount = 0; + private int maxRetryCount = 1; + + @Override + public boolean retry(ITestResult result) { + if (retryCount < maxRetryCount) { + retryCount++; + return true; + } + return false; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/issue1538/RetryForIssue1538.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue1538/RetryForIssue1538.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/issue1538/RetryForIssue1538.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue1538/RetryForIssue1538.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.retryAnalyzer.issue1538; + +import org.testng.IRetryAnalyzer; +import org.testng.ITestResult; + +public class RetryForIssue1538 implements IRetryAnalyzer { + @Override + public boolean retry(ITestResult result) { + return true; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/issue1538/TestClassSampleWithTestMethodDependencies.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue1538/TestClassSampleWithTestMethodDependencies.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/issue1538/TestClassSampleWithTestMethodDependencies.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue1538/TestClassSampleWithTestMethodDependencies.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ +package test.retryAnalyzer.issue1538; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class TestClassSampleWithTestMethodDependencies { + private int i = 0; + + @Test(retryAnalyzer = RetryForIssue1538.class) + public void a() { + Assert.assertEquals(i++, 1); + } + + @Test(dependsOnMethods = "a", retryAnalyzer = RetryForIssue1538.class) + public void b() { + Assert.assertEquals(i++, 2); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/issue1697/DatadrivenSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue1697/DatadrivenSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/issue1697/DatadrivenSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue1697/DatadrivenSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,22 @@ +package test.retryAnalyzer.issue1697; + +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class DatadrivenSample { + private boolean flag = true; + + @Test(dataProvider = "dp", retryAnalyzer = RetryForDataDrivenTest.class) + public void testMethod(int data) { + if (data == 1 && flag) { + flag = false; + Assert.fail(); + } + } + + @DataProvider(name = "dp") + public Object[][] getData() { + return new Object[][] {{1}, {2}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/issue1697/LocalReporter.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue1697/LocalReporter.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/issue1697/LocalReporter.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue1697/LocalReporter.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,53 @@ +package test.retryAnalyzer.issue1697; + +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; +import org.testng.IReporter; +import org.testng.ISuite; +import org.testng.ISuiteResult; +import org.testng.ITestResult; +import org.testng.collections.Maps; +import org.testng.collections.Sets; +import org.testng.xml.XmlSuite; + +public class LocalReporter implements IReporter { + private Set skipped = Collections.newSetFromMap(Maps.newConcurrentMap()); + private Set retried = Collections.newSetFromMap(Maps.newConcurrentMap()); + + @Override + public void generateReport( + List xmlSuites, List suites, String outputDirectory) { + suites.stream() + .map( + suite -> { + Set results = Sets.newHashSet(); + Collection values = suite.getResults().values(); + for (ISuiteResult value : values) { + results.addAll(value.getTestContext().getSkippedTests().getAllResults()); + } + return results; + }) + .collect(Collectors.toSet()) + .forEach( + iTestResults -> { + for (ITestResult iTestResult : iTestResults) { + if (iTestResult.wasRetried()) { + retried.add(iTestResult); + } else { + skipped.add(iTestResult); + } + } + }); + } + + public Set getRetried() { + return retried; + } + + public Set getSkipped() { + return skipped; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/issue1697/RetryForDataDrivenTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue1697/RetryForDataDrivenTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/issue1697/RetryForDataDrivenTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue1697/RetryForDataDrivenTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.retryAnalyzer.issue1697; + +import org.testng.IRetryAnalyzer; +import org.testng.ITestResult; + +public class RetryForDataDrivenTest implements IRetryAnalyzer { + private int counter = 0; + + @Override + public boolean retry(ITestResult result) { + if (counter++ < 2) { + return true; + } + return false; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/issue1697/SampleTestclass.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue1697/SampleTestclass.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/issue1697/SampleTestclass.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue1697/SampleTestclass.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package test.retryAnalyzer.issue1697; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class SampleTestclass { + public static int counter = 0; + + @Test(retryAnalyzer = SimpleRetrier.class) + public void dataDrivenTest() { + if (counter++ != 1) { + Assert.fail(); + } + } + + @Test + public void parent() { + Assert.fail(); + } + + @Test(dependsOnMethods = "parent") + public void child() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/issue1697/SimpleRetrier.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue1697/SimpleRetrier.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/issue1697/SimpleRetrier.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue1697/SimpleRetrier.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.retryAnalyzer.issue1697; + +import org.testng.IRetryAnalyzer; +import org.testng.ITestResult; + +public class SimpleRetrier implements IRetryAnalyzer { + @Override + public boolean retry(ITestResult result) { + return true; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/issue1946/RetryAnalyzer.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue1946/RetryAnalyzer.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/issue1946/RetryAnalyzer.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue1946/RetryAnalyzer.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,38 @@ +package test.retryAnalyzer.issue1946; + +import java.util.Arrays; +import java.util.List; +import org.testng.IRetryAnalyzer; +import org.testng.ITestResult; +import org.testng.collections.Lists; + +public class RetryAnalyzer implements IRetryAnalyzer { + + public static List logs = Lists.newArrayList(); + + private int retryCount = 0; + private static final int MAX_RETRY_COUNT = 1; + + public boolean retry(ITestResult result) { + String prefix = "Attempt #" + retryCount; + if (retryCount < MAX_RETRY_COUNT) { + if (result.getParameters().length > 0) { + logs.add(prefix + ". Retry :true " + prettyMsg(result)); + } + retryCount++; + return true; + } + logs.add(prefix + ". Retry :false " + prettyMsg(result)); + return false; + } + + private static String prettyMsg(ITestResult result) { + return "Test method : " + + result.getTestClass().getRealClass().getName() + + "." + + result.getMethod().getMethodName() + + "()" + + ", Parameters : " + + Arrays.toString(result.getParameters()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/issue1946/TestclassBase.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue1946/TestclassBase.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/issue1946/TestclassBase.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue1946/TestclassBase.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package test.retryAnalyzer.issue1946; + +import static org.testng.Assert.fail; + +import org.testng.Reporter; +import org.testng.annotations.DataProvider; + +public class TestclassBase { + + @DataProvider + public Object[][] dp() { + return new Object[][] { + {"param1", "value1"}, + {"param2", "value2"} + }; + } + + static void performTest(String username, String password) { + String method = Reporter.getCurrentTestResult().getMethod().getMethodName(); + String txt = String.format("%s() Assertion for (%s, %s)", method, username, password); + fail(txt); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/issue1946/TestclassSample1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue1946/TestclassSample1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/issue1946/TestclassSample1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue1946/TestclassSample1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.retryAnalyzer.issue1946; + +import org.testng.annotations.Test; + +public class TestclassSample1 extends TestclassBase { + + @Test(dataProvider = "dp", retryAnalyzer = RetryAnalyzer.class) + public void test1(String username, String password) { + performTest(username, password); + } + + @Test(dataProvider = "dp", retryAnalyzer = RetryAnalyzer.class) + public void test2(String username, String password) { + performTest(username, password); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/issue1946/TestclassSample2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue1946/TestclassSample2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/issue1946/TestclassSample2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue1946/TestclassSample2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,21 @@ +package test.retryAnalyzer.issue1946; + +import org.testng.annotations.Test; + +public class TestclassSample2 extends TestclassBase { + + @Test(dataProvider = "dp", retryAnalyzer = RetryAnalyzer.class) + public void test1(String username, String password) { + performTest(username, password); + } + + @Test(dataProvider = "dp", retryAnalyzer = RetryAnalyzer.class) + public void test3(String username, String password) { + performTest(username, password); + } + + @Test(dataProvider = "dp", retryAnalyzer = RetryAnalyzer.class) + public void test4(String username, String password) { + performTest(username, password); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/issue2148/ExceptionAfterMethodTestSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue2148/ExceptionAfterMethodTestSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/issue2148/ExceptionAfterMethodTestSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue2148/ExceptionAfterMethodTestSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,35 @@ +package test.retryAnalyzer.issue2148; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; +import org.testng.Assert; +import org.testng.ITestResult; +import org.testng.Reporter; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class ExceptionAfterMethodTestSample { + static final AtomicInteger counter = new AtomicInteger(0); + static final List logs = new ArrayList<>(); + + @BeforeMethod(alwaysRun = true) + public void beforeMethod(ITestResult method) { + logs.add( + "Before Method [" + method.getMethod().getMethodName() + "] #" + counter.incrementAndGet()); + } + + @Test(alwaysRun = true, retryAnalyzer = RetryAnalyzer.class) + public void testMethod() { + ITestResult method = Reporter.getCurrentTestResult(); + logs.add("Test Method [" + method.getMethod().getMethodName() + "] #" + counter.get()); + Assert.fail(); + } + + @AfterMethod(alwaysRun = true) + public void afterMethod(ITestResult method) { + logs.add("Before Method [" + method.getMethod().getMethodName() + "] #" + counter.get()); + throw new RuntimeException("Simulating a failure in AfterMethod"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/issue2148/IssueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue2148/IssueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/issue2148/IssueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue2148/IssueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,28 @@ +package test.retryAnalyzer.issue2148; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite.FailurePolicy; +import test.SimpleBaseTest; + +public class IssueTest extends SimpleBaseTest { + + @Test(description = "GITHUB-2148") + public void ensureTestsAreRetriedWhenConfigFailurePolicySetToContinue() { + TestNG testng = create(ExceptionAfterMethodTestSample.class); + testng.setConfigFailurePolicy(FailurePolicy.CONTINUE); + testng.run(); + String[] expected = + new String[] { + "Before Method [testMethod] #1", + "Test Method [testMethod] #1", + "Before Method [testMethod] #1", + "Before Method [testMethod] #2", + "Test Method [testMethod] #2", + "Before Method [testMethod] #2" + }; + assertThat(ExceptionAfterMethodTestSample.logs).containsExactly(expected); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/issue2148/RetryAnalyzer.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue2148/RetryAnalyzer.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/issue2148/RetryAnalyzer.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue2148/RetryAnalyzer.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.retryAnalyzer.issue2148; + +import org.testng.IRetryAnalyzer; +import org.testng.ITestResult; + +public class RetryAnalyzer implements IRetryAnalyzer { + + private int counter = 0; + private int retryLimit = 1; + + @Override + public boolean retry(ITestResult result) { + if (counter < retryLimit) { + counter++; + return true; + } + return false; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/issue2684/RerunAnalyzer.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue2684/RerunAnalyzer.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/issue2684/RerunAnalyzer.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue2684/RerunAnalyzer.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.retryAnalyzer.issue2684; + +import org.testng.IRetryAnalyzer; +import org.testng.ITestResult; + +public class RerunAnalyzer implements IRetryAnalyzer { + + public static final int maxRetryCount = 1; + public static int secondTestRetryCount = 0; + private int retryCount = 0; + + @Override + public boolean retry(ITestResult iTestResult) { + if (retryCount < maxRetryCount) { + retryCount++; + return true; + } + return false; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/issue2684/SampleTestClassWithGroupConfigs.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue2684/SampleTestClassWithGroupConfigs.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/retryAnalyzer/issue2684/SampleTestClassWithGroupConfigs.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/retryAnalyzer/issue2684/SampleTestClassWithGroupConfigs.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,54 @@ +package test.retryAnalyzer.issue2684; + +import static org.testng.Assert.assertTrue; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.AfterGroups; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.AfterSuite; +import org.testng.annotations.AfterTest; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeGroups; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.BeforeSuite; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.Test; + +public class SampleTestClassWithGroupConfigs { + + @BeforeSuite(alwaysRun = true) + public void beforeSuite() {} + + @BeforeTest(alwaysRun = true) + public void beforeTest() {} + + @BeforeGroups("2684_group") + public void beforeGroups() {} + + @BeforeClass(alwaysRun = true) + public void beforeClass() {} + + @BeforeMethod(alwaysRun = true) + public void beforeMethod() {} + + @Test(groups = "2684_group", retryAnalyzer = RerunAnalyzer.class) + public void testMethod() { + RerunAnalyzer.secondTestRetryCount++; + assertTrue(RerunAnalyzer.secondTestRetryCount > RerunAnalyzer.maxRetryCount); + } + + @AfterMethod(alwaysRun = true) + public void afterMethod() {} + + @AfterClass(alwaysRun = true) + public void afterClass() {} + + @AfterGroups("2684_group") + public void afterGroups() {} + + @AfterTest(alwaysRun = true) + public void afterTest() {} + + @AfterSuite(alwaysRun = true) + public void afterSuite() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sample/AfterClassCalledAtEnd.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/AfterClassCalledAtEnd.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sample/AfterClassCalledAtEnd.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/AfterClassCalledAtEnd.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,49 @@ +package test.sample; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +/** + * Check to see that AfterClass is called only at the end and that after methods are called in + * reverse order of the before methods. + */ +public class AfterClassCalledAtEnd extends BaseAfterClassCalledAtEnd { + boolean m_before1Class = false; + boolean m_test1 = false; + boolean m_test2 = false; + boolean m_test3 = false; + + @BeforeClass(groups = {"before1Class"}) + public void before1Class() { + m_before1Class = true; + } + + @AfterClass(groups = {"someGroup"}) + public void afterClass() { + m_afterClass = true; + assert m_test1 && m_test2 && m_test3 + : "One of the test methods was not invoked: " + m_test1 + " " + m_test2 + " " + m_test3; + } + + @Test(description = "Verify that beforeClass and afterClass are called correctly") + public void test1() { + m_test1 = true; + assert m_before1Class : "beforeClass configuration must be called before method"; + assert !m_afterClass : "afterClass configuration must not be called before test method"; + } + + @Test + public void test2() { + m_test2 = true; + assert m_before1Class : "beforeClass configuration must be called before method"; + assert !m_afterClass : "afterClass configuration must not be called before test method"; + } + + @Test + public void test3() { + m_test3 = true; + assert m_before1Class : "beforeClass configuration must be called before method"; + assert !m_afterClass : "afterClass configuration must not be called before test method"; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sample/AllJUnitTests.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/AllJUnitTests.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sample/AllJUnitTests.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/AllJUnitTests.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ +package test.sample; + +import junit.framework.Test; +import junit.framework.TestSuite; + +/** + * Tests the suite() functionality of TestNG + * + * @author Cedric Beust, May 5, 2004 + */ +public class AllJUnitTests { + public static Test suite() { + TestSuite suite = new TestSuite(); + suite.addTest(new JUnitSample1(JUnitSample1.EXPECTED1)); + suite.addTest(new JUnitSample2(JUnitSample2.EXPECTED)); + return suite; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sample/BaseAfterClassCalledAtEnd.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/BaseAfterClassCalledAtEnd.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sample/BaseAfterClassCalledAtEnd.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/BaseAfterClassCalledAtEnd.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.sample; + +import org.testng.annotations.AfterClass; + +public class BaseAfterClassCalledAtEnd { + protected boolean m_afterClass = false; + + @AfterClass(dependsOnGroups = {".*"}) + public void baseAfterClass() { + assert m_afterClass : "This afterClass method should have been called last"; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sample/BaseSample1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/BaseSample1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sample/BaseSample1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/BaseSample1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,10 @@ +package test.sample; + +import org.testng.annotations.Test; + +/** @author Cedric Beust, Apr 30, 2004 */ +public class BaseSample1 { + + @Test(groups = {"odd"}) + public void method1() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sample/BaseSampleInheritance.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/BaseSampleInheritance.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sample/BaseSampleInheritance.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/BaseSampleInheritance.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,44 @@ +package test.sample; + +import java.util.ArrayList; +import java.util.List; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +/** @author Cedric Beust, Apr 30, 2004 */ +public class BaseSampleInheritance { + + protected List m_configurations = new ArrayList<>(); + + protected void addConfiguration(String c) { + m_configurations.add(c); + } + + protected boolean m_invokedBaseMethod = false; + + @Test(groups = {"inheritedTestMethod"}) + public void baseMethod() { + m_invokedBaseMethod = true; + } + + protected boolean m_invokedBaseConfiguration = false; + + @BeforeClass(alwaysRun = true) + public void baseConfiguration() { + m_invokedBaseConfiguration = true; + } + + @BeforeClass( + groups = {"configuration1"}, + dependsOnGroups = {"configuration0"}) + public void configuration1() { + // System.out.println("CONFIGURATION 1"); + addConfiguration("configuration1"); + } + + @Test(dependsOnGroups = {"inheritedTestMethod"}) + public void testBooleans() { + assert m_invokedBaseMethod : "Didn't invoke test method in base class"; + assert m_invokedBaseConfiguration : "Didn't invoke configuration method in base class"; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sample/Basic1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/Basic1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sample/Basic1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/Basic1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,26 @@ +package test.sample; + +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class Basic1 { + private static int m_count = 0; + + public static void incrementCount() { + m_count++; + } + + public static int getCount() { + return m_count; + } + + @BeforeMethod + public void beforeTestMethod() { + incrementCount(); + } + + @Test(groups = {"basic1"}) + public void basic1() { + assert getCount() > 0 : "COUNT WAS NOT INCREMENTED"; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sample/Basic2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/Basic2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sample/Basic2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/Basic2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,30 @@ +package test.sample; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.AfterTest; +import org.testng.annotations.Test; + +public class Basic2 { + private boolean m_basic2WasRun = false; + private static int m_afterClass = 0; + + @Test(dependsOnGroups = {"basic1"}) + public void basic2() { + m_basic2WasRun = true; + assert Basic1.getCount() > 0 : "COUNT WAS NOT INCREMENTED"; + } + + @AfterTest + public void cleanUp() { + m_basic2WasRun = false; + m_afterClass = 0; + } + + @AfterClass + public void checkTestAtClassLevelWasRun() { + m_afterClass++; + assert m_basic2WasRun : "Class annotated with @Test didn't have its methods run."; + assert 1 == m_afterClass + : "After class should have been called exactly once, not " + m_afterClass; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sample/ConverterSample3.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/ConverterSample3.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sample/ConverterSample3.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/ConverterSample3.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,83 @@ +package test.sample; + +/* + * Created on 12-Sep-2006 by micheb10 + */ + +/** + * Sample file for the Javadoc annotations to Java 5 annotations converter for a non-default package + * + * @author micheb10 12-Sep-2006 + * @testng.test + */ +public class ConverterSample3 { + /** + * This comment line should be preserved + * + * @testng.before-suite alwaysRun = "true" + */ + public void beforeSuiteAlwaysRun() { + // We are just checking appropriate annotations are added so we don't care about body + } + + /** @testng.test */ + public void plainTest() { + // Empty body + } + + /** + * @testng.test + * @testng.expected-exceptions value = "java.lang.NullPointerException + * java.lang.NumberFormatException" + */ + public void expectedExceptions() { + // Empty body + } + + /** @testng.test groups = "groupA groupB" */ + public void testGroups() { + // Empty body + } + + /** @testng.after-method */ + public void afterMethod() { + // Empty body + } + + /** + * This key should be preserved + * + * @author The author is a standard tag and should not be touched + * @testng.test groups = "groupA" alwaysRun=true dependsOnMethods = "expectedExceptions" + * timeOut="3000" + * @version another standard tag should not be changed + * @testng.expected-exceptions value = "java.lang.NullPointerException + * java.lang.NumberFormatException" + * @testng.parameters value="firstParameter secondParameter thirdParameter" + */ + public void testEverything() { + // Lots and lots of stuff + } + + /** @testng.data-provider name="test1" */ + public Object[][] dataProvider() { + return null; + } + + /** @testng.factory */ + public Object[] factory() { + return null; + } + + /** @testng.test */ + public class TestInnerClass { + public void bareInnerMethod() { + // Empty body + } + + /** @testng.test */ + public void testInnerMethod() { + // empty body + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sample/InvocationCountTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/InvocationCountTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sample/InvocationCountTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/InvocationCountTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,75 @@ +package test.sample; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.AfterSuite; +import org.testng.annotations.Test; + +/** + * This class is used to test invocationCountTest + * + * @author cbeust + */ +public class InvocationCountTest { + + // + // Invocation test + // + private static int m_count = 0; + + @AfterSuite(groups = {"invocationOnly"}) + public void afterSuite() { + m_count = 0; + m_count2 = 0; + m_count3 = 0; + } + + @Test( + groups = {"invocationOnly"}, + invocationCount = 10) + public void tenTimesShouldSucceed() { + m_count++; + } + + // + // Invocation + Success percentage test + // This method will work the first 8 times and fail after that, but overall + // the test should still pass because successPercentage = 80 + // + private static int m_count2 = 0; + + @Test( + groups = {"successPercentageThatSucceedsOnly"}, + invocationCount = 10, + successPercentage = 80) + public void successPercentageShouldSucceed() { + if (m_count2 >= 8) { + throw new RuntimeException("Called more than eight times : " + m_count2); + } + m_count2++; + } + + // + // Invocation + Success percentage test + // This method will work the first 8 times and fail after that. One of + // the failures will fall under the percentage tolerance but the next one + // will not. + // + private static int m_count3 = 0; + + @Test( + groups = {"successPercentageThatFailsOnly"}, + invocationCount = 10, + successPercentage = 90) + public void successPercentageShouldFail() { + if (m_count3 >= 8) { + throw new RuntimeException("Called more than eight times : " + m_count3); + } + m_count3++; + } + + @AfterClass(groups = {"invocationOnly"}) + public void verify() { + assert 10 == m_count + : "Method should have been invoked 10 times but was invoked " + m_count + " times"; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sample/JUnitSample1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/JUnitSample1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sample/JUnitSample1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/JUnitSample1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,36 @@ +package test.sample; + +import junit.framework.TestCase; + +/** + * This class + * + * @author Cedric Beust, May 5, 2004 + */ +public class JUnitSample1 extends TestCase { + private String m_field = null; + public static final String EXPECTED2 = "testSample1_2"; + public static final String EXPECTED1 = "testSample1_1"; + + public JUnitSample1() { + super(); + } + + public JUnitSample1(String n) { + super(n); + } + + @Override + public void setUp() { + m_field = "foo"; + } + + @Override + public void tearDown() { + m_field = null; + } + + public void testSample1_1() {} + + public void testSample1_2() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sample/JUnitSample2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/JUnitSample2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sample/JUnitSample2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/JUnitSample2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,30 @@ +package test.sample; + +import junit.framework.TestCase; + +/** + * This class + * + * @author Cedric Beust, May 5, 2004 + */ +public class JUnitSample2 extends TestCase { + public static final String EXPECTED = "testSample2ThatSetUpWasRun"; + private String m_field = null; + + public JUnitSample2() { + super(); + } + + public JUnitSample2(String n) { + super(n); + } + + @Override + public void setUp() { + m_field = "foo"; + } + + public void testSample2ThatSetUpWasRun() { + assert null != m_field : "setUp() wasn't run"; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sample/JUnitSample3.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/JUnitSample3.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sample/JUnitSample3.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/JUnitSample3.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package test.sample; + +import junit.framework.TestCase; +import org.testng.Assert; + +/** + * This class verifies that a new instance is used every time + * + * @author cbeust + */ +public class JUnitSample3 extends TestCase { + private int m_count = 0; + + public void test1() { + Assert.assertEquals(m_count, 0); + m_count++; + } + + public void test2() { + Assert.assertEquals(m_count, 0); + m_count++; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sample/JUnitSample4.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/JUnitSample4.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sample/JUnitSample4.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/JUnitSample4.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,35 @@ +package test.sample; + +import junit.framework.TestCase; +import junit.framework.TestSuite; +import org.junit.Assert; + +/** @author lukas */ +public abstract class JUnitSample4 extends TestCase { + + private int i = 0; + + public JUnitSample4(String name, int i) { + super(name); + this.i = i; + } + + public void testXY() { + Assert.assertEquals(1, 1); + } + + public static TestSuite suite() { + TestSuite ts = new TestSuite("Sample Suite"); + for (int i = 0; i < 3; i++) { + ts.addTest(new T(i)); + } + return ts; + } + + private static class T extends JUnitSample4 { + + public T(int i) { + super("testXY", i); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sample/PartialGroupTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/PartialGroupTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sample/PartialGroupTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/PartialGroupTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,43 @@ +package test.sample; + +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +/** + * This class tests groups that are partially defined at the class level and then augmented at the + * method level. + * + * @author cbeust + */ +@Test(groups = {"classGroup"}) +public class PartialGroupTest { + public static boolean m_successMethod = false; + public static boolean m_successClass = false; + + @BeforeClass + public void init() { + m_successMethod = false; + m_successClass = false; + } + + @Test(groups = {"methodGroup"}) + public void testMethodGroup() { + m_successMethod = true; + } + + @Test + public void testClassGroupShouldFail() { + Assert.assertTrue(false); + } + + @Test(groups = {"methodGroup"}) + public void testMethodGroupShouldFail() { + Assert.assertTrue(false); + } + + @Test + public void testClassGroup() { + m_successClass = true; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sample/PartialGroupVerification.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/PartialGroupVerification.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sample/PartialGroupVerification.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/PartialGroupVerification.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.sample; + +import org.testng.annotations.Test; + +/** + * This class verifies the PartialGroupTest + * + * @author cbeust + */ +public class PartialGroupVerification { + @Test + public void verify() { + assert PartialGroupTest.m_successMethod && PartialGroupTest.m_successClass + : "test1 and test2 should have been invoked both"; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sample/README.txt jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/README.txt --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sample/README.txt 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/README.txt 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,2 @@ +This directory contains "samples": TestNG tests that are not invoked directly but invoked +programmatically by the real test classes in the main directory. diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sample/Sample1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/Sample1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sample/Sample1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/Sample1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,64 @@ +package test.sample; + +import org.testng.Assert; +import org.testng.annotations.AfterClass; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +/** + * This class + * + * @author Cedric Beust, Apr 26, 2004 + */ +public class Sample1 extends BaseSample1 { + @AfterClass + public static void tearDownClass1() {} + + @AfterClass + public void tearDownClass2() {} + + @BeforeMethod + public void beforeTest() {} + + @AfterMethod + public void afterTest() {} + + @Test(groups = {"even"}) + public void method2() {} + + @Test(groups = {"odd"}) + public void method3() {} + + @Test( + groups = {"odd"}, + enabled = false) + public void oddDisableMethod() {} + + @Test(groups = {"broken"}) + public void broken() {} + + @Test( + groups = {"fail"}, + expectedExceptions = {NumberFormatException.class, ArithmeticException.class}) + public void throwExpectedException1ShouldPass() { + throw new NumberFormatException(); + } + + @Test( + groups = {"fail"}, + expectedExceptions = {NumberFormatException.class, ArithmeticException.class}) + public void throwExpectedException2ShouldPass() { + throw new ArithmeticException(); + } + + @Test(groups = {"fail", "bug"}) + public void throwExceptionShouldFail() { + throw new NumberFormatException(); + } + + @Test(groups = {"assert"}) + public void verifyLastNameShouldFail() { + Assert.assertEquals("Beust", "", "Expected name Beust, found blah"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sample/Sample2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/Sample2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sample/Sample2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/Sample2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,26 @@ +package test.sample; + +import org.testng.annotations.Test; + +/** + * This class + * + * @author Cedric Beust, Apr 26, 2004 + */ +public class Sample2 { + + @Test(groups = "g1") + public void method1() { + // System.out.println("@@@@@@@@@@@@@@@@@@@ METHOD1"); + } + + @Test + public void method2() { + // System.out.println("@@@@@@@@@@@@@@@@@@@ METHOD2"); + } + + @Test + public void method3() { + // System.out.println("@@@@@@@@@@@@@@@@@@@ METHOD3"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sample/Scope.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/Scope.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sample/Scope.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/Scope.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.sample; + +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; + +/** This class tests paramete scopes. */ +public class Scope { + + @Parameters({"parameter"}) + @Test(groups = {"outer-group"}) + public void outerDeprecated(String s) { + assert "out".equals(s) : "Expected out got " + s; + } + + @Parameters({"parameter"}) + @Test(groups = {"inner-group"}) + public void innerDeprecated(String s) { + assert "in".equals(s) : "Expected in got " + s; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sample/SetUpWithParameterTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/SetUpWithParameterTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sample/SetUpWithParameterTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sample/SetUpWithParameterTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ +package test.sample; + +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +/** + * This class fails in setUp and should result in 1 failure, 1 skip + * + * @author cbeust + */ +public class SetUpWithParameterTest { + + @BeforeClass + public void setUp(String bogusParameter) {} + + @Test + public void test() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sanitycheck/CheckSuiteNamesTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sanitycheck/CheckSuiteNamesTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sanitycheck/CheckSuiteNamesTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sanitycheck/CheckSuiteNamesTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,80 @@ +package test.sanitycheck; + +import java.io.IOException; +import java.util.Arrays; +import java.util.Collections; +import org.testng.Assert; +import org.testng.ITestNGListener; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlClass; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import org.testng.xml.internal.Parser; +import test.SimpleBaseTest; + +public class CheckSuiteNamesTest extends SimpleBaseTest { + + /** Child suites have different names */ + @Test + public void checkChildSuites() { + TestListenerAdapter tla = new TestListenerAdapter(); + TestNG tng = create(); + String testngXmlPath = getPathToResource("sanitycheck/test-s-b.xml"); + tng.setTestSuites(Collections.singletonList(testngXmlPath)); + tng.addListener((ITestNGListener) tla); + tng.run(); + Assert.assertEquals(tla.getPassedTests().size(), 4); + } + + /** Child suites have same names */ + @Test + public void checkChildSuitesFails() { + TestListenerAdapter tla = new TestListenerAdapter(); + TestNG tng = create(); + String testngXmlPath = getPathToResource("sanitycheck/test-s-a.xml"); + tng.setTestSuites(Collections.singletonList(testngXmlPath)); + tng.addListener((ITestNGListener) tla); + tng.run(); + Assert.assertEquals(tla.getTestContexts().get(0).getSuite().getName(), "SanityCheck suites"); + Assert.assertEquals(tla.getTestContexts().get(1).getSuite().getName(), "SanityCheck suites"); + Assert.assertEquals( + tla.getTestContexts().get(2).getSuite().getName(), "SanityCheck suites (0)"); + Assert.assertEquals( + tla.getTestContexts().get(3).getSuite().getName(), "SanityCheck suites (0)"); + } + + /** Checks that suites created programmatically also works as expected */ + @Test + public void checkProgrammaticSuitesFails() { + XmlSuite xmlSuite1 = new XmlSuite(); + xmlSuite1.setName("SanityCheckSuite"); + { + XmlTest result = new XmlTest(xmlSuite1); + result.getXmlClasses().add(new XmlClass(SampleTest1.class.getCanonicalName())); + } + + XmlSuite xmlSuite2 = new XmlSuite(); + xmlSuite2.setName("SanityCheckSuite"); + { + XmlTest result = new XmlTest(xmlSuite2); + result.getXmlClasses().add(new XmlClass(SampleTest2.class.getCanonicalName())); + } + + TestNG tng = create(); + tng.setXmlSuites(Arrays.asList(xmlSuite1, xmlSuite2)); + tng.run(); + Assert.assertEquals(xmlSuite1.getName(), "SanityCheckSuite"); + Assert.assertEquals(xmlSuite2.getName(), "SanityCheckSuite (0)"); + } + + @Test + public void checkXmlSuiteAddition() throws IOException { + TestNG tng = create(); + String testngXmlPath = getPathToResource("sanitycheck/test-s-b.xml"); + Parser parser = new Parser(testngXmlPath); + tng.setXmlSuites(parser.parseToList()); + tng.initializeSuitesAndJarFile(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sanitycheck/CheckTestNamesTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sanitycheck/CheckTestNamesTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sanitycheck/CheckTestNamesTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sanitycheck/CheckTestNamesTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,84 @@ +package test.sanitycheck; + +import java.util.Collections; +import org.testng.Assert; +import org.testng.ITestNGListener; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.TestNGException; +import org.testng.annotations.Test; +import org.testng.xml.XmlClass; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.SimpleBaseTest; + +public class CheckTestNamesTest extends SimpleBaseTest { + + /** Child suites and same suite has two tests with same name */ + @Test + public void checkWithChildSuites() { + runSuite("sanitycheck/test-a.xml"); + } + + /** Simple suite with two tests with same name */ + @Test + public void checkWithoutChildSuites() { + runSuite("sanitycheck/test1.xml"); + } + + private void runSuite(String suitePath) { + TestListenerAdapter tla = new TestListenerAdapter(); + boolean exceptionRaised = false; + try { + TestNG tng = create(); + String testngXmlPath = getPathToResource(suitePath); + tng.setTestSuites(Collections.singletonList(testngXmlPath)); + tng.addListener((ITestNGListener) tla); + tng.run(); + } catch (TestNGException ex) { + exceptionRaised = true; + Assert.assertEquals(tla.getPassedTests().size(), 0); + Assert.assertEquals(tla.getFailedTests().size(), 0); + } + Assert.assertTrue(exceptionRaised); + } + + /** Simple suite with no two tests with same name */ + @Test + public void checkNoError() { + TestListenerAdapter tla = new TestListenerAdapter(); + TestNG tng = create(); + String testngXmlPath = getPathToResource("sanitycheck/test2.xml"); + tng.setTestSuites(Collections.singletonList(testngXmlPath)); + tng.addListener((ITestNGListener) tla); + tng.run(); + Assert.assertEquals(tla.getPassedTests().size(), 2); + } + + /** Child suites and tests within different suites have same names */ + @Test(enabled = false) + public void checkNoErrorWtihChildSuites() { + TestListenerAdapter tla = new TestListenerAdapter(); + TestNG tng = create(); + String testngXmlPath = getPathToResource("sanitycheck/test-b.xml"); + tng.setTestSuites(Collections.singletonList(testngXmlPath)); + tng.addListener((ITestNGListener) tla); + tng.run(); + Assert.assertEquals(tla.getPassedTests().size(), 4); + } + + /** Checks that suites created programmatically also run as expected */ + @Test + public void checkTestNamesForProgrammaticSuites() { + XmlSuite xmlSuite = new XmlSuite(); + xmlSuite.setName("SanityCheckSuite"); + XmlTest result = new XmlTest(xmlSuite); + result.getXmlClasses().add(new XmlClass(SampleTest1.class.getCanonicalName())); + result = new XmlTest(xmlSuite); + result.getXmlClasses().add(new XmlClass(SampleTest2.class.getCanonicalName())); + + TestNG tng = new TestNG(); + tng.setXmlSuites(Collections.singletonList(xmlSuite)); + tng.run(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sanitycheck/SampleTest1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sanitycheck/SampleTest1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sanitycheck/SampleTest1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sanitycheck/SampleTest1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ +package test.sanitycheck; + +import org.testng.annotations.Test; + +public class SampleTest1 { + @Test() + public void test1() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sanitycheck/SampleTest2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sanitycheck/SampleTest2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sanitycheck/SampleTest2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sanitycheck/SampleTest2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ +package test.sanitycheck; + +import org.testng.annotations.Test; + +public class SampleTest2 { + @Test() + public void test2() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sanitycheck/SampleTest3.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sanitycheck/SampleTest3.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/sanitycheck/SampleTest3.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/sanitycheck/SampleTest3.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ +package test.sanitycheck; + +import org.testng.annotations.Test; + +public class SampleTest3 { + @Test() + public void test3() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/serviceloader/MyConfigurationListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/serviceloader/MyConfigurationListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/serviceloader/MyConfigurationListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/serviceloader/MyConfigurationListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.serviceloader; + +import org.testng.IConfigurationListener; +import org.testng.ITestResult; + +public class MyConfigurationListener implements IConfigurationListener { + + @Override + public void onConfigurationSuccess(ITestResult itr) {} + + @Override + public void onConfigurationFailure(ITestResult itr) {} + + @Override + public void onConfigurationSkip(ITestResult itr) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/serviceloader/ServiceLoaderSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/serviceloader/ServiceLoaderSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/serviceloader/ServiceLoaderSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/serviceloader/ServiceLoaderSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package test.serviceloader; + +import org.testng.annotations.Test; + +/** + * Dummy class to test ServiceLoader + * + * @author Cedric Beust + */ +public class ServiceLoaderSampleTest { + + @Test + public void f() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/serviceloader/ServiceLoaderTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/serviceloader/ServiceLoaderTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/serviceloader/ServiceLoaderTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/serviceloader/ServiceLoaderTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,91 @@ +package test.serviceloader; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.net.URL; +import java.net.URLClassLoader; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import org.testng.Assert; +import org.testng.CommandLineArgs; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; +import test.listeners.ListenerAssert; + +public class ServiceLoaderTest extends SimpleBaseTest { + + @Test + public void serviceLoaderShouldWork() { + TestNG tng = create(ServiceLoaderSampleTest.class); + URL url = getClass().getClassLoader().getResource("serviceloader.jar"); + URLClassLoader ucl = URLClassLoader.newInstance(new URL[] {url}); + tng.setServiceLoaderClassLoader(ucl); + tng.run(); + + ListenerAssert.assertListenerType(tng.getServiceLoaderListeners(), TmpSuiteListener.class); + } + + @Test(description = "GITHUB-2259") + public void ensureSpiLoadedListenersCanBeSkipped() { + TestNG tng = create(ServiceLoaderSampleTest.class); + URL url = getClass().getClassLoader().getResource("serviceloader.jar"); + URLClassLoader ucl = URLClassLoader.newInstance(new URL[] {url}); + tng.setServiceLoaderClassLoader(ucl); + String dontLoad = "test.serviceloader.TmpSuiteListener"; + tng.setListenersToSkipFromBeingWiredInViaServiceLoaders(dontLoad); + tng.run(); + List loaded = + tng.getServiceLoaderListeners().stream() + .map(l -> l.getClass().getName()) + .collect(Collectors.toList()); + assertThat(loaded).doesNotContain(dontLoad); + } + + @Test(description = "GITHUB-2259") + @SuppressWarnings("deprecation") + public void ensureSpiLoadedListenersCanBeSkipped2() { + TestNG tng = create(ServiceLoaderSampleTest.class); + URL url = getClass().getClassLoader().getResource("serviceloader.jar"); + URLClassLoader ucl = URLClassLoader.newInstance(new URL[] {url}); + tng.setServiceLoaderClassLoader(ucl); + String dontLoad = "test.serviceloader.TmpSuiteListener"; + Map cli = new HashMap<>(); + cli.put(CommandLineArgs.LISTENERS_TO_SKIP_VIA_SPI, dontLoad); + tng.configure(cli); + tng.run(); + List loaded = + tng.getServiceLoaderListeners().stream() + .map(l -> l.getClass().getName()) + .collect(Collectors.toList()); + assertThat(loaded).doesNotContain(dontLoad); + } + + @Test + public void serviceLoaderWithNoClassLoader() { + // Here ServiceLoader is expected to rely on the current context class loader to load the + // service loader file + // Since serviceloader.jar doesn't seem to be visible to the current thread's contextual class + // loader + // resorting to pushing in a class loader into the current thread that can load the resource + URL url = getClass().getClassLoader().getResource("serviceloader.jar"); + URLClassLoader ucl = URLClassLoader.newInstance(new URL[] {url}); + Thread.currentThread().setContextClassLoader(ucl); + TestNG tng = create(ServiceLoaderSampleTest.class); + tng.run(); + + ListenerAssert.assertListenerType(tng.getServiceLoaderListeners(), TmpSuiteListener.class); + } + + @Test(description = "GITHUB-491") + public void serviceLoaderShouldWorkWithConfigurationListener() { + TestNG tng = create(ServiceLoaderSampleTest.class); + tng.run(); + + Assert.assertEquals(2, tng.getServiceLoaderListeners().size()); + ListenerAssert.assertListenerType( + tng.getServiceLoaderListeners(), MyConfigurationListener.class); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/serviceloader/TmpSuiteListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/serviceloader/TmpSuiteListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/serviceloader/TmpSuiteListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/serviceloader/TmpSuiteListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.serviceloader; + +import org.testng.ISuite; +import org.testng.ISuiteListener; + +public class TmpSuiteListener implements ISuiteListener { + @Override + public void onFinish(ISuite suite) {} + + @Override + public void onStart(ISuite suite) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/simple/IncludedExcludedSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/simple/IncludedExcludedSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/simple/IncludedExcludedSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/simple/IncludedExcludedSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,46 @@ +package test.simple; + +import org.testng.Reporter; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.BeforeSuite; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.Test; + +public class IncludedExcludedSampleTest { + + @BeforeSuite + public void beforeSuite() { + Reporter.log("beforeSuite"); + } + + @BeforeTest + public void beforeTest() { + Reporter.log("beforeTest"); + } + + @BeforeClass + public void beforeTestClass() { + Reporter.log("beforeTestClass"); + } + + @BeforeMethod + public void beforeTestMethod() { + Reporter.log("beforeTestMethod"); + } + + @Test + public void test1() { + Reporter.log("Child.test1"); + } + + @Test(enabled = false) + public void test2() { + Reporter.log("Child.test2"); + } + + @Test(groups = "a") + public void test3() { + Reporter.log("Child.test3"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/simple/IncludedExcludedTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/simple/IncludedExcludedTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/simple/IncludedExcludedTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/simple/IncludedExcludedTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,105 @@ +package test.simple; + +import java.util.Collection; +import java.util.List; +import org.testng.Assert; +import org.testng.IInvokedMethod; +import org.testng.IReporter; +import org.testng.ISuite; +import org.testng.ITestNGListener; +import org.testng.ITestNGMethod; +import org.testng.TestNG; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import testhelper.OutputDirectoryPatch; + +public class IncludedExcludedTest { + + private TestNG m_tng; + + @BeforeMethod + public void init() { + m_tng = new TestNG(); + m_tng.setOutputDirectory(OutputDirectoryPatch.getOutputDirectory()); + m_tng.setUseDefaultListeners(false); + } + + @Test(description = "First test method") + public void verifyIncludedExcludedCount1() { + m_tng.setTestClasses(new Class[] {IncludedExcludedSampleTest.class}); + m_tng.setGroups("a"); + m_tng.addListener( + (ITestNGListener) new MyReporter(new String[] {"test3"}, new String[] {"test1", "test2"})); + m_tng.run(); + } + + @Test(description = "Second test method") + public void verifyIncludedExcludedCount2() { + m_tng.setTestClasses(new Class[] {IncludedExcludedSampleTest.class}); + m_tng.addListener( + (ITestNGListener) + new MyReporter( + new String[] { + "beforeSuite", + "beforeTest", + "beforeTestClass", + "beforeTestMethod", + "test1", + "beforeTestMethod", + "test3" + }, + new String[] {"test2"})); + m_tng.run(); + } +} + +class MyReporter implements IReporter { + + private String[] m_included; + private String[] m_excluded; + + public MyReporter(String[] included, String[] excluded) { + m_included = included; + m_excluded = excluded; + } + + @Override + public void generateReport( + List xmlSuites, List suites, String outputDirectory) { + Assert.assertEquals(suites.size(), 1); + ISuite suite = suites.get(0); + + List invoked = suite.getAllInvokedMethods(); + Assert.assertEquals(invoked.size(), m_included.length); + for (String s : m_included) { + Assert.assertTrue(containsInvokedMethod(invoked, s)); + } + + Collection excluded = suite.getExcludedMethods(); + Assert.assertEquals(excluded.size(), m_excluded.length); + for (String s : m_excluded) { + Assert.assertTrue(containsMethod(excluded, s)); + } + } + + private boolean containsMethod(Collection invoked, String string) { + for (ITestNGMethod m : invoked) { + if (m.getMethodName().equals(string)) { + return true; + } + } + + return false; + } + + private static boolean containsInvokedMethod(Collection invoked, String string) { + for (IInvokedMethod m : invoked) { + if (m.getTestMethod().getMethodName().equals(string)) { + return true; + } + } + + return false; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/simple/SimpleSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/simple/SimpleSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/simple/SimpleSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/simple/SimpleSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.simple; + +import org.testng.annotations.Test; + +public class SimpleSample { + + @Test + public void f() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skip/ReasonForSkipTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/ReasonForSkipTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skip/ReasonForSkipTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/ReasonForSkipTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,141 @@ +package test.skip; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.entry; + +import java.util.Arrays; +import java.util.Map; +import org.testng.CommandLineArgs; +import org.testng.ITestResult; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.collections.Maps; +import org.testng.xml.XmlSuite; +import test.InvokedMethodNameListener; +import test.SimpleBaseTest; +import test.skip.github1967.TestClassSample; +import test.skip.issue2674.ConfigAwareTestNG; + +public class ReasonForSkipTest extends SimpleBaseTest { + + @Test(description = "GITHUB-1878") + public void ensureSkipInfoHasFailedConfigDetails() { + Map expected = Maps.newHashMap(); + expected.put("testMethod", "beforeClass"); + runTest(expected, TestClassWithFailedConfig.class); + } + + @Test(description = "GITHUB-1878") + public void ensureSkipInfoHasFailedTestDetails() { + Map expected = Maps.newHashMap(); + expected.put("childMethod", "parentMethod"); + runTest(expected, TestClassWithFailedMethod.class); + } + + @Test(description = "GITHUB-1878") + public void ensureSkipInfoHasAllFailedTestDetails() { + TestNG testng = create(TestClassWithMultipleFailures.class); + ReasonReporter reporter = new ReasonReporter(); + testng.addListener(reporter); + testng.run(); + assertThat(reporter.getSkippedInfo()) + .containsAnyOf(entry("child", "father,mother"), entry("child", "mother,father")); + } + + @Test(description = "GITHUB-1878") + public void ensureSkipInfoHasFailedConfigDetailsInBaseClass() { + Map expected = Maps.newHashMap(); + expected.put("testMethod", "beforeClass"); + expected.put("testMethodInChildClass", "beforeClass"); + runTest(expected, TestClassWithFailedConfigInParentClass.class); + } + + @Test(description = "GITHUB-1878") + public void ensureSkipInfoHasFailedTestDetailsInBaseClass() { + Map expected = Maps.newHashMap(); + expected.put("childMethod", "parentMethod"); + expected.put("anotherChild", "parentMethod"); + runTest(expected, TestClassWithFailedMethodInParentClass.class); + } + + @Test(description = "GITHUB-1878") + public void ensureSkipInfoHasGlobalConfigFailureDetails() { + Map expected = Maps.newHashMap(); + expected.put("testMethod", "beforeTest"); + runTest(expected, TestClassWithOnlyGlobalConfig.class, TestClassWithOnlyTestMethods.class); + } + + @Test(description = "GITHUB-1878") + public void ensureSkipInfoHasFailedTestDetailsWhenInvolvingGroups() { + XmlSuite xmlSuite = createXmlSuite("sample_suite"); + createXmlTest(xmlSuite, "sample_test", TestClassWithGroupFailures.class); + xmlSuite.getIncludedGroups().addAll(Arrays.asList("unit", "integration")); + TestNG testng = create(xmlSuite); + ReasonReporter reporter = new ReasonReporter(); + testng.addListener(reporter); + testng.run(); + Map expected = Maps.newHashMap(); + expected.put("integrationTests", "unitTests"); + assertThat(reporter.getSkippedInfo()).containsAllEntriesOf(expected); + } + + @Test(description = "GITHUB-1878") + public void ensureSkipInfoHasFailedTestDetailsWhenInvolvingMultipleGroups() { + XmlSuite xmlSuite = createXmlSuite("sample_suite"); + createXmlTest(xmlSuite, "sample_test", TestClassWithMultipleGroupFailures.class); + xmlSuite.getIncludedGroups().addAll(Arrays.asList("p1", "p2", "all")); + TestNG testng = create(xmlSuite); + ReasonReporter reporter = new ReasonReporter(); + testng.addListener(reporter); + testng.run(); + assertThat(reporter.getSkippedInfo()) + .containsAnyOf(entry("child", "father,mother"), entry("child", "mother,father")); + } + + @Test(description = "GITHUB-1878") + public void testEnsureTestStatusIsSetProperlyForSkippedTests() { + TestNG testng = create(TestClassSample.class); + ReasonReporter reporter = new ReasonReporter(); + testng.addListener(reporter); + testng.run(); + Map actual = reporter.getResults(); + Map expected = Maps.newHashMap(); + expected.put("test1min", ITestResult.SKIP); + expected.put("test2min", ITestResult.SKIP); + expected.put("setup", ITestResult.FAILURE); + assertThat(actual).containsAllEntriesOf(expected); + } + + @Test(description = "GITHUB-2674") + public void ensureUpstreamFailuresTriggerSkipsForAllDataProviderValues() { + TestNG testng = create(test.skip.issue2674.TestClassSample.class); + testng.setReportAllDataDrivenTestsAsSkipped(true); + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + testng.addListener(listener); + testng.run(); + assertThat(listener.getSkippedMethodNames()) + .containsExactly("test2(iPhone,13)", "test2(iPhone-Pro,12)"); + } + + @Test(description = "GITHUB-2674") + public void ensureUpstreamFailuresTriggerSkipsForAllDataProviderValuesViaCmdLineArgs() { + CommandLineArgs cli = new CommandLineArgs(); + cli.includeAllDataDrivenTestsWhenSkipping = true; + ConfigAwareTestNG testng = new ConfigAwareTestNG(); + testng.setTestClasses(new Class[] {test.skip.issue2674.TestClassSample.class}); + testng.configure(cli); + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + testng.addListener(listener); + testng.run(); + assertThat(listener.getSkippedMethodNames()) + .containsExactly("test2(iPhone,13)", "test2(iPhone-Pro,12)"); + } + + private static void runTest(Map expected, Class... clazz) { + TestNG testng = create(clazz); + ReasonReporter reporter = new ReasonReporter(); + testng.addListener(reporter); + testng.run(); + assertThat(reporter.getSkippedInfo()).containsAllEntriesOf(expected); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skip/ReasonReporter.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/ReasonReporter.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skip/ReasonReporter.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/ReasonReporter.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,51 @@ +package test.skip; + +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import org.testng.IReporter; +import org.testng.ISuite; +import org.testng.ITestNGMethod; +import org.testng.ITestResult; +import org.testng.collections.Maps; +import org.testng.xml.XmlSuite; + +public class ReasonReporter implements IReporter { + + private Map results = Maps.newHashMap(); + + public Map getResults() { + return results; + } + + private Map skippedInfo = Maps.newHashMap(); + + public Map getSkippedInfo() { + return skippedInfo; + } + + @Override + public void generateReport(List xmlSuites, List suites, String outDir) { + suites.stream() + .flatMap(suite -> suite.getResults().values().stream()) + .flatMap( + suiteResult -> suiteResult.getTestContext().getSkippedTests().getAllResults().stream()) + .forEach(this::generateReport); + + suites.stream() + .flatMap(iSuite -> iSuite.getAllInvokedMethods().stream()) + .collect(Collectors.toList()) + .forEach( + im -> { + results.put(im.getTestMethod().getMethodName(), im.getTestResult().getStatus()); + }); + } + + public void generateReport(ITestResult result) { + String text = + result.getSkipCausedBy().stream() + .map(ITestNGMethod::getMethodName) + .collect(Collectors.joining(",")); + skippedInfo.put(result.getMethod().getMethodName(), text); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skip/TestClassWithFailedConfig.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/TestClassWithFailedConfig.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skip/TestClassWithFailedConfig.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/TestClassWithFailedConfig.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.skip; + +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +public class TestClassWithFailedConfig { + + @BeforeClass + public void beforeClass() { + throw new RuntimeException("simulating a failure"); + } + + @Test + public void testMethod() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skip/TestClassWithFailedConfigInParentClass.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/TestClassWithFailedConfigInParentClass.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skip/TestClassWithFailedConfigInParentClass.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/TestClassWithFailedConfigInParentClass.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.skip; + +import org.testng.annotations.Test; + +public class TestClassWithFailedConfigInParentClass extends TestClassWithFailedConfig { + + @Test + public void testMethodInChildClass() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skip/TestClassWithFailedMethod.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/TestClassWithFailedMethod.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skip/TestClassWithFailedMethod.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/TestClassWithFailedMethod.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package test.skip; + +import org.testng.annotations.Test; + +public class TestClassWithFailedMethod { + + @Test + public void parentMethod() { + throw new RuntimeException("simulating a failure"); + } + + @Test(dependsOnMethods = "parentMethod") + public void childMethod() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skip/TestClassWithFailedMethodInParentClass.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/TestClassWithFailedMethodInParentClass.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skip/TestClassWithFailedMethodInParentClass.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/TestClassWithFailedMethodInParentClass.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.skip; + +import org.testng.annotations.Test; + +public class TestClassWithFailedMethodInParentClass extends TestClassWithFailedMethod { + + @Test(dependsOnMethods = "parentMethod") + public void anotherChild() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skip/TestClassWithGroupFailures.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/TestClassWithGroupFailures.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skip/TestClassWithGroupFailures.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/TestClassWithGroupFailures.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package test.skip; + +import org.testng.annotations.Test; + +public class TestClassWithGroupFailures { + + @Test(groups = "unit") + public void unitTests() { + throw new RuntimeException("simulating a failure"); + } + + @Test(groups = "integration", dependsOnGroups = "unit") + public void integrationTests() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skip/TestClassWithMultipleFailures.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/TestClassWithMultipleFailures.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skip/TestClassWithMultipleFailures.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/TestClassWithMultipleFailures.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.skip; + +import org.testng.annotations.Test; + +public class TestClassWithMultipleFailures { + + @Test + public void father() { + throw new RuntimeException("simulating a failure"); + } + + @Test + public void mother() { + throw new RuntimeException("simulating a failure"); + } + + @Test(dependsOnMethods = {"father", "mother"}) + public void child() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skip/TestClassWithMultipleGroupFailures.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/TestClassWithMultipleGroupFailures.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skip/TestClassWithMultipleGroupFailures.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/TestClassWithMultipleGroupFailures.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,21 @@ +package test.skip; + +import org.testng.annotations.Test; + +public class TestClassWithMultipleGroupFailures { + + @Test(groups = "p1") + public void father() { + throw new RuntimeException("simulating a failure"); + } + + @Test(groups = "p2") + public void mother() { + throw new RuntimeException("simulating a failure"); + } + + @Test( + groups = "all", + dependsOnGroups = {"p1", "p2"}) + public void child() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skip/TestClassWithOnlyGlobalConfig.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/TestClassWithOnlyGlobalConfig.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skip/TestClassWithOnlyGlobalConfig.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/TestClassWithOnlyGlobalConfig.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,10 @@ +package test.skip; + +import org.testng.annotations.BeforeTest; + +public class TestClassWithOnlyGlobalConfig { + @BeforeTest + public void beforeTest() { + throw new RuntimeException("simulating a failure"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skip/TestClassWithOnlyTestMethods.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/TestClassWithOnlyTestMethods.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skip/TestClassWithOnlyTestMethods.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/TestClassWithOnlyTestMethods.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ +package test.skip; + +import org.testng.annotations.Test; + +public class TestClassWithOnlyTestMethods { + @Test + public void testMethod() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skip/github1632/AfterListenerSkipSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/github1632/AfterListenerSkipSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skip/github1632/AfterListenerSkipSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/github1632/AfterListenerSkipSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +package test.skip.github1632; + +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.ITestResult; +import org.testng.SkipException; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +@Listeners(AfterListenerSkipSample.MySkipTestListener.class) +public class AfterListenerSkipSample { + + @BeforeMethod + void beforeMethod() {} + + @Test + void shouldNotBeExecuted() {} + + public static class MySkipTestListener implements IInvokedMethodListener { + + @Override + public void afterInvocation(IInvokedMethod method, ITestResult testResult) { + throw new SkipException("skip"); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skip/github1632/BeforeListenerSkipSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/github1632/BeforeListenerSkipSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skip/github1632/BeforeListenerSkipSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/github1632/BeforeListenerSkipSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,29 @@ +package test.skip.github1632; + +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.ITestResult; +import org.testng.SkipException; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +// Sample from +// https://github.com/spring-projects/spring-framework/issues/26387#issuecomment-760326643 +@Listeners(BeforeListenerSkipSample.MySkipTestListener.class) +public class BeforeListenerSkipSample { + + @BeforeMethod + void beforeMethod() {} + + @Test + void shouldNotBeExecuted() {} + + public static class MySkipTestListener implements IInvokedMethodListener { + + @Override + public void beforeInvocation(IInvokedMethod invokedMethod, ITestResult testResult) { + throw new SkipException("skip"); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skip/github1632/IssueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/github1632/IssueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skip/github1632/IssueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/github1632/IssueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,54 @@ +package test.skip.github1632; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.ITestResult; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.InvokedMethodNameListener; +import test.SimpleBaseTest; + +public class IssueTest extends SimpleBaseTest { + + @Test + public void runTest() { + TestNG testng = create(TestClassSample.class); + SkipMonitoringListener listener = new SkipMonitoringListener(); + testng.addListener(listener); + testng.run(); + assertThat(listener.getStatus().get("skippingMethod")).isEqualTo(ITestResult.SKIP); + assertThat(listener.getStatus().get("passingMethod")).isEqualTo(ITestResult.SUCCESS); + assertThat(listener.getStatus().get("failingMethod")).isEqualTo(ITestResult.FAILURE); + assertThat(listener.getStatus().get("anotherFailingMethod")).isEqualTo(ITestResult.FAILURE); + } + + @Test + public void runBeforeListenerSkipSample() { + InvokedMethodNameListener listener = run(BeforeListenerSkipSample.class); + assertThat(listener.getResult("shouldNotBeExecuted").getStatus()).isEqualTo(ITestResult.SKIP); + } + + @Test + public void runNoConfigBeforeListenerSample() { + InvokedMethodNameListener listener = run(NoConfigBeforeListenerSample.class); + assertThat(listener.getResult("shouldNotBeExecuted").getStatus()).isEqualTo(ITestResult.SKIP); + } + + @Test + public void runAfterListenerSkipSample() { + InvokedMethodNameListener listener = run(AfterListenerSkipSample.class); + assertThat(listener.getResult("shouldNotBeExecuted").getStatus()).isEqualTo(ITestResult.SKIP); + } + + @Test + public void runNoConfigAfterListenerSample() { + InvokedMethodNameListener listener = run(NoConfigAfterListenerSample.class); + assertThat(listener.getResult("shouldNotBeExecuted").getStatus()).isEqualTo(ITestResult.SKIP); + } + + @Test + public void runBeforeListenerSkipSample2() { + InvokedMethodNameListener listener = run(ListenerMarksMethodAsSkippedSample.class); + assertThat(listener.getResult("shouldNotBeExecuted").getStatus()).isEqualTo(ITestResult.SKIP); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skip/github1632/ListenerMarksMethodAsSkippedSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/github1632/ListenerMarksMethodAsSkippedSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skip/github1632/ListenerMarksMethodAsSkippedSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/github1632/ListenerMarksMethodAsSkippedSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,26 @@ +package test.skip.github1632; + +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.ITestResult; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +@Listeners(ListenerMarksMethodAsSkippedSample.MySkipTestListener.class) +public class ListenerMarksMethodAsSkippedSample { + + @BeforeMethod + void beforeMethod() {} + + @Test + void shouldNotBeExecuted() {} + + public static class MySkipTestListener implements IInvokedMethodListener { + + @Override + public void afterInvocation(IInvokedMethod method, ITestResult testResult) { + testResult.setStatus(ITestResult.SKIP); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skip/github1632/NoConfigAfterListenerSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/github1632/NoConfigAfterListenerSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skip/github1632/NoConfigAfterListenerSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/github1632/NoConfigAfterListenerSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package test.skip.github1632; + +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.ITestResult; +import org.testng.SkipException; +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +@Listeners(NoConfigAfterListenerSample.MySkipTestListener.class) +public class NoConfigAfterListenerSample { + + @Test + void shouldNotBeExecuted() {} + + public static class MySkipTestListener implements IInvokedMethodListener { + + @Override + public void afterInvocation(IInvokedMethod method, ITestResult testResult) { + throw new SkipException("skip"); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skip/github1632/NoConfigBeforeListenerSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/github1632/NoConfigBeforeListenerSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skip/github1632/NoConfigBeforeListenerSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/github1632/NoConfigBeforeListenerSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,25 @@ +package test.skip.github1632; + +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.ITestResult; +import org.testng.SkipException; +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +// Sample from +// https://github.com/spring-projects/spring-framework/issues/26387#issuecomment-760326643 +@Listeners(NoConfigBeforeListenerSample.MySkipTestListener.class) +public class NoConfigBeforeListenerSample { + + @Test + void shouldNotBeExecuted() {} + + public static class MySkipTestListener implements IInvokedMethodListener { + + @Override + public void beforeInvocation(IInvokedMethod invokedMethod, ITestResult testResult) { + throw new SkipException("skip"); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skip/github1632/SkipMonitoringListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/github1632/SkipMonitoringListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skip/github1632/SkipMonitoringListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/github1632/SkipMonitoringListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,35 @@ +package test.skip.github1632; + +import java.util.HashMap; +import java.util.Map; +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.ITestResult; +import org.testng.SkipException; + +public class SkipMonitoringListener implements IInvokedMethodListener { + + private final Map status = new HashMap<>(); + + public Map getStatus() { + return status; + } + + @Override + public void beforeInvocation(IInvokedMethod iInvokedMethod, ITestResult iTestResult) { + SkipTest skipTest = + iInvokedMethod + .getTestMethod() + .getConstructorOrMethod() + .getMethod() + .getAnnotation(SkipTest.class); + if (skipTest != null) { + throw new SkipException("skip"); + } + } + + @Override + public void afterInvocation(IInvokedMethod method, ITestResult testResult) { + status.put(method.getTestMethod().getMethodName(), testResult.getStatus()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skip/github1632/SkipTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/github1632/SkipTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skip/github1632/SkipTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/github1632/SkipTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.skip.github1632; + +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.ElementType.TYPE; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +@Retention(java.lang.annotation.RetentionPolicy.RUNTIME) +@Target({METHOD, TYPE}) +public @interface SkipTest {} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skip/github1632/TestClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/github1632/TestClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skip/github1632/TestClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/github1632/TestClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,24 @@ +package test.skip.github1632; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class TestClassSample { + + @Test + public void passingMethod() {} + + @Test + @SkipTest + public void skippingMethod() {} + + @Test + public void failingMethod() { + Assert.fail(); + } + + @Test + public void anotherFailingMethod() { + throw new RuntimeException("Failure"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skip/github1967/TestClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/github1967/TestClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skip/github1967/TestClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/github1967/TestClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package test.skip.github1967; + +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +public class TestClassSample { + + @Test + public void test1min() { + Assert.fail(); + } + + @Test + public void test2min() { + Assert.fail(); + } + + @BeforeClass + public void setup() { + Assert.fail(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skip/issue2674/ConfigAwareTestNG.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/issue2674/ConfigAwareTestNG.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skip/issue2674/ConfigAwareTestNG.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/issue2674/ConfigAwareTestNG.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.skip.issue2674; + +import org.testng.CommandLineArgs; +import org.testng.TestNG; + +public class ConfigAwareTestNG extends TestNG { + + @Override + public void configure(CommandLineArgs cla) { + super.configure(cla); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skip/issue2674/TestClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/issue2674/TestClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skip/issue2674/TestClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skip/issue2674/TestClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,22 @@ +package test.skip.issue2674; + +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class TestClassSample { + @Test + void test1() { + Assert.fail(); + } + + @Test( + dataProvider = "items", + dependsOnMethods = {"test1"}) + void test2(String model, int variant) {} + + @DataProvider(name = "items") + Object[][] items() { + return new Object[][] {{"iPhone", 13}, {"iPhone-Pro", 12}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skipex/ConfigurationSkippedExceptionTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skipex/ConfigurationSkippedExceptionTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skipex/ConfigurationSkippedExceptionTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skipex/ConfigurationSkippedExceptionTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.skipex; + +import org.testng.SkipException; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +/** This class/interface */ +public class ConfigurationSkippedExceptionTest { + @BeforeMethod + public void configurationLevelSkipException() { + throw new SkipException("some skip message"); + } + + @Test + public void dummyTest() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skipex/SkipAndExpectedSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skipex/SkipAndExpectedSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skipex/SkipAndExpectedSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skipex/SkipAndExpectedSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.skipex; + +import org.testng.SkipException; +import org.testng.annotations.Test; + +public class SkipAndExpectedSampleTest { + @Test(expectedExceptions = NullPointerException.class) + public void a2() { + throw new SkipException("test"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skipex/SkipAndExpectedTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skipex/SkipAndExpectedTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skipex/SkipAndExpectedTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skipex/SkipAndExpectedTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package test.skipex; + +import org.testng.Assert; +import org.testng.ITestNGListener; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class SkipAndExpectedTest extends SimpleBaseTest { + + @Test + public void shouldSkip() { + TestNG tng = create(SkipAndExpectedSampleTest.class); + TestListenerAdapter tla = new TestListenerAdapter(); + tng.addListener((ITestNGListener) tla); + tng.run(); + + Assert.assertEquals(tla.getPassedTests().size(), 0); + Assert.assertEquals(tla.getSkippedTests().size(), 1); + Assert.assertEquals(tla.getFailedTests().size(), 0); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skipex/SkippedExceptionTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skipex/SkippedExceptionTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skipex/SkippedExceptionTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skipex/SkippedExceptionTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,47 @@ +package test.skipex; + +import java.util.List; +import org.testng.Assert; +import org.testng.ITestNGListener; +import org.testng.ITestResult; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; + +/** This class/interface */ +public class SkippedExceptionTest { + @Test + public void skippedExceptionInConfigurationMethods() { + TestListenerAdapter listener = new TestListenerAdapter(); + TestNG test = new TestNG(false); + test.addListener((ITestNGListener) listener); + test.setTestClasses(new Class[] {ConfigurationSkippedExceptionTest.class}); + test.run(); + List confSkips = listener.getConfigurationSkips(); + List testSkips = listener.getSkippedTests(); + Assert.assertEquals(testSkips.size(), 1); + Assert.assertEquals(testSkips.get(0).getMethod().getMethodName(), "dummyTest"); + + Assert.assertEquals(confSkips.size(), 1); + Assert.assertEquals( + confSkips.get(0).getMethod().getMethodName(), "configurationLevelSkipException"); + } + + @Test + public void skippedExceptionInTestMethods() { + TestListenerAdapter listener = new TestListenerAdapter(); + TestNG test = new TestNG(false); + test.addListener(listener); + test.setTestClasses(new Class[] {TestSkippedExceptionTest.class}); + test.run(); + List skips = listener.getSkippedTests(); + List failures = listener.getFailedTests(); + List passed = listener.getPassedTests(); + Assert.assertEquals(skips.size(), 1); + Assert.assertEquals(failures.size(), 1); + Assert.assertEquals(passed.size(), 1); + Assert.assertEquals(skips.get(0).getMethod().getMethodName(), "genericSkipException"); + Assert.assertEquals(failures.get(0).getMethod().getMethodName(), "timedSkipException"); + Assert.assertEquals(passed.get(0).getMethod().getMethodName(), "genericExpectedSkipException"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skipex/TestSkippedExceptionTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skipex/TestSkippedExceptionTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/skipex/TestSkippedExceptionTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/skipex/TestSkippedExceptionTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package test.skipex; + +import org.testng.SkipException; +import org.testng.TimeBombSkipException; +import org.testng.annotations.Test; + +/** This class/interface */ +public class TestSkippedExceptionTest { + @Test + public void genericSkipException() { + throw new SkipException("genericSkipException is skipped for now"); + } + + @Test(expectedExceptions = SkipException.class) + public void genericExpectedSkipException() { + throw new SkipException("genericExpectedSkipException should not be skipped"); + } + + @Test + public void timedSkipException() { + throw new TimeBombSkipException("timedSkipException is time bombed", "2007/04/10"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/suites/github1533/Github1533Test.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/suites/github1533/Github1533Test.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/suites/github1533/Github1533Test.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/suites/github1533/Github1533Test.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,46 @@ +package test.suites.github1533; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.testng.Assert.assertEquals; + +import java.io.IOException; +import java.util.List; +import org.testng.ITestNGListener; +import org.testng.TestNG; +import org.testng.TestNGException; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import org.testng.xml.internal.Parser; +import test.SimpleBaseTest; + +public class Github1533Test extends SimpleBaseTest { + @Test + public void testScenarioWithChildSuites() { + String suiteFile = "src/test/resources/xml/github1533/parent.xml"; + runTests(suiteFile, 1, 2, "GitHub1533_Suite", "GitHub1533_Parent_Suite"); + } + + @Test + public void testScenarioWithNoChildSuites() { + String suiteFile = "src/test/resources/xml/github1533/child.xml"; + runTests(suiteFile, 0, 1, "GitHub1533_Suite"); + } + + private static void runTests( + String suiteFile, int childSuitesCount, int suiteCounter, String... suiteNames) { + List suites; + try { + suites = new Parser(suiteFile).parseToList(); + } catch (IOException e) { + throw new TestNGException(e); + } + assertEquals(suites.size(), 1); + assertEquals(suites.get(0).getChildSuites().size(), childSuitesCount); + TestNG testng = create(suites); + SuiteCounter listener = new SuiteCounter(); + testng.addListener((ITestNGListener) listener); + testng.run(); + assertEquals(listener.getCounter(), suiteCounter); + assertThat(listener.getSuiteNames()).containsExactly(suiteNames); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/suites/github1533/SampleTestClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/suites/github1533/SampleTestClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/suites/github1533/SampleTestClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/suites/github1533/SampleTestClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ +package test.suites.github1533; + +import org.testng.annotations.Test; + +public class SampleTestClassSample { + @Test + public void testMethod() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/suites/github1533/SuiteCounter.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/suites/github1533/SuiteCounter.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/suites/github1533/SuiteCounter.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/suites/github1533/SuiteCounter.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,29 @@ +package test.suites.github1533; + +import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; +import org.testng.ISuite; +import org.testng.ISuiteListener; +import org.testng.collections.Lists; + +public class SuiteCounter implements ISuiteListener { + private final AtomicInteger counter = new AtomicInteger(0); + private final List suiteNames = Lists.newArrayList(); + + @Override + public void onStart(ISuite suite) { + counter.incrementAndGet(); + suiteNames.add(suite.getName()); + } + + @Override + public void onFinish(ISuite suite) {} + + public int getCounter() { + return counter.get(); + } + + public List getSuiteNames() { + return suiteNames; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/suites/github1850/DuplicateChildSuitesInitializationTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/suites/github1850/DuplicateChildSuitesInitializationTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/suites/github1850/DuplicateChildSuitesInitializationTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/suites/github1850/DuplicateChildSuitesInitializationTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,60 @@ +package test.suites.github1850; + +import static org.testng.Assert.assertEquals; + +import java.io.IOException; +import java.util.List; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import org.testng.xml.internal.Parser; +import test.SimpleBaseTest; + +/** + * This test checks that TestNG can handle duplicate child suites when we have the following set of + * files: + * + *

- parent-suite-with-duplicate-child -> [child-suite-1, children/child-suite-3, child-suite1, + * children/child-suite-3] - children/child-suite-3 -> [../child-suite-2, child-suite-4, + * morechildren/child-suite-5] + * + *

SHOULD return a XmlSuite object with following structure: + * + *

parent-suite-with-duplicate-child ├───child-suite-1 ├───child-suite-3 │ ├───child-suite-2 │ + * ├───child-suite-4 │ └───child-suite-5 ├───child-suite-1(0) └───child-suite-3(0) + * ├───child-suite-2(0) ├───child-suite-4(0) └───child-suite-5(0) + * + *

but NOT like: + * + *

parent-suite-with-duplicate-child ├───child-suite-1 ├───child-suite-3 ├───child-suite-1(0) + * └───child-suite-3(0) ├───child-suite-2 ├───child-suite-4 ├───child-suite-5 ├───child-suite-2(0) + * ├───child-suite-4(0) └───child-suite-5(0) + * + *

Check the checksuitesinitialization folder under test resources + */ +public class DuplicateChildSuitesInitializationTest extends SimpleBaseTest { + @Test + public void checkDuplicateChildSuites() throws IOException { + String path = + getPathToResource("checksuitesinitialization/parent-suite-with-duplicate-child.xml"); + Parser parser = new Parser(path); + List suites = parser.parseToList(); + XmlSuite rootSuite = suites.get(0); + assertEquals(rootSuite.getChildSuites().size(), 4); + + XmlSuite suite3 = rootSuite.getChildSuites().get(1); + assertEquals(suite3.getName(), "Child Suite 3"); + assertEquals(suite3.getChildSuites().size(), 3); + + XmlSuite suite3_0 = rootSuite.getChildSuites().get(3); + assertEquals(suite3.getName(), "Child Suite 3"); + assertEquals(suite3_0.getChildSuites().size(), 3); + + XmlSuite suite5 = suite3.getChildSuites().get(2); + assertEquals(suite5.getName(), "Child Suite 5"); + assertEquals(suite5.getTests().size(), 1); + + XmlSuite suite5_0 = suite3_0.getChildSuites().get(2); + assertEquals(suite5_0.getName(), "Child Suite 5"); + assertEquals(suite5_0.getTests().size(), 1); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/suites/github1874/IssueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/suites/github1874/IssueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/suites/github1874/IssueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/suites/github1874/IssueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +package test.suites.github1874; + +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlClass; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.SimpleBaseTest; + +public class IssueTest extends SimpleBaseTest { + + @Test + // We are explicitly not including any assertions here because the intent of this test is to + // ensure that there are no exceptions triggered related to circular dependency. + public void testEnsureNoCyclicDependencyTriggered() { + XmlSuite suite = createXmlSuite("sample_suite"); + XmlTest test = createXmlTest(suite, "sample_test"); + XmlClass entryOne = new XmlClass(TestClassSample.class); + createXmlInclude(entryOne, "testMethodTwo"); + test.getClasses().add(entryOne); + XmlClass entryTwo = new XmlClass(TestClassSample.class); + createXmlInclude(entryTwo, "testMethodOne"); + test.getClasses().add(entryTwo); + TestNG testng = create(suite); + testng.run(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/suites/github1874/TestClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/suites/github1874/TestClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/suites/github1874/TestClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/suites/github1874/TestClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.suites.github1874; + +import org.testng.annotations.Test; + +public class TestClassSample { + @Test + public void testMethodOne() {} + + @Test + public void testMethodTwo() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/superclass/Base1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/superclass/Base1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/superclass/Base1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/superclass/Base1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.superclass; + +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class Base1 { + @BeforeClass + public void bc() {} + + @BeforeMethod + public void bm() {} + + @Test + public void tbase() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/superclass/Base2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/superclass/Base2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/superclass/Base2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/superclass/Base2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.superclass; + +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +@Test +public class Base2 { + @BeforeClass + public void bc() {} + + @BeforeMethod + public void bm() {} + + public void tbase() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/superclass/BaseSampleTest3.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/superclass/BaseSampleTest3.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/superclass/BaseSampleTest3.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/superclass/BaseSampleTest3.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,10 @@ +package test.superclass; + +import org.testng.annotations.Test; + +public class BaseSampleTest3 { + @Test + public void base() { + assert true; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/superclass/Child1Test.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/superclass/Child1Test.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/superclass/Child1Test.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/superclass/Child1Test.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.superclass; + +import org.testng.annotations.Test; + +@Test +public class Child1Test extends Base1 { + public void t1() {} + + public void t2() {} + + public void t3() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/superclass/Child2Test.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/superclass/Child2Test.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/superclass/Child2Test.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/superclass/Child2Test.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.superclass; + +import org.testng.annotations.Test; + +@Test +public class Child2Test extends Base2 { + public void t1() {} + + public void t2() {} + + public void t3() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/superclass/ChildSampleTest3.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/superclass/ChildSampleTest3.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/superclass/ChildSampleTest3.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/superclass/ChildSampleTest3.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.superclass; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class ChildSampleTest3 extends BaseSampleTest3 { + @Test + public void pass() { + Assert.assertTrue(true); + } + + @Test + public void fail() { + Assert.assertTrue(false); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/superclass/MainTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/superclass/MainTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/superclass/MainTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/superclass/MainTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +package test.superclass; + +import org.testng.annotations.Test; +import test.BaseTest; + +public class MainTest extends BaseTest { + + @Test + public void baseMethodIsCalledWithMethodTest() { + addClass("test.superclass.Child1Test"); + run(); + String[] passed = {"tbase", "t1", "t2", "t3"}; + String[] failed = {}; + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Failed", failed, getFailedTests()); + } + + @Test + public void baseMethodIsCalledWithClassTest() { + addClass("test.superclass.Child2Test"); + run(); + String[] passed = {"tbase", "t1", "t2", "t3"}; + String[] failed = {}; + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Failed", failed, getFailedTests()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/superclass/Test3.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/superclass/Test3.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/superclass/Test3.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/superclass/Test3.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.superclass; + +import org.testng.annotations.Test; +import test.BaseTest; + +public class Test3 extends BaseTest { + + @Test + public void shouldExcludeBaseMethods() { + addClass("test.superclass.ChildSampleTest3"); + addExcludedMethod("test.superclass.ChildSampleTest3", "pass"); + addExcludedMethod("test.superclass.ChildSampleTest3", "base"); + run(); + String[] passed = {}; + String[] failed = {"fail"}; + verifyTests("Failed", failed, getFailedTests()); + verifyTests("Passed", passed, getPassedTests()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/test111/AbstractTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/test111/AbstractTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/test111/AbstractTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/test111/AbstractTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package test.test111; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.Test; + +public abstract class AbstractTest { + + public static int R = 0; + + @Test + public void testAbstract() {} + + @AfterClass + public void afterClass() { + R++; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/test111/Test1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/test111/Test1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/test111/Test1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/test111/Test1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.test111; + +import org.junit.Assert; +import org.testng.annotations.Test; + +public class Test1 extends AbstractTest { + @Test + public void test() { + Assert.assertEquals(0, AbstractTest.R); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testnames/TestNamesFeature.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testnames/TestNamesFeature.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testnames/TestNamesFeature.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testnames/TestNamesFeature.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.testnames; + +import org.testng.annotations.Test; + +public class TestNamesFeature { + + @Test + public void sampleOutputTest1() {} + + @Test + public void sampleOutputTest2() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testnames/TestNamesTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testnames/TestNamesTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testnames/TestNamesTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testnames/TestNamesTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,26 @@ +package test.testnames; + +import java.util.Collections; +import org.testng.Assert; +import org.testng.ITestNGListener; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class TestNamesTest extends SimpleBaseTest { + + @Test + public void checkWithoutChildSuites() { + TestListenerAdapter tla = new TestListenerAdapter(); + TestNG tng = create(); + tng.setTestNames(Collections.singletonList("testGroup2")); + tng.setTestSuites(Collections.singletonList(getPathToResource("testnames/upstream-suite.xml"))); + tng.addListener((ITestNGListener) tla); + tng.run(); + Assert.assertEquals(tla.getFailedTests().size(), 0); + Assert.assertEquals(tla.getPassedTests().size(), 1); + Assert.assertEquals( + tla.getPassedTests().get(0).getMethod().getMethodName(), "sampleOutputTest2"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng106/FailingSuiteFixture.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng106/FailingSuiteFixture.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng106/FailingSuiteFixture.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng106/FailingSuiteFixture.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,13 @@ +package test.testng106; + +import org.testng.annotations.BeforeSuite; + +/** TESTNG-106: failing @BeforeSuite doesn't skip all tests */ +public class FailingSuiteFixture { + static int s_invocations = 0; + + @BeforeSuite + public void failingBeforeSuite() { + throw new RuntimeException(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng106/Test1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng106/Test1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng106/Test1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng106/Test1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.testng106; + +import org.testng.annotations.Test; + +/** This class/interface */ +public class Test1 { + @Test + public void method1() { + System.out.println("method1"); + FailingSuiteFixture.s_invocations++; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng106/Test2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng106/Test2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng106/Test2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng106/Test2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ +package test.testng106; + +import org.testng.annotations.Test; + +/** This class/interface */ +public class Test2 { + @Test + public void method2() { + System.out.println("method2"); + FailingSuiteFixture.s_invocations++; + } + + @Test + public void method3() { + System.out.println("method3"); + FailingSuiteFixture.s_invocations++; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng106/TestNG106.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng106/TestNG106.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng106/TestNG106.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng106/TestNG106.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,26 @@ +package test.testng106; + +import java.util.Arrays; +import org.testng.Assert; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import test.SimpleBaseTest; + +public class TestNG106 extends SimpleBaseTest { + @Test + public void testFailingBeforeSuiteShouldSkipAllTests() throws Exception { + TestNG tng = create(); + XmlSuite s = createXmlSuite("TESTNG-106"); + createXmlTest(s, "myTest1", FailingSuiteFixture.class.getName(), Test1.class.getName()); + createXmlTest(s, "myTest2", Test1.class.getName()); + createXmlTest(s, "myTest3", Test2.class.getName()); + createXmlTest(s, "myTest-last", Test2.class.getName()); + tng.setXmlSuites(Arrays.asList(s)); + tng.run(); + Assert.assertEquals( + FailingSuiteFixture.s_invocations, + 0, + "@BeforeSuite has failed. All tests should be skipped."); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng109/SkippedTestWithExpectedExceptionTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng109/SkippedTestWithExpectedExceptionTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng109/SkippedTestWithExpectedExceptionTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng109/SkippedTestWithExpectedExceptionTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,22 @@ +package test.testng109; + +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +/** This class/interface */ +public class SkippedTestWithExpectedExceptionTest { + @BeforeClass + public void setup() { + throw new RuntimeException("test-exception"); + } + + @Test + public void test1() { + // empty + } + + @Test(expectedExceptions = {OutOfMemoryError.class}) + public void test2() { + // empty + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng1231/ListenerOrderTestSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng1231/ListenerOrderTestSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng1231/ListenerOrderTestSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng1231/ListenerOrderTestSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ +package test.testng1231; + +import org.testng.annotations.Test; + +public class ListenerOrderTestSample { + @Test + public void testMethod() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng1231/TestExecutionListenerInvocationOrder.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng1231/TestExecutionListenerInvocationOrder.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng1231/TestExecutionListenerInvocationOrder.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng1231/TestExecutionListenerInvocationOrder.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,62 @@ +package test.testng1231; + +import com.beust.jcommander.internal.Lists; +import java.util.Arrays; +import java.util.LinkedList; +import java.util.List; +import org.testng.*; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.SimpleBaseTest; + +public class TestExecutionListenerInvocationOrder extends SimpleBaseTest { + @Test + public void testListenerOrder() { + XmlSuite xmlSuite = createXmlSuite("Suite"); + XmlTest xmlTest = createXmlTest(xmlSuite, "Test"); + createXmlClass(xmlTest, ListenerOrderTestSample.class); + TestNG tng = create(xmlSuite); + TestListenerFor1231 listener = new TestListenerFor1231(); + tng.addListener((ITestNGListener) listener); + tng.run(); + List expected = Arrays.asList(1, 2, 3, 4, 5, 6); + Assert.assertEquals(TestListenerFor1231.order, expected); + } + + public static class TestListenerFor1231 + implements IExecutionListener, IAlterSuiteListener, IReporter, ISuiteListener { + public static LinkedList order = Lists.newLinkedList(); + + @Override + public void onExecutionStart() { + order.add(1); + } + + @Override + public void onExecutionFinish() { + order.add(6); + } + + @Override + public void generateReport( + List xmlSuites, List suites, String outputDirectory) { + order.add(5); + } + + @Override + public void alter(List suites) { + order.add(2); + } + + @Override + public void onStart(ISuite suite) { + order.add(3); + } + + @Override + public void onFinish(ISuite suite) { + order.add(4); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng1232/ListenerTemplate.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng1232/ListenerTemplate.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng1232/ListenerTemplate.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng1232/ListenerTemplate.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,72 @@ +package test.testng1232; + +import java.util.List; +import org.testng.*; +import org.testng.xml.XmlSuite; + +/** + * This class provides "void" implementations for all listener invocations so that one can tweak + * behavior of only those methods which need customization. (Mainly to circumvent verbosity in + * actual listener implementations) + */ +public class ListenerTemplate + implements IInvokedMethodListener, + IClassListener, + ITestListener, + ISuiteListener, + IAlterSuiteListener, + IExecutionListener, + IReporter { + + @Override + public void onBeforeClass(ITestClass testClass) {} + + @Override + public void onAfterClass(ITestClass testClass) {} + + @Override + public void onStart(ISuite suite) {} + + @Override + public void onFinish(ISuite suite) {} + + @Override + public void beforeInvocation(IInvokedMethod method, ITestResult testResult) {} + + @Override + public void afterInvocation(IInvokedMethod method, ITestResult testResult) {} + + @Override + public void onTestStart(ITestResult result) {} + + @Override + public void onTestSuccess(ITestResult result) {} + + @Override + public void onTestFailure(ITestResult result) {} + + @Override + public void onTestSkipped(ITestResult result) {} + + @Override + public void onTestFailedButWithinSuccessPercentage(ITestResult result) {} + + @Override + public void onStart(ITestContext context) {} + + @Override + public void onFinish(ITestContext context) {} + + @Override + public void onExecutionStart() {} + + @Override + public void onExecutionFinish() {} + + @Override + public void alter(List suites) {} + + @Override + public void generateReport( + List xmlSuites, List suites, String outputDirectory) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng1232/TestClassContainer.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng1232/TestClassContainer.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng1232/TestClassContainer.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng1232/TestClassContainer.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.testng1232; + +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +/** This Class houses all the test classes that are required by {@link TestListenerInstances} */ +public class TestClassContainer { + + public static class SimpleTestClass { + @Test + public void testMethod() {} + } + + @Listeners(TestListenerFor1232.class) + public static class SimpleTestClassWithListener { + @Test + public void testMethod() {} + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng1232/TestListenerFor1232.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng1232/TestListenerFor1232.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng1232/TestListenerFor1232.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng1232/TestListenerFor1232.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,71 @@ +package test.testng1232; + +import java.util.List; +import java.util.Map; +import java.util.concurrent.atomic.AtomicInteger; +import org.testng.*; +import org.testng.collections.Maps; +import org.testng.xml.XmlSuite; + +public class TestListenerFor1232 extends ListenerTemplate { + static Map counters = Maps.newHashMap(); + + static synchronized void resetCounters() { + counters = Maps.newHashMap(); + } + + @Override + public void beforeInvocation(IInvokedMethod method, ITestResult testResult) { + incrementCounter(CounterTypes.METHOD); + } + + @Override + public void onBeforeClass(ITestClass testClass) { + incrementCounter(CounterTypes.CLASS); + } + + @Override + public void onStart(ITestContext context) { + incrementCounter(CounterTypes.TEST); + } + + @Override + public void onStart(ISuite suite) { + incrementCounter(CounterTypes.SUITE); + } + + @Override + public void alter(List suites) { + incrementCounter(CounterTypes.ALTER_SUITE); + } + + @Override + public void onExecutionStart() { + incrementCounter(CounterTypes.EXECUTION); + } + + @Override + public void generateReport( + List xmlSuites, List suites, String outputDirectory) { + incrementCounter(CounterTypes.REPORTER); + } + + private void incrementCounter(CounterTypes type) { + if (!counters.containsKey(type)) { + counters.put(type, new AtomicInteger(0)); + } + AtomicInteger value = counters.get(type); + value.incrementAndGet(); + counters.put(type, value); + } + + enum CounterTypes { + METHOD, + CLASS, + TEST, + SUITE, + ALTER_SUITE, + EXECUTION, + REPORTER + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng1232/TestListenerInstances.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng1232/TestListenerInstances.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng1232/TestListenerInstances.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng1232/TestListenerInstances.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,55 @@ +package test.testng1232; + +import org.testng.Assert; +import org.testng.ITestNGListener; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.SimpleBaseTest; +import test.testng1232.TestListenerFor1232.CounterTypes; + +public class TestListenerInstances extends SimpleBaseTest { + + @Test + public void testIfOnlyOneListenerInstanceExists() { + runTestForTestClass(TestClassContainer.SimpleTestClass.class); + } + + @Test + public void testIfOnlyOneListenerInstanceExistsUsingAnnotations() { + runTestForTestClass(TestClassContainer.SimpleTestClassWithListener.class); + } + + @Test + public void testIfOnlyOneListenerInstanceExistsUsingListenerTag() { + runTestForTestClass(TestClassContainer.SimpleTestClass.class, true); + } + + private static void runTestForTestClass(Class clazz) { + runTestForTestClass(clazz, false); + } + + private static void runTestForTestClass(Class clazz, boolean injectListenerViaTag) { + TestNG tng = createTestNGInstanceFor(clazz, injectListenerViaTag); + TestListenerFor1232.resetCounters(); + TestListenerFor1232 listener = new TestListenerFor1232(); + tng.addListener((ITestNGListener) listener); + TestListenerFor1232 anotherListener = new TestListenerFor1232(); + tng.addListener((ITestNGListener) anotherListener); + tng.run(); + for (CounterTypes type : CounterTypes.values()) { + Assert.assertEquals(TestListenerFor1232.counters.get(type).intValue(), 1); + } + } + + private static TestNG createTestNGInstanceFor(Class clazz, boolean addListenerTag) { + XmlSuite xmlSuite = createXmlSuite("Suite"); + if (addListenerTag) { + xmlSuite.addListener(TestListenerFor1232.class.getName()); + } + XmlTest xmlTest = createXmlTest(xmlSuite, "Test"); + createXmlClass(xmlTest, clazz); + return create(xmlSuite); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng1396/ParallelByInstancesInterceptorTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng1396/ParallelByInstancesInterceptorTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng1396/ParallelByInstancesInterceptorTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng1396/ParallelByInstancesInterceptorTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,107 @@ +package test.testng1396; + +import static org.testng.Assert.fail; + +import java.util.Comparator; +import java.util.List; +import org.testng.IMethodInstance; +import org.testng.IMethodInterceptor; +import org.testng.ITestContext; +import org.testng.ITestNGListener; +import org.testng.ITestNGMethod; +import org.testng.ITestResult; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.collections.Lists; +import org.testng.xml.XmlSuite; + +public class ParallelByInstancesInterceptorTest { + + @Test(description = "test for https://github.com/cbeust/testng/issues/1396") + public void should_honor_interceptor_order_when_running_parallel_instances() { + TestNG tng = new TestNG(); + + // 10 instances is enough that we see the non-deterministic ordering of hashmaps more often than + // not + tng.setTestClasses( + new Class[] { + SampleFor1396.Sample9For1396.class, + SampleFor1396.Sample8For1396.class, + SampleFor1396.Sample7For1396.class, + SampleFor1396.Sample6For1396.class, + SampleFor1396.Sample5For1396.class, + SampleFor1396.Sample4For1396.class, + SampleFor1396.Sample3For1396.class, + SampleFor1396.Sample2For1396.class, + SampleFor1396.Sample1For1396.class, + SampleFor1396.Sample0For1396.class + }); + + // bug only exists when running parallel by instances with this flag set to false + tng.setParallel(XmlSuite.ParallelMode.INSTANCES); + tng.setPreserveOrder(false); + // thread count of 1 forces sequential execution so we can verify ordering + tng.setThreadCount(1); + + TestListenerAdapter adapter = new TestListenerAdapter(); + tng.addListener((ITestNGListener) adapter); + + // Runs tests annotated with @TestNG1396HighPriority before tests without it + ReverseOrderTestInterceptor listener = new ReverseOrderTestInterceptor(); + tng.addListener(listener); + + tng.run(); + + List passedTests = adapter.getPassedTests(); + + boolean lowPrioritySeen = false; + + for (ITestResult testResult : passedTests) { + if (isHighPriority(testResult.getMethod())) { + if (lowPrioritySeen) { + fail("high priority should be first"); + } + } else { + lowPrioritySeen = true; + } + } + } + + private static boolean isHighPriority(IMethodInstance instance) { + return instance.getInstance().getClass().getAnnotation(TestNG1396HighPriority.class) != null; + } + + private static boolean isHighPriority(ITestNGMethod method) { + return method.getInstance().getClass().getAnnotation(TestNG1396HighPriority.class) != null; + } + + public class ReverseOrderTestInterceptor implements IMethodInterceptor { + @Override + public List intercept(List methods, ITestContext context) { + List sorted = Lists.newArrayList(methods); + sorted.sort(new PriorityComparator()); + return sorted; + } + } + + public class PriorityComparator implements Comparator { + @Override + public int compare(IMethodInstance o1, IMethodInstance o2) { + if (isHighPriority(o1)) { + if (isHighPriority(o2)) { + return compareMethodNames(o1, o2); + } + return -1; + } + if (isHighPriority(o2)) { + return 1; + } + return compareMethodNames(o1, o2); + } + + private int compareMethodNames(IMethodInstance o1, IMethodInstance o2) { + return o2.getMethod().getQualifiedName().compareTo(o1.getMethod().getQualifiedName()); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng1396/SampleFor1396.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng1396/SampleFor1396.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng1396/SampleFor1396.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng1396/SampleFor1396.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,60 @@ +package test.testng1396; + +import org.testng.annotations.Test; + +public class SampleFor1396 { + public class Sample0For1396 { + @Test + public void sample() {} + } + + @TestNG1396HighPriority + public class Sample1For1396 { + @Test + public void sample() {} + } + + public class Sample2For1396 { + @Test + public void sample() {} + } + + @TestNG1396HighPriority + public class Sample3For1396 { + @Test + public void sample() {} + } + + public class Sample4For1396 { + @Test + public void sample() {} + } + + @TestNG1396HighPriority + public class Sample5For1396 { + @Test + public void sample() {} + } + + public class Sample6For1396 { + @Test + public void sample() {} + } + + @TestNG1396HighPriority + public class Sample7For1396 { + @Test + public void sample() {} + } + + public class Sample8For1396 { + @Test + public void sample() {} + } + + @TestNG1396HighPriority + public class Sample9For1396 { + @Test + public void sample() {} + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng1396/TestNG1396HighPriority.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng1396/TestNG1396HighPriority.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng1396/TestNG1396HighPriority.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng1396/TestNG1396HighPriority.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.testng1396; + +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.ElementType.TYPE; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target({METHOD, TYPE}) +@Retention(RetentionPolicy.RUNTIME) +public @interface TestNG1396HighPriority {} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng173/ClassA.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng173/ClassA.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng173/ClassA.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng173/ClassA.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.testng173; + +import org.testng.annotations.Test; + +public class ClassA { + + @Test + public void test1() {} + + @Test(dependsOnMethods = "test1") + public void test2() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng173/ClassB.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng173/ClassB.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng173/ClassB.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng173/ClassB.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package test.testng173; + +import org.testng.annotations.*; + +public class ClassB { + @Test + public void testX() {} + + @Test(dependsOnMethods = "testX") + public void test2() {} + + @Test(dependsOnMethods = "test2") + public void test1() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng173/TestNG173Test.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng173/TestNG173Test.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng173/TestNG173Test.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng173/TestNG173Test.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,66 @@ +package test.testng173; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Arrays; +import org.testng.ITestNGListener; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlClass; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.InvokedMethodNameListener; +import test.SimpleBaseTest; + +public class TestNG173Test extends SimpleBaseTest { + + @Test + public void orderShouldBePreservedInMethodsWithSameNameAndInDifferentClasses() { + TestNG tng = create(); + XmlSuite s = createXmlSuite("PreserveOrder"); + XmlTest t = new XmlTest(s); + + t.getXmlClasses().add(new XmlClass("test.testng173.ClassA")); + t.getXmlClasses().add(new XmlClass("test.testng173.ClassB")); + + t.setPreserveOrder(true); + + tng.setXmlSuites(Arrays.asList(s)); + + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener((ITestNGListener) listener); + tng.run(); + + // bug + // verifyPassedTests(tla, "test1", "test2", "testX", "test1", "test2"); + + // Proposed fix + assertThat(listener.getSucceedMethodNames()) + .containsExactly("test1", "test2", "testX", "test2", "test1"); + } + + @Test + public void + orderShouldBePreservedInMethodsWithSameNameAndInDifferentClassesAndDifferentPackage() { + TestNG tng = create(); + XmlSuite s = createXmlSuite("PreserveOrder"); + XmlTest t = new XmlTest(s); + + t.getXmlClasses().add(new XmlClass("test.testng173.ClassA")); + t.getXmlClasses().add(new XmlClass("test.testng173.anotherpackage.ClassC")); + + t.setPreserveOrder(true); + + tng.setXmlSuites(Arrays.asList(s)); + + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener((ITestNGListener) listener); + tng.run(); + + // bug + // verifyPassedTests(tla, "test1", "test2", "testX", "test1", "test2"); + + assertThat(listener.getSucceedMethodNames()) + .containsExactly("test1", "test2", "testX", "test2", "test1"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng173/anotherpackage/ClassC.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng173/anotherpackage/ClassC.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng173/anotherpackage/ClassC.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng173/anotherpackage/ClassC.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.testng173.anotherpackage; + +import org.testng.annotations.Test; + +public class ClassC { + + @Test + public void testX() {} + + @Test(dependsOnMethods = "testX") + public void test2() {} + + @Test(dependsOnMethods = "test2") + public void test1() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng195/AfterMethodSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng195/AfterMethodSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng195/AfterMethodSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng195/AfterMethodSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,26 @@ +package test.testng195; + +import java.lang.reflect.Method; +import org.testng.IResultMap; +import org.testng.ITestContext; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +public class AfterMethodSampleTest { + static boolean m_success; + + @Test + public void pass() {} + + @BeforeClass + public void init() { + m_success = false; + } + + @AfterMethod + public void afterMethod(ITestContext c, Method m) { + IResultMap map = c.getPassedTests(); + m_success = map.size() == 1; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng195/AfterMethodTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng195/AfterMethodTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng195/AfterMethodTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng195/AfterMethodTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.testng195; + +import org.testng.Assert; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class AfterMethodTest extends SimpleBaseTest { + + @Test + public void testContextShouldBeInitialized() { + TestNG tng = create(AfterMethodSampleTest.class); + tng.run(); + Assert.assertTrue(AfterMethodSampleTest.m_success); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng249/B.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng249/B.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng249/B.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng249/B.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.testng249; + +import org.testng.annotations.Test; + +public class B extends Base { + @Override + @Test + public void b() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng249/Base.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng249/Base.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng249/Base.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng249/Base.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ +package test.testng249; + +import org.testng.annotations.Test; + +public class Base { + @Test + public void b() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng249/VerifyTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng249/VerifyTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng249/VerifyTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng249/VerifyTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,39 @@ +package test.testng249; + +import java.util.Arrays; +import java.util.Collections; +import org.testng.Assert; +import org.testng.ITestNGListener; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlClass; +import org.testng.xml.XmlInclude; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.SimpleBaseTest; + +public class VerifyTest extends SimpleBaseTest { + + @Test + public void verify() { + XmlSuite suite = new XmlSuite(); + suite.setName("Suite"); + + XmlTest test = new XmlTest(suite); + test.setName("Test"); + XmlClass c1 = new XmlClass(B.class); + c1.setIncludedMethods(Collections.singletonList(new XmlInclude("b"))); + XmlClass c2 = new XmlClass(Base.class); + c2.setIncludedMethods(Collections.singletonList(new XmlInclude("b"))); + test.setXmlClasses(Arrays.asList(c1, c2)); + + TestNG tng = new TestNG(); + tng.setXmlSuites(Collections.singletonList(suite)); + TestListenerAdapter tla = new TestListenerAdapter(); + tng.addListener((ITestNGListener) tla); + tng.run(); + + Assert.assertEquals(tla.getPassedTests().size(), 2); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng285/BugBase.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng285/BugBase.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng285/BugBase.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng285/BugBase.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,24 @@ +package test.testng285; + +import java.util.HashSet; +import java.util.Set; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +@Test(singleThreaded = true) +public class BugBase { + static Set m_threadIds; + + @BeforeClass + public void setup() { + m_threadIds = new HashSet<>(); + } + + void log(long threadId) { + m_threadIds.add(threadId); + } + + public void fbase() { + log(Thread.currentThread().getId()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng285/Derived.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng285/Derived.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng285/Derived.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng285/Derived.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.testng285; + +import org.testng.annotations.Test; + +public class Derived extends BugBase { + + @Test + public void f1() { + log(Thread.currentThread().getId()); + } + + @Test + public void f2() { + log(Thread.currentThread().getId()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng285/TestNG285Test.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng285/TestNG285Test.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng285/TestNG285Test.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng285/TestNG285Test.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.testng285; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import test.BaseTest; + +public class TestNG285Test extends BaseTest { + + @Test + public void verifyBug() { + addClass("test.testng285.Derived"); + setParallel(XmlSuite.ParallelMode.METHODS); + setThreadCount(5); + + run(); + + Assert.assertEquals(BugBase.m_threadIds.size(), 1); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng317/ClassA.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng317/ClassA.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng317/ClassA.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng317/ClassA.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,59 @@ +package test.testng317; + +import org.testng.annotations.Test; + +public class ClassA { + @Test + public void sameNameA() { + printMethod(); + } + + @Test(dependsOnMethods = "sameNameA") + public void uniqueNameB() { + printMethod(); + } + + @Test(dependsOnMethods = "uniqueNameB") + public void uniqueNameC() { + printMethod(); + } + + @Test(dependsOnMethods = "uniqueNameC") + public void uniqueNameD() { + printMethod(); + } + + @Test(dependsOnMethods = "uniqueNameD") + public void sameNameE() { + printMethod(); + } + + @Test(dependsOnMethods = "sameNameE") + public void sameNameF() { + printMethod(); + } + + @Test(dependsOnMethods = "sameNameF") + public void sameNameG() { + printMethod(); + } + + @Test(dependsOnMethods = "sameNameG") + public void sameNameH() { + printMethod(); + } + + public void nullTest() { + printMethod(); + } + + protected void printMethod() { + StackTraceElement[] sTrace = new Exception().getStackTrace(); + String className = sTrace[0].getClassName(); + String methodName = sTrace[1].getMethodName(); + + System.out.printf("*********** executing --- %s %s\n", className, methodName); + + VerifyTest.m_methods.add(className + "." + methodName); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng317/ClassB.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng317/ClassB.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng317/ClassB.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng317/ClassB.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,44 @@ +package test.testng317; + +import org.testng.annotations.Test; + +public class ClassB { + @Test + public void sameNameAA() { + printMethod(); + } + + @Test(dependsOnMethods = "sameNameAA") + public void uniqueNameBB() { + printMethod(); + } + + @Test(dependsOnMethods = "uniqueNameBB") + public void uniqueNameCC() { + printMethod(); + } + + @Test(dependsOnMethods = "uniqueNameCC") + public void uniqueNameDD() { + printMethod(); + } + + @Test(dependsOnMethods = "uniqueNameDD") + public void sameNameE() { + printMethod(); + } + + public void nullTest() { + printMethod(); + } + + protected void printMethod() { + StackTraceElement[] sTrace = new Exception().getStackTrace(); + String className = sTrace[0].getClassName(); + String methodName = sTrace[1].getMethodName(); + + System.out.printf("*********** executing --- %s %s\n", className, methodName); + + VerifyTest.m_methods.add(className + "." + methodName); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng317/VerifyTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng317/VerifyTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng317/VerifyTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng317/VerifyTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,26 @@ +package test.testng317; + +import java.util.ArrayList; +import java.util.List; +import org.testng.TestNG; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class VerifyTest extends SimpleBaseTest { + static List m_methods = new ArrayList<>(); + + @BeforeMethod + public void before() { + m_methods = new ArrayList<>(); + } + + @Test + public void verify() { + TestNG tng = create(); + tng.setTestClasses(new Class[] {test.testng317.ClassB.class, test.testng317.ClassA.class}); + tng.run(); + + System.out.println("Methods:" + m_methods.size()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng37/NullParameterTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng37/NullParameterTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng37/NullParameterTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng37/NullParameterTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.testng37; + +import org.testng.Assert; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; + +/** This class/interface */ +public class NullParameterTest { + @Test + @Parameters({"notnull", "nullvalue"}) + public void nullParameter(String notNull, int mustBeNull) { + Assert.assertNotNull(notNull, "not null parameter expected"); + Assert.assertNull(mustBeNull, "null parameter expected"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng37/testng-37.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng37/testng-37.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng37/testng-37.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng37/testng-37.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng387/FailedDPTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng387/FailedDPTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng387/FailedDPTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng387/FailedDPTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,45 @@ +package test.testng387; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +/** + * test for https://jira.opensymphony.com/browse/TESTNG-387 The invocation-numbers logic in + * failed.xml is wrong for dataprovider and parallel=true + * + *

The test will throw exception when numbers are prime, so getFailedInvocationNumbers() should + * be a list of prime numbers. + * + * @author freynaud + */ +public class FailedDPTest { + static final List primes = Arrays.asList(2, 3, 5, 7); + + /** DP generating all number from 0 to 9. */ + @DataProvider(name = "DP", parallel = true) + public Iterator getData() { + List list = new ArrayList<>(); + for (int i = 0; i < 10; i++) { + list.add(new Integer[] {i}); + } + return list.iterator(); + } + + /** + * Throws an exception for a prime number. + * + * @throws Exception + */ + @Test( + dataProvider = "DP", + groups = {"DPTest"}) + public void isNotPrime(Integer i) throws Exception { + if (primes.contains(i)) { + throw new Exception(i + " is prime"); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng387/TestNG387.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng387/TestNG387.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng387/TestNG387.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng387/TestNG387.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +package test.testng387; + +import static org.testng.Assert.assertEqualsNoOrder; + +import java.util.List; +import org.testng.*; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import test.SimpleBaseTest; + +public class TestNG387 extends SimpleBaseTest { + @Test(invocationCount = 500) + public void testInvocationCounterIsCorrectForMethodWithDataProvider() { + final TestNG tng = create(FailedDPTest.class); + tng.setThreadCount(1); + tng.setParallel(XmlSuite.ParallelMode.NONE); + tng.setPreserveOrder(true); + final TestListenerAdapter tla = new TestListenerAdapter(); + tng.addListener((ITestNGListener) tla); + tng.run(); + + ITestNGMethod method = tla.getTestContexts().get(0).getAllTestMethods()[0]; + + List failed = method.getFailedInvocationNumbers(); + assertEqualsNoOrder(failed.toArray(), FailedDPTest.primes.toArray()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng56/ParallelTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng56/ParallelTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng56/ParallelTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng56/ParallelTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,43 @@ +package test.testng56; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +/** This class/interface */ +public class ParallelTest { + @BeforeClass + public void setup() { + System.out.println(Thread.currentThread().getId() + ":setup"); + } + + @AfterClass + public void teardown() { + System.out.println(Thread.currentThread().getId() + ":teardown"); + } + + @Test + public void test1() { + System.out.println(Thread.currentThread().getId() + ":test1"); + } + + @Test(dependsOnMethods = {"test1"}) + public void test2() { + System.out.println(Thread.currentThread().getId() + ":test2"); + } + + @Test + public void test3() { + System.out.println(Thread.currentThread().getId() + ":test3"); + } + + @Test(dependsOnMethods = {"test3"}) + public void test4() { + System.out.println(Thread.currentThread().getId() + ":test4"); + } + + @Test + public void test5() { + System.out.println(Thread.currentThread().getId() + ":test5"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng56/testng-56.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng56/testng-56.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng56/testng-56.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng56/testng-56.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng59/Test1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng59/Test1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng59/Test1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng59/Test1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.testng59; + +import org.testng.Assert; +import org.testng.annotations.AfterClass; +import org.testng.annotations.Test; + +/** This class/interface */ +public class Test1 { + private boolean m_run = false; + + @Test + public void test1() { + m_run = true; + } + + @AfterClass + public void checkWasRun() { + Assert.assertTrue(m_run, "test1() should have been run according to testng-59.xml"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng59/Test2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng59/Test2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng59/Test2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng59/Test2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.testng59; + +import org.testng.Assert; +import org.testng.annotations.AfterClass; +import org.testng.annotations.Test; + +/** This class/interface */ +public class Test2 { + private boolean m_run = false; + + @Test + public void test2() { + m_run = true; + } + + @AfterClass + public void checkWasRun() { + Assert.assertTrue(m_run, "test2() should have been run according to testng-59.xml"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng59/testng-59.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng59/testng-59.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng59/testng-59.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng59/testng-59.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng674/BeforeClassSkipExceptionTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng674/BeforeClassSkipExceptionTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng674/BeforeClassSkipExceptionTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng674/BeforeClassSkipExceptionTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,106 @@ +package test.testng674; + +import org.testng.Assert; +import org.testng.ITestNGListener; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.SimpleBaseTest; + +public class BeforeClassSkipExceptionTest extends SimpleBaseTest { + + @Test + public void testIfTestMethodHasException() { + ReportingListenerFor674 reporter = new ReportingListenerFor674(); + createTestNGInstanceAndRun( + reporter, TestClassSampleContainer.SampleClassWithFailingBeforeClassMethod.class); + } + + @Test + public void testIfTestMethodHasExceptionInInheritance() { + ReportingListenerFor674 reporter = new ReportingListenerFor674(); + createTestNGInstanceAndRun(reporter, TestClassSampleContainer.ChildClass.class); + } + + @Test + public void testExceptionDetailsWhenClassHasMultipleFailures() { + ReportingListenerFor674 reporter = new ReportingListenerFor674(); + createTestNGInstanceAndRun( + reporter, TestClassSampleContainer.SampleClassWithMultipleFailures.class); + } + + @Test + public void testExceptionDetailsWhenClassHasExplicitSkipInConfiguration() { + ReportingListenerFor674 reporter = new ReportingListenerFor674(); + createTestNGInstanceAndRun( + reporter, TestClassSampleContainer.SampleClassWithExplicitConfigSkip.class); + } + + @Test + public void testExceptionDetailsWhenConfigHasAlwaysRun() { + ReportingListenerFor674 reporter = new ReportingListenerFor674(); + createTestNGInstanceAndRun( + reporter, TestClassSampleContainer.SampleClassWithMultipleFailuresAndAlwaysRun.class); + } + + @Test + public void testExceptionDetailsUsingGroupsWithFailures() { + ReportingListenerFor674 reporter = new ReportingListenerFor674(); + Class[] classes = { + TestClassSampleContainer.GroupsContainer.GroupA.class, + TestClassSampleContainer.GroupsContainer.GroupB.class + }; + createTestNGInstanceAndRun(reporter, 2, true, classes); + } + + @Test + public void testExceptionDetailsWhenFailuresExistInSuiteConfigs() { + XmlSuite xmlSuite = createXmlSuite("Suite"); + XmlTest xmlTest1 = createXmlTest(xmlSuite, "Test1"); + createXmlClass(xmlTest1, TestClassSampleContainer.SuiteFailureTestClass.class); + XmlTest xmlTest2 = createXmlTest(xmlSuite, "Test2"); + createXmlClass(xmlTest2, TestClassSampleContainer.RegularTestClass.class); + TestNG tng = create(xmlSuite); + ReportingListenerFor674 reporter = new ReportingListenerFor674(); + tng.addListener((ITestNGListener) reporter); + tng.run(); + Assert.assertEquals(reporter.getErrors().size(), 2); + for (Throwable error : reporter.getErrors()) { + Assert.assertEquals(error.getMessage(), TestClassSampleContainer.ERROR_MSG); + Assert.assertTrue(error instanceof RuntimeException); + } + } + + @Test + public void testExceptionDetailsWhenFailuresExistInABaseClass() { + ReportingListenerFor674 reporter = new ReportingListenerFor674(); + Class[] classes = {TestClassSampleContainer.A.class, TestClassSampleContainer.B.class}; + createTestNGInstanceAndRun(reporter, 2, false, classes); + } + + private static void createTestNGInstanceAndRun( + ReportingListenerFor674 reporter, Class... clazz) { + createTestNGInstanceAndRun(reporter, 1, false, clazz); + } + + private static void createTestNGInstanceAndRun( + ReportingListenerFor674 reporter, int expectedCount, boolean useGroups, Class... clazzes) { + XmlSuite xmlSuite = createXmlSuite("Suite"); + XmlTest xmlTest = createXmlTest(xmlSuite, "Test"); + if (useGroups) { + xmlTest.addIncludedGroup("foo"); + } + for (Class clazz : clazzes) { + createXmlClass(xmlTest, clazz); + } + TestNG tng = create(xmlSuite); + tng.addListener((ITestNGListener) reporter); + tng.run(); + Assert.assertEquals(reporter.getErrors().size(), expectedCount); + for (Throwable error : reporter.getErrors()) { + Assert.assertEquals(error.getMessage(), TestClassSampleContainer.ERROR_MSG); + Assert.assertTrue(error instanceof RuntimeException); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng674/ReportingListenerFor674.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng674/ReportingListenerFor674.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng674/ReportingListenerFor674.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng674/ReportingListenerFor674.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,28 @@ +package test.testng674; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import org.testng.*; +import org.testng.xml.XmlSuite; + +public class ReportingListenerFor674 implements IReporter { + private List errors = new ArrayList<>(); + + public void generateReport(List list, List suites, String s) { + for (ISuite suite : suites) { + for (ISuiteResult suiteResult : suite.getResults().values()) { + ITestContext ctx = suiteResult.getTestContext(); + Set results = ctx.getSkippedTests().getAllResults(); + for (ITestResult result : results) { + Throwable throwable = result.getThrowable(); + errors.add(throwable); + } + } + } + } + + public List getErrors() { + return errors; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng674/TestClassSampleContainer.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng674/TestClassSampleContainer.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng674/TestClassSampleContainer.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng674/TestClassSampleContainer.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,113 @@ +package test.testng674; + +import org.testng.SkipException; +import org.testng.annotations.*; + +public class TestClassSampleContainer { + public static final String ERROR_MSG = "GITHUB-674 Exception"; + + public static class SampleClassWithFailingBeforeClassMethod { + @BeforeClass + public void beforeClass() { + throw new RuntimeException(ERROR_MSG); + } + + @Test + public void testMethod() {} + } + + public static class ChildClass extends SampleClassWithFailingBeforeClassMethod {} + + public static class SampleClassWithMultipleFailures { + @BeforeClass + public void beforeClass() { + throw new RuntimeException(ERROR_MSG); + } + + @BeforeMethod + public void beforeMethod() { + throw new RuntimeException(ERROR_MSG); + } + + @Test + public void testMethod() {} + } + + public static class SampleClassWithMultipleFailuresAndAlwaysRun { + @BeforeClass + public void beforeClass() { + throw new RuntimeException(ERROR_MSG); + } + + @BeforeMethod(alwaysRun = true) + public void beforeMethod() { + throw new RuntimeException(ERROR_MSG); + } + + @Test + public void testMethod() {} + } + + public static class SampleClassWithExplicitConfigSkip { + @BeforeClass + public void beforeClass() { + throw new SkipException(ERROR_MSG); + } + + @Test + public void testMethod() {} + } + + public static class SuiteFailureTestClass { + @BeforeSuite + public void beforeSuite() { + throw new SkipException(ERROR_MSG); + } + + @Test + public void testMethod() {} + } + + public static class RegularTestClass { + @Test + public void testMethod() {} + } + + public static class GroupsContainer { + + public static class GroupA { + @BeforeGroups(groups = "foo") + public void beforeGroups() { + throw new RuntimeException(ERROR_MSG); + } + + @Test(groups = "foo") + public void testMethod() {} + } + + public static class GroupB { + @Test(groups = "foo") + public void testMethod() {} + } + } + + public static class BaseSample { + + @BeforeSuite + public void beforeSuite() { + throw new RuntimeException(ERROR_MSG); + } + } + + public static class A extends BaseSample { + + @Test + public void testMethod() {} + } + + public static class B extends BaseSample { + + @Test + public void testMethod() {} + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng93/SingleTestTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng93/SingleTestTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng93/SingleTestTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng93/SingleTestTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,22 @@ +package test.testng93; + +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +/** This class/interface */ +public class SingleTestTest { + @BeforeMethod(groups = {"group1"}) + public void shouldRunBefore() { + System.out.println("Runs before"); + } + + @Test(groups = {"group1"}) + public void theFirstActualTest() { + System.out.println("The first actual test"); + } + + @Test + public void theSecondActualTest() { + System.out.println("The second actual test"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng93/testng-93.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng93/testng-93.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/testng93/testng-93.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/testng93/testng-93.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/B.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/B.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/B.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/B.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.thread; + +import java.util.Map; +import org.testng.annotations.Test; +import org.testng.collections.Maps; + +public class B { + public static Map m_threadIds = Maps.newConcurrentMap(); + + public static void setUp() { + m_threadIds = Maps.newConcurrentMap(); + } + + @Test + public void f2() { + Long id = Thread.currentThread().getId(); + m_threadIds.put(id, id); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/BaseSequentialSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/BaseSequentialSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/BaseSequentialSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/BaseSequentialSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,24 @@ +package test.thread; + +import java.util.Map; +import org.testng.log4testng.Logger; + +public class BaseSequentialSample { + + protected void addId(String method, long id) { + debug(method + " ID:" + id); + getMap().put(id, id); + } + + Map getMap() { + Map result = Helper.getMap(getClass().getName()); + debug("RETURNING MAP " + result + " THIS:" + this); + + return result; + } + + protected void debug(String s) { + Logger.getLogger(getClass()) + .debug("[" + getClass().getName() + " " + Thread.currentThread().getId() + " " + "] " + s); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/BaseThreadTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/BaseThreadTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/BaseThreadTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/BaseThreadTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,81 @@ +package test.thread; + +import java.util.List; +import java.util.Map; +import java.util.Set; +import org.testng.Assert; +import org.testng.collections.Lists; +import org.testng.collections.Maps; +import org.testng.collections.Sets; +import test.SimpleBaseTest; + +public class BaseThreadTest extends SimpleBaseTest { + private static Set m_threadIds; + private static Map m_suitesMap; + private static List m_strings; + + static void initThreadLog() { + m_threadIds = Sets.newHashSet(); + m_suitesMap = Maps.newHashMap(); + m_strings = Lists.newArrayList(); + } + + protected void logString(String s) { + synchronized (m_strings) { + log("BaseThreadTest", "Logging string:" + s); + m_strings.add(s); + } + } + + public static List getStrings() { + return m_strings; + } + + protected void logCurrentThread() { + logThread(Thread.currentThread().getId()); + } + + protected void logThread(long threadId) { + synchronized (m_threadIds) { + log("BaseThreadTest", "Logging thread:" + threadId); + m_threadIds.add(threadId); + } + } + + protected void logSuite(String suiteName, long time) { + synchronized (m_suitesMap) { + m_suitesMap.put(suiteName, time); + } + } + + static int getThreadCount() { + synchronized (m_threadIds) { + return m_threadIds.size(); + } + } + + static Map getSuitesMap() { + return m_suitesMap; + } + + protected void log(String cls, String s) { + if (false) { + System.out.println( + "[" + + cls + + "] thread:" + + Thread.currentThread().getId() + + " hash:" + + hashCode() + + " " + + s); + } + } + + protected void verifyThreads(int expected) { + Assert.assertEquals( + getThreadCount(), + expected, + "Ran on " + getThreadCount() + " threads instead of " + expected); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/DataProviderThreadPoolSizeSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/DataProviderThreadPoolSizeSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/DataProviderThreadPoolSizeSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/DataProviderThreadPoolSizeSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,70 @@ +package test.thread; + +import org.testng.annotations.BeforeClass; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class DataProviderThreadPoolSizeSampleTest extends BaseThreadTest { + @BeforeClass(alwaysRun = true) + public void setUp() { + log(getClass().getName(), "Init log ids"); + initThreadLog(); + } + + @DataProvider(parallel = true) + public Object[][] parallelDataProvider() { + return createArray(); + } + + @DataProvider + public Object[][] sequentialDataProvider() { + return createArray(); + } + + private Object[][] createArray() { + int i = 0; + return new Object[][] { + new Object[] {i++}, + new Object[] {i++}, + new Object[] {i++}, + new Object[] {i++}, + new Object[] {i++}, + new Object[] {i++}, + new Object[] {i++}, + new Object[] {i++}, + new Object[] {i++}, + new Object[] {i++}, + new Object[] {i++}, + new Object[] {i++}, + new Object[] {i++}, + new Object[] {i++}, + new Object[] {i++}, + new Object[] {i++}, + new Object[] {i++}, + new Object[] {i++}, + new Object[] {i++}, + new Object[] {i++}, + }; + } + + @Test(dataProvider = "sequentialDataProvider", groups = "sequential") + public void fSequential(Integer p) { + long n = Thread.currentThread().getId(); + log(getClass().getName(), "Sequential"); + logThread(n); + } + + @Test(dataProvider = "parallelDataProvider", groups = "parallel") + public void fParallel(Integer p) { + long n = Thread.currentThread().getId(); + log(getClass().getName(), "Parallel"); + logThread(n); + } + + // @Test(dependsOnMethods = {"f1"}) + // public void verify() { + // int expected = 3; + // Assert.assertEquals(m_threadIds.size(), expected, + // "Should have run on " + expected + " threads but ran on " + m_threadIds.size()); + // } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/DataProviderThreadPoolSizeTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/DataProviderThreadPoolSizeTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/DataProviderThreadPoolSizeTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/DataProviderThreadPoolSizeTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,34 @@ +package test.thread; + +import org.testng.Assert; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class DataProviderThreadPoolSizeTest extends SimpleBaseTest { + + @Test + public void shouldUseDefaultDataProviderThreadCount() { + TestNG tng = create(DataProviderThreadPoolSizeSampleTest.class); + tng.setGroups("parallel"); + tng.run(); + Assert.assertEquals(DataProviderThreadPoolSizeSampleTest.getThreadCount(), 10); + } + + @Test + public void shouldNotUseThreadsIfNotUsingParallel() { + TestNG tng = create(DataProviderThreadPoolSizeSampleTest.class); + tng.setGroups("sequential"); + tng.run(); + Assert.assertEquals(DataProviderThreadPoolSizeSampleTest.getThreadCount(), 1); + } + + @Test + public void shouldUseSpecifiedDataProviderThreadCount() { + TestNG tng = create(DataProviderThreadPoolSizeSampleTest.class); + tng.setGroups("parallel"); + tng.setDataProviderThreadCount(3); + tng.run(); + Assert.assertEquals(DataProviderThreadPoolSizeSampleTest.getThreadCount(), 3); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/FactorySampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/FactorySampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/FactorySampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/FactorySampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.thread; + +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +@Test +public class FactorySampleTest { + + @Factory + public Object[] init() { + return new Object[] { + new B(), new B(), + }; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/FactoryTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/FactoryTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/FactoryTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/FactoryTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,46 @@ +package test.thread; + +import org.testng.Assert; +import org.testng.ITestNGListener; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; + +public class FactoryTest { + + @Test( + description = + "In non-parallel mode, we should only have one thread id for the two methods invoked on B") + public void verifyFactoryNotParallel() { + runTest(null, 1); + } + + @Test( + description = + "In parallel mode 'methods', we should have as many thread id's as there are test methods on B (2).") + public void verifyFactoryParallelMethods() { + runTest(XmlSuite.ParallelMode.METHODS, 2); + } + + @Test + public void verifyFactoryParallelTests() { + runTest(XmlSuite.ParallelMode.TESTS, 1); + } + + private void runTest(XmlSuite.ParallelMode parallelMode, int expectedThreadIdCount) { + TestNG tng = new TestNG(); + tng.setTestClasses(new Class[] {FactorySampleTest.class}); + if (parallelMode != null) { + tng.setParallel(parallelMode); + } + TestListenerAdapter tla = new TestListenerAdapter(); + tng.addListener((ITestNGListener) tla); + + B.setUp(); + tng.run(); + + Assert.assertEquals(tla.getPassedTests().size(), 2); + Assert.assertEquals(B.m_threadIds.size(), expectedThreadIdCount); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/Github1636Sample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/Github1636Sample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/Github1636Sample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/Github1636Sample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +package test.thread; + +import java.util.Collections; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import org.testng.annotations.Test; + +public class Github1636Sample { + private static Map map = new ConcurrentHashMap<>(); + static Set threads = Collections.newSetFromMap(map); + + @Test + public void test1() { + threads.add(Thread.currentThread().getId()); + } + + @Test + public void test2() { + threads.add(Thread.currentThread().getId()); + } + + @Test + public void test3() { + threads.add(Thread.currentThread().getId()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/Helper.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/Helper.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/Helper.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/Helper.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.thread; + +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +public class Helper { + private static final Map> m_maps = new ConcurrentHashMap<>(); + + public static Map getMap(String className) { + return m_maps.computeIfAbsent(className, cn -> new ConcurrentHashMap<>()); + } + + public static void reset() { + m_maps.clear(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/MultiThreadedDependentSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/MultiThreadedDependentSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/MultiThreadedDependentSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/MultiThreadedDependentSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,122 @@ +package test.thread; + +import java.util.List; +import org.testng.annotations.AfterClass; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; +import org.testng.collections.Lists; + +public class MultiThreadedDependentSampleTest { + + public static List m_methods = Lists.newArrayList(); + + @BeforeClass + public void bc() {} + + @AfterClass + public void ac() {} + + @BeforeMethod + public void bm() {} + + @AfterMethod + public void am() {} + + @Test(groups = "1") + public void a1() { + logThread(); + log("a1"); + } + + @Test(groups = "1") + public void a2() { + logThread(); + log("a2"); + } + + @Test(groups = "1") + public void a3() { + logThread(); + log("a3"); + } + + @Test(groups = "2", dependsOnGroups = "1") + public void b1() { + logThread(); + log("b1"); + } + + @Test(groups = "2", dependsOnGroups = "1") + public void b2() { + logThread(); + log("b2"); + } + + @Test(groups = "2", dependsOnGroups = "1") + public void b3() { + logThread(); + log("b3"); + } + + @Test(groups = "2", dependsOnGroups = "1") + public void b4() { + logThread(); + log("b4"); + } + + @Test(groups = "2", dependsOnGroups = "1") + public void b5() { + logThread(); + log("b5"); + } + + @Test(dependsOnGroups = "2") + public void c1() { + logThread(); + log("c1"); + } + + @Test(dependsOnGroups = {"1"}) + public void d() { + logThread(); + log("d"); + } + + @Test + public void x() { + log("x"); + } + + @Test + public void y() { + log("y"); + } + + @Test + public void z() { + log("z"); + } + + @Test + public void t() { + log("t"); + } + + private void logThread() { + try { + // With a lower value, tests fail sometimes + Thread.sleep(40); + } catch (InterruptedException e) { + } + long id = Thread.currentThread().getId(); + Helper.getMap(getClass().getName()).put(id, id); + } + + private void log(String string) { + synchronized (m_methods) { + m_methods.add(string); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/MultiThreadedDependentTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/MultiThreadedDependentTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/MultiThreadedDependentTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/MultiThreadedDependentTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,81 @@ +package test.thread; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import org.testng.Assert; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.collections.Lists; +import org.testng.collections.Maps; +import org.testng.xml.XmlSuite; +import test.SimpleBaseTest; + +/** + * Test that classes with dependent methods are still run in different threads and in the correct + * order. + */ +public class MultiThreadedDependentTest extends SimpleBaseTest { + + /** + * Make sure that the topological order is preserved and that if the TestNG runner is configured + * to run n threads, the dependent methods are using these n threads. + */ + private void assertOrder(List methods) { + List expectedMethods = + Arrays.asList( + new String[] { + "a1", "a2", "a3", "b1", "b2", "b3", "b4", "b5", "c1", "d", "x", "y", "z", "t" + }); + int size = expectedMethods.size(); + Assert.assertEquals(methods.size(), size); + for (String em : expectedMethods) { + Assert.assertTrue(methods.contains(em)); + } + Map map = Maps.newHashMap(); + for (String m : methods) { + map.put(m, Boolean.TRUE); + if ("b1".equals(m) || "b2".equals(m) || "b3".equals(m) || "b4".equals(m) || "b5".equals(m)) { + Assert.assertTrue(map.get("a1")); + Assert.assertTrue(map.get("a2")); + Assert.assertTrue(map.get("a3")); + } + if ("d".equals(m)) { + Assert.assertTrue(map.get("a1")); + Assert.assertTrue(map.get("a2")); + } + if ("c1".equals(m)) { + Assert.assertTrue(map.get("b1")); + Assert.assertTrue(map.get("b2")); + } + } + Assert.assertEquals(map.size(), size); + for (Boolean val : map.values()) { + Assert.assertTrue(val); + } + } + + @Test + public void test2Threads() { + test(2); + } + + @Test + public void test3Threads() { + test(3); + } + + private void test(int threadCount) { + Helper.reset(); + MultiThreadedDependentSampleTest.m_methods = Lists.newArrayList(); + TestNG tng = create(MultiThreadedDependentSampleTest.class); + tng.setThreadCount(threadCount); + tng.setParallel(XmlSuite.ParallelMode.METHODS); + Map map = Helper.getMap(MultiThreadedDependentSampleTest.class.getName()); + synchronized (map) { + tng.run(); + Assert.assertTrue(map.size() > 1, "Map size:" + map.size() + " expected more than 1"); + assertOrder(MultiThreadedDependentSampleTest.m_methods); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/ParallelSuiteTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/ParallelSuiteTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/ParallelSuiteTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/ParallelSuiteTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,199 @@ +package test.thread; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import org.testng.Assert; +import org.testng.ITestNGListener; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import test.SimpleBaseTest; + +public class ParallelSuiteTest extends SimpleBaseTest { + + @Test + public void suitesShouldRunInParallel1() { + runTest( + 5, + 2, + 2, + null, + Arrays.asList( + getPathToParallelResource("simple-suite-parallel-1.xml"), + getPathToParallelResource("simple-suite-parallel-2.xml"))); + } + + @Test + public void suitesShouldRunInParallel2() { + runTest( + 5, + 3, + 3, + null, + Collections.singletonList(getPathToParallelResource("simple-suite-parallel-0.xml"))); + } + + @Test(description = "Number of threads (2) is less than number of suites (3)") + public void suitesShouldRunInParallel3() { + final int SUITE_THREAD_POOL_SIZE = 2; + TestListenerAdapter tla = new TestListenerAdapter(); + TestNG tng = create(); + tng.setSuiteThreadPoolSize(SUITE_THREAD_POOL_SIZE); + tng.setTestSuites( + Collections.singletonList(getPathToParallelResource("simple-suite-parallel-0.xml"))); + tng.addListener((ITestNGListener) tla); + + BaseThreadTest.initThreadLog(); + tng.run(); // Shouldn't not deadlock + Assert.assertEquals(BaseThreadTest.getThreadCount(), SUITE_THREAD_POOL_SIZE); + } + + @Test + public void suitesShouldRunInParallel4() { + final int TOTAL_SUITE_COUNT_INCLUDING_DUPLICATES = 8; + runTest( + 10, + TOTAL_SUITE_COUNT_INCLUDING_DUPLICATES, + TOTAL_SUITE_COUNT_INCLUDING_DUPLICATES, + null, + Arrays.asList( + getPathToParallelResource("suite-parallel-1.xml"), + getPathToParallelResource("suite-parallel-2.xml"), + getPathToParallelResource("suite-parallel-2-1.xml"), + getPathToParallelResource("suite-parallel-2-2.xml"))); + } + + @Test + public void suitesShouldRunInParallel5() { + runTest( + 5, + 5, + 7, + null, + Collections.singletonList(getPathToParallelResource("suite-parallel-0.xml"))); + } + + @Test(description = "Number of threads (2) is less than level of suites (3)") + public void suitesShouldRunInParallel6() { + runTest( + 2, + 2, + 7, + null, + Collections.singletonList(getPathToParallelResource("suite-parallel-0.xml"))); + } + + @Test( + description = + "If suiteThreadPoolSize and randomizeSuites are not specified" + + " suites should run in order specified in XML") + public void suitesShouldRunInOrder() { + TestListenerAdapter tla = new TestListenerAdapter(); + TestNG tng = create(); + tng.setTestSuites( + Collections.singletonList(getPathToParallelResource("simple-suite-parallel-0.xml"))); + tng.addListener((ITestNGListener) tla); + BaseThreadTest.initThreadLog(); + tng.run(); + + Map suitesMap = BaseThreadTest.getSuitesMap(); + Assert.assertEquals(BaseThreadTest.getThreadCount(), 1); + Assert.assertEquals(suitesMap.keySet().size(), 3); + + final String SUITE_NAME_PREFIX = "Suite Parallel "; + if (suitesMap.get(SUITE_NAME_PREFIX + 1) > suitesMap.get(SUITE_NAME_PREFIX + 2)) { + Assert.fail( + "Suite " + + (SUITE_NAME_PREFIX + 1) + + " should have run before " + + (SUITE_NAME_PREFIX + 2)); + } + Assert.assertTrue(suitesMap.get(SUITE_NAME_PREFIX + 2) <= suitesMap.get(SUITE_NAME_PREFIX + 0)); + } + + @Test(description = "Number of threads (1) is less than number of levels of suites (2)") + public void suitesShouldRun1() { + runTest( + 1, + 1, + 3, + true, + Collections.singletonList(getPathToParallelResource("simple-suite-parallel-0.xml"))); + } + + @Test(description = "Child suite should obey threadCount parameter") + public void childSuiteObeyParentThreadCount() { + /* parent suite has no tests, so only child suite counts */ + final int EXPECTED_SUITE_COUNT = 1; + runTest( + 1, + 2, + XmlSuite.ParallelMode.CLASSES, + 2, + EXPECTED_SUITE_COUNT, + null, + Arrays.asList(getPathToParallelResource("inherit-thread-count-parent.yaml"))); + } + + private void runTest( + int suiteThreadPoolSize, + int expectedThreadCount, + int expectedSuiteCount, + Boolean randomizeSuites, + List paths) { + runTest( + suiteThreadPoolSize, + null, + null, + expectedThreadCount, + expectedSuiteCount, + randomizeSuites, + paths); + } + + private void runTest( + int suiteThreadPoolSize, + Integer threadCount, + XmlSuite.ParallelMode parallelMode, + int expectedThreadCount, + int expectedSuiteCount, + Boolean randomizeSuites, + List paths) { + TestListenerAdapter tla = new TestListenerAdapter(); + TestNG tng = create(); + tng.setSuiteThreadPoolSize(suiteThreadPoolSize); + if (threadCount != null) { + tng.setThreadCount(threadCount); + } + if (parallelMode != null) { + tng.setParallel(parallelMode); + } + tng.setTestSuites(paths); + tng.addListener((ITestNGListener) tla); + if (null != randomizeSuites) { + tng.setRandomizeSuites(randomizeSuites); + } + + BaseThreadTest.initThreadLog(); + tng.run(); + + Assert.assertEquals( + BaseThreadTest.getThreadCount(), + expectedThreadCount, + "Thread count expected:" + + expectedThreadCount + + " actual:" + + BaseThreadTest.getThreadCount()); + Assert.assertEquals( + BaseThreadTest.getSuitesMap().keySet().size(), + expectedSuiteCount, + "Suite count is incorrect"); + } + + private static String getPathToParallelResource(String resourceName) { + return getPathToResource(String.format("parallel-suites/%s", resourceName)); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/ParallelTestTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/ParallelTestTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/ParallelTestTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/ParallelTestTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,178 @@ +package test.thread; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; +import org.apache.commons.io.IOUtils; +import org.testng.SkipException; +import org.testng.TestNG; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import org.testng.collections.Lists; +import org.testng.xml.SuiteXmlParser; +import org.testng.xml.XmlClass; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.BaseTest; + +public class ParallelTestTest extends BaseTest { + + @DataProvider + private static Object[][] verifyParallelDp() { + return new Object[][] { + // isCommandLine, parallelMode, expectedThreadCount + {true, XmlSuite.ParallelMode.NONE, 1}, + {false, XmlSuite.ParallelMode.NONE, 1}, + {true, XmlSuite.ParallelMode.TESTS, 2}, + {false, XmlSuite.ParallelMode.TESTS, 2}, + {true, XmlSuite.ParallelMode.METHODS, 4}, + {false, XmlSuite.ParallelMode.METHODS, 4}, + {true, XmlSuite.ParallelMode.CLASSES, 2}, + {false, XmlSuite.ParallelMode.CLASSES, 2}, + {true, XmlSuite.ParallelMode.INSTANCES, 4}, + {false, XmlSuite.ParallelMode.INSTANCES, 4} + }; + } + + @Test(dataProvider = "verifyParallelDp") + public void verifyParallel( + boolean isCommandLine, XmlSuite.ParallelMode parallelMode, int expectedThreadCount) { + verifyExpected( + isCommandLine, parallelMode, expectedThreadCount, Test1Test.class, Test2Test.class); + } + + @DataProvider + private static Object[][] verifyParallelWithFactoryDp() { + return new Object[][] { + // isCommandLine, parallelMode, expectedThreadCount + {true, XmlSuite.ParallelMode.NONE, 1}, + {false, XmlSuite.ParallelMode.NONE, 1}, + {true, XmlSuite.ParallelMode.INSTANCES, 4}, + {false, XmlSuite.ParallelMode.INSTANCES, 4} + }; + } + + @Test(dataProvider = "verifyParallelWithFactoryDp") // TODO use "verifyParallelDp" + public void verifyParallelWithFactory( + boolean isCommandLine, XmlSuite.ParallelMode parallelMode, int expectedThreadCount) { + verifyExpected( + isCommandLine, parallelMode, expectedThreadCount, ParallelWithFactorySampleTest.class); + } + + @Test + public void testParallelModeInheritanceInCommandlineMode() throws FileNotFoundException { + SuiteXmlParser parser = new SuiteXmlParser(); + String file = "src/test/resources/1636.xml"; + XmlSuite xmlSuite = parser.parse(file, new FileInputStream(file), true); + TestNG tng = new TestNG(); + tng.setXmlSuites(Collections.singletonList(xmlSuite)); + tng.run(); + assertThat(Github1636Sample.threads).hasSize(3); + } + + @Test + public void testJarXmlSuiteObeyCommandLine() { + final String file = "build/resources/test/2532.zip"; + final String suiteFileName = "2532.xml"; + final int threadCount = 3; + zipResource(suiteFileName, file); + + TestNG tng = new TestNG(); + tng.setXmlPathInJar(suiteFileName); + tng.setTestJar(file); + tng.setThreadCount(threadCount); + tng.setParallel(XmlSuite.ParallelMode.METHODS); + tng.run(); + assertThat(Github1636Sample.threads).hasSize(threadCount); + } + + @Test + public void testXmlSuiteObeyCommandLine() { + final String file = "build/resources/test/2532.xml"; + final int threadCount = 3; + + TestNG tng = new TestNG(); + tng.setTestSuites(Collections.singletonList(file)); + tng.setThreadCount(threadCount); + tng.setParallel(XmlSuite.ParallelMode.METHODS); + tng.run(); + assertThat(Github1636Sample.threads).hasSize(threadCount); + } + + private void createTest(XmlSuite xmlSuite, Class clazz) { + XmlTest result = new XmlTest(xmlSuite); + List classes = result.getXmlClasses(); + XmlClass xmlClass = new XmlClass(clazz); + classes.add(xmlClass); + } + + private void verifyExpected( + boolean isCommandLine, + XmlSuite.ParallelMode parallelMode, + int expectedThreadCount, + Class... classes) { + XmlSuite xmlSuite = new XmlSuite(); + xmlSuite.setName("ParallelTestTest"); + xmlSuite.setParallel(parallelMode); + for (Class clazz : classes) { + createTest(xmlSuite, clazz); + } + + TestNG tng = new TestNG(); + if (isCommandLine) { + tng.setCommandLineSuite(xmlSuite); + } else { + tng.setXmlSuites(Collections.singletonList(xmlSuite)); + } + + Helper.reset(); + + tng.run(); + + List> maps = Lists.newArrayList(); + for (Class clazz : classes) { + maps.add(Helper.getMap(clazz.getName())); + } + + Map mergedMap = new HashMap<>(); + for (Map m : maps) { + mergedMap.putAll(m); + } + + assertThat(mergedMap).hasSize(expectedThreadCount); + } + + private void zipResource(String resourceName, String targetFilePath) { + InputStream suiteStream = this.getClass().getClassLoader().getResourceAsStream(resourceName); + try { + File targetFile = new File(targetFilePath); + FileOutputStream targetFileStream = new FileOutputStream(targetFile); + ZipOutputStream zipSuiteStream = new ZipOutputStream(targetFileStream); + zipSuiteStream.putNextEntry(new ZipEntry(resourceName)); + + byte[] suiteByteData = IOUtils.toByteArray(suiteStream); + zipSuiteStream.write(suiteByteData, 0, suiteByteData.length); + zipSuiteStream.closeEntry(); + zipSuiteStream.close(); + } catch (IOException e) { + throw new SkipException(String.format("Error writing zip to %s", targetFilePath), e); + } + } + + @AfterMethod + private void clearThreadCount() { + Github1636Sample.threads.clear(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/ParallelWithFactorySampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/ParallelWithFactorySampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/ParallelWithFactorySampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/ParallelWithFactorySampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,33 @@ +package test.thread; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +public class ParallelWithFactorySampleTest extends BaseSequentialSample { + private int m_n; + + @DataProvider + public static Object[][] dp() { + return new Object[][] {new Object[] {42}, new Object[] {43}}; + } + + @Factory(dataProvider = "dp") + public ParallelWithFactorySampleTest(int n) { + m_n = n; + } + + protected int getN() { + return m_n; + } + + @Test + public void f1() { + addId("f1 " + getN(), Thread.currentThread().getId()); + } + + @Test + public void f2() { + addId("f2", Thread.currentThread().getId()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/PriorityInSingleThreadTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/PriorityInSingleThreadTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/PriorityInSingleThreadTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/PriorityInSingleThreadTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,32 @@ +package test.thread; + +import org.testng.annotations.Test; + +@Test(singleThreaded = true) +public class PriorityInSingleThreadTest extends BaseThreadTest { + + @Test(priority = -10) + public void f1() { + logCurrentThread(); + } + + @Test(priority = -5) + public void f2() { + logCurrentThread(); + } + + @Test(priority = 0) + public void f3() { + logCurrentThread(); + } + + @Test(priority = 5) + public void f4() { + logCurrentThread(); + } + + @Test(priority = 10) + public void f5() { + logCurrentThread(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/Sample1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/Sample1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/Sample1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/Sample1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.thread; + +import org.testng.annotations.Test; + +public class Sample1 extends BaseThreadTest { + + @Test + public void s1() { + logThread(Thread.currentThread().getId()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/Sample2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/Sample2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/Sample2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/Sample2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ +package test.thread; + +import org.testng.ITestContext; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class Sample2 extends BaseThreadTest { + + @BeforeMethod + public void before(ITestContext ctx) { + logSuite(ctx.getSuite().getName(), System.currentTimeMillis()); + } + + @Test + public void s1() { + logThread(Thread.currentThread().getId()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/SequentialSample2Test.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/SequentialSample2Test.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/SequentialSample2Test.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/SequentialSample2Test.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.thread; + +import org.testng.annotations.Test; + +@Test(singleThreaded = true) +public class SequentialSample2Test extends BaseSequentialSample { + + public void f1() { + addId("SequentialSample2Test.f1()", Thread.currentThread().getId()); + } + + public void f2() { + addId("SequentialSample2Test.f2()", Thread.currentThread().getId()); + } + + public void f3() { + addId("SequentialSample2Test.f3()", Thread.currentThread().getId()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/SequentialSample3Test.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/SequentialSample3Test.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/SequentialSample3Test.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/SequentialSample3Test.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.thread; + +import org.testng.annotations.Test; + +@Test(singleThreaded = true) +public class SequentialSample3Test extends BaseSequentialSample { + + public void f1() { + addId("SequentialSample3Test.f1()", Thread.currentThread().getId()); + } + + public void f2() { + addId("SequentialSample3Test.f2()", Thread.currentThread().getId()); + } + + public void f3() { + addId("SequentialSample3Test.f3()", Thread.currentThread().getId()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/SequentialSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/SequentialSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/SequentialSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/SequentialSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.thread; + +import org.testng.annotations.Test; + +@Test(singleThreaded = true) +public class SequentialSampleTest extends BaseSequentialSample { + + public void f1() { + addId("SequentialSampleTest.f1()", Thread.currentThread().getId()); + } + + public void f2() { + addId("SequentialSampleTest.f2()", Thread.currentThread().getId()); + } + + public void f3() { + addId("SequentialSampleTest.f3()", Thread.currentThread().getId()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/SequentialTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/SequentialTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/SequentialTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/SequentialTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,99 @@ +package test.thread; + +import java.util.HashMap; +import java.util.Map; +import org.testng.Assert; +import org.testng.annotations.Test; +import org.testng.log4testng.Logger; +import org.testng.xml.XmlSuite; +import test.BaseTest; + +public class SequentialTest extends BaseTest { + + @Test + public void verifySequential1() { + verifySequential(1); + } + + @Test + public void verifySequential2() { + verifySequential(2); + } + + @Test + public void verifySequential3() { + verifySequential(3); + } + + @Test + public void verifySingleThreaded1() { + verifySingleThreaded(1); + } + + @Test + public void verifySingleThreaded2() { + verifySingleThreaded(2); + } + + @Test + public void verifySingleThreaded3() { + verifySingleThreaded(3); + } + + public void verifySequential(int threadCount) { + runTest( + threadCount, + SequentialSampleTest.class.getName(), + SequentialSample2Test.class.getName(), + SequentialSample3Test.class.getName()); + } + + public void verifySingleThreaded(int threadCount) { + runTest( + threadCount, + SingleThreadedSampleTest.class.getName(), + SingleThreadedSample2Test.class.getName(), + SingleThreadedSample3Test.class.getName()); + } + + private void runTest(int threadCount, String... classes) { + Helper.reset(); + + for (String c : classes) { + addClass(c); + } + setParallel(XmlSuite.ParallelMode.METHODS); + setThreadCount(threadCount); + + run(); + + Map[] maps = + new Map[] { + Helper.getMap(classes[0]), Helper.getMap(classes[1]), Helper.getMap(classes[2]), + }; + + for (Map m : maps) { + Assert.assertEquals(m.size(), 1); + } + + long[] ids = + new long[] { + maps[0].keySet().iterator().next(), + maps[1].keySet().iterator().next(), + maps[2].keySet().iterator().next(), + }; + Map verifyMap = new HashMap<>(); + + for (long id : ids) { + verifyMap.put(id, id); + } + + Assert.assertEquals(verifyMap.size(), threadCount); + + debug("COUNT:" + threadCount + " THREAD ID'S:" + ids[0] + " " + ids[1] + " " + ids[2]); + } + + private void debug(String s) { + Logger.getLogger(getClass()).debug("[SequentialTest] " + s); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/SingleThreadForParallelMethodsTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/SingleThreadForParallelMethodsTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/SingleThreadForParallelMethodsTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/SingleThreadForParallelMethodsTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package test.thread; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import test.BaseTest; + +public class SingleThreadForParallelMethodsTest extends BaseTest { + + @Test(description = "GITHUB #1066: Regression is in priority. It broke parallel mode") + public void testPriorityDoesNotAffectSingleThreadOrder() { + PriorityInSingleThreadTest.initThreadLog(); + Helper.reset(); + addClass(PriorityInSingleThreadTest.class); + + setParallel(XmlSuite.ParallelMode.METHODS); + setThreadCount(10); + + run(); + + Assert.assertEquals(PriorityInSingleThreadTest.getThreadCount(), 1); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/SingleThreadedSample2Test.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/SingleThreadedSample2Test.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/SingleThreadedSample2Test.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/SingleThreadedSample2Test.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,22 @@ +package test.thread; + +import org.testng.annotations.Test; + +@Test(singleThreaded = true) +public class SingleThreadedSample2Test extends BaseSequentialSample { + + @Test + public void f1() { + addId("SingleThreadedSample2Test.f1()", Thread.currentThread().getId()); + } + + @Test + public void f2() { + addId("SingleThreadedSample2Test.f2()", Thread.currentThread().getId()); + } + + @Test + public void f3() { + addId("SingleThreadedSample2Test.f3()", Thread.currentThread().getId()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/SingleThreadedSample3Test.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/SingleThreadedSample3Test.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/SingleThreadedSample3Test.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/SingleThreadedSample3Test.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,22 @@ +package test.thread; + +import org.testng.annotations.Test; + +@Test(singleThreaded = true) +public class SingleThreadedSample3Test extends BaseSequentialSample { + + @Test + public void f1() { + addId("SingleThreadedSample3Test.f1()", Thread.currentThread().getId()); + } + + @Test // (dependsOnMethods = "f1") + public void f2() { + addId("SingleThreadedSample3Test.f2()", Thread.currentThread().getId()); + } + + @Test // (dependsOnMethods = "f2") + public void f3() { + addId("SingleThreadedSample3Test.f3()", Thread.currentThread().getId()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/SingleThreadedSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/SingleThreadedSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/SingleThreadedSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/SingleThreadedSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,22 @@ +package test.thread; + +import org.testng.annotations.Test; + +@Test(singleThreaded = true) +public class SingleThreadedSampleTest extends BaseSequentialSample { + + @Test + public void f1() { + addId("SingleThreadedSampleTest.f1()", Thread.currentThread().getId()); + } + + @Test + public void f2() { + addId("SingleThreadedSampleTest.f2()", Thread.currentThread().getId()); + } + + @Test + public void f3() { + addId("SingleThreadedSampleTest.f3()", Thread.currentThread().getId()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/SuiteThreadCountTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/SuiteThreadCountTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/SuiteThreadCountTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/SuiteThreadCountTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,33 @@ +package test.thread; + +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; +import org.testng.Assert; +import org.testng.annotations.AfterClass; +import org.testng.annotations.Test; +import org.testng.internal.thread.ThreadUtil; + +/** + * Test for test level thread-count. + * + * @author Alex Popescu + */ +public class SuiteThreadCountTest { + private Set m_threads = Collections.synchronizedSet(new HashSet()); + + @Test + public void test1() { + m_threads.add(ThreadUtil.currentThreadInfo()); + } + + @Test + public void test2() { + m_threads.add(ThreadUtil.currentThreadInfo()); + } + + @AfterClass + public void checkThreading() { + Assert.assertEquals(m_threads.size(), 2, "Test should use 2 threads (suite level)"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/Test1Test.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/Test1Test.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/Test1Test.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/Test1Test.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ +package test.thread; + +import org.testng.annotations.Test; + +public class Test1Test extends BaseSequentialSample { + + @Test + public void f11() { + debug("f11"); + addId("Test1Test.f11()", Thread.currentThread().getId()); + } + + @Test + public void f12() { + debug("f12"); + addId("Test1Test.f12()", Thread.currentThread().getId()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/Test2Test.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/Test2Test.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/Test2Test.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/Test2Test.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ +package test.thread; + +import org.testng.annotations.Test; + +public class Test2Test extends BaseSequentialSample { + + @Test + public void f21() { + debug("f21"); + addId("Test2Test.f21()", Thread.currentThread().getId()); + } + + @Test + public void f22() { + debug("f22"); + addId("Test2Test.f22()", Thread.currentThread().getId()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/TestThreadCountTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/TestThreadCountTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/TestThreadCountTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/TestThreadCountTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,38 @@ +package test.thread; + +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; +import org.testng.Assert; +import org.testng.annotations.AfterClass; +import org.testng.annotations.Test; +import org.testng.internal.thread.ThreadUtil; + +/** + * Test for test level thread-count. + * + * @author Alex Popescu + */ +public class TestThreadCountTest { + private Set m_threads = Collections.synchronizedSet(new HashSet()); + + @Test + public void test1() { + m_threads.add(ThreadUtil.currentThreadInfo()); + } + + @Test + public void test2() { + m_threads.add(ThreadUtil.currentThreadInfo()); + } + + @Test + public void test3() { + m_threads.add(ThreadUtil.currentThreadInfo()); + } + + @AfterClass + public void checkThreading() { + Assert.assertEquals(m_threads.size(), 3, "Test should use 3 threads"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/ThreadPoolSampleBugTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/ThreadPoolSampleBugTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/ThreadPoolSampleBugTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/ThreadPoolSampleBugTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +package test.thread; + +import org.testng.annotations.Test; + +public class ThreadPoolSampleBugTest { + private static final long TIMEOUT = 500; + + @Test(invocationCount = 1, threadPoolSize = 5) + public void shouldPass1() throws InterruptedException { + Thread.sleep(TIMEOUT); + } + + @Test(invocationCount = 2, threadPoolSize = 5) + public void shouldPass2() throws InterruptedException { + Thread.sleep(TIMEOUT); + } + + @Test(timeOut = 10, invocationCount = 1, threadPoolSize = 5) + public void shouldFail1() throws InterruptedException { + Thread.sleep(TIMEOUT); + } + + @Test(timeOut = 10, invocationCount = 2, threadPoolSize = 5) + public void shouldFail2() throws InterruptedException { + Thread.sleep(TIMEOUT); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/ThreadPoolSizeBase.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/ThreadPoolSizeBase.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/ThreadPoolSizeBase.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/ThreadPoolSizeBase.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package test.thread; + +import org.testng.annotations.BeforeClass; + +public class ThreadPoolSizeBase extends BaseThreadTest { + @BeforeClass + public void setUp() { + log(getClass().getName(), "Init log ids"); + initThreadLog(); + } + + protected void logThread() { + long n = Thread.currentThread().getId(); + log(getClass().getName(), ""); + logThread(n); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/ThreadPoolSizeSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/ThreadPoolSizeSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/ThreadPoolSizeSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/ThreadPoolSizeSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,10 @@ +package test.thread; + +import org.testng.annotations.Test; + +public class ThreadPoolSizeSampleTest { + @Test(threadPoolSize = 2, timeOut = 100) + public void willPassBug() throws InterruptedException { + Thread.sleep(500); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/ThreadPoolSizeTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/ThreadPoolSizeTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/ThreadPoolSizeTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/ThreadPoolSizeTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.thread; + +import org.testng.annotations.Test; + +public class ThreadPoolSizeTest extends ThreadPoolSizeBase { + @Test(invocationCount = 5, threadPoolSize = 3) + public void f1() { + logThread(); + } + + @Test(dependsOnMethods = {"f1"}) + public void verify() { + verifyThreads(3); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/ThreadPoolSizeWithTimeOutTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/ThreadPoolSizeWithTimeOutTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/ThreadPoolSizeWithTimeOutTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/ThreadPoolSizeWithTimeOutTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,32 @@ +package test.thread; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.ITestNGListener; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; + +public class ThreadPoolSizeWithTimeOutTest extends ThreadPoolSizeBase { + + @Test(invocationCount = 5, threadPoolSize = 3, timeOut = 1000) + public void f1() { + logThread(); + } + + @Test(dependsOnMethods = {"f1"}) + public void verify() { + verifyThreads(3); + } + + @Test + public void threadPoolAndTimeOutShouldFail() { + TestNG tng = create(ThreadPoolSizeSampleTest.class); + TestListenerAdapter tla = new TestListenerAdapter(); + tng.addListener((ITestNGListener) tla); + tng.run(); + + assertThat(tla.getPassedTests()).isEmpty(); + assertThat(tla.getFailedTests()).hasSize(1); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/ThreadTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/ThreadTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/ThreadTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/ThreadTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.thread; + +import org.testng.annotations.Test; +import test.BaseTest; + +public class ThreadTest extends BaseTest { + + @Test( + groups = "broken", + description = + "This can be fixed by using sets instead of lists in DynamicGraph, but more failures happen then") + public void timeoutAndInvocationCountShouldFail() { + addClass(ThreadPoolSampleBugTest.class.getName()); + run(); + String[] passed = {"shouldPass1", "shouldPass2"}; + String[] failed = {"shouldFail1", "shouldFail2"}; + verifyTests("Passed", passed, getPassedTests()); + verifyTests("Failed", failed, getFailedTests()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/TrueParallelSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/TrueParallelSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/TrueParallelSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/TrueParallelSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,40 @@ +package test.thread; + +import java.util.Random; +import org.testng.annotations.Test; + +@Test +public class TrueParallelSampleTest extends BaseThreadTest { + static Random random = new Random(System.currentTimeMillis()); + + private void log(String s) { + logString(s); + try { + Thread.sleep(random.nextInt(10)); + } catch (InterruptedException ex) { + Thread.yield(); + } + logString(s); + logCurrentThread(); + } + + public void m1() { + log("m1"); + } + + public void m2() { + log("m2"); + } + + public void m3() { + log("m3"); + } + + public void m4() { + log("m4"); + } + + public void m5() { + log("m5"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/TrueParallelTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/TrueParallelTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/TrueParallelTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/TrueParallelTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,48 @@ +package test.thread; + +import java.util.Arrays; +import java.util.List; +import org.testng.Assert; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import test.SimpleBaseTest; + +/** + * Attempt to make sure that we are truly running methods in parallel. The best I can think of right + * now is to run the tests a few times in a row and verify the ordering is never the same. + */ +public class TrueParallelTest extends SimpleBaseTest { + + @Test + public void shouldRunInParallel() { + boolean success = false; + for (int i = 0, count = Runtime.getRuntime().availableProcessors() * 4; i < count; i++) { + XmlSuite s = createXmlSuite("TrueParallel"); + createXmlTest(s, "Test", TrueParallelSampleTest.class.getName()); + TestNG tng = create(); + s.setParallel(XmlSuite.ParallelMode.METHODS); + tng.setXmlSuites(Arrays.asList(s)); + BaseThreadTest.initThreadLog(); + tng.run(); + + // A sequential result will look like "m1 m1 m3 m3 m2 m2 m4 m4 m5 m5". A properly + // multithreaded result will have at least one non-consecutive different pair: + // "m1 m1 m3 m2 m4 m4 m2 m3 m5 m5" + List strings = TrueParallelSampleTest.getStrings(); + boolean ii = isInterleaved(strings); + success = success || ii; + // System.out.println(strings + " -> " + ii); + } + Assert.assertTrue(success, "Couldn't find any interleaved test method run"); + } + + private boolean isInterleaved(List strings) { + for (int i = 0; i < strings.size(); i += 2) { + if (!strings.get(i).equals(strings.get(i + 1))) { + return true; + } + } + return false; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/issue188/Issue188TestSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/issue188/Issue188TestSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/issue188/Issue188TestSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/issue188/Issue188TestSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,45 @@ +package test.thread.issue188; + +import java.util.Map; +import java.util.Random; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.TimeUnit; +import org.testng.ITestResult; +import org.testng.Reporter; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class Issue188TestSample { + public static final Map> timestamps = new ConcurrentHashMap<>(); + private static final Random random = new Random(); + + @BeforeMethod + public void logTime(ITestResult itr) { + String txt = + Reporter.getCurrentTestResult().getTestContext().getName() + + "_" + + itr.getMethod().getQualifiedName(); + timestamps + .computeIfAbsent(System.currentTimeMillis(), k -> ConcurrentHashMap.newKeySet()) + .add(txt); + } + + @Test + public void sampleTest() { + sleepSilently(); + } + + @Test + public void anotherSampleTest() { + sleepSilently(); + } + + private void sleepSilently() { + try { + TimeUnit.MILLISECONDS.sleep(500 * random.nextInt(10)); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/issue188/IssueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/issue188/IssueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/issue188/IssueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/issue188/IssueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,61 @@ +package test.thread.issue188; + +import java.util.Collections; +import java.util.List; +import java.util.Objects; +import java.util.Set; +import java.util.stream.Collectors; +import org.assertj.core.api.Assertions; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.internal.RuntimeBehavior; +import org.testng.xml.XmlSuite; +import test.SimpleBaseTest; + +public class IssueTest extends SimpleBaseTest { + + @Test + public void testSuiteLevelParallelMode() { + System.setProperty(RuntimeBehavior.STRICTLY_HONOUR_PARALLEL_MODE, "true"); + try { + TestNG testng = new TestNG(); + XmlSuite xmlSuite = new XmlSuite(); + xmlSuite.setParallel(XmlSuite.ParallelMode.METHODS); + xmlSuite.setThreadCount(10); + xmlSuite.setName("Parallel Issue Suite"); + createXmlTest(xmlSuite, "Test1", Issue188TestSample.class); + createXmlTest(xmlSuite, "Test2", Issue188TestSample.class); + createXmlTest(xmlSuite, "Test3", Issue188TestSample.class); + testng.setXmlSuites(Collections.singletonList(xmlSuite)); + testng.run(); + Set timestamps = Issue188TestSample.timestamps.keySet(); + if (timestamps.size() == 1) { + Assertions.assertThat(Issue188TestSample.timestamps.values().iterator().next()) + .withFailMessage( + "Since all tests were started simultaneously,test method count should have been 6") + .hasSize(6); + } else { + List keyset = + Issue188TestSample.timestamps.keySet().stream().sorted().collect(Collectors.toList()); + String allTimeStamps = + keyset.stream().map(Objects::toString).collect(Collectors.joining(",")); + long prev = keyset.get(0); + for (int i = 1; i < keyset.size(); i++) { + long current = keyset.get(i); + long diff = current - prev; + Assertions.assertThat(diff) + .withFailMessage( + "Test methods should have started within a lag of max 40 ms but it was " + + diff + + " ms [" + + allTimeStamps + + "]") + .isLessThanOrEqualTo(40); + prev = current; + } + } + } finally { + System.setProperty(RuntimeBehavior.STRICTLY_HONOUR_PARALLEL_MODE, "false"); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/issue2361/AnotherChildClassExample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/issue2361/AnotherChildClassExample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/issue2361/AnotherChildClassExample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/issue2361/AnotherChildClassExample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,6 @@ +package test.thread.issue2361; + +import org.testng.annotations.Test; + +@Test(singleThreaded = true) +public class AnotherChildClassExample extends BaseTestClassExample {} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/issue2361/BaseTestClassExample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/issue2361/BaseTestClassExample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/issue2361/BaseTestClassExample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/issue2361/BaseTestClassExample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,45 @@ +package test.thread.issue2361; + +import static java.util.concurrent.TimeUnit.MILLISECONDS; +import static org.testng.Assert.assertEquals; + +import java.util.concurrent.atomic.AtomicInteger; +import org.testng.annotations.Test; + +@Test(singleThreaded = true) +public class BaseTestClassExample { + + private final AtomicInteger currentTests = new AtomicInteger(); + + protected void test() { + int currentTests = this.currentTests.incrementAndGet(); + try { + assertEquals(currentTests, 1); + MILLISECONDS.sleep(10); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } finally { + this.currentTests.decrementAndGet(); + } + } + + @Test + public void test1() { + test(); + } + + @Test + public void test2() { + test(); + } + + @Test + public void test3() { + test(); + } + + @Test + public void test4() { + test(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/issue2361/ChildClassExample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/issue2361/ChildClassExample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/issue2361/ChildClassExample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/issue2361/ChildClassExample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,6 @@ +package test.thread.issue2361; + +import org.testng.annotations.Test; + +@Test(singleThreaded = true) +public class ChildClassExample extends BaseTestClassExample {} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/issue2361/FactorySample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/issue2361/FactorySample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/issue2361/FactorySample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/issue2361/FactorySample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.thread.issue2361; + +import org.testng.annotations.Factory; + +public class FactorySample { + + @Factory + public static Object[] newInstances() { + return new Object[] {new ChildClassExample(), new AnotherChildClassExample()}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/issue2361/IssueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/issue2361/IssueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/issue2361/IssueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/issue2361/IssueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,29 @@ +package test.thread.issue2361; + +import org.assertj.core.api.Assertions; +import org.testng.TestNG; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlSuite.ParallelMode; +import org.testng.xml.XmlTest; +import test.SimpleBaseTest; + +public class IssueTest extends SimpleBaseTest { + + @Test(dataProvider = "dp") + public void ensureClassLevelSingleThreadedNatureGetsHonoured(Class cls) { + XmlSuite suite = createXmlSuite("Sample_Suite"); + suite.setParallel(ParallelMode.METHODS); + XmlTest xmlTest = createXmlTest(suite, "Sample_Test", cls); + xmlTest.setParallel(ParallelMode.METHODS); + TestNG testng = create(suite); + testng.run(); + Assertions.assertThat(testng.getStatus()).isEqualTo(0); + } + + @DataProvider(name = "dp") + public Object[][] getTestData() { + return new Object[][] {{ChildClassExample.class}, {FactorySample.class}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/BaseParallelizationTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/BaseParallelizationTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/BaseParallelizationTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/BaseParallelizationTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,1102 @@ +package test.thread.parallelization; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertFalse; +import static org.testng.Assert.assertNull; +import static org.testng.Assert.assertTrue; +import static org.testng.Assert.fail; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHOD_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.SUITE_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.LISTENER_SUITE_FINISH; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.LISTENER_SUITE_START; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.LISTENER_TEST_FINISH; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.LISTENER_TEST_METHOD_PASS; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.LISTENER_TEST_METHOD_START; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.LISTENER_TEST_START; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.TEST_METHOD_EXECUTION; +import static test.thread.parallelization.TestNgRunStateTracker.getTestMethodEventLogsForMethod; + +import com.google.common.collect.Multimap; +import java.lang.annotation.Annotation; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import org.testng.annotations.Test; +import org.testng.internal.collections.Pair; +import org.testng.log4testng.Logger; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.SimpleBaseTest; +import test.thread.parallelization.TestNgRunStateTracker.EventLog; +import test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent; + +public class BaseParallelizationTest extends SimpleBaseTest { + private static final Logger log = Logger.getLogger(BaseParallelizationTest.class); + + // Get a list of the names of declared methods with the @Test annotation from the specified class + public static List getDeclaredTestMethods(Class clazz) { + List methodNames = new ArrayList<>(); + + for (Method method : clazz.getMethods()) { + List declaredAnnotations = Arrays.asList(method.getDeclaredAnnotations()); + + for (Annotation a : declaredAnnotations) { + if (a.annotationType().isAssignableFrom(org.testng.annotations.Test.class)) { + methodNames.add(method.getName()); + } + } + } + + return methodNames; + } + + // Send the name of the suite and the name of the test as parameters so that the methods can + // associate their + // execution event logs with them. Specified the delay in seconds to apply for the method + // execution. This delay + // helps in determining the parallelism or lack thereof for method executions. + public static void addParams(XmlSuite suite, String suiteName, String testName, String sleepFor) { + Map parameters = new HashMap<>(); + parameters.put("suiteName", suiteName); + parameters.put("testName", testName); + parameters.put("sleepFor", sleepFor); + + for (XmlTest test : suite.getTests()) { + if (test.getName().equals(testName)) { + test.setParameters(parameters); + } + } + } + + public static void addParams( + XmlSuite suite, + String suiteName, + String testName, + String sleepFor, + String dataProviderParam) { + Map parameters = new HashMap<>(); + parameters.put("suiteName", suiteName); + parameters.put("testName", testName); + parameters.put("sleepFor", sleepFor); + parameters.put("dataProviderParam", dataProviderParam); + + for (XmlTest test : suite.getTests()) { + if (test.getName().equals(testName)) { + test.setParameters(parameters); + } + } + } + + // Verify that the list of event logs have the specified event type. Print the specified failure + // message if the + // assertion on the event type fails. + public static void verifyEventTypeForEventsLogs( + List eventLogs, TestNgRunEvent event, String failMessage) { + for (EventLog eventLog : eventLogs) { + assertTrue(eventLog.getEvent() == event, failMessage); + } + } + + // Verify that the list of event logs all have different thread IDS. Print the specified failure + // message if the + // assertion on the thread IDs fails. + public static void verifyDifferentThreadIdsForEvents( + List eventLogs, String failMessage) { + List threadIds = new ArrayList<>(); + + for (EventLog eventLog : eventLogs) { + assertFalse(threadIds.contains(eventLog.getThreadId()), failMessage); + threadIds.add(eventLog.getThreadId()); + } + } + + // Verify that the event logs in the first list all have different thread IDs from the event logs + // in the second + // list. Print the specified failure message if the assertion on the thread IDs fails. + public static void verifyDifferentThreadIdsForEvents( + List eventLogsOne, List eventLogsTwo, String failMessage) { + List threadIds = new ArrayList<>(); + + for (EventLog eventLog : eventLogsOne) { + threadIds.add(eventLog.getThreadId()); + } + + for (EventLog eventLog : eventLogsTwo) { + assertFalse(threadIds.contains(eventLog.getThreadId()), failMessage); + } + } + + // Verify that the list of event logs all have the same thread ID. Print the specified failure + // message if the + // assertion on the event type fails. + public static void verifySameThreadIdForAllEvents(List eventLogs, String failMessage) { + long threadId = -1; + for (EventLog eventLog : eventLogs) { + if (threadId == -1) { + threadId = eventLog.getThreadId(); + } else { + assertEquals(eventLog.getThreadId(), threadId, failMessage); + } + } + } + + // Verify that the threads from the specified list of event logs are all greater than the + // specified thread ID. Print + // the specified failure message if the assertion on the thread IDs fails. + public static void verifyEventThreadsSpawnedAfter( + Long earlierThreadId, List eventsFromLaterThread, String failMessage) { + for (EventLog eventLog : eventsFromLaterThread) { + assertTrue(eventLog.getThreadId() > earlierThreadId, failMessage); + } + } + + // //Verify that the timestamps of the list of event logs are all within the specified range of + // each other. Print + // //the specified failure message if the assertion on the timing range fails. + // public static void verifyTimingOfEvents(List eventLogs, long timingRange, String + // failMessage) { + // if(!eventLogs.isEmpty()) { + // Pair timestamps = getEarliestAndLatestTimestamps(eventLogs); + // verifyTimestampDifference(timestamps.second(), timestamps.first(), timingRange, + // failMessage); + // } + // } + + // public static void verifyTimingOfEvents(EventLog eventLogOne, EventLog eventLogTwo, long + // timingRange, String + // failMessage) { + // verifyTimestampDifference(eventLogOne.getTimeOfEvent(), eventLogTwo.getTimeOfEvent(), + // timingRange, failMessage); + // } + // + // //Verify that the timestamps of the first list of events are all within the specified range + // from the timestamps + // //of the second list of events. Print the specified failure message if the assertion on the + // timing range fails. + // public static void verifyTimingOfEvents(List firstEventLogs, List + // secondEventLogs, + // long lowerTimingRange, long upperTimingRange, String failMessage) { + // + // if(!firstEventLogs.isEmpty() && !secondEventLogs.isEmpty()) { + // Pair timestampsListOne = getEarliestAndLatestTimestamps(firstEventLogs); + // Pair timestampsListTwo = + // getEarliestAndLatestTimestamps(secondEventLogs); + // + // verifyTimestampDifference(timestampsListTwo.first(), timestampsListOne.first(), + // lowerTimingRange, + // upperTimingRange, failMessage); + // verifyTimestampDifference(timestampsListTwo.first(), timestampsListOne.second(), + // lowerTimingRange, + // upperTimingRange, failMessage); + // verifyTimestampDifference(timestampsListTwo.second(), timestampsListOne.first(), + // lowerTimingRange, + // upperTimingRange, failMessage); + // verifyTimestampDifference(timestampsListTwo.second(), timestampsListOne.second(), + // lowerTimingRange, + // upperTimingRange, failMessage); + // } + // } + + // //Verify that the difference between the two specified timestamps is within the specfied + // upper and lower bound. The + // //difference is calculated as an absolute value. + // public static void verifyTimestampDifference(long timestampOne, long timestampTwo, long + // lowerTimingRange, + // long upperTimingRange, String failMessage) { + // assertTrue(Math.abs(timestampOne - timestampTwo) <= upperTimingRange && + // Math.abs(timestampOne - timestampTwo) >= lowerTimingRange, failMessage + ". + // Difference: " + + // Math.abs(timestampOne - timestampTwo)); + // } + // + // public static void verifyTimestampDifference(long timestampOne, long timestampTwo, long + // timingRange, String + // failMessage) { + // assertTrue(Math.abs(timestampOne - timestampTwo) <= timingRange, failMessage + ". + // Difference: " + + // Math.abs(timestampOne - timestampTwo)); + // } + + // Verify that the specified event logs all have timestamps between the specified earlier and + // later event logs. + // Print the specified failure message if the assertion on the timestamps fails. + public static void verifyEventsOccurBetween( + EventLog earlierEventLog, + List inBetweenEventLogs, + EventLog laterEventLog, + String failMessage) { + for (EventLog eventLog : inBetweenEventLogs) { + assertTrue( + eventLog.getTimeOfEvent() >= earlierEventLog.getTimeOfEvent() + && eventLog.getTimeOfEvent() <= laterEventLog.getTimeOfEvent(), + failMessage); + } + } + + // Verify that the timestamps for the events if the specified list are all increasing. That each + // the timestamps of + // a given event logger is later than the event logger immediately preceding it. Print the + // specified failure message if + // the assertion on the timestamps fails + public static void verifySequentialTimingOfEvents(List eventLogs, String failMessage) { + for (int i = 0; i + 1 < eventLogs.size(); i++) { + assertTrue( + eventLogs.get(i).getTimeOfEvent() < eventLogs.get(i + 1).getTimeOfEvent(), failMessage); + } + } + + // Verify that the first list of event logs all have timestamps earlier than all the events in the + // second list of + // event logs. Print the specified failure message if the assertion on the timestamps fails. + public static void verifySequentialTimingOfEvents( + List firstEventLogs, List secondEventLogs, String failMessage) { + + if (!firstEventLogs.isEmpty() && !secondEventLogs.isEmpty()) { + Pair timestampsListOne = getEarliestAndLatestTimestamps(firstEventLogs); + Pair timestampsListTwo = getEarliestAndLatestTimestamps(secondEventLogs); + + assertTrue(timestampsListTwo.first() > timestampsListOne.second(), failMessage); + } + } + + // Verify that the test methods declared in the specified list of classes have the specified + // number of class + // instances associated with them for the specified suite and test. + public static void verifyNumberOfInstancesOfTestClassesForMethods( + String suiteName, String testName, List> classes, int numInstances) { + + for (Class clazz : classes) { + verifyNumberOfInstancesOfTestClassForMethods(suiteName, testName, clazz, numInstances); + } + } + + // Verify that the test methods declared in the specified list of classes have the specified + // number of class + // instances associated with them for the specified suite and test. + public static void verifyNumberOfInstancesOfTestClassesForMethods( + String suiteName, String testName, List> classes, int... numInstances) { + + for (int i = 0; i < numInstances.length; i++) { + verifyNumberOfInstancesOfTestClassForMethods( + suiteName, testName, classes.get(i), numInstances[i]); + } + } + + // Verify that the test methods declared in the specified class have the specified number of class + // instances + // associated with them for the specified suite and test. + public static void verifyNumberOfInstancesOfTestClassForMethods( + String suiteName, String testName, Class clazz, int numInstances) { + + for (String methodName : getDeclaredTestMethods(clazz)) { + verifyNumberOfInstancesOfTestClassForMethod( + suiteName, testName, clazz, methodName, numInstances); + } + } + + // Verify that the specified test method has the specified number of class instances associated + // with it for the + // specified suite and test. + public static void verifyNumberOfInstancesOfTestClassForMethod( + String suiteName, String testName, Class clazz, String methodName, int numInstances) { + + Multimap eventLogMap = + getTestMethodEventLogsForMethod(suiteName, testName, clazz.getCanonicalName(), methodName); + + assertEquals( + eventLogMap.keySet().size(), + numInstances, + "There should be " + + numInstances + + " instances " + + "associated with the class " + + clazz.getCanonicalName() + + " for method " + + methodName + + " in the " + + "test " + + testName + + " in the suite " + + suiteName + + ": " + + eventLogMap); + } + + // Verify that all the test methods declared in the specified list of classes have the same + // instances of the classes + // associated with them for the specified suite and test. + public static void verifySameInstancesOfTestClassesAssociatedWithMethods( + String suiteName, String testName, List> classes) { + for (Class clazz : classes) { + verifySameInstancesOfTestClassAssociatedWithMethods(suiteName, testName, clazz); + } + } + + // Verify that all the test methods declared in the specified class have the same instances of the + // class associated / + // with them for the specified suite and test. + public static void verifySameInstancesOfTestClassAssociatedWithMethods( + String suiteName, String testName, Class clazz) { + + Set instanceKeys = null; + + for (String methodName : getDeclaredTestMethods(clazz)) { + Multimap eventLogMap = + getTestMethodEventLogsForMethod( + suiteName, testName, clazz.getCanonicalName(), methodName); + + if (instanceKeys == null) { + instanceKeys = eventLogMap.keySet(); + } else { + assertTrue( + instanceKeys.containsAll(eventLogMap.keySet()) + && eventLogMap.keySet().containsAll(instanceKeys), + "The same instances of " + + clazz.getCanonicalName() + + " should be associated with its methods for the test " + + testName + + " in the suite " + + suiteName); + } + } + } + + // Verify that methods associated with the specified event logs execute simultaneously in parallel + // fashion, in + // accordance with the thread count. This verification is for blocks of parallel methods, none of + // which use + // data providers. This verification is for blocks of parallel methods that have the same sleep + // delays for their + // execution bodies and which do not have any BeforeMethod AfterMethod, BeforeGroup or AfterGroup + // configuration methods. + public static void verifySimultaneousTestMethods( + List testMethodEventLogs, String testName, int threadCount) { + + if (log.isDebugEnabled()) { + log.debug( + "Verifying parallel execution of test methods for test named " + + testName + + " with " + + "thread count " + + threadCount); + log.debug( + testMethodEventLogs.size() + + " test method event logs for " + + testMethodEventLogs.size() / 3 + + " test methods"); + } + + // Keep track of the methods that have started, but not completed execution. + Map methodsExecuting = new HashMap<>(); + + // Keep track of the methods whose start, execute and test method pass events have all been + // found in the list + // of logs + Map methodsCompleted = new HashMap<>(); + + // Keep track of the thread IDs for all the methods that are executing and check that all a + // method's events + // run in the same thread. + List executingMethodThreadIds = new ArrayList<>(); + + // Make a list of the all the thread IDs of the first batch of start method events and check + // that no other + // thread IDs are found in the rest of the event logs. + List allThreadIds = new ArrayList<>(); + + // If number of test methods is more than the thread count, then the first block of methods will + // be equal to + // the thread count. If not, it will be equal to the total number of methods. + int blockSize = + testMethodEventLogs.size() / 3 >= threadCount + ? threadCount + : testMethodEventLogs.size() / 3; + + // Get the start events for the first batch of methods. + List eventLogTestMethodListenerStartEvents = + testMethodEventLogs.subList(0, blockSize); + + if (log.isDebugEnabled()) { + log.debug( + "First " + + blockSize + + " test method event logs should all be test method start events: " + + getStringForEventLogList(eventLogTestMethodListenerStartEvents)); + } + + // Verify that all the events in the sublist extracted for the start events of the block of + // methods expected + // to execute in parallel all have the test method start event type and that they all executed + // in different + // threads. + verifySimultaneousTestMethodListenerStartEvents( + eventLogTestMethodListenerStartEvents, testName, blockSize); + + // Keep track of the current methods that are executing and their thread IDs + for (EventLog eventLog : eventLogTestMethodListenerStartEvents) { + ClassInstanceMethodKey classAndMethodNameAndInstanceHash = + new ClassInstanceMethodKey(eventLog); + + assertNull( + methodsExecuting.get(classAndMethodNameAndInstanceHash), + "There should only be one start " + + "event logged for a method in the first block of test method events"); + assertFalse( + executingMethodThreadIds.contains(eventLog.getThreadId()), + "The first block of test method " + "events should all have different thread IDs"); + + methodsExecuting.put(classAndMethodNameAndInstanceHash, eventLog); + executingMethodThreadIds.add(eventLog.getThreadId()); + allThreadIds.add(eventLog.getThreadId()); + } + + for (int i = blockSize; i < testMethodEventLogs.size(); i++) { + EventLog eventLog = testMethodEventLogs.get(i); + + log.debug("Processing test method event log at index " + i + ": " + eventLog); + + ClassInstanceMethodKey classAndMethodNameAndInstanceHash = + new ClassInstanceMethodKey(eventLog); + + if (eventLog.getEvent() == LISTENER_TEST_METHOD_START) { + assertTrue( + methodsExecuting.get(classAndMethodNameAndInstanceHash) == null + && methodsCompleted.get(classAndMethodNameAndInstanceHash) == null, + "There should only be one " + "execution of any given method"); + assertFalse( + executingMethodThreadIds.contains(eventLog.getThreadId()), + "Event logs for currently " + + "executing test methods should have different thread IDs"); + assertTrue( + allThreadIds.contains(eventLog.getThreadId()), + "All of the test method event logs should " + + "have the same " + + threadCount + + " thread IDs: " + + allThreadIds.toString()); + assertTrue( + methodsExecuting.size() < threadCount, + "The current event log is a test method start " + + "event. The list of currently executing methods should be less than the thread count. " + + "Thread count: " + + threadCount + + ". Currently executing methods: " + + getStringForEventLogList(methodsExecuting.values())); + + methodsExecuting.put(classAndMethodNameAndInstanceHash, eventLog); + executingMethodThreadIds.add(eventLog.getThreadId()); + } + + if (eventLog.getEvent() == TEST_METHOD_EXECUTION) { + assertTrue( + methodsExecuting.get(classAndMethodNameAndInstanceHash) != null, + "Found a test method " + + "execution event log that does not have a corresponding test method start event log"); + assertTrue( + methodsExecuting.get(classAndMethodNameAndInstanceHash).getThreadId() + == eventLog.getThreadId(), + "All the event logs for a given method should have the same thread ID"); + } + + if (eventLog.getEvent() == LISTENER_TEST_METHOD_PASS) { + + assertTrue( + methodsExecuting.get(classAndMethodNameAndInstanceHash) != null, + "Found a test method " + + "pass event log that does not have a corresponding test method start event log"); + assertTrue( + methodsExecuting.get(classAndMethodNameAndInstanceHash).getThreadId() + == eventLog.getThreadId(), + "All the event logs for a given method should have the same thread ID"); + methodsExecuting.remove(classAndMethodNameAndInstanceHash); + executingMethodThreadIds.remove(eventLog.getThreadId()); + methodsCompleted.put(classAndMethodNameAndInstanceHash, eventLog); + } + } + } + + // Verify that methods associated with the specified event logs execute simultaneously in parallel + // fashion, in + // accordance with the thread count. This verification is for blocks of parallel methods, some of + // which use + // non-parallel data providers without factories, so all the invocations of the methods run on the + // same class + // instances. This verification is for blocks of parallel methods that have the same sleep delays + // for their + // execution bodies and which do not have any BeforeMethod AfterMethod, BeforeGroup or AfterGroup + // configuration methods. + // + // Some of the test methods use non-parallel data providers without factories. All the invocations + // of those + // test methods will occur serially within the same thread on the same class instances. There are + // three test + // method events expected per test method: a start event, an execution event, and a test method + // pass event. + public static void verifyParallelTestMethodsWithNonParallelDataProvider( + List testMethodEventLogs, + String testName, + Map expectedInvocationCounts, + int numUniqueMethods, + int threadCount) { + + log.debug( + "Verifying parallel execution of test methods using non-parallel data providers for " + + "test named " + + testName + + " with thread count " + + threadCount); + log.debug( + testMethodEventLogs.size() + + " test method event logs for " + + numUniqueMethods + + " unique methods"); + + Map methodsExecuting = new HashMap<>(); + Map methodsCompleted = new HashMap<>(); + + // Because this method verifies combination of parallel-by-methods mode and the use of + // non-parallel data + // providers without factories, it is necessary to track the number of times that test methods + // are invoked in + // order to check that this is consistent with the number of times they are expected to be + // invoked based on + // their use of non-parallel data providers. + Map methodInvocationsCounts = new HashMap<>(); + + // In order to verify that all invocations of test methods which use non-parallel data providers + // occur in the + // same thread, it is necessary to keep track of the thread IDs of methods that are executing + // within a + // block of simultaneously executing methods. + Map executingMethodThreadIds = new HashMap<>(); + + // Make a list of the all the thread IDs of the first batch of start method events and check + // that no other + // thread IDs are found in the rest of the event logs. + List allThreadIds = new ArrayList<>(); + + // The logic for determining the block size of simultaneously executing parallel methods is + // initially determined + // by whether the total number of unique methods less than the thread count. If it is less than + // the thread count, + // then the block size is equal to the number of unique methods. Those methods will execute in + // parallel + // until all invocations of all the methods completes. Otherwise, there are more methods queued + // up than the + // thread count, so the block size is equal to the thread count. + int blockSize = numUniqueMethods >= threadCount ? threadCount : numUniqueMethods; + + // Get the start events for the first batch of methods. + List eventLogTestMethodListenerStartEvents = + testMethodEventLogs.subList(0, blockSize); + + log.debug( + "First " + + blockSize + + " test method event logs should all be test method start events: " + + "\n" + + getStringForEventLogList(eventLogTestMethodListenerStartEvents)); + log.debug(getStringForEventLogList(eventLogTestMethodListenerStartEvents)); + + // Keep track of the current methods that are executing and their thread IDs + for (EventLog eventLog : eventLogTestMethodListenerStartEvents) { + String classAndMethodName = + (String) eventLog.getData(CLASS_NAME) + "." + (String) eventLog.getData(METHOD_NAME); + + assertNull( + methodsExecuting.get(classAndMethodName), + "There should only be one start event logged for a " + + "method in the first block of test method events"); + assertNull( + executingMethodThreadIds.get(classAndMethodName), + "The first block of test method events " + "should all have different thread IDs"); + + methodsExecuting.put(classAndMethodName, eventLog); + executingMethodThreadIds.put(classAndMethodName, eventLog.getThreadId()); + allThreadIds.add(eventLog.getThreadId()); + methodInvocationsCounts.put(classAndMethodName, 1); + } + + // Verify that all the events in the sublist extracted for the test method execution events of + // the block of + // methods expected to execute in parallel all have the test method execution event type and + // that they all + // executed in different threads. + verifySimultaneousTestMethodListenerStartEvents( + eventLogTestMethodListenerStartEvents, testName, blockSize); + + for (int i = blockSize; i < testMethodEventLogs.size(); i++) { + + EventLog eventLog = testMethodEventLogs.get(i); + + log.debug("Processing test method event log at index " + i + ": " + eventLog); + + String classAndMethodName = + (String) eventLog.getData(CLASS_NAME) + "." + (String) eventLog.getData(METHOD_NAME); + + if (i != blockSize) { + // All methods that are in the list of currently executing methods should still have + // invocations left. + // Otherwise, they would have been removed from that list and added to the completed methods + // list. + allExecutingMethodsHaveMoreInvocations( + methodsExecuting, methodInvocationsCounts, expectedInvocationCounts); + } + + if (eventLog.getEvent() == LISTENER_TEST_METHOD_START) { + assertTrue( + executingMethodThreadIds.get(classAndMethodName) == null + || executingMethodThreadIds.get(classAndMethodName) == eventLog.getThreadId(), + "Event logs for all invocations of a method on a give class instance should have the same " + + "thread ID "); + + for (String key : executingMethodThreadIds.keySet()) { + if (!key.equals(classAndMethodName)) { + assertFalse( + executingMethodThreadIds.get(key) == eventLog.getThreadId(), + "Events for " + "different methods should have different thread IDs"); + } + } + + assertTrue( + allThreadIds.contains(eventLog.getThreadId()), + "All of the test method event logs should " + + "have the same " + + threadCount + + " thread IDs: " + + allThreadIds.toString()); + + if (methodsExecuting.get(classAndMethodName) == null) { + assertTrue( + methodsExecuting.size() < threadCount, + "The current event log is a test method start " + + "event for a method that has not yet been invoked. The list of currently executing " + + "methods should be less than the thread count. Thread count: " + + threadCount + + ". Currently executing methods: " + + getStringForEventLogList(methodsExecuting.values())); + + methodsExecuting.put(classAndMethodName, eventLog); + executingMethodThreadIds.put(classAndMethodName, eventLog.getThreadId()); + methodInvocationsCounts.put(classAndMethodName, 1); + } else { + methodInvocationsCounts.put( + classAndMethodName, methodInvocationsCounts.get(classAndMethodName) + 1); + assertTrue( + methodInvocationsCounts.get(classAndMethodName) + <= expectedInvocationCounts.get(classAndMethodName), + "Method '" + + classAndMethodName + + "' is expected to execute only " + + expectedInvocationCounts.get(classAndMethodName) + + " times, but event logs show " + + "that it was execute at least " + + methodInvocationsCounts.get(classAndMethodName) + + " times"); + } + } + + if (eventLog.getEvent() == TEST_METHOD_EXECUTION) { + assertTrue( + methodsExecuting.get(classAndMethodName) != null, + "Found a test method execution event " + + "log that does not have a corresponding test method start event log"); + assertTrue( + methodsExecuting.get(classAndMethodName).getThreadId() == eventLog.getThreadId(), + "All the event logs for a given method should have the same thread ID"); + } + + if (eventLog.getEvent() == LISTENER_TEST_METHOD_PASS) { + + assertTrue( + methodsExecuting.get(classAndMethodName) != null, + "Found a test method pass event log " + + "that does not have a corresponding test method start event log"); + assertTrue( + methodsExecuting.get(classAndMethodName).getThreadId() == eventLog.getThreadId(), + "All the event logs for a given method should have the same thread ID"); + + if (methodInvocationsCounts + .get(classAndMethodName) + .equals(expectedInvocationCounts.get(classAndMethodName))) { + methodsExecuting.remove(classAndMethodName); + executingMethodThreadIds.remove(classAndMethodName); + methodsCompleted.put(classAndMethodName, eventLog); + } + + log.debug( + classAndMethodName + + " has executed " + + methodInvocationsCounts.get(classAndMethodName) + + " times. Expected to execute " + + (expectedInvocationCounts.get(classAndMethodName) + - methodInvocationsCounts.get(classAndMethodName)) + + " more times"); + } + } + } + + // Verify that the specified test method listener onTestStart event logs execute simultaneously in + // parallel fashion + // according to the expected maximum number of simultaneous executions. Verifies that each of them + // has the same + // event type and all have different thread IDs. + public static void verifySimultaneousTestMethodListenerStartEvents( + List listenerStartEventLogs, String testName, int blockSize) { + + verifyEventTypeForEventsLogs( + listenerStartEventLogs, + LISTENER_TEST_METHOD_START, + "Expected " + + blockSize + + " test method start event logs to be in a block of methods executing in parallel. Found an event log " + + "of a different type in the block being processed: " + + listenerStartEventLogs); + + verifyDifferentThreadIdsForEvents( + listenerStartEventLogs, + "Expected " + + blockSize + + " test method start " + + "event logs to be in a block of methods executing in parallel. Each one of these event logs should " + + "be associated with a different thread ID, but found that at two event logs share the same thread " + + "ID: " + + listenerStartEventLogs); + } + + // Verify that the test method level events for the test methods declared in the specified class + // run in the same + // thread for each instance of the test class for the specified suite and test + public static void verifyEventsForTestMethodsRunInTheSameThread( + Class testClass, String suiteName, String testName) { + + for (Method method : testClass.getMethods()) { + boolean isTestMethod = false; + + Annotation[] annotations = method.getDeclaredAnnotations(); + + for (Annotation a : annotations) { + if (Test.class.isAssignableFrom(a.getClass())) { + isTestMethod = true; + } + } + + if (method.getDeclaringClass().equals(testClass) && isTestMethod) { + Multimap testMethodEventLogs = + getTestMethodEventLogsForMethod( + suiteName, testName, testClass.getCanonicalName(), method.getName()); + + for (Object instanceKey : testMethodEventLogs.keySet()) { + + long threadId = -1; + + for (EventLog eventLog : testMethodEventLogs.get(instanceKey)) { + + if (threadId == -1) { + threadId = eventLog.getThreadId(); + } else { + assertEquals( + eventLog.getThreadId(), + threadId, + "All of the method level events for the test " + + "method " + + method.getName() + + " in the test class " + + testClass.getCanonicalName() + + " for the test " + + suiteName + + " should be run in the same thread"); + } + } + } + } + } + } + + public static void verifySequentialSuites( + List suiteLevelEventLogs, Map> suiteEventLogsMap) { + + verifySameThreadIdForAllEvents( + suiteLevelEventLogs, + "Because the suites execute sequentially, the event logs " + + "suite level events should have the same thread ID: " + + suiteLevelEventLogs); + + List suiteListenerStartEventLogs = new ArrayList<>(); + + for (int i = 0; i < suiteLevelEventLogs.size(); i = i + 2) { + assertTrue( + suiteLevelEventLogs.get(i).getEvent() == LISTENER_SUITE_START + && suiteLevelEventLogs.get(i + 1).getEvent() == LISTENER_SUITE_FINISH, + "Because the suites are " + + "expected to execute sequentially, the suite level event logs should consist of a series of " + + "pairs of a suite listener onStart event logger followed by a suite listener onFinish event logger: " + + suiteLevelEventLogs); + suiteListenerStartEventLogs.add((suiteLevelEventLogs.get(i))); + } + + for (int i = 0; i < suiteListenerStartEventLogs.size() - 1; i++) { + String firstSuite = (String) suiteListenerStartEventLogs.get(i).getData(SUITE_NAME); + String secondSuite = (String) suiteListenerStartEventLogs.get(i + 1).getData(SUITE_NAME); + + List firstSuiteEventLogs = suiteEventLogsMap.get(firstSuite); + List secondSuiteEventLogs = suiteEventLogsMap.get(secondSuite); + + verifySequentialTimingOfEvents( + firstSuiteEventLogs, + secondSuiteEventLogs, + "The first suite listener " + + "onStart event logger is for " + + firstSuite + + " and the second suite listener onStart event logger is " + + "for " + + secondSuite + + ". Because the suites are supposed to execute sequentially, all of the " + + "event logs for " + + firstSuite + + " should have timestamps earlier than all of the event logs for " + + secondSuite + + ". First suite event logs: " + + firstSuiteEventLogs + + ". Second suite event logs: " + + secondSuiteEventLogs); + } + } + + public static void verifySequentialTests( + List suiteAndTestLevelEventLogs, + List testLevelEventLogs, + EventLog suiteListenerOnStartEventLog, + EventLog suiteListenerOnFinishEventLog) { + + verifySameThreadIdForAllEvents( + suiteAndTestLevelEventLogs, + "All suite level and test level event logs " + + "should have the same thread ID because there is no parallelism specified at the suite or test " + + "level: " + + suiteAndTestLevelEventLogs); + + verifySequentialTimingOfEvents( + suiteAndTestLevelEventLogs, + "The timestamps of suite and test level events " + + "logged first should be earlier than those which are logged afterwards because there is no " + + "parallelism specified at the suite or test level: " + + suiteAndTestLevelEventLogs); + + verifyEventsOccurBetween( + suiteListenerOnStartEventLog, + testLevelEventLogs, + suiteListenerOnFinishEventLog, + "All of the test level event logs should have timestamps between the suite listener's onStart and " + + "onFinish event logs. Suite listener onStart event logger: " + + suiteListenerOnStartEventLog + + ". Suite listener onFinish event logger: " + + suiteListenerOnFinishEventLog + + ". Test level " + + "event logs: " + + testLevelEventLogs); + + for (int i = 0; i < testLevelEventLogs.size(); i = i + 2) { + assertTrue( + testLevelEventLogs.get(i).getEvent() == LISTENER_TEST_START + && testLevelEventLogs.get(i + 1).getEvent() == LISTENER_TEST_FINISH, + "Because the tests are " + + "expected to execute sequentially, the test level event logs should consist of a series of " + + "pairs of a test listener onStart event logger followed by a test listener onFinish event logger: " + + testLevelEventLogs); + } + } + + public static void verifyParallelSuitesWithUnequalExecutionTimes( + List suiteLevelEventLogs, int threadPoolSize) { + + Map suitesExecuting = new HashMap<>(); + Map suitesCompleted = new HashMap<>(); + + List executingSuiteThreadIds = new ArrayList<>(); + + if (suiteLevelEventLogs.size() > 2) { + int offset = + suiteLevelEventLogs.size() >= 2 * threadPoolSize + ? threadPoolSize + : suiteLevelEventLogs.size() / 2; + + List suiteListenerStartEventLogs = suiteLevelEventLogs.subList(0, offset); + + verifyFirstBlockOfSimultaneouslyExecutingSuites(suiteListenerStartEventLogs, threadPoolSize); + + for (EventLog eventLog : suiteListenerStartEventLogs) { + suitesExecuting.put((String) eventLog.getData(SUITE_NAME), eventLog); + executingSuiteThreadIds.add(eventLog.getThreadId()); + } + + for (int i = offset; i < suiteLevelEventLogs.size(); i++) { + + EventLog eventLog = suiteLevelEventLogs.get(i); + String suiteName = (String) eventLog.getData(SUITE_NAME); + + if (eventLog.getEvent() == LISTENER_SUITE_START) { + if (suitesExecuting.keySet().size() == threadPoolSize) { + fail( + "The thread pool size is " + + threadPoolSize + + ", so there should be no more than " + + threadPoolSize + + " suites executing at the same time: " + + suiteLevelEventLogs); + } + + assertFalse( + suitesExecuting.get(suiteName) != null || suitesCompleted.get(suiteName) != null, + "There should only be one execution of any given suite"); + assertFalse( + executingSuiteThreadIds.contains(eventLog.getThreadId()), + "Event logs for currently " + "executing suites should have different thread IDs"); + + suitesExecuting.put(suiteName, eventLog); + executingSuiteThreadIds.add(eventLog.getThreadId()); + + if (suitesCompleted.size() > 0) { + EventLog priorEventLog = suiteLevelEventLogs.get(i - 1); + + assertEquals( + priorEventLog.getEvent(), + LISTENER_SUITE_FINISH, + "When suites are executing in " + + "parallel and a new suite begins execution when the active thread count was last " + + "known to be equal to the maximum thread pool size, the previously logged suite " + + "level event should be a suite listener onFinish event."); + } + } + + if (suitesExecuting.keySet().size() < threadPoolSize + && suiteLevelEventLogs.size() - i + 1 > threadPoolSize) { + fail( + "The thread pool size is " + + threadPoolSize + + ", so there should be at least " + + threadPoolSize + + " suites executing at the same time unless there are no suites left to " + + "queue and the final block of suites is currently in execution: " + + suiteLevelEventLogs); + } + + if (eventLog.getEvent() == LISTENER_SUITE_FINISH) { + + assertTrue( + suitesExecuting.get(suiteName) != null, + "Found an event logger for a suite listener " + + "onFinish event that does not have a corresponding event logger for a suite listener " + + "onStart event"); + assertTrue( + suitesExecuting.get(suiteName).getThreadId() == eventLog.getThreadId(), + "All the " + + "suite level event logs for a given suite should have the same thread ID"); + + suitesExecuting.remove(suiteName); + executingSuiteThreadIds.remove(eventLog.getThreadId()); + suitesCompleted.put((String) eventLog.getData(SUITE_NAME), eventLog); + } + } + } + } + + public static void verifySimultaneousSuiteListenerStartEvents( + List listenerStartEventLogs, int threadPoolSize) { + + verifyEventTypeForEventsLogs( + listenerStartEventLogs, + LISTENER_SUITE_START, + "The suite thread pool size is " + + threadPoolSize + + ", so no more than " + + threadPoolSize + + " suites should start running at the " + + "same time if there are more than " + + threadPoolSize + + " suites remaining to execute."); + verifyDifferentThreadIdsForEvents( + listenerStartEventLogs, + "The suite thread pool size is " + + threadPoolSize + + ", so the thread IDs for all the suite listener's onStart method for the " + + threadPoolSize + + " currently executing suites should be different"); + } + + private static void verifyFirstBlockOfSimultaneouslyExecutingSuites( + List suiteListenerStartEventLogs, int threadPoolSize) { + + verifySimultaneousSuiteListenerStartEvents(suiteListenerStartEventLogs, threadPoolSize); + verifyDifferentThreadIdsForEvents( + suiteListenerStartEventLogs, + "The thread count is " + + threadPoolSize + + " so the thread IDs for the suite listener onStart events for simultaneously executing suites " + + "should be different. Event logs: " + + suiteListenerStartEventLogs); + } + + // Helper method that retrieves the earliest and latest timestamps for the specified list of event + // logs + private static Pair getEarliestAndLatestTimestamps(List eventLogs) { + + if (eventLogs.isEmpty()) { + return null; + } + + long earliestTimestamp = eventLogs.get(0).getTimeOfEvent(); + long latestTimestamp = eventLogs.get(0).getTimeOfEvent(); + + for (int i = 1; i < eventLogs.size(); i++) { + long timestamp = eventLogs.get(i).getTimeOfEvent(); + + if (timestamp < earliestTimestamp) { + earliestTimestamp = timestamp; + } + + if (timestamp > latestTimestamp) { + latestTimestamp = timestamp; + } + } + + return new Pair<>(earliestTimestamp, latestTimestamp); + } + + private static boolean allExecutingMethodsHaveMoreInvocations( + Map methodsExecuting, + Map methodInvocationsCounts, + Map expectedInvocationCounts) { + + for (String methodAndClassName : methodsExecuting.keySet()) { + if (Objects.equals( + methodInvocationsCounts.get(methodAndClassName), + expectedInvocationCounts.get(methodAndClassName))) { + return false; + } + } + + return true; + } + + private static String getStringForEventLogList(Collection list) { + StringBuilder sb = new StringBuilder(); + ArrayList eventLogs = new ArrayList<>(list); + + for (int i = 0; i < eventLogs.size(); i++) { + sb.append(eventLogs.get(i)); + if (i != eventLogs.size() - 1) { + sb.append("\n"); + } + } + + return sb.toString(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/ClassInstanceMethodKey.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/ClassInstanceMethodKey.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/ClassInstanceMethodKey.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/ClassInstanceMethodKey.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,32 @@ +package test.thread.parallelization; + +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.*; + +import java.util.Objects; + +public class ClassInstanceMethodKey { + private final String className; + private final String methodName; + private final Object classInstance; + + public ClassInstanceMethodKey(TestNgRunStateTracker.EventLog eventLog) { + className = (String) eventLog.getData(CLASS_NAME); + methodName = (String) eventLog.getData(METHOD_NAME); + classInstance = eventLog.getData(CLASS_INSTANCE); + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ClassInstanceMethodKey that = (ClassInstanceMethodKey) o; + return Objects.equals(className, that.className) + && Objects.equals(methodName, that.methodName) + && Objects.equals(classInstance, that.classInstance); + } + + @Override + public int hashCode() { + return Objects.hash(className, methodName, classInstance); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase1Scenario1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase1Scenario1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase1Scenario1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase1Scenario1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,218 @@ +package test.thread.parallelization; + +import static org.testng.Assert.assertEquals; +import static test.thread.parallelization.TestNgRunStateTracker.getAllSuiteAndTestLevelEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getAllSuiteLevelEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getAllTestLevelEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getAllTestMethodLevelEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getSuiteListenerFinishEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getSuiteListenerStartEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getTestListenerFinishEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getTestListenerStartEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getTestListenerStartThreadId; +import static test.thread.parallelization.TestNgRunStateTracker.reset; + +import java.util.List; +import org.testng.ITestNGListener; +import org.testng.TestNG; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import org.testng.log4testng.Logger; +import org.testng.xml.XmlSuite; +import test.thread.parallelization.TestNgRunStateTracker.EventLog; +import test.thread.parallelization.sample.TestClassAFiveMethodsWithNoDepsSample; + +/** + * This class covers PTP_TC_1, Scenario 1 in the Parallelization Test Plan. + * + *

Test Case Summary: Parallel by methods mode with sequential test suites, no dependencies and + * no factories or data providers. + * + *

Scenario Description: Single suite with a single test consisting of a single test class with + * five methods + * + *

1) Thread count and parallel mode are specified at the suite level 2) The thread count is + * equal to the number of test methods, ensuring that no method should have to wait for any other + * method to complete execution 3) There are NO configuration methods 4) All test methods pass 5) NO + * ordering is specified 6) group-by-instances is NOT set 7) There are no method exclusions + */ +public class ParallelByMethodsTestCase1Scenario1 extends BaseParallelizationTest { + private static final Logger log = Logger.getLogger(ParallelByMethodsTestCase1Scenario1.class); + + private static final String SUITE = "SingleTestSuite"; + private static final String TEST = "SingleTestClassTest"; + + private List suiteLevelEventLogs; + private List testLevelEventLogs; + private List suiteAndTestLevelEventLogs; + private List testMethodLevelEventLogs; + + private EventLog suiteListenerOnStartEventLog; + private EventLog suiteListenerOnFinishEventLog; + + private EventLog testListenerOnStartEventLog; + private EventLog testListenerOnFinishEventLog; + + private Long testListenerOnStartThreadId; + + @BeforeClass + public void setUp() { + reset(); + + XmlSuite suite = createXmlSuite(SUITE); + suite.setParallel(XmlSuite.ParallelMode.METHODS); + suite.setThreadCount(5); + + createXmlTest(suite, TEST, TestClassAFiveMethodsWithNoDepsSample.class); + + addParams(suite, SUITE, TEST, "100"); + + TestNG tng = create(suite); + tng.addListener((ITestNGListener) new TestNgRunStateListener()); + + log.debug( + "Beginning ParallelByMethodsTestCase1Scenario1. This test scenario consists of a " + + "single suite with a single test which consists of one test class with five test methods. There " + + "are no dependencies, data providers or factories."); + log.debug( + "Suite: " + + SUITE + + ", Test: " + + TEST + + ", Test class: " + + TestClassAFiveMethodsWithNoDepsSample.class.getCanonicalName() + + ". Thread count: 5"); + + tng.run(); + + suiteLevelEventLogs = getAllSuiteLevelEventLogs(); + testLevelEventLogs = getAllTestLevelEventLogs(); + suiteAndTestLevelEventLogs = getAllSuiteAndTestLevelEventLogs(); + testMethodLevelEventLogs = getAllTestMethodLevelEventLogs(); + + suiteListenerOnStartEventLog = getSuiteListenerStartEventLog(SUITE); + suiteListenerOnFinishEventLog = getSuiteListenerFinishEventLog(SUITE); + + testListenerOnStartEventLog = getTestListenerStartEventLog(SUITE, TEST); + testListenerOnFinishEventLog = getTestListenerFinishEventLog(SUITE, TEST); + + testListenerOnStartThreadId = getTestListenerStartThreadId(SUITE, TEST); + } + + // Verifies that the expected number of suite, test and test method level events were logged. + @Test + public void sanityCheck() { + assertEquals( + suiteLevelEventLogs.size(), + 2, + "There should be 2 suite level events logged for " + SUITE + ": " + suiteLevelEventLogs); + assertEquals( + testLevelEventLogs.size(), + 2, + "There should be 2 test level events logged for " + SUITE + ": " + testLevelEventLogs); + assertEquals( + testMethodLevelEventLogs.size(), + 15, + "There should be 15 test method level event logged for " + + SUITE + + ": " + + testMethodLevelEventLogs); + } + + // Verify that the suite listener and test listener events have timestamps in the following order: + // suite start, + // test start, test finish, suite finish. Verify that all of these events run in the same thread + // because the + // parallelization mode is by methods only. + @Test + public void verifySuiteAndTestLevelEventsRunInSequentialOrderInSameThread() { + verifySameThreadIdForAllEvents( + suiteAndTestLevelEventLogs, + "The thread ID for all the suite and test level " + + "event logs should be the same because there is no parallelism specified at the suite or test level: " + + suiteAndTestLevelEventLogs); + verifySequentialTimingOfEvents( + suiteAndTestLevelEventLogs, + "The timestamps of suite and test level events " + + "logged first should be earlier than those which are logged afterwards because there is no " + + "parallelism specified at the suite or test level: " + + suiteAndTestLevelEventLogs); + verifyEventsOccurBetween( + suiteListenerOnStartEventLog, + testLevelEventLogs, + suiteListenerOnFinishEventLog, + "All of the test level event logs should have timestamps between the suite listener's onStart and " + + "onFinish event logs. Suite listener onStart event log: " + + suiteListenerOnStartEventLog + + ". Suite listener onFinish event log: " + + suiteListenerOnFinishEventLog + + ". Test level " + + "event logs: " + + testLevelEventLogs); + } + + // Verify that there is only a single test class instance associated with each of the test methods + // from the + // sample test class + // Verify that the same test class instance is associated with each of the test methods from the + // sample test class + @Test + public void verifyOnlyOneInstanceOfTestClassForAllTestMethods() { + + verifyNumberOfInstancesOfTestClassForMethods( + SUITE, TEST, TestClassAFiveMethodsWithNoDepsSample.class, 1); + + verifySameInstancesOfTestClassAssociatedWithMethods( + SUITE, TEST, TestClassAFiveMethodsWithNoDepsSample.class); + } + + // Verifies that all the test method level events execute between the test listener onStart and + // onFinish methods + @Test + public void verifyTestMethodLevelEventsAllOccurBetweenTestListenerStartAndFinish() { + verifyEventsOccurBetween( + testListenerOnStartEventLog, + testMethodLevelEventLogs, + testListenerOnFinishEventLog, + "All of the test method level event logs should have timestamps between the test listener's onStart " + + "and onFinish event logs. Test Listener onStart event log: " + + testListenerOnStartEventLog + + ". Test Listener onFinish event log: " + + testListenerOnFinishEventLog + + ". Test method level " + + "event logs: " + + testMethodLevelEventLogs); + } + + // Verifies that the method level events all run in different threads from the test and suite + // level events. + @Test + public void verifyThatMethodLevelEventsRunInDifferentThreadsFromSuiteAndTestLevelEvents() { + verifyEventThreadsSpawnedAfter( + testListenerOnStartThreadId, + testMethodLevelEventLogs, + "All the thread IDs " + + "for the test method level events should be greater than the thread ID for the suite and test level " + + "events. The expectation is that since the suite and test level events are running sequentially, and " + + "all the test methods are running in parallel, new threads will be spawned after the thread " + + "executing the suite and test level events when new methods begin executing. Suite and test level " + + "events thread ID: " + + testListenerOnStartThreadId + + ". Test method level event logs: " + + testMethodLevelEventLogs); + } + + // Verifies that the test methods execute in different threads in parallel fashion. + @Test + public void verifyThatTestMethodsRunInParallelThreads() { + verifySimultaneousTestMethods(testMethodLevelEventLogs, TEST, 5); + } + + // Verifies that all the test method level events for any given test method run in the same + // thread. + @Test + public void verifyThatAllEventsForATestMethodExecuteInSameThread() { + verifyEventsForTestMethodsRunInTheSameThread( + TestClassAFiveMethodsWithNoDepsSample.class, SUITE, TEST); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase1Scenario2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase1Scenario2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase1Scenario2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase1Scenario2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,801 @@ +package test.thread.parallelization; + +import static org.testng.Assert.assertEquals; +import static test.thread.parallelization.TestNgRunStateTracker.getAllEventLogsForSuite; +import static test.thread.parallelization.TestNgRunStateTracker.getAllSuiteLevelEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getAllSuiteListenerStartEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getAllTestLevelEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getAllTestMethodLevelEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getSuiteAndTestLevelEventLogsForSuite; +import static test.thread.parallelization.TestNgRunStateTracker.getSuiteLevelEventLogsForSuite; +import static test.thread.parallelization.TestNgRunStateTracker.getSuiteListenerFinishEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getSuiteListenerStartEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getTestLevelEventLogsForSuite; +import static test.thread.parallelization.TestNgRunStateTracker.getTestLevelEventLogsForTest; +import static test.thread.parallelization.TestNgRunStateTracker.getTestListenerFinishEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getTestListenerStartEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getTestMethodLevelEventLogsForSuite; +import static test.thread.parallelization.TestNgRunStateTracker.getTestMethodLevelEventLogsForTest; +import static test.thread.parallelization.TestNgRunStateTracker.reset; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.testng.ITestNGListener; +import org.testng.TestNG; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import org.testng.log4testng.Logger; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.thread.parallelization.TestNgRunStateTracker.EventLog; +import test.thread.parallelization.sample.TestClassAFiveMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassBFourMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassCSixMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassDThreeMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassEFiveMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassFSixMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassGThreeMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassHFourMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassIFiveMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassJFourMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassKFiveMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassLThreeMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassMFourMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassNFiveMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassOSixMethodsWithNoDepsSample; + +/** + * This class covers PTP_TC_1, Scenario 2 in the Parallelization Test Plan. + * + *

Test Case Summary: Parallel by methods mode with sequential test suites, no dependencies and + * no factories or data providers. + * + *

Scenario Description: Three suites with 1, 2 and 3 tests respectively. One test for a suite + * shall consist of a single test class while the rest shall consist of more than one test class. + * + *

1) For one of the suites, the thread count and parallel mode are specified at the suite level + * 2) For one of the suites, the thread count and parallel mode are specified at the test level 3) + * For one of the suites, the parallel mode is specified at the suite level, and the thread counts + * are specified at the test level (thread counts for each test differ) 4) The thread count is less + * than the number of test methods for the tests in two of the suites, so some methods will have to + * wait the active thread count to drop below the maximum thread count before they can begin + * execution. 5) The thread count is more than the number of test methods for the tests in one of + * the suites, ensuring that none of the methods in that suite should have to wait for any other + * method to complete execution 6) There are NO configuration methods 7) All test methods pass 8) NO + * ordering is specified 9) group-by-instances is NOT set 10) There are no method exclusions + */ +public class ParallelByMethodsTestCase1Scenario2 extends BaseParallelizationTest { + private static final Logger log = Logger.getLogger(ParallelByMethodsTestCase1Scenario2.class); + + private static final String SUITE_A = "TestSuiteA"; + private static final String SUITE_B = "TestSuiteB"; + private static final String SUITE_C = "TestSuiteC"; + + private static final String SUITE_A_TEST_A = "TestSuiteA-TwoTestClassTest"; + + private static final String SUITE_B_TEST_A = "TestSuiteB-SingleTestClassTest"; + private static final String SUITE_B_TEST_B = "TestSuiteB-ThreeTestClassTest"; + + private static final String SUITE_C_TEST_A = "TestSuiteC-ThreeTestClassTest"; + private static final String SUITE_C_TEST_B = "TestSuiteC-TwoTestClassTest"; + private static final String SUITE_C_TEST_C = "TestSuiteC-FourTestClassTest"; + + private Map> suiteEventLogsMap = new HashMap<>(); + private Map> testEventLogsMap = new HashMap<>(); + + private List suiteLevelEventLogs; + private List testLevelEventLogs; + private List testMethodLevelEventLogs; + + private List suiteOneSuiteAndTestLevelEventLogs; + private List suiteOneSuiteLevelEventLogs; + private List suiteOneTestLevelEventLogs; + private List suiteOneTestMethodLevelEventLogs; + + private List suiteTwoSuiteAndTestLevelEventLogs; + private List suiteTwoSuiteLevelEventLogs; + private List suiteTwoTestLevelEventLogs; + private List suiteTwoTestMethodLevelEventLogs; + + private List suiteThreeSuiteAndTestLevelEventLogs; + private List suiteThreeSuiteLevelEventLogs; + private List suiteThreeTestLevelEventLogs; + private List suiteThreeTestMethodLevelEventLogs; + + private List suiteOneTestOneTestMethodLevelEventLogs; + + private List suiteTwoTestOneTestMethodLevelEventLogs; + private List suiteTwoTestTwoTestMethodLevelEventLogs; + + private List suiteThreeTestOneTestMethodLevelEventLogs; + private List suiteThreeTestTwoTestMethodLevelEventLogs; + private List suiteThreeTestThreeTestMethodLevelEventLogs; + + private EventLog suiteOneSuiteListenerOnStartEventLog; + private EventLog suiteOneSuiteListenerOnFinishEventLog; + + private EventLog suiteTwoSuiteListenerOnStartEventLog; + private EventLog suiteTwoSuiteListenerOnFinishEventLog; + + private EventLog suiteThreeSuiteListenerOnStartEventLog; + private EventLog suiteThreeSuiteListenerOnFinishEventLog; + + private EventLog suiteOneTestOneListenerOnStartEventLog; + private EventLog suiteOneTestOneListenerOnFinishEventLog; + + private EventLog suiteTwoTestOneListenerOnStartEventLog; + private EventLog suiteTwoTestOneListenerOnFinishEventLog; + private EventLog suiteTwoTestTwoListenerOnStartEventLog; + private EventLog suiteTwoTestTwoListenerOnFinishEventLog; + + private EventLog suiteThreeTestOneListenerOnStartEventLog; + private EventLog suiteThreeTestOneListenerOnFinishEventLog; + private EventLog suiteThreeTestTwoListenerOnStartEventLog; + private EventLog suiteThreeTestTwoListenerOnFinishEventLog; + private EventLog suiteThreeTestThreeListenerOnStartEventLog; + private EventLog suiteThreeTestThreeListenerOnFinishEventLog; + + @BeforeClass + public void setUp() { + reset(); + + XmlSuite suiteOne = createXmlSuite(SUITE_A); + XmlSuite suiteTwo = createXmlSuite(SUITE_B); + XmlSuite suiteThree = createXmlSuite(SUITE_C); + + suiteOne.setParallel(XmlSuite.ParallelMode.METHODS); + suiteOne.setThreadCount(3); + + createXmlTest( + suiteOne, + SUITE_A_TEST_A, + TestClassAFiveMethodsWithNoDepsSample.class, + TestClassCSixMethodsWithNoDepsSample.class); + createXmlTest(suiteTwo, SUITE_B_TEST_A, TestClassEFiveMethodsWithNoDepsSample.class); + createXmlTest( + suiteTwo, + SUITE_B_TEST_B, + TestClassDThreeMethodsWithNoDepsSample.class, + TestClassBFourMethodsWithNoDepsSample.class, + TestClassFSixMethodsWithNoDepsSample.class); + + suiteTwo.setParallel(XmlSuite.ParallelMode.METHODS); + + for (XmlTest test : suiteTwo.getTests()) { + if (test.getName().equals(SUITE_B_TEST_A)) { + test.setThreadCount(6); + } else { + test.setThreadCount(20); + } + } + + createXmlTest( + suiteThree, + SUITE_C_TEST_A, + TestClassGThreeMethodsWithNoDepsSample.class, + TestClassHFourMethodsWithNoDepsSample.class, + TestClassIFiveMethodsWithNoDepsSample.class); + createXmlTest( + suiteThree, + SUITE_C_TEST_B, + TestClassJFourMethodsWithNoDepsSample.class, + TestClassKFiveMethodsWithNoDepsSample.class); + createXmlTest( + suiteThree, + SUITE_C_TEST_C, + TestClassLThreeMethodsWithNoDepsSample.class, + TestClassMFourMethodsWithNoDepsSample.class, + TestClassNFiveMethodsWithNoDepsSample.class, + TestClassOSixMethodsWithNoDepsSample.class); + + for (XmlTest test : suiteThree.getTests()) { + test.setParallel(XmlSuite.ParallelMode.METHODS); + + switch (test.getName()) { + case SUITE_C_TEST_A: + test.setThreadCount(10); + break; + case SUITE_C_TEST_B: + test.setThreadCount(5); + break; + default: + test.setThreadCount(12); + break; + } + } + + addParams(suiteOne, SUITE_A, SUITE_A_TEST_A, "100"); + + addParams(suiteTwo, SUITE_B, SUITE_B_TEST_A, "100"); + addParams(suiteTwo, SUITE_B, SUITE_B_TEST_B, "100"); + + addParams(suiteThree, SUITE_C, SUITE_C_TEST_A, "100"); + addParams(suiteThree, SUITE_C, SUITE_C_TEST_B, "100"); + addParams(suiteThree, SUITE_C, SUITE_C_TEST_C, "100"); + + TestNG tng = create(suiteOne, suiteTwo, suiteThree); + tng.addListener((ITestNGListener) new TestNgRunStateListener()); + + log.debug( + "Beginning ParallelByMethodsTestCase1Scenario2. This test scenario consists of three " + + "sequentially executed suites with 1, 2 and 3 tests respectively. One test for a suite consists of a " + + "single test class while the rest shall consist of more than one test class. There are no " + + "dependencies, data providers or factories."); + + log.debug( + "Suite: " + + SUITE_A + + ", Test: " + + SUITE_A_TEST_A + + ", Test classes: " + + TestClassAFiveMethodsWithNoDepsSample.class.getCanonicalName() + + ", " + + TestClassCSixMethodsWithNoDepsSample.class.getCanonicalName() + + ". Thread count: 3"); + + log.debug( + "Suite: " + + SUITE_B + + ", Test: " + + SUITE_B_TEST_A + + ", Test class: " + + TestClassEFiveMethodsWithNoDepsSample.class.getCanonicalName() + + ". Thread count: 6"); + + log.debug( + "Suite " + + SUITE_B + + ", Test: " + + SUITE_B_TEST_B + + ", Test classes: " + + TestClassDThreeMethodsWithNoDepsSample.class + + ", " + + TestClassBFourMethodsWithNoDepsSample.class + + ", " + + TestClassFSixMethodsWithNoDepsSample.class + + ". Thread count: 20"); + + log.debug( + "Suite: " + + SUITE_C + + ", Test: " + + SUITE_C_TEST_A + + ", Test classes: " + + TestClassGThreeMethodsWithNoDepsSample.class.getCanonicalName() + + ", " + + TestClassHFourMethodsWithNoDepsSample.class.getCanonicalName() + + ", " + + TestClassIFiveMethodsWithNoDepsSample.class + + ". Thread count: 10"); + + log.debug( + "Suite: " + + SUITE_C + + ", Test: " + + SUITE_C_TEST_B + + ", Test classes: " + + TestClassJFourMethodsWithNoDepsSample.class.getCanonicalName() + + ", " + + TestClassKFiveMethodsWithNoDepsSample.class + + ". Thread count: 5"); + + log.debug( + "Suite: " + + SUITE_C + + ", Test: " + + SUITE_C_TEST_C + + ", Test classes: " + + TestClassLThreeMethodsWithNoDepsSample.class.getCanonicalName() + + ", " + + TestClassMFourMethodsWithNoDepsSample.class.getCanonicalName() + + ", " + + TestClassNFiveMethodsWithNoDepsSample.class.getCanonicalName() + + ", " + + TestClassOSixMethodsWithNoDepsSample.class.getCanonicalName() + + ". Thread count: 12."); + + tng.run(); + + suiteLevelEventLogs = getAllSuiteLevelEventLogs(); + testLevelEventLogs = getAllTestLevelEventLogs(); + testMethodLevelEventLogs = getAllTestMethodLevelEventLogs(); + + suiteOneSuiteAndTestLevelEventLogs = getSuiteAndTestLevelEventLogsForSuite(SUITE_A); + suiteOneSuiteLevelEventLogs = getSuiteLevelEventLogsForSuite(SUITE_A); + suiteOneTestLevelEventLogs = getTestLevelEventLogsForSuite(SUITE_A); + + suiteTwoSuiteAndTestLevelEventLogs = getSuiteAndTestLevelEventLogsForSuite(SUITE_B); + suiteTwoSuiteLevelEventLogs = getSuiteLevelEventLogsForSuite(SUITE_B); + suiteTwoTestLevelEventLogs = getTestLevelEventLogsForSuite(SUITE_B); + + suiteThreeSuiteAndTestLevelEventLogs = getSuiteAndTestLevelEventLogsForSuite(SUITE_C); + suiteThreeSuiteLevelEventLogs = getSuiteLevelEventLogsForSuite(SUITE_C); + suiteThreeTestLevelEventLogs = getTestLevelEventLogsForSuite(SUITE_C); + + suiteEventLogsMap.put(SUITE_A, getAllEventLogsForSuite(SUITE_A)); + suiteEventLogsMap.put(SUITE_B, getAllEventLogsForSuite(SUITE_B)); + suiteEventLogsMap.put(SUITE_C, getAllEventLogsForSuite(SUITE_C)); + + suiteOneTestMethodLevelEventLogs = getTestMethodLevelEventLogsForSuite(SUITE_A); + suiteTwoTestMethodLevelEventLogs = getTestMethodLevelEventLogsForSuite(SUITE_B); + suiteThreeTestMethodLevelEventLogs = getTestMethodLevelEventLogsForSuite(SUITE_C); + + suiteOneTestOneTestMethodLevelEventLogs = + getTestMethodLevelEventLogsForTest(SUITE_A, SUITE_A_TEST_A); + + suiteTwoTestOneTestMethodLevelEventLogs = + getTestMethodLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_A); + suiteTwoTestTwoTestMethodLevelEventLogs = + getTestMethodLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_B); + + suiteThreeTestOneTestMethodLevelEventLogs = + getTestMethodLevelEventLogsForTest(SUITE_C, SUITE_C_TEST_A); + suiteThreeTestTwoTestMethodLevelEventLogs = + getTestMethodLevelEventLogsForTest(SUITE_C, SUITE_C_TEST_B); + suiteThreeTestThreeTestMethodLevelEventLogs = + getTestMethodLevelEventLogsForTest(SUITE_C, SUITE_C_TEST_C); + + testEventLogsMap.put(SUITE_B_TEST_A, getTestLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_A)); + testEventLogsMap.put(SUITE_B_TEST_B, getTestLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_B)); + + testEventLogsMap.put(SUITE_C_TEST_A, getTestLevelEventLogsForTest(SUITE_C, SUITE_C_TEST_A)); + testEventLogsMap.put(SUITE_C_TEST_B, getTestLevelEventLogsForTest(SUITE_C, SUITE_C_TEST_B)); + testEventLogsMap.put(SUITE_C_TEST_C, getTestLevelEventLogsForTest(SUITE_C, SUITE_C_TEST_C)); + + suiteOneSuiteListenerOnStartEventLog = getSuiteListenerStartEventLog(SUITE_A); + suiteOneSuiteListenerOnFinishEventLog = getSuiteListenerFinishEventLog(SUITE_A); + + suiteTwoSuiteListenerOnStartEventLog = getSuiteListenerStartEventLog(SUITE_B); + suiteTwoSuiteListenerOnFinishEventLog = getSuiteListenerFinishEventLog(SUITE_B); + + suiteThreeSuiteListenerOnStartEventLog = getSuiteListenerStartEventLog(SUITE_C); + suiteThreeSuiteListenerOnFinishEventLog = getSuiteListenerFinishEventLog(SUITE_C); + + suiteOneTestOneListenerOnStartEventLog = getTestListenerStartEventLog(SUITE_A, SUITE_A_TEST_A); + suiteOneTestOneListenerOnFinishEventLog = + getTestListenerFinishEventLog(SUITE_A, SUITE_A_TEST_A); + + suiteTwoTestOneListenerOnStartEventLog = getTestListenerStartEventLog(SUITE_B, SUITE_B_TEST_A); + suiteTwoTestOneListenerOnFinishEventLog = + getTestListenerFinishEventLog(SUITE_B, SUITE_B_TEST_A); + + suiteTwoTestTwoListenerOnStartEventLog = getTestListenerStartEventLog(SUITE_B, SUITE_B_TEST_B); + suiteTwoTestTwoListenerOnFinishEventLog = + getTestListenerFinishEventLog(SUITE_B, SUITE_B_TEST_B); + + suiteThreeTestOneListenerOnStartEventLog = + getTestListenerStartEventLog(SUITE_C, SUITE_C_TEST_A); + suiteThreeTestOneListenerOnFinishEventLog = + getTestListenerFinishEventLog(SUITE_C, SUITE_C_TEST_A); + suiteThreeTestTwoListenerOnStartEventLog = + getTestListenerStartEventLog(SUITE_C, SUITE_C_TEST_B); + suiteThreeTestTwoListenerOnFinishEventLog = + getTestListenerFinishEventLog(SUITE_C, SUITE_C_TEST_B); + suiteThreeTestThreeListenerOnStartEventLog = + getTestListenerStartEventLog(SUITE_C, SUITE_C_TEST_C); + suiteThreeTestThreeListenerOnFinishEventLog = + getTestListenerFinishEventLog(SUITE_C, SUITE_C_TEST_C); + } + + // Verifies that the expected number of suite, test and test method level events were logged for + // each of the three + // suites. + @Test + public void sanityCheck() { + assertEquals( + suiteLevelEventLogs.size(), + 6, + "There should be 6 suite level events logged for " + + SUITE_A + + ", " + + SUITE_B + + " and " + + SUITE_C + + ": " + + suiteLevelEventLogs); + assertEquals( + testLevelEventLogs.size(), + 12, + "There should be 12 test level events logged for " + + SUITE_A + + ", " + + SUITE_B + + " and " + + SUITE_C + + ": " + + testLevelEventLogs); + + assertEquals( + testMethodLevelEventLogs.size(), + 204, + "There should 204 test method level events logged for " + + SUITE_A + + ", " + + SUITE_B + + " and " + + SUITE_C + + ": " + + testMethodLevelEventLogs); + + assertEquals( + suiteOneSuiteLevelEventLogs.size(), + 2, + "There should be 2 suite level events logged for " + + SUITE_A + + ": " + + suiteOneSuiteLevelEventLogs); + assertEquals( + suiteOneTestLevelEventLogs.size(), + 2, + "There should be 2 test level events logged for " + + SUITE_A + + ": " + + suiteOneTestLevelEventLogs); + assertEquals( + suiteOneTestMethodLevelEventLogs.size(), + 33, + "There should be 33 test method level events " + + "logged for " + + SUITE_A + + ": " + + suiteOneTestMethodLevelEventLogs); + + assertEquals( + suiteTwoSuiteLevelEventLogs.size(), + 2, + "There should be 2 suite level events logged for " + + SUITE_B + + ": " + + suiteTwoSuiteLevelEventLogs); + assertEquals( + suiteTwoTestLevelEventLogs.size(), + 4, + "There should be 4 test level events logged for " + + SUITE_B + + ": " + + suiteTwoTestLevelEventLogs); + assertEquals( + suiteTwoTestMethodLevelEventLogs.size(), + 54, + "There should be 54 test method level events " + + "logged for " + + SUITE_B + + ": " + + suiteTwoTestMethodLevelEventLogs); + + assertEquals( + suiteThreeSuiteLevelEventLogs.size(), + 2, + "There should be 2 suite level events logged for " + + SUITE_C + + ": " + + suiteThreeSuiteLevelEventLogs); + assertEquals( + suiteThreeTestLevelEventLogs.size(), + 6, + "There should be 6 test level events logged for " + + SUITE_C + + ": " + + suiteThreeTestLevelEventLogs); + assertEquals( + suiteThreeTestMethodLevelEventLogs.size(), + 117, + "There should be 87 test method level events " + + "logged for " + + SUITE_C + + ": " + + suiteThreeTestMethodLevelEventLogs); + } + + // Verify that all the events in the second suite and third suites run have timestamps later than + // the suite + // listener's onFinish event for the first suite run. + // Verify that all the events in the third suite run have timestamps later than the suite + // listener's onFinish + // event for the second suite run. + // Verify that all suite level events run in the same thread + @Test + public void verifySuitesRunSequentiallyInSameThread() { + verifySequentialSuites(suiteLevelEventLogs, suiteEventLogsMap); + } + + // For all suites, verify that the test level events run sequentially because the parallel mode is + // by methods only. + @Test + public void verifySuiteAndTestLevelEventsRunInSequentialOrderForIndividualSuites() { + + verifySequentialTests( + suiteOneSuiteAndTestLevelEventLogs, + suiteOneTestLevelEventLogs, + suiteOneSuiteListenerOnStartEventLog, + suiteOneSuiteListenerOnFinishEventLog); + + verifySequentialTests( + suiteTwoSuiteAndTestLevelEventLogs, + suiteTwoTestLevelEventLogs, + suiteTwoSuiteListenerOnStartEventLog, + suiteTwoSuiteListenerOnFinishEventLog); + + verifySequentialTests( + suiteThreeSuiteAndTestLevelEventLogs, + suiteThreeTestLevelEventLogs, + suiteThreeSuiteListenerOnStartEventLog, + suiteThreeSuiteListenerOnFinishEventLog); + } + + // Verify that there is only a single test class instance associated with each of the test methods + // from the sample + // classes for every test in all the suites. + // Verify that the same test class instance is associated with each of the test methods from the + // sample test class + @Test + public void verifyOnlyOneInstanceOfTestClassForAllTestMethodsForAllSuites() { + + verifyNumberOfInstancesOfTestClassesForMethods( + SUITE_A, + SUITE_A_TEST_A, + Arrays.asList( + TestClassAFiveMethodsWithNoDepsSample.class, + TestClassCSixMethodsWithNoDepsSample.class), + 1); + + verifySameInstancesOfTestClassesAssociatedWithMethods( + SUITE_A, + SUITE_A_TEST_A, + Arrays.asList( + TestClassAFiveMethodsWithNoDepsSample.class, + TestClassCSixMethodsWithNoDepsSample.class)); + + verifyNumberOfInstancesOfTestClassForMethods( + SUITE_B, SUITE_B_TEST_A, TestClassEFiveMethodsWithNoDepsSample.class, 1); + + verifySameInstancesOfTestClassAssociatedWithMethods( + SUITE_B, SUITE_B_TEST_A, TestClassEFiveMethodsWithNoDepsSample.class); + + verifyNumberOfInstancesOfTestClassesForMethods( + SUITE_B, + SUITE_B_TEST_B, + Arrays.asList( + TestClassDThreeMethodsWithNoDepsSample.class, + TestClassBFourMethodsWithNoDepsSample.class, + TestClassFSixMethodsWithNoDepsSample.class), + 1); + + verifySameInstancesOfTestClassesAssociatedWithMethods( + SUITE_B, + SUITE_B_TEST_B, + Arrays.asList( + TestClassDThreeMethodsWithNoDepsSample.class, + TestClassBFourMethodsWithNoDepsSample.class, + TestClassFSixMethodsWithNoDepsSample.class)); + + verifyNumberOfInstancesOfTestClassesForMethods( + SUITE_C, + SUITE_C_TEST_A, + Arrays.asList( + TestClassGThreeMethodsWithNoDepsSample.class, + TestClassHFourMethodsWithNoDepsSample.class, + TestClassIFiveMethodsWithNoDepsSample.class), + 1); + + verifySameInstancesOfTestClassesAssociatedWithMethods( + SUITE_C, + SUITE_C_TEST_A, + Arrays.asList( + TestClassGThreeMethodsWithNoDepsSample.class, + TestClassHFourMethodsWithNoDepsSample.class, + TestClassIFiveMethodsWithNoDepsSample.class)); + + verifyNumberOfInstancesOfTestClassesForMethods( + SUITE_C, + SUITE_C_TEST_B, + Arrays.asList( + TestClassJFourMethodsWithNoDepsSample.class, + TestClassKFiveMethodsWithNoDepsSample.class), + 1); + + verifySameInstancesOfTestClassesAssociatedWithMethods( + SUITE_C, + SUITE_C_TEST_B, + Arrays.asList( + TestClassJFourMethodsWithNoDepsSample.class, + TestClassKFiveMethodsWithNoDepsSample.class)); + + verifyNumberOfInstancesOfTestClassesForMethods( + SUITE_C, + SUITE_C_TEST_C, + Arrays.asList( + TestClassLThreeMethodsWithNoDepsSample.class, + TestClassMFourMethodsWithNoDepsSample.class, + TestClassNFiveMethodsWithNoDepsSample.class, + TestClassOSixMethodsWithNoDepsSample.class), + 1); + + verifySameInstancesOfTestClassesAssociatedWithMethods( + SUITE_C, + SUITE_C_TEST_C, + Arrays.asList( + TestClassLThreeMethodsWithNoDepsSample.class, + TestClassMFourMethodsWithNoDepsSample.class, + TestClassNFiveMethodsWithNoDepsSample.class, + TestClassOSixMethodsWithNoDepsSample.class)); + } + + // Verify that the test method listener's onTestStart method runs after the test listener's + // onStart method for + // all the test methods in all tests and suites. + @Test + public void + verifyTestLevelMethodLevelEventLogsOccurBetweenAfterTestListenerStartAndFinishEventLogs() { + verifyEventsOccurBetween( + suiteOneTestOneListenerOnStartEventLog, + suiteOneTestOneTestMethodLevelEventLogs, + suiteOneTestOneListenerOnFinishEventLog, + "All of the test method level event logs for " + + SUITE_A_TEST_A + + " should have timestamps between the test listener's onStart and onFinish " + + "event logs for " + + SUITE_A_TEST_A + + ". Test listener onStart event log: " + + suiteOneTestOneListenerOnStartEventLog + + ". Test listener onFinish event log: " + + suiteOneTestOneListenerOnFinishEventLog + + ". Test method level event logs: " + + suiteOneTestOneTestMethodLevelEventLogs); + + verifyEventsOccurBetween( + suiteTwoTestOneListenerOnStartEventLog, + suiteTwoTestOneTestMethodLevelEventLogs, + suiteTwoTestOneListenerOnFinishEventLog, + "All of the test method level event logs for " + + SUITE_B_TEST_A + + " should have timestamps between the test listener's onStart and onFinish " + + "event logs for " + + SUITE_B_TEST_A + + ". Test listener onStart event log: " + + suiteTwoTestOneListenerOnStartEventLog + + ". Test listener onFinish event log: " + + suiteTwoTestOneListenerOnFinishEventLog + + ". Test method level event logs: " + + suiteTwoTestOneTestMethodLevelEventLogs); + + verifyEventsOccurBetween( + suiteTwoTestTwoListenerOnStartEventLog, + suiteTwoTestTwoTestMethodLevelEventLogs, + suiteTwoTestTwoListenerOnFinishEventLog, + "All of the test method level event logs for " + + SUITE_B_TEST_B + + " should have timestamps between the test listener's onStart and onFinish " + + "event logs for " + + SUITE_B_TEST_B + + ". Test listener onStart event log: " + + suiteTwoTestTwoListenerOnStartEventLog + + ". Test listener onFinish event log: " + + suiteTwoTestTwoListenerOnFinishEventLog + + ". Test method level event logs: " + + suiteTwoTestTwoTestMethodLevelEventLogs); + + verifyEventsOccurBetween( + suiteThreeTestOneListenerOnStartEventLog, + suiteThreeTestOneTestMethodLevelEventLogs, + suiteThreeTestOneListenerOnFinishEventLog, + "All of the test method level event logs for " + + SUITE_C_TEST_A + + " should have timestamps between the test listener's onStart and onFinish " + + "event logs for " + + SUITE_C_TEST_A + + ". Test listener onStart event log: " + + suiteThreeTestOneListenerOnStartEventLog + + ". Test listener onFinish event log: " + + suiteThreeTestOneListenerOnFinishEventLog + + ". Test method level event logs: " + + suiteThreeTestOneTestMethodLevelEventLogs); + + verifyEventsOccurBetween( + suiteThreeTestTwoListenerOnStartEventLog, + suiteThreeTestTwoTestMethodLevelEventLogs, + suiteThreeTestTwoListenerOnFinishEventLog, + "All of the test method level event logs for " + + SUITE_C_TEST_B + + " should have timestamps between the test listener's onStart and onFinish " + + "event logs for " + + SUITE_C_TEST_B + + ". Test listener onStart event log: " + + suiteThreeTestTwoListenerOnStartEventLog + + ". Test listener onFinish event log: " + + suiteThreeTestTwoListenerOnFinishEventLog + + ". Test method level event logs: " + + suiteThreeTestTwoTestMethodLevelEventLogs); + + verifyEventsOccurBetween( + suiteThreeTestThreeListenerOnStartEventLog, + suiteThreeTestThreeTestMethodLevelEventLogs, + suiteThreeTestThreeListenerOnFinishEventLog, + "All of the test method level event logs for " + + SUITE_C_TEST_C + + " should have timestamps between the test listener's onStart and onFinish " + + "event logs for " + + SUITE_C_TEST_C + + ". Test listener onStart event log: " + + suiteThreeTestThreeListenerOnStartEventLog + + ". Test listener onFinish event log: " + + suiteThreeTestThreeListenerOnFinishEventLog + + ". Test method level event logs: " + + suiteThreeTestThreeTestMethodLevelEventLogs); + } + + // Verifies that the method level events all run in different threads from the test and suite + // level events. + // Verifies that the test method listener and execution events for a given test method all run in + // the same thread. + @Test + public void verifyThatMethodLevelEventsRunInDifferentThreadsFromSuiteAndTestLevelEvents() { + + verifyEventThreadsSpawnedAfter( + getAllSuiteListenerStartEventLogs().get(0).getThreadId(), + testMethodLevelEventLogs, + "All the thread IDs for the test method level events should be greater than the thread ID for the " + + "suite and test level events. The expectation is that since the suite and test level events " + + "are running sequentially, and all the test methods are running in parallel, new threads " + + "will be spawned after the thread executing the suite and test level events when new methods " + + "begin executing. Suite and test level events thread ID: " + + getAllSuiteListenerStartEventLogs().get(0).getThreadId() + + ". Test method level event logs: " + + testMethodLevelEventLogs); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassAFiveMethodsWithNoDepsSample.class, SUITE_A, SUITE_A_TEST_A); + verifyEventsForTestMethodsRunInTheSameThread( + TestClassCSixMethodsWithNoDepsSample.class, SUITE_A, SUITE_A_TEST_A); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassEFiveMethodsWithNoDepsSample.class, SUITE_B, SUITE_B_TEST_A); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassDThreeMethodsWithNoDepsSample.class, SUITE_B, SUITE_B_TEST_B); + verifyEventsForTestMethodsRunInTheSameThread( + TestClassBFourMethodsWithNoDepsSample.class, SUITE_B, SUITE_B_TEST_B); + verifyEventsForTestMethodsRunInTheSameThread( + TestClassFSixMethodsWithNoDepsSample.class, SUITE_B, SUITE_B_TEST_B); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassGThreeMethodsWithNoDepsSample.class, SUITE_C, SUITE_C_TEST_A); + verifyEventsForTestMethodsRunInTheSameThread( + TestClassHFourMethodsWithNoDepsSample.class, SUITE_C, SUITE_C_TEST_A); + verifyEventsForTestMethodsRunInTheSameThread( + TestClassIFiveMethodsWithNoDepsSample.class, SUITE_C, SUITE_C_TEST_A); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassJFourMethodsWithNoDepsSample.class, SUITE_C, SUITE_C_TEST_B); + verifyEventsForTestMethodsRunInTheSameThread( + TestClassKFiveMethodsWithNoDepsSample.class, SUITE_C, SUITE_C_TEST_B); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassLThreeMethodsWithNoDepsSample.class, SUITE_C, SUITE_C_TEST_C); + verifyEventsForTestMethodsRunInTheSameThread( + TestClassMFourMethodsWithNoDepsSample.class, SUITE_C, SUITE_C_TEST_C); + verifyEventsForTestMethodsRunInTheSameThread( + TestClassNFiveMethodsWithNoDepsSample.class, SUITE_C, SUITE_C_TEST_C); + verifyEventsForTestMethodsRunInTheSameThread( + TestClassOSixMethodsWithNoDepsSample.class, SUITE_C, SUITE_C_TEST_C); + } + + // Verify that the methods are run in separate threads. + @Test + public void verifyThatTestMethodsRunInParallelThreads() { + verifySimultaneousTestMethods( + getTestMethodLevelEventLogsForTest(SUITE_A, SUITE_A_TEST_A), SUITE_A_TEST_A, 3); + verifySimultaneousTestMethods( + getTestMethodLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_A), SUITE_B_TEST_A, 6); + verifySimultaneousTestMethods( + getTestMethodLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_B), SUITE_B_TEST_B, 20); + verifySimultaneousTestMethods( + getTestMethodLevelEventLogsForTest(SUITE_C, SUITE_C_TEST_A), SUITE_C_TEST_A, 10); + verifySimultaneousTestMethods( + getTestMethodLevelEventLogsForTest(SUITE_C, SUITE_C_TEST_B), SUITE_C_TEST_B, 5); + verifySimultaneousTestMethods( + getTestMethodLevelEventLogsForTest(SUITE_C, SUITE_C_TEST_C), SUITE_C_TEST_C, 12); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase2Scenario1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase2Scenario1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase2Scenario1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase2Scenario1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,478 @@ +package test.thread.parallelization; + +import static org.testng.Assert.assertEquals; +import static test.thread.parallelization.TestNgRunStateTracker.getAllSuiteLevelEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getAllSuiteListenerStartEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getAllTestLevelEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getAllTestMethodLevelEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getSuiteAndTestLevelEventLogsForSuite; +import static test.thread.parallelization.TestNgRunStateTracker.getSuiteLevelEventLogsForSuite; +import static test.thread.parallelization.TestNgRunStateTracker.getSuiteListenerFinishEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getSuiteListenerStartEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getTestLevelEventLogsForSuite; +import static test.thread.parallelization.TestNgRunStateTracker.getTestLevelEventLogsForTest; +import static test.thread.parallelization.TestNgRunStateTracker.getTestListenerFinishEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getTestListenerStartEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getTestMethodLevelEventLogsForSuite; +import static test.thread.parallelization.TestNgRunStateTracker.getTestMethodLevelEventLogsForTest; +import static test.thread.parallelization.TestNgRunStateTracker.reset; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.testng.ITestNGListener; +import org.testng.TestNG; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import org.testng.log4testng.Logger; +import org.testng.xml.XmlSuite; +import test.thread.parallelization.TestNgRunStateTracker.EventLog; +import test.thread.parallelization.sample.TestClassAFiveMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassBFourMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassCSixMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassDThreeMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassEFiveMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassFSixMethodsWithNoDepsSample; + +/** + * This class covers PTP_TC_2, Scenario 1 in the Parallelization Test Plan. + * + *

Test Case Summary: Parallel by methods mode with parallel test suites, no dependencies and no + * factories or data providers. + * + *

Scenario Description: Two suites with 1 and 2 tests respectively. One test for a suite shall + * consist of a single test class while the rest shall consist of more than one test class. + * + *

1) The suite thread pool is 2, so neither suite should have to wait for the other to complete + * execution 2) For both suites, the thread count and parallel mode are specified at the suite level + * 3) The thread count is less than the number of test methods in a test for one of the suites, so + * some methods will have to wait the active thread count to drop below the maximum thread count + * before they can begin execution. 4) The thread count is more than the number of test methods for + * the rest of the tests, ensuring that none of their test methods should have to wait for any other + * method to complete execution 5) There are NO configuration methods 6) All test methods pass 7) NO + * ordering is specified 8) group-by-instances is NOT set 9) There are no method exclusions + */ +public class ParallelByMethodsTestCase2Scenario1 extends BaseParallelizationTest { + private static final Logger log = Logger.getLogger(ParallelByMethodsTestCase2Scenario1.class); + + private static final String SUITE_A = "TestSuiteA"; + private static final String SUITE_B = "TestSuiteB"; + + private static final String SUITE_A_TEST_A = "TestSuiteA-TwoTestClassTest"; + + private static final String SUITE_B_TEST_A = "TestSuiteB-SingleTestClassTest"; + private static final String SUITE_B_TEST_B = "TestSuiteB-ThreeTestClassTest"; + + private static final int THREAD_POOL_SIZE = 2; + + private Map> testEventLogsMap = new HashMap<>(); + + private List suiteLevelEventLogs; + private List testLevelEventLogs; + private List testMethodLevelEventLogs; + + private List suiteOneSuiteAndTestLevelEventLogs; + private List suiteOneSuiteLevelEventLogs; + private List suiteOneTestLevelEventLogs; + private List suiteOneTestMethodLevelEventLogs; + + private List suiteTwoSuiteAndTestLevelEventLogs; + private List suiteTwoSuiteLevelEventLogs; + private List suiteTwoTestLevelEventLogs; + private List suiteTwoTestMethodLevelEventLogs; + + private List suiteOneTestOneTestMethodLevelEventLogs; + + private List suiteTwoTestOneTestMethodLevelEventLogs; + private List suiteTwoTestTwoTestMethodLevelEventLogs; + + private EventLog suiteOneSuiteListenerOnStartEventLog; + private EventLog suiteOneSuiteListenerOnFinishEventLog; + + private EventLog suiteTwoSuiteListenerOnStartEventLog; + private EventLog suiteTwoSuiteListenerOnFinishEventLog; + + private EventLog suiteOneTestOneListenerOnStartEventLog; + private EventLog suiteOneTestOneListenerOnFinishEventLog; + + private EventLog suiteTwoTestOneListenerOnStartEventLog; + private EventLog suiteTwoTestOneListenerOnFinishEventLog; + private EventLog suiteTwoTestTwoListenerOnStartEventLog; + private EventLog suiteTwoTestTwoListenerOnFinishEventLog; + + @BeforeClass + public void setUp() { + reset(); + + XmlSuite suiteOne = createXmlSuite(SUITE_A); + XmlSuite suiteTwo = createXmlSuite(SUITE_B); + + createXmlTest( + suiteOne, + SUITE_A_TEST_A, + TestClassAFiveMethodsWithNoDepsSample.class, + TestClassCSixMethodsWithNoDepsSample.class); + createXmlTest(suiteTwo, SUITE_B_TEST_A, TestClassEFiveMethodsWithNoDepsSample.class); + createXmlTest( + suiteTwo, + SUITE_B_TEST_B, + TestClassDThreeMethodsWithNoDepsSample.class, + TestClassBFourMethodsWithNoDepsSample.class, + TestClassFSixMethodsWithNoDepsSample.class); + + suiteOne.setParallel(XmlSuite.ParallelMode.METHODS); + suiteOne.setThreadCount(3); + suiteTwo.setParallel(XmlSuite.ParallelMode.METHODS); + suiteTwo.setThreadCount(14); + + addParams(suiteOne, SUITE_A, SUITE_A_TEST_A, "100"); + + addParams(suiteTwo, SUITE_B, SUITE_B_TEST_A, "100"); + addParams(suiteTwo, SUITE_B, SUITE_B_TEST_B, "100"); + + TestNG tng = create(suiteOne, suiteTwo); + tng.setSuiteThreadPoolSize(2); + tng.addListener((ITestNGListener) new TestNgRunStateListener()); + + log.debug( + "Beginning ParallelByMethodsTestCase2Scenario1. This test scenario consists of two " + + "suites with 1 and 2 tests respectively. The suites run in parallel and the thread pool size is 2. " + + "One test for a suite shall consist of a single test class while the rest shall consist of more than " + + "one test class. There are no dependencies, data providers or factories."); + + log.debug( + "Suite: " + + SUITE_A + + ", Test: " + + SUITE_A_TEST_A + + ", Test classes: " + + TestClassAFiveMethodsWithNoDepsSample.class.getCanonicalName() + + ", " + + TestClassCSixMethodsWithNoDepsSample.class.getCanonicalName() + + ". Thread count: 3"); + + log.debug( + "Suite: " + + SUITE_B + + ", Test: " + + SUITE_B_TEST_A + + ", Test class: " + + TestClassEFiveMethodsWithNoDepsSample.class.getCanonicalName() + + ". Thread count: 14"); + + log.debug( + "Suite: " + + SUITE_B + + ", Test: " + + SUITE_B_TEST_B + + ", Test classes: " + + TestClassDThreeMethodsWithNoDepsSample.class + + ", " + + TestClassBFourMethodsWithNoDepsSample.class + + ", " + + TestClassFSixMethodsWithNoDepsSample.class + + ". Thread count: 14"); + + tng.run(); + + suiteLevelEventLogs = getAllSuiteLevelEventLogs(); + testLevelEventLogs = getAllTestLevelEventLogs(); + testMethodLevelEventLogs = getAllTestMethodLevelEventLogs(); + + suiteOneSuiteAndTestLevelEventLogs = getSuiteAndTestLevelEventLogsForSuite(SUITE_A); + suiteOneSuiteLevelEventLogs = getSuiteLevelEventLogsForSuite(SUITE_A); + suiteOneTestLevelEventLogs = getTestLevelEventLogsForSuite(SUITE_A); + + suiteTwoSuiteAndTestLevelEventLogs = getSuiteAndTestLevelEventLogsForSuite(SUITE_B); + suiteTwoSuiteLevelEventLogs = getSuiteLevelEventLogsForSuite(SUITE_B); + suiteTwoTestLevelEventLogs = getTestLevelEventLogsForSuite(SUITE_B); + + suiteOneTestMethodLevelEventLogs = getTestMethodLevelEventLogsForSuite(SUITE_A); + suiteTwoTestMethodLevelEventLogs = getTestMethodLevelEventLogsForSuite(SUITE_B); + + suiteOneTestOneTestMethodLevelEventLogs = + getTestMethodLevelEventLogsForTest(SUITE_A, SUITE_A_TEST_A); + + suiteTwoTestOneTestMethodLevelEventLogs = + getTestMethodLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_A); + suiteTwoTestTwoTestMethodLevelEventLogs = + getTestMethodLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_B); + + testEventLogsMap.put(SUITE_B_TEST_A, getTestLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_A)); + testEventLogsMap.put(SUITE_B_TEST_B, getTestLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_B)); + + suiteOneSuiteListenerOnStartEventLog = getSuiteListenerStartEventLog(SUITE_A); + suiteOneSuiteListenerOnFinishEventLog = getSuiteListenerFinishEventLog(SUITE_A); + + suiteTwoSuiteListenerOnStartEventLog = getSuiteListenerStartEventLog(SUITE_B); + suiteTwoSuiteListenerOnFinishEventLog = getSuiteListenerFinishEventLog(SUITE_B); + + suiteOneTestOneListenerOnStartEventLog = getTestListenerStartEventLog(SUITE_A, SUITE_A_TEST_A); + suiteOneTestOneListenerOnFinishEventLog = + getTestListenerFinishEventLog(SUITE_A, SUITE_A_TEST_A); + + suiteTwoTestOneListenerOnStartEventLog = getTestListenerStartEventLog(SUITE_B, SUITE_B_TEST_A); + suiteTwoTestOneListenerOnFinishEventLog = + getTestListenerFinishEventLog(SUITE_B, SUITE_B_TEST_A); + + suiteTwoTestTwoListenerOnStartEventLog = getTestListenerStartEventLog(SUITE_B, SUITE_B_TEST_B); + suiteTwoTestTwoListenerOnFinishEventLog = + getTestListenerFinishEventLog(SUITE_B, SUITE_B_TEST_B); + } + + // Verifies that the expected number of suite, test and test method level events were logged for + // each of the three + // suites. + @Test + public void sanityCheck() { + assertEquals( + suiteLevelEventLogs.size(), + 4, + "There should be 4 suite level events logged for " + + SUITE_A + + ", " + + SUITE_B + + ": " + + suiteLevelEventLogs); + assertEquals( + testLevelEventLogs.size(), + 6, + "There should be 6 test level events logged for " + + SUITE_A + + ", " + + SUITE_B + + ": " + + testLevelEventLogs); + + assertEquals( + testMethodLevelEventLogs.size(), + 87, + "There should 87 test method level events logged for " + + SUITE_A + + ", " + + SUITE_B + + ": " + + testMethodLevelEventLogs); + + assertEquals( + suiteOneSuiteLevelEventLogs.size(), + 2, + "There should be 2 suite level events logged for " + + SUITE_A + + ": " + + suiteOneSuiteLevelEventLogs); + assertEquals( + suiteOneTestLevelEventLogs.size(), + 2, + "There should be 2 test level events logged for " + + SUITE_A + + ": " + + suiteOneTestLevelEventLogs); + assertEquals( + suiteOneTestMethodLevelEventLogs.size(), + 33, + "There should be 33 test method level events " + + "logged for " + + SUITE_A + + ": " + + suiteOneTestMethodLevelEventLogs); + + assertEquals( + suiteTwoSuiteLevelEventLogs.size(), + 2, + "There should be 2 suite level events logged for " + + SUITE_B + + ": " + + suiteTwoSuiteLevelEventLogs); + assertEquals( + suiteTwoTestLevelEventLogs.size(), + 4, + "There should be 4 test level events logged for " + + SUITE_B + + ": " + + suiteTwoTestLevelEventLogs); + assertEquals( + suiteTwoTestMethodLevelEventLogs.size(), + 54, + "There should be 54 test method level events " + + "logged for " + + SUITE_B + + ": " + + suiteTwoTestMethodLevelEventLogs); + } + + // Verify that the suites run in parallel by checking that the suite and test level events for + // both suites have + // overlapping timestamps. Verify that there are two separate threads executing the suite-level + // and test-level + // events for each suite. + @Test + public void verifyThatSuitesRunInParallelThreads() { + verifyParallelSuitesWithUnequalExecutionTimes(suiteLevelEventLogs, THREAD_POOL_SIZE); + } + + @Test + public void verifyTestLevelEventsRunInSequentialOrderForIndividualSuites() { + verifySequentialTests( + suiteOneSuiteAndTestLevelEventLogs, + suiteOneTestLevelEventLogs, + suiteOneSuiteListenerOnStartEventLog, + suiteOneSuiteListenerOnFinishEventLog); + + verifySequentialTests( + suiteTwoSuiteAndTestLevelEventLogs, + suiteTwoTestLevelEventLogs, + suiteTwoSuiteListenerOnStartEventLog, + suiteTwoSuiteListenerOnFinishEventLog); + } + + @Test + public void verifyOnlyOneInstanceOfTestClassForAllTestMethodsForAllSuites() { + + verifyNumberOfInstancesOfTestClassesForMethods( + SUITE_A, + SUITE_A_TEST_A, + Arrays.asList( + TestClassAFiveMethodsWithNoDepsSample.class, + TestClassCSixMethodsWithNoDepsSample.class), + 1); + + verifySameInstancesOfTestClassesAssociatedWithMethods( + SUITE_A, + SUITE_A_TEST_A, + Arrays.asList( + TestClassAFiveMethodsWithNoDepsSample.class, + TestClassCSixMethodsWithNoDepsSample.class)); + + verifyNumberOfInstancesOfTestClassForMethods( + SUITE_B, SUITE_B_TEST_A, TestClassEFiveMethodsWithNoDepsSample.class, 1); + + verifySameInstancesOfTestClassAssociatedWithMethods( + SUITE_B, SUITE_B_TEST_A, TestClassEFiveMethodsWithNoDepsSample.class); + + verifyNumberOfInstancesOfTestClassesForMethods( + SUITE_B, + SUITE_B_TEST_B, + Arrays.asList( + TestClassDThreeMethodsWithNoDepsSample.class, + TestClassBFourMethodsWithNoDepsSample.class, + TestClassFSixMethodsWithNoDepsSample.class), + 1); + + verifySameInstancesOfTestClassesAssociatedWithMethods( + SUITE_B, + SUITE_B_TEST_B, + Arrays.asList( + TestClassDThreeMethodsWithNoDepsSample.class, + TestClassBFourMethodsWithNoDepsSample.class, + TestClassFSixMethodsWithNoDepsSample.class)); + } + + // Verify that the test method listener's onTestStart method runs after the test listener's + // onStart method for + // all the test methods in all tests and suites. + @Test + public void + verifyTestLevelMethodLevelEventLogsOccurBetweenAfterTestListenerStartAndFinishEventLogs() { + verifyEventsOccurBetween( + suiteOneTestOneListenerOnStartEventLog, + suiteOneTestOneTestMethodLevelEventLogs, + suiteOneTestOneListenerOnFinishEventLog, + "All of the test method level event logs for " + + SUITE_A_TEST_A + + " should have timestamps between the test listener's onStart and onFinish " + + "event logs for " + + SUITE_A_TEST_A + + ". Test listener onStart event log: " + + suiteOneTestOneListenerOnStartEventLog + + ". Test listener onFinish event log: " + + suiteOneTestOneListenerOnFinishEventLog + + ". Test method level event logs: " + + suiteOneTestOneTestMethodLevelEventLogs); + + verifyEventsOccurBetween( + suiteTwoTestOneListenerOnStartEventLog, + suiteTwoTestOneTestMethodLevelEventLogs, + suiteTwoTestOneListenerOnFinishEventLog, + "All of the test method level event logs for " + + SUITE_B_TEST_A + + " should have timestamps between the test listener's onStart and onFinish " + + "event logs for " + + SUITE_B_TEST_A + + ". Test listener onStart event log: " + + suiteTwoTestOneListenerOnStartEventLog + + ". Test listener onFinish event log: " + + suiteTwoTestOneListenerOnFinishEventLog + + ". Test method level event logs: " + + suiteTwoTestOneTestMethodLevelEventLogs); + + verifyEventsOccurBetween( + suiteTwoTestTwoListenerOnStartEventLog, + suiteTwoTestTwoTestMethodLevelEventLogs, + suiteTwoTestTwoListenerOnFinishEventLog, + "All of the test method level event logs for " + + SUITE_B_TEST_B + + " should have timestamps between the test listener's onStart and onFinish " + + "event logs for " + + SUITE_B_TEST_B + + ". Test listener onStart event log: " + + suiteTwoTestTwoListenerOnStartEventLog + + ". Test listener onFinish event log: " + + suiteTwoTestTwoListenerOnFinishEventLog + + ". Test method level event logs: " + + suiteTwoTestTwoTestMethodLevelEventLogs); + } + + // Verifies that the method level events all run in different threads from the test and suite + // level events. + // Verifies that the test method listener and execution events for a given test method all run in + // the same thread. + @Test + public void verifyThatMethodLevelEventsRunInDifferentThreadsFromSuiteAndTestLevelEvents() { + + verifyEventThreadsSpawnedAfter( + getAllSuiteListenerStartEventLogs().get(0).getThreadId(), + testMethodLevelEventLogs, + "All the thread IDs for the test method level events should be greater than the thread ID for the " + + "suite and test level events. The expectation is that since the suite and test level events " + + "are running sequentially, and all the test methods are running in parallel, new threads " + + "will be spawned after the thread executing the suite and test level events when new methods " + + "begin executing. Suite and test level events thread ID: " + + getAllSuiteListenerStartEventLogs().get(0).getThreadId() + + ". Test method level event logs: " + + testMethodLevelEventLogs); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassAFiveMethodsWithNoDepsSample.class, SUITE_A, SUITE_A_TEST_A); + verifyEventsForTestMethodsRunInTheSameThread( + TestClassCSixMethodsWithNoDepsSample.class, SUITE_A, SUITE_A_TEST_A); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassEFiveMethodsWithNoDepsSample.class, SUITE_B, SUITE_B_TEST_A); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassDThreeMethodsWithNoDepsSample.class, SUITE_B, SUITE_B_TEST_B); + verifyEventsForTestMethodsRunInTheSameThread( + TestClassBFourMethodsWithNoDepsSample.class, SUITE_B, SUITE_B_TEST_B); + verifyEventsForTestMethodsRunInTheSameThread( + TestClassFSixMethodsWithNoDepsSample.class, SUITE_B, SUITE_B_TEST_B); + } + + // Verify that the methods are run in separate threads in true parallel fashion by checking that + // the start and run + // times of events that should be run simultaneously start basically at the same time using the + // timestamps and the + // known values of the wait time specified for the event. Verify that the thread IDs of parallel + // events are + // different. + @Test + public void verifyThatTestMethodsRunInParallelThreads() { + verifySimultaneousTestMethods( + getTestMethodLevelEventLogsForTest(SUITE_A, SUITE_A_TEST_A), SUITE_A_TEST_A, 3); + verifySimultaneousTestMethods( + getTestMethodLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_A), SUITE_B_TEST_A, 14); + verifySimultaneousTestMethods( + getTestMethodLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_B), SUITE_B_TEST_B, 14); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase2Scenario2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase2Scenario2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase2Scenario2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase2Scenario2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,802 @@ +package test.thread.parallelization; + +import static org.testng.Assert.assertEquals; +import static test.thread.parallelization.TestNgRunStateTracker.getAllSuiteLevelEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getAllSuiteListenerStartEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getAllTestLevelEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getAllTestMethodLevelEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getSuiteAndTestLevelEventLogsForSuite; +import static test.thread.parallelization.TestNgRunStateTracker.getSuiteLevelEventLogsForSuite; +import static test.thread.parallelization.TestNgRunStateTracker.getSuiteListenerFinishEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getSuiteListenerStartEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getTestLevelEventLogsForSuite; +import static test.thread.parallelization.TestNgRunStateTracker.getTestLevelEventLogsForTest; +import static test.thread.parallelization.TestNgRunStateTracker.getTestListenerFinishEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getTestListenerStartEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getTestMethodLevelEventLogsForSuite; +import static test.thread.parallelization.TestNgRunStateTracker.getTestMethodLevelEventLogsForTest; +import static test.thread.parallelization.TestNgRunStateTracker.reset; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.testng.ITestNGListener; +import org.testng.TestNG; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import org.testng.log4testng.Logger; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.thread.parallelization.sample.TestClassAFiveMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassBFourMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassCSixMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassDThreeMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassEFiveMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassFSixMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassGThreeMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassHFourMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassIFiveMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassJFourMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassKFiveMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassLThreeMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassMFourMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassNFiveMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassOSixMethodsWithNoDepsSample; + +/** + * This class covers PTP_TC_2, Scenario 2 in the Parallelization Test Plan. + * + *

Test Case Summary: Parallel by methods mode with parallel test suites, no dependencies and no + * factories or data providers. + * + *

Scenario Description: Three suites with 1, 2 and 3 tests respectively. One test for a suite + * shall consist of a single test class while the rest shall consist of more than one test class. + * + *

1) The suite thread pool is 2, so one suite will have to wait for one of the others to + * complete execution before it can begin execution 2) For one of the suites, the thread count and + * parallel mode are specified at the suite level 3) For one of the suites, the thread count and + * parallel mode are specified at the test level 4) For one of the suites, the parallel mode is + * specified at the suite level, and the thread counts are specified at the test level (thread + * counts for each test differ) 5) The thread count is less than the number of test methods for the + * tests in two of the suites, so some methods will have to wait the active thread count to drop + * below the maximum thread count before they can begin execution. 6) The thread count is more than + * the number of test methods for the tests in one of the suites, ensuring that none of the methods + * in that suite should have to wait for any other method to complete execution 7) There are NO + * configuration methods 8) All test methods pass 9) NO ordering is specified 10) group-by-instances + * is NOT set 11) There are no method exclusions + */ +public class ParallelByMethodsTestCase2Scenario2 extends BaseParallelizationTest { + private static final Logger log = Logger.getLogger(ParallelByMethodsTestCase2Scenario2.class); + + private static final String SUITE_A = "TestSuiteA"; + private static final String SUITE_B = "TestSuiteB"; + private static final String SUITE_C = "TestSuiteC"; + + private static final String SUITE_A_TEST_A = "TestSuiteA-TwoTestClassTest"; + + private static final String SUITE_B_TEST_A = "TestSuiteB-SingleTestClassTest"; + private static final String SUITE_B_TEST_B = "TestSuiteB-ThreeTestClassTest"; + + private static final String SUITE_C_TEST_A = "TestSuiteC-ThreeTestClassTest"; + private static final String SUITE_C_TEST_B = "TestSuiteC-TwoTestClassTest"; + private static final String SUITE_C_TEST_C = "TestSuiteC-FourTestClassTest"; + + private static final int THREAD_POOL_SIZE = 2; + + private Map> testEventLogsMap = new HashMap<>(); + + private List suiteLevelEventLogs; + private List testLevelEventLogs; + private List testMethodLevelEventLogs; + + private List suiteOneSuiteAndTestLevelEventLogs; + private List suiteOneSuiteLevelEventLogs; + private List suiteOneTestLevelEventLogs; + private List suiteOneTestMethodLevelEventLogs; + + private List suiteTwoSuiteAndTestLevelEventLogs; + private List suiteTwoSuiteLevelEventLogs; + private List suiteTwoTestLevelEventLogs; + private List suiteTwoTestMethodLevelEventLogs; + + private List suiteThreeSuiteAndTestLevelEventLogs; + private List suiteThreeSuiteLevelEventLogs; + private List suiteThreeTestLevelEventLogs; + private List suiteThreeTestMethodLevelEventLogs; + + private List suiteOneTestOneTestMethodLevelEventLogs; + + private List suiteTwoTestOneTestMethodLevelEventLogs; + private List suiteTwoTestTwoTestMethodLevelEventLogs; + + private List suiteThreeTestOneTestMethodLevelEventLogs; + private List suiteThreeTestTwoTestMethodLevelEventLogs; + private List suiteThreeTestThreeTestMethodLevelEventLogs; + + private TestNgRunStateTracker.EventLog suiteOneSuiteListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteOneSuiteListenerOnFinishEventLog; + + private TestNgRunStateTracker.EventLog suiteTwoSuiteListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteTwoSuiteListenerOnFinishEventLog; + + private TestNgRunStateTracker.EventLog suiteThreeSuiteListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteThreeSuiteListenerOnFinishEventLog; + + private TestNgRunStateTracker.EventLog suiteOneTestOneListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteOneTestOneListenerOnFinishEventLog; + + private TestNgRunStateTracker.EventLog suiteTwoTestOneListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteTwoTestOneListenerOnFinishEventLog; + private TestNgRunStateTracker.EventLog suiteTwoTestTwoListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteTwoTestTwoListenerOnFinishEventLog; + + private TestNgRunStateTracker.EventLog suiteThreeTestOneListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteThreeTestOneListenerOnFinishEventLog; + private TestNgRunStateTracker.EventLog suiteThreeTestTwoListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteThreeTestTwoListenerOnFinishEventLog; + private TestNgRunStateTracker.EventLog suiteThreeTestThreeListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteThreeTestThreeListenerOnFinishEventLog; + + @BeforeClass + public void setUp() { + reset(); + + XmlSuite suiteOne = createXmlSuite(SUITE_A); + XmlSuite suiteTwo = createXmlSuite(SUITE_B); + XmlSuite suiteThree = createXmlSuite(SUITE_C); + + suiteOne.setParallel(XmlSuite.ParallelMode.METHODS); + suiteOne.setThreadCount(3); + + createXmlTest( + suiteOne, + SUITE_A_TEST_A, + TestClassAFiveMethodsWithNoDepsSample.class, + TestClassCSixMethodsWithNoDepsSample.class); + createXmlTest(suiteTwo, SUITE_B_TEST_A, TestClassEFiveMethodsWithNoDepsSample.class); + createXmlTest( + suiteTwo, + SUITE_B_TEST_B, + TestClassDThreeMethodsWithNoDepsSample.class, + TestClassBFourMethodsWithNoDepsSample.class, + TestClassFSixMethodsWithNoDepsSample.class); + + suiteTwo.setParallel(XmlSuite.ParallelMode.METHODS); + + for (XmlTest test : suiteTwo.getTests()) { + if (test.getName().equals(SUITE_B_TEST_A)) { + test.setThreadCount(6); + } else { + test.setThreadCount(20); + } + } + + createXmlTest( + suiteThree, + SUITE_C_TEST_A, + TestClassGThreeMethodsWithNoDepsSample.class, + TestClassHFourMethodsWithNoDepsSample.class, + TestClassIFiveMethodsWithNoDepsSample.class); + createXmlTest( + suiteThree, + SUITE_C_TEST_B, + TestClassJFourMethodsWithNoDepsSample.class, + TestClassKFiveMethodsWithNoDepsSample.class); + createXmlTest( + suiteThree, + SUITE_C_TEST_C, + TestClassLThreeMethodsWithNoDepsSample.class, + TestClassMFourMethodsWithNoDepsSample.class, + TestClassNFiveMethodsWithNoDepsSample.class, + TestClassOSixMethodsWithNoDepsSample.class); + + for (XmlTest test : suiteThree.getTests()) { + test.setParallel(XmlSuite.ParallelMode.METHODS); + + switch (test.getName()) { + case SUITE_C_TEST_A: + test.setThreadCount(10); + break; + case SUITE_C_TEST_B: + test.setThreadCount(5); + break; + default: + test.setThreadCount(12); + break; + } + } + + addParams(suiteOne, SUITE_A, SUITE_A_TEST_A, "100"); + + addParams(suiteTwo, SUITE_B, SUITE_B_TEST_A, "100"); + addParams(suiteTwo, SUITE_B, SUITE_B_TEST_B, "100"); + + addParams(suiteThree, SUITE_C, SUITE_C_TEST_A, "100"); + addParams(suiteThree, SUITE_C, SUITE_C_TEST_B, "100"); + addParams(suiteThree, SUITE_C, SUITE_C_TEST_C, "100"); + + TestNG tng = create(suiteOne, suiteTwo, suiteThree); + tng.setSuiteThreadPoolSize(2); + tng.addListener((ITestNGListener) new TestNgRunStateListener()); + + log.debug( + "Beginning ParallelByMethodsTestCase2Scenario2. This test scenario consists of three " + + "suites with 1, 2 and 3 tests respectively. The suites run in parallel and the thread pool size is 3 " + + "One test for a suite shall consist of a single test class while the rest shall consist of more than " + + "one test class. There are no dependencies, data providers or factories."); + + log.debug( + "Suite: " + + SUITE_A + + ", Test: " + + SUITE_A_TEST_A + + ", Test classes: " + + TestClassAFiveMethodsWithNoDepsSample.class.getCanonicalName() + + ", " + + TestClassCSixMethodsWithNoDepsSample.class.getCanonicalName() + + ". Thread count: 3"); + + log.debug( + "Suite: " + + SUITE_B + + ", Test: " + + SUITE_B_TEST_A + + ", Test class: " + + TestClassEFiveMethodsWithNoDepsSample.class.getCanonicalName() + + ". Thread count: 6"); + + log.debug( + "Suite: " + + SUITE_B + + ", Test: " + + SUITE_B_TEST_B + + ", Test classes: " + + TestClassDThreeMethodsWithNoDepsSample.class + + ", " + + TestClassBFourMethodsWithNoDepsSample.class + + ", " + + TestClassFSixMethodsWithNoDepsSample.class + + ". Thread count: 20"); + + log.debug( + "Suite: " + + SUITE_C + + ", Test: " + + SUITE_C_TEST_A + + ", Test classes: " + + TestClassGThreeMethodsWithNoDepsSample.class.getCanonicalName() + + ", " + + TestClassHFourMethodsWithNoDepsSample.class.getCanonicalName() + + ", " + + TestClassIFiveMethodsWithNoDepsSample.class + + ". Thread count: 10"); + + log.debug( + "Suite: " + + SUITE_C + + ", Test: " + + SUITE_C_TEST_B + + ", Test classes: " + + TestClassJFourMethodsWithNoDepsSample.class.getCanonicalName() + + ", " + + TestClassKFiveMethodsWithNoDepsSample.class + + ". Thread count: 5"); + + log.debug( + "Suite: " + + SUITE_C + + ", Test: " + + SUITE_C_TEST_C + + ", Test classes: " + + TestClassLThreeMethodsWithNoDepsSample.class.getCanonicalName() + + ", " + + TestClassMFourMethodsWithNoDepsSample.class.getCanonicalName() + + ", " + + TestClassNFiveMethodsWithNoDepsSample.class.getCanonicalName() + + ", " + + TestClassOSixMethodsWithNoDepsSample.class.getCanonicalName() + + ". Thread count: 12."); + + tng.run(); + + suiteLevelEventLogs = getAllSuiteLevelEventLogs(); + testLevelEventLogs = getAllTestLevelEventLogs(); + testMethodLevelEventLogs = getAllTestMethodLevelEventLogs(); + + suiteOneSuiteAndTestLevelEventLogs = getSuiteAndTestLevelEventLogsForSuite(SUITE_A); + suiteOneSuiteLevelEventLogs = getSuiteLevelEventLogsForSuite(SUITE_A); + suiteOneTestLevelEventLogs = getTestLevelEventLogsForSuite(SUITE_A); + + suiteTwoSuiteAndTestLevelEventLogs = getSuiteAndTestLevelEventLogsForSuite(SUITE_B); + suiteTwoSuiteLevelEventLogs = getSuiteLevelEventLogsForSuite(SUITE_B); + suiteTwoTestLevelEventLogs = getTestLevelEventLogsForSuite(SUITE_B); + + suiteThreeSuiteAndTestLevelEventLogs = getSuiteAndTestLevelEventLogsForSuite(SUITE_C); + suiteThreeSuiteLevelEventLogs = getSuiteLevelEventLogsForSuite(SUITE_C); + suiteThreeTestLevelEventLogs = getTestLevelEventLogsForSuite(SUITE_C); + + suiteOneTestMethodLevelEventLogs = getTestMethodLevelEventLogsForSuite(SUITE_A); + suiteTwoTestMethodLevelEventLogs = getTestMethodLevelEventLogsForSuite(SUITE_B); + suiteThreeTestMethodLevelEventLogs = getTestMethodLevelEventLogsForSuite(SUITE_C); + + suiteOneTestOneTestMethodLevelEventLogs = + getTestMethodLevelEventLogsForTest(SUITE_A, SUITE_A_TEST_A); + + suiteTwoTestOneTestMethodLevelEventLogs = + getTestMethodLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_A); + suiteTwoTestTwoTestMethodLevelEventLogs = + getTestMethodLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_B); + + suiteThreeTestOneTestMethodLevelEventLogs = + getTestMethodLevelEventLogsForTest(SUITE_C, SUITE_C_TEST_A); + suiteThreeTestTwoTestMethodLevelEventLogs = + getTestMethodLevelEventLogsForTest(SUITE_C, SUITE_C_TEST_B); + suiteThreeTestThreeTestMethodLevelEventLogs = + getTestMethodLevelEventLogsForTest(SUITE_C, SUITE_C_TEST_C); + + testEventLogsMap.put(SUITE_B_TEST_A, getTestLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_A)); + testEventLogsMap.put(SUITE_B_TEST_B, getTestLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_B)); + + testEventLogsMap.put(SUITE_C_TEST_A, getTestLevelEventLogsForTest(SUITE_C, SUITE_C_TEST_A)); + testEventLogsMap.put(SUITE_C_TEST_B, getTestLevelEventLogsForTest(SUITE_C, SUITE_C_TEST_B)); + testEventLogsMap.put(SUITE_C_TEST_C, getTestLevelEventLogsForTest(SUITE_C, SUITE_C_TEST_C)); + + suiteOneSuiteListenerOnStartEventLog = getSuiteListenerStartEventLog(SUITE_A); + suiteOneSuiteListenerOnFinishEventLog = getSuiteListenerFinishEventLog(SUITE_A); + + suiteTwoSuiteListenerOnStartEventLog = getSuiteListenerStartEventLog(SUITE_B); + suiteTwoSuiteListenerOnFinishEventLog = getSuiteListenerFinishEventLog(SUITE_B); + + suiteThreeSuiteListenerOnStartEventLog = getSuiteListenerStartEventLog(SUITE_C); + suiteThreeSuiteListenerOnFinishEventLog = getSuiteListenerFinishEventLog(SUITE_C); + + suiteOneTestOneListenerOnStartEventLog = getTestListenerStartEventLog(SUITE_A, SUITE_A_TEST_A); + suiteOneTestOneListenerOnFinishEventLog = + getTestListenerFinishEventLog(SUITE_A, SUITE_A_TEST_A); + + suiteTwoTestOneListenerOnStartEventLog = getTestListenerStartEventLog(SUITE_B, SUITE_B_TEST_A); + suiteTwoTestOneListenerOnFinishEventLog = + getTestListenerFinishEventLog(SUITE_B, SUITE_B_TEST_A); + + suiteTwoTestTwoListenerOnStartEventLog = getTestListenerStartEventLog(SUITE_B, SUITE_B_TEST_B); + suiteTwoTestTwoListenerOnFinishEventLog = + getTestListenerFinishEventLog(SUITE_B, SUITE_B_TEST_B); + + suiteThreeTestOneListenerOnStartEventLog = + getTestListenerStartEventLog(SUITE_C, SUITE_C_TEST_A); + suiteThreeTestOneListenerOnFinishEventLog = + getTestListenerFinishEventLog(SUITE_C, SUITE_C_TEST_A); + suiteThreeTestTwoListenerOnStartEventLog = + getTestListenerStartEventLog(SUITE_C, SUITE_C_TEST_B); + suiteThreeTestTwoListenerOnFinishEventLog = + getTestListenerFinishEventLog(SUITE_C, SUITE_C_TEST_B); + suiteThreeTestThreeListenerOnStartEventLog = + getTestListenerStartEventLog(SUITE_C, SUITE_C_TEST_C); + suiteThreeTestThreeListenerOnFinishEventLog = + getTestListenerFinishEventLog(SUITE_C, SUITE_C_TEST_C); + } + + // Verifies that the expected number of suite, test and test method level events were logged for + // each of the three + // suites. + @Test + public void sanityCheck() { + assertEquals( + suiteLevelEventLogs.size(), + 6, + "There should be 6 suite level events logged for " + + SUITE_A + + ", " + + SUITE_B + + " and " + + SUITE_C + + ": " + + suiteLevelEventLogs); + assertEquals( + testLevelEventLogs.size(), + 12, + "There should be 12 test level events logged for " + + SUITE_A + + ", " + + SUITE_B + + " and " + + SUITE_C + + ": " + + testLevelEventLogs); + + assertEquals( + testMethodLevelEventLogs.size(), + 204, + "There should 204 test method level events logged for " + + SUITE_A + + ", " + + SUITE_B + + " and " + + SUITE_C + + ": " + + testMethodLevelEventLogs); + + assertEquals( + suiteOneSuiteLevelEventLogs.size(), + 2, + "There should be 2 suite level events logged for " + + SUITE_A + + ": " + + suiteOneSuiteLevelEventLogs); + assertEquals( + suiteOneTestLevelEventLogs.size(), + 2, + "There should be 2 test level events logged for " + + SUITE_A + + ": " + + suiteOneTestLevelEventLogs); + assertEquals( + suiteOneTestMethodLevelEventLogs.size(), + 33, + "There should be 33 test method level events " + + "logged for " + + SUITE_A + + ": " + + suiteOneTestMethodLevelEventLogs); + + assertEquals( + suiteTwoSuiteLevelEventLogs.size(), + 2, + "There should be 2 suite level events logged for " + + SUITE_B + + ": " + + suiteTwoSuiteLevelEventLogs); + assertEquals( + suiteTwoTestLevelEventLogs.size(), + 4, + "There should be 4 test level events logged for " + + SUITE_B + + ": " + + suiteTwoTestLevelEventLogs); + assertEquals( + suiteTwoTestMethodLevelEventLogs.size(), + 54, + "There should be 54 test method level events " + + "logged for " + + SUITE_B + + ": " + + suiteTwoTestMethodLevelEventLogs); + + assertEquals( + suiteThreeSuiteLevelEventLogs.size(), + 2, + "There should be 2 suite level events logged for " + + SUITE_C + + ": " + + suiteThreeSuiteLevelEventLogs); + assertEquals( + suiteThreeTestLevelEventLogs.size(), + 6, + "There should be 6 test level events logged for " + + SUITE_C + + ": " + + suiteThreeTestLevelEventLogs); + assertEquals( + suiteThreeTestMethodLevelEventLogs.size(), + 117, + "There should be 87 test method level events " + + "logged for " + + SUITE_C + + ": " + + suiteThreeTestMethodLevelEventLogs); + } + + // Verify that the suites run in parallel by checking that the suite and test level events for + // both suites have + // overlapping timestamps. Verify that there are two separate threads executing the suite-level + // and test-level + // events for each suite. + @Test + public void verifyThatSuitesRunInParallelThreads() { + verifyParallelSuitesWithUnequalExecutionTimes(suiteLevelEventLogs, THREAD_POOL_SIZE); + } + + @Test + public void verifyTestLevelEventsRunInSequentialOrderForIndividualSuites() { + verifySequentialTests( + suiteOneSuiteAndTestLevelEventLogs, + suiteOneTestLevelEventLogs, + suiteOneSuiteListenerOnStartEventLog, + suiteOneSuiteListenerOnFinishEventLog); + + verifySequentialTests( + suiteTwoSuiteAndTestLevelEventLogs, + suiteTwoTestLevelEventLogs, + suiteTwoSuiteListenerOnStartEventLog, + suiteTwoSuiteListenerOnFinishEventLog); + + verifySequentialTests( + suiteThreeSuiteAndTestLevelEventLogs, + suiteThreeTestLevelEventLogs, + suiteThreeSuiteListenerOnStartEventLog, + suiteThreeSuiteListenerOnFinishEventLog); + } + + // Verify that there is only a single test class instance associated with each of the test methods + // from the sample + // classes for every test in all the suites. + // Verify that the same test class instance is associated with each of the test methods from the + // sample test class + @Test + public void verifyOnlyOneInstanceOfTestClassForAllTestMethodsForAllSuites() { + + verifyNumberOfInstancesOfTestClassesForMethods( + SUITE_A, + SUITE_A_TEST_A, + Arrays.asList( + TestClassAFiveMethodsWithNoDepsSample.class, + TestClassCSixMethodsWithNoDepsSample.class), + 1); + + verifySameInstancesOfTestClassesAssociatedWithMethods( + SUITE_A, + SUITE_A_TEST_A, + Arrays.asList( + TestClassAFiveMethodsWithNoDepsSample.class, + TestClassCSixMethodsWithNoDepsSample.class)); + + verifyNumberOfInstancesOfTestClassForMethods( + SUITE_B, SUITE_B_TEST_A, TestClassEFiveMethodsWithNoDepsSample.class, 1); + + verifySameInstancesOfTestClassAssociatedWithMethods( + SUITE_B, SUITE_B_TEST_A, TestClassEFiveMethodsWithNoDepsSample.class); + + verifyNumberOfInstancesOfTestClassesForMethods( + SUITE_B, + SUITE_B_TEST_B, + Arrays.asList( + TestClassDThreeMethodsWithNoDepsSample.class, + TestClassBFourMethodsWithNoDepsSample.class, + TestClassFSixMethodsWithNoDepsSample.class), + 1); + + verifySameInstancesOfTestClassesAssociatedWithMethods( + SUITE_B, + SUITE_B_TEST_B, + Arrays.asList( + TestClassDThreeMethodsWithNoDepsSample.class, + TestClassBFourMethodsWithNoDepsSample.class, + TestClassFSixMethodsWithNoDepsSample.class)); + + verifyNumberOfInstancesOfTestClassesForMethods( + SUITE_C, + SUITE_C_TEST_A, + Arrays.asList( + TestClassGThreeMethodsWithNoDepsSample.class, + TestClassHFourMethodsWithNoDepsSample.class, + TestClassIFiveMethodsWithNoDepsSample.class), + 1); + + verifySameInstancesOfTestClassesAssociatedWithMethods( + SUITE_C, + SUITE_C_TEST_A, + Arrays.asList( + TestClassGThreeMethodsWithNoDepsSample.class, + TestClassHFourMethodsWithNoDepsSample.class, + TestClassIFiveMethodsWithNoDepsSample.class)); + + verifyNumberOfInstancesOfTestClassesForMethods( + SUITE_C, + SUITE_C_TEST_B, + Arrays.asList( + TestClassJFourMethodsWithNoDepsSample.class, + TestClassKFiveMethodsWithNoDepsSample.class), + 1); + + verifySameInstancesOfTestClassesAssociatedWithMethods( + SUITE_C, + SUITE_C_TEST_B, + Arrays.asList( + TestClassJFourMethodsWithNoDepsSample.class, + TestClassKFiveMethodsWithNoDepsSample.class)); + + verifyNumberOfInstancesOfTestClassesForMethods( + SUITE_C, + SUITE_C_TEST_C, + Arrays.asList( + TestClassLThreeMethodsWithNoDepsSample.class, + TestClassMFourMethodsWithNoDepsSample.class, + TestClassNFiveMethodsWithNoDepsSample.class, + TestClassOSixMethodsWithNoDepsSample.class), + 1); + + verifySameInstancesOfTestClassesAssociatedWithMethods( + SUITE_C, + SUITE_C_TEST_C, + Arrays.asList( + TestClassLThreeMethodsWithNoDepsSample.class, + TestClassMFourMethodsWithNoDepsSample.class, + TestClassNFiveMethodsWithNoDepsSample.class, + TestClassOSixMethodsWithNoDepsSample.class)); + } + + // Verify that the test method listener's onTestStart method runs after the test listener's + // onStart method for + // all the test methods in all tests and suites. + @Test + public void + verifyTestLevelMethodLevelEventLogsOccurBetweenAfterTestListenerStartAndFinishEventLogs() { + verifyEventsOccurBetween( + suiteOneTestOneListenerOnStartEventLog, + suiteOneTestOneTestMethodLevelEventLogs, + suiteOneTestOneListenerOnFinishEventLog, + "All of the test method level event logs for " + + SUITE_A_TEST_A + + " should have timestamps between the test listener's onStart and onFinish " + + "event logs for " + + SUITE_A_TEST_A + + ". Test listener onStart event log: " + + suiteOneTestOneListenerOnStartEventLog + + ". Test listener onFinish event log: " + + suiteOneTestOneListenerOnFinishEventLog + + ". Test method level event logs: " + + suiteOneTestOneTestMethodLevelEventLogs); + + verifyEventsOccurBetween( + suiteTwoTestOneListenerOnStartEventLog, + suiteTwoTestOneTestMethodLevelEventLogs, + suiteTwoTestOneListenerOnFinishEventLog, + "All of the test method level event logs for " + + SUITE_B_TEST_A + + " should have timestamps between the test listener's onStart and onFinish " + + "event logs for " + + SUITE_B_TEST_A + + ". Test listener onStart event log: " + + suiteTwoTestOneListenerOnStartEventLog + + ". Test listener onFinish event log: " + + suiteTwoTestOneListenerOnFinishEventLog + + ". Test method level event logs: " + + suiteTwoTestOneTestMethodLevelEventLogs); + + verifyEventsOccurBetween( + suiteTwoTestTwoListenerOnStartEventLog, + suiteTwoTestTwoTestMethodLevelEventLogs, + suiteTwoTestTwoListenerOnFinishEventLog, + "All of the test method level event logs for " + + SUITE_B_TEST_B + + " should have timestamps between the test listener's onStart and onFinish " + + "event logs for " + + SUITE_B_TEST_B + + ". Test listener onStart event log: " + + suiteTwoTestTwoListenerOnStartEventLog + + ". Test listener onFinish event log: " + + suiteTwoTestTwoListenerOnFinishEventLog + + ". Test method level event logs: " + + suiteTwoTestTwoTestMethodLevelEventLogs); + + verifyEventsOccurBetween( + suiteThreeTestOneListenerOnStartEventLog, + suiteThreeTestOneTestMethodLevelEventLogs, + suiteThreeTestOneListenerOnFinishEventLog, + "All of the test method level event logs for " + + SUITE_C_TEST_A + + " should have timestamps between the test listener's onStart and onFinish " + + "event logs for " + + SUITE_C_TEST_A + + ". Test listener onStart event log: " + + suiteThreeTestOneListenerOnStartEventLog + + ". Test listener onFinish event log: " + + suiteThreeTestOneListenerOnFinishEventLog + + ". Test method level event logs: " + + suiteThreeTestOneTestMethodLevelEventLogs); + + verifyEventsOccurBetween( + suiteThreeTestTwoListenerOnStartEventLog, + suiteThreeTestTwoTestMethodLevelEventLogs, + suiteThreeTestTwoListenerOnFinishEventLog, + "All of the test method level event logs for " + + SUITE_C_TEST_B + + " should have timestamps between the test listener's onStart and onFinish " + + "event logs for " + + SUITE_C_TEST_B + + ". Test listener onStart event log: " + + suiteThreeTestTwoListenerOnStartEventLog + + ". Test listener onFinish event log: " + + suiteThreeTestTwoListenerOnFinishEventLog + + ". Test method level event logs: " + + suiteThreeTestTwoTestMethodLevelEventLogs); + + verifyEventsOccurBetween( + suiteThreeTestThreeListenerOnStartEventLog, + suiteThreeTestThreeTestMethodLevelEventLogs, + suiteThreeTestThreeListenerOnFinishEventLog, + "All of the test method level event logs for " + + SUITE_C_TEST_C + + " should have timestamps between the test listener's onStart and onFinish " + + "event logs for " + + SUITE_C_TEST_C + + ". Test listener onStart event log: " + + suiteThreeTestThreeListenerOnStartEventLog + + ". Test listener onFinish event log: " + + suiteThreeTestThreeListenerOnFinishEventLog + + ". Test method level event logs: " + + suiteThreeTestThreeTestMethodLevelEventLogs); + } + + // Verifies that the method level events all run in different threads from the test and suite + // level events. + // Verifies that the test method listener and execution events for a given test method all run in + // the same thread. + @Test + public void verifyThatMethodLevelEventsRunInDifferentThreadsFromSuiteAndTestLevelEvents() { + + verifyEventThreadsSpawnedAfter( + getAllSuiteListenerStartEventLogs().get(0).getThreadId(), + testMethodLevelEventLogs, + "All the thread IDs for the test method level events should be greater than the thread ID for the " + + "suite and test level events. The expectation is that since the suite and test level events " + + "are running sequentially, and all the test methods are running in parallel, new threads " + + "will be spawned after the thread executing the suite and test level events when new methods " + + "begin executing. Suite and test level events thread ID: " + + getAllSuiteListenerStartEventLogs().get(0).getThreadId() + + ". Test method level event logs: " + + testMethodLevelEventLogs); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassAFiveMethodsWithNoDepsSample.class, SUITE_A, SUITE_A_TEST_A); + verifyEventsForTestMethodsRunInTheSameThread( + TestClassAFiveMethodsWithNoDepsSample.class, SUITE_A, SUITE_A_TEST_A); + verifyEventsForTestMethodsRunInTheSameThread( + TestClassCSixMethodsWithNoDepsSample.class, SUITE_A, SUITE_A_TEST_A); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassEFiveMethodsWithNoDepsSample.class, SUITE_B, SUITE_B_TEST_A); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassDThreeMethodsWithNoDepsSample.class, SUITE_B, SUITE_B_TEST_B); + verifyEventsForTestMethodsRunInTheSameThread( + TestClassBFourMethodsWithNoDepsSample.class, SUITE_B, SUITE_B_TEST_B); + verifyEventsForTestMethodsRunInTheSameThread( + TestClassFSixMethodsWithNoDepsSample.class, SUITE_B, SUITE_B_TEST_B); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassGThreeMethodsWithNoDepsSample.class, SUITE_C, SUITE_C_TEST_A); + verifyEventsForTestMethodsRunInTheSameThread( + TestClassHFourMethodsWithNoDepsSample.class, SUITE_C, SUITE_C_TEST_A); + verifyEventsForTestMethodsRunInTheSameThread( + TestClassIFiveMethodsWithNoDepsSample.class, SUITE_C, SUITE_C_TEST_A); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassJFourMethodsWithNoDepsSample.class, SUITE_C, SUITE_C_TEST_B); + verifyEventsForTestMethodsRunInTheSameThread( + TestClassKFiveMethodsWithNoDepsSample.class, SUITE_C, SUITE_C_TEST_B); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassLThreeMethodsWithNoDepsSample.class, SUITE_C, SUITE_C_TEST_C); + verifyEventsForTestMethodsRunInTheSameThread( + TestClassMFourMethodsWithNoDepsSample.class, SUITE_C, SUITE_C_TEST_C); + verifyEventsForTestMethodsRunInTheSameThread( + TestClassNFiveMethodsWithNoDepsSample.class, SUITE_C, SUITE_C_TEST_C); + verifyEventsForTestMethodsRunInTheSameThread( + TestClassOSixMethodsWithNoDepsSample.class, SUITE_C, SUITE_C_TEST_C); + } + + // Verify that the methods are run in separate threads in true parallel fashion by checking that + // the start and run + // times of events that should be run simultaneously start basically at the same time using the + // timestamps and the + // known values of the wait time specified for the event. Verify that the thread IDs of parallel + // events are + // different. + @Test + public void verifyThatTestMethodsRunInParallelThreads() { + verifySimultaneousTestMethods( + getTestMethodLevelEventLogsForTest(SUITE_A, SUITE_A_TEST_A), SUITE_A_TEST_A, 3); + verifySimultaneousTestMethods( + getTestMethodLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_A), SUITE_B_TEST_A, 6); + verifySimultaneousTestMethods( + getTestMethodLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_B), SUITE_B_TEST_B, 20); + verifySimultaneousTestMethods( + getTestMethodLevelEventLogsForTest(SUITE_C, SUITE_C_TEST_A), SUITE_C_TEST_A, 10); + verifySimultaneousTestMethods( + getTestMethodLevelEventLogsForTest(SUITE_C, SUITE_C_TEST_B), SUITE_C_TEST_B, 5); + verifySimultaneousTestMethods( + getTestMethodLevelEventLogsForTest(SUITE_C, SUITE_C_TEST_C), SUITE_C_TEST_C, 12); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase3Scenario1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase3Scenario1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase3Scenario1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase3Scenario1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,256 @@ +package test.thread.parallelization; + +import static org.testng.Assert.assertEquals; +import static test.thread.parallelization.TestNgRunStateTracker.getAllSuiteAndTestLevelEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getAllSuiteLevelEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getAllTestLevelEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getAllTestMethodLevelEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getSuiteListenerFinishEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getSuiteListenerStartEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getTestListenerFinishEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getTestListenerStartEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getTestListenerStartThreadId; +import static test.thread.parallelization.TestNgRunStateTracker.getTestMethodLevelEventLogsForTest; +import static test.thread.parallelization.TestNgRunStateTracker.reset; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.testng.ITestNGListener; +import org.testng.TestNG; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import org.testng.log4testng.Logger; +import org.testng.xml.XmlSuite; +import test.thread.parallelization.TestNgRunStateTracker.EventLog; +import test.thread.parallelization.sample.TestClassAFiveMethodsWithDataProviderOnAllMethodsAndNoDepsSample; + +/** + * This class covers PTP_TC_3, Scenario 1 in the Parallelization Test Plan. + * + *

Test Case Summary: Parallel by methods mode with sequential test suites using a non-parallel + * data provider but no dependencies and no factories. + * + *

Scenario Description: Single suite with a single test consisting of a single test class with + * five methods with a data provider specifying 3 sets of data + * + *

1) Thread count and parallel mode are specified at the suite level 2) The thread count is + * equal to the number of test methods times 3, the number of times each method will be invoked with + * a data set from the data provider. Expectation is that only 5 threads will be spawned, one for + * each of the methods and that in this thread, the method will be invoked 3 times, once for each + * set of data from the data provider. 3) There are NO configuration methods 4) All test methods + * pass 5) NO ordering is specified 6) group-by-instances is NOT set 7) There are no method + * exclusions + */ +public class ParallelByMethodsTestCase3Scenario1 extends BaseParallelizationTest { + private static final Logger log = Logger.getLogger(ParallelByMethodsTestCase3Scenario1.class); + + private static final String SUITE = "SingleTestSuite"; + private static final String TEST = "SingleTestClassTest"; + + private List suiteLevelEventLogs; + private List testLevelEventLogs; + private List suiteAndTestLevelEventLogs; + private List testMethodLevelEventLogs; + + private EventLog suiteListenerOnStartEventLog; + private EventLog suiteListenerOnFinishEventLog; + + private EventLog testListenerOnStartEventLog; + private EventLog testListenerOnFinishEventLog; + + private Long testListenerOnStartThreadId; + + private Map expectedInvocationCounts = new HashMap<>(); + + @BeforeClass + public void setUp() { + reset(); + + XmlSuite suite = createXmlSuite(SUITE); + suite.setParallel(XmlSuite.ParallelMode.METHODS); + suite.setThreadCount(15); + + expectedInvocationCounts.put( + TestClassAFiveMethodsWithDataProviderOnAllMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodA", + 3); + + expectedInvocationCounts.put( + TestClassAFiveMethodsWithDataProviderOnAllMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodB", + 3); + + expectedInvocationCounts.put( + TestClassAFiveMethodsWithDataProviderOnAllMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodC", + 3); + + expectedInvocationCounts.put( + TestClassAFiveMethodsWithDataProviderOnAllMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodD", + 3); + + expectedInvocationCounts.put( + TestClassAFiveMethodsWithDataProviderOnAllMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodE", + 3); + + createXmlTest( + suite, TEST, TestClassAFiveMethodsWithDataProviderOnAllMethodsAndNoDepsSample.class); + + addParams(suite, SUITE, TEST, "100", "paramOne,paramTwo,paramThree"); + + TestNG tng = create(suite); + + tng.addListener((ITestNGListener) new TestNgRunStateListener()); + + log.debug( + "Beginning ParallelByMethodsTestCase3Scenario1. This test scenario consists of a " + + "single suite with a single test consisting of a single test class with five methods with a data " + + "provider specifying 3 sets of data. There are no dependencies or factories."); + + log.debug( + "Suite: " + + SUITE + + ", Test: " + + TEST + + ", Test class: " + + TestClassAFiveMethodsWithDataProviderOnAllMethodsAndNoDepsSample.class + .getCanonicalName() + + ". Thread count: 15"); + + tng.run(); + + suiteLevelEventLogs = getAllSuiteLevelEventLogs(); + testLevelEventLogs = getAllTestLevelEventLogs(); + suiteAndTestLevelEventLogs = getAllSuiteAndTestLevelEventLogs(); + testMethodLevelEventLogs = getAllTestMethodLevelEventLogs(); + + suiteListenerOnStartEventLog = getSuiteListenerStartEventLog(SUITE); + suiteListenerOnFinishEventLog = getSuiteListenerFinishEventLog(SUITE); + + testListenerOnStartEventLog = getTestListenerStartEventLog(SUITE, TEST); + testListenerOnFinishEventLog = getTestListenerFinishEventLog(SUITE, TEST); + + testListenerOnStartThreadId = getTestListenerStartThreadId(SUITE, TEST); + } + + // Verifies that the expected number of suite, test and test method level events were logged. + @Test + public void sanityCheck() { + assertEquals( + suiteLevelEventLogs.size(), + 2, + "There should be 2 suite level events logged for " + SUITE + ": " + suiteLevelEventLogs); + assertEquals( + testLevelEventLogs.size(), + 2, + "There should be 2 test level events logged for " + SUITE + ": " + testLevelEventLogs); + assertEquals( + testMethodLevelEventLogs.size(), + 45, + "There should be 45 test method level events logged for " + + SUITE + + ": " + + testMethodLevelEventLogs); + } + + // Verify that the suite listener and test listener events have timestamps in the following order: + // suite start, + // test start, test finish, suite finish. Verify that all of these events run in the same thread + // because the + // parallelization mode is by methods only. + @Test + public void verifySuiteAndTestLevelEventsRunInSequentialOrderInSameThread() { + verifySameThreadIdForAllEvents( + suiteAndTestLevelEventLogs, + "The thread ID for all the suite and test level " + + "event logs should be the same because there is no parallelism specified at the suite or test level: " + + suiteAndTestLevelEventLogs); + verifySequentialTimingOfEvents( + suiteAndTestLevelEventLogs, + "The timestamps of suite and test level events " + + "logged first should be earlier than those which are logged afterwards because there is no " + + "parallelism specified at the suite or test level: " + + suiteAndTestLevelEventLogs); + verifyEventsOccurBetween( + suiteListenerOnStartEventLog, + testLevelEventLogs, + suiteListenerOnFinishEventLog, + "All of the test level event logs should have timestamps between the suite listener's onStart and " + + "onFinish event logs. Suite listener onStart event log: " + + suiteListenerOnStartEventLog + + ". Suite listener onFinish event log: " + + suiteListenerOnFinishEventLog + + ". Test level " + + "event logs: " + + testLevelEventLogs); + } + + // Verify that there is only a single test class instance associated with each of the test methods + // from the + // sample test class + // Verify that the same test class instance is associated with each of the test methods from the + // sample test class + @Test + public void verifyOnlyOneInstanceOfTestClassForAllTestMethods() { + + verifyNumberOfInstancesOfTestClassForMethods( + SUITE, TEST, TestClassAFiveMethodsWithDataProviderOnAllMethodsAndNoDepsSample.class, 1); + + verifySameInstancesOfTestClassAssociatedWithMethods( + SUITE, TEST, TestClassAFiveMethodsWithDataProviderOnAllMethodsAndNoDepsSample.class); + } + + // Verifies that all the test method level events execute between the test listener onStart and + // onFinish methods + @Test + public void verifyTestMethodLevelEventsAllOccurBetweenTestListenerStartAndFinish() { + verifyEventsOccurBetween( + testListenerOnStartEventLog, + testMethodLevelEventLogs, + testListenerOnFinishEventLog, + "All of the test method level event logs should have timestamps between the test listener's onStart " + + "and onFinish event logs. Test Listener onStart event log: " + + testListenerOnStartEventLog + + ". Test Listener onFinish event log: " + + testListenerOnFinishEventLog + + ". Test method level " + + "event logs: " + + testMethodLevelEventLogs); + } + + // Verifies that the method level events all run in different threads from the test and suite + // level events. + @Test + public void verifyThatMethodLevelEventsRunInDifferentThreadsFromSuiteAndTestLevelEvents() { + verifyEventThreadsSpawnedAfter( + testListenerOnStartThreadId, + testMethodLevelEventLogs, + "All the thread IDs " + + "for the test method level events should be greater than the thread ID for the suite and test level " + + "events. The expectation is that since the suite and test level events are running sequentially, and " + + "all the test methods are running in parallel, new threads will be spawned after the thread " + + "executing the suite and test level events when new methods begin executing. Suite and test level " + + "events thread ID: " + + testListenerOnStartThreadId + + ". Test method level event logs: " + + testMethodLevelEventLogs); + } + + // Verifies that the test methods execute in different threads in parallel fashion. + @Test + public void verifyThatTestMethodsRunInParallelThreads() { + verifyParallelTestMethodsWithNonParallelDataProvider( + getTestMethodLevelEventLogsForTest(SUITE, TEST), TEST, expectedInvocationCounts, 5, 5); + } + + // Verifies that all the test method level events for any given test method run in the same + // thread. + @Test + public void verifyThatAllEventsForATestMethodExecuteInSameThread() { + verifyEventsForTestMethodsRunInTheSameThread( + TestClassAFiveMethodsWithDataProviderOnAllMethodsAndNoDepsSample.class, SUITE, TEST); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase3Scenario2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase3Scenario2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase3Scenario2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase3Scenario2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,645 @@ +package test.thread.parallelization; + +import static org.testng.Assert.assertEquals; +import static test.thread.parallelization.TestNgRunStateTracker.getAllEventLogsForSuite; +import static test.thread.parallelization.TestNgRunStateTracker.getAllSuiteLevelEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getAllSuiteListenerStartEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getAllTestLevelEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getAllTestMethodLevelEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getSuiteAndTestLevelEventLogsForSuite; +import static test.thread.parallelization.TestNgRunStateTracker.getSuiteLevelEventLogsForSuite; +import static test.thread.parallelization.TestNgRunStateTracker.getSuiteListenerFinishEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getSuiteListenerStartEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getTestLevelEventLogsForSuite; +import static test.thread.parallelization.TestNgRunStateTracker.getTestListenerFinishEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getTestListenerStartEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getTestMethodLevelEventLogsForSuite; +import static test.thread.parallelization.TestNgRunStateTracker.getTestMethodLevelEventLogsForTest; +import static test.thread.parallelization.TestNgRunStateTracker.reset; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.testng.ITestNGListener; +import org.testng.TestNG; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import org.testng.log4testng.Logger; +import org.testng.xml.XmlSuite; +import test.thread.parallelization.sample.TestClassAFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample; +import test.thread.parallelization.sample.TestClassBSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample; +import test.thread.parallelization.sample.TestClassCFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample; +import test.thread.parallelization.sample.TestClassDThreeMethodsWithDataProviderOnSomeMethodsAndNoDepsSample; +import test.thread.parallelization.sample.TestClassEFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample; +import test.thread.parallelization.sample.TestClassFSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample; + +/** + * This class covers PTP_TC_3, Scenario 2 in the Parallelization Test Plan. + * + *

Test Case Summary: Parallel by methods mode with sequential test suites using a non-parallel + * data provider but no dependencies and no factories. + * + *

Scenario Description: Two suites with 1 and 2 tests respectively. One test for a suite shall + * consist of a single test class while the rest shall consist of more than one test class. Each + * test class has some methods with use a data provider and some which do not. Two data providers + * are used: one which provides two sets of data, one which provide three sets of data. + * + *

1) For both suites, the thread count and parallel mode are specified at the suite level 2) The + * thread count is less than the number of test methods for all tests in both suites, so methods + * will have to wait the active thread count to drop below the maximum thread count before they can + * begin execution. The expectation is that a thread for a method does not terminate until the + * method has been invoked for all sets of data if it uses a data provider. 3) There are NO + * configuration methods 4) All test methods pass 5) NO ordering is specified 6) group-by-instances + * is NOT set 7) There are no method exclusions + */ +public class ParallelByMethodsTestCase3Scenario2 extends BaseParallelizationTest { + private static final Logger log = Logger.getLogger(ParallelByMethodsTestCase3Scenario2.class); + + private static final String SUITE_A = "TestSuiteA"; + private static final String SUITE_B = "TestSuiteB"; + + private static final String SUITE_A_TEST_A = "TestSuiteA-TwoTestClassTest"; + + private static final String SUITE_B_TEST_A = "TestSuiteB-SingleTestClassTest"; + private static final String SUITE_B_TEST_B = "TestSuiteB-ThreeTestClassTest"; + + private Map> suiteEventLogsMap = new HashMap<>(); + private Map expectedInvocationCounts = new HashMap<>(); + + private List suiteLevelEventLogs; + private List testLevelEventLogs; + private List testMethodLevelEventLogs; + + private List suiteOneSuiteAndTestLevelEventLogs; + private List suiteOneSuiteLevelEventLogs; + private List suiteOneTestLevelEventLogs; + private List suiteOneTestMethodLevelEventLogs; + + private List suiteTwoSuiteAndTestLevelEventLogs; + private List suiteTwoSuiteLevelEventLogs; + private List suiteTwoTestLevelEventLogs; + private List suiteTwoTestMethodLevelEventLogs; + + private List suiteOneTestOneTestMethodLevelEventLogs; + + private List suiteTwoTestOneTestMethodLevelEventLogs; + private List suiteTwoTestTwoTestMethodLevelEventLogs; + + private TestNgRunStateTracker.EventLog suiteOneSuiteListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteOneSuiteListenerOnFinishEventLog; + + private TestNgRunStateTracker.EventLog suiteTwoSuiteListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteTwoSuiteListenerOnFinishEventLog; + + private TestNgRunStateTracker.EventLog suiteOneTestOneListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteOneTestOneListenerOnFinishEventLog; + + private TestNgRunStateTracker.EventLog suiteTwoTestOneListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteTwoTestOneListenerOnFinishEventLog; + private TestNgRunStateTracker.EventLog suiteTwoTestTwoListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteTwoTestTwoListenerOnFinishEventLog; + + @BeforeClass + public void setUp() { + reset(); + + XmlSuite suiteOne = createXmlSuite(SUITE_A); + XmlSuite suiteTwo = createXmlSuite(SUITE_B); + + createXmlTest( + suiteOne, + SUITE_A_TEST_A, + TestClassAFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class, + TestClassBSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class); + + createXmlTest( + suiteTwo, + SUITE_B_TEST_A, + TestClassCFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class); + createXmlTest( + suiteTwo, + SUITE_B_TEST_B, + TestClassDThreeMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class, + TestClassEFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class, + TestClassFSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class); + + suiteOne.setParallel(XmlSuite.ParallelMode.METHODS); + suiteOne.setThreadCount(3); + + suiteTwo.setParallel(XmlSuite.ParallelMode.METHODS); + suiteTwo.setThreadCount(4); + + addParams(suiteOne, SUITE_A, SUITE_A_TEST_A, "100", "paramOne,paramTwo,paramThree"); + + addParams(suiteTwo, SUITE_B, SUITE_B_TEST_A, "100", "paramOne,paramTwo"); + addParams(suiteTwo, SUITE_B, SUITE_B_TEST_B, "100", "paramOne,paramTwo"); + + TestNG tng = create(suiteOne, suiteTwo); + tng.addListener((ITestNGListener) new TestNgRunStateListener()); + + log.debug( + "Beginning ParallelByMethodsTestCase3Scenario2. This test scenario consists of two " + + "suites with 1 and 2 tests respectively. One test for a suite shall consist of a single test class " + + "while the rest shall consist of more than one test class. Each test class has some methods with use " + + "a data provider and some which do not. Two data providers are used: one which provides two sets of " + + "data, one which provide three sets of data. There are no dependencies or factories."); + + log.debug( + "Suite: " + + SUITE_A + + ", Test: " + + SUITE_A_TEST_A + + ", Test classes: " + + TestClassAFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class + .getCanonicalName() + + ", " + + TestClassBSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class + .getCanonicalName() + + ". Thread count: 3"); + + log.debug( + "Suite: " + + SUITE_B + + ", Test: " + + SUITE_B_TEST_A + + ", Test class: " + + TestClassCFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class + .getCanonicalName() + + ". Thread count: 4"); + + log.debug( + "Suite: " + + SUITE_B + + ", Test: " + + SUITE_B_TEST_B + + ", Test classes: " + + TestClassDThreeMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class + + ", " + + TestClassEFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class + + ", " + + TestClassFSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class + + ". Thread count: 4"); + + tng.run(); + + expectedInvocationCounts.put( + TestClassAFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodA", + 3); + expectedInvocationCounts.put( + TestClassAFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodB", + 1); + expectedInvocationCounts.put( + TestClassAFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodC", + 3); + expectedInvocationCounts.put( + TestClassAFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodD", + 1); + expectedInvocationCounts.put( + TestClassAFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodE", + 3); + + expectedInvocationCounts.put( + TestClassBSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodA", + 1); + expectedInvocationCounts.put( + TestClassBSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodB", + 3); + expectedInvocationCounts.put( + TestClassBSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodC", + 1); + expectedInvocationCounts.put( + TestClassBSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodD", + 3); + expectedInvocationCounts.put( + TestClassBSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodE", + 1); + expectedInvocationCounts.put( + TestClassBSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodF", + 3); + + expectedInvocationCounts.put( + TestClassCFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodA", + 2); + expectedInvocationCounts.put( + TestClassCFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodB", + 1); + expectedInvocationCounts.put( + TestClassCFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodC", + 2); + expectedInvocationCounts.put( + TestClassCFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodD", + 1); + expectedInvocationCounts.put( + TestClassCFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodE", + 2); + + expectedInvocationCounts.put( + TestClassDThreeMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodA", + 1); + expectedInvocationCounts.put( + TestClassDThreeMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodB", + 2); + expectedInvocationCounts.put( + TestClassDThreeMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodC", + 1); + + expectedInvocationCounts.put( + TestClassEFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodA", + 2); + expectedInvocationCounts.put( + TestClassEFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodB", + 2); + expectedInvocationCounts.put( + TestClassEFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodC", + 1); + expectedInvocationCounts.put( + TestClassEFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodD", + 1); + + expectedInvocationCounts.put( + TestClassFSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodA", + 1); + expectedInvocationCounts.put( + TestClassFSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodB", + 2); + expectedInvocationCounts.put( + TestClassFSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodC", + 1); + expectedInvocationCounts.put( + TestClassFSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodD", + 2); + expectedInvocationCounts.put( + TestClassFSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodE", + 1); + expectedInvocationCounts.put( + TestClassFSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodF", + 2); + + suiteLevelEventLogs = getAllSuiteLevelEventLogs(); + testLevelEventLogs = getAllTestLevelEventLogs(); + testMethodLevelEventLogs = getAllTestMethodLevelEventLogs(); + + suiteOneSuiteAndTestLevelEventLogs = getSuiteAndTestLevelEventLogsForSuite(SUITE_A); + suiteOneSuiteLevelEventLogs = getSuiteLevelEventLogsForSuite(SUITE_A); + suiteOneTestLevelEventLogs = getTestLevelEventLogsForSuite(SUITE_A); + + suiteTwoSuiteAndTestLevelEventLogs = getSuiteAndTestLevelEventLogsForSuite(SUITE_B); + suiteTwoSuiteLevelEventLogs = getSuiteLevelEventLogsForSuite(SUITE_B); + suiteTwoTestLevelEventLogs = getTestLevelEventLogsForSuite(SUITE_B); + + suiteEventLogsMap.put(SUITE_A, getAllEventLogsForSuite(SUITE_A)); + suiteEventLogsMap.put(SUITE_B, getAllEventLogsForSuite(SUITE_B)); + + suiteOneTestMethodLevelEventLogs = getTestMethodLevelEventLogsForSuite(SUITE_A); + suiteTwoTestMethodLevelEventLogs = getTestMethodLevelEventLogsForSuite(SUITE_B); + + suiteOneTestOneTestMethodLevelEventLogs = + getTestMethodLevelEventLogsForTest(SUITE_A, SUITE_A_TEST_A); + + suiteTwoTestOneTestMethodLevelEventLogs = + getTestMethodLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_A); + suiteTwoTestTwoTestMethodLevelEventLogs = + getTestMethodLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_B); + + suiteOneSuiteListenerOnStartEventLog = getSuiteListenerStartEventLog(SUITE_A); + suiteOneSuiteListenerOnFinishEventLog = getSuiteListenerFinishEventLog(SUITE_A); + + suiteTwoSuiteListenerOnStartEventLog = getSuiteListenerStartEventLog(SUITE_B); + suiteTwoSuiteListenerOnFinishEventLog = getSuiteListenerFinishEventLog(SUITE_B); + + suiteOneTestOneListenerOnStartEventLog = getTestListenerStartEventLog(SUITE_A, SUITE_A_TEST_A); + suiteOneTestOneListenerOnFinishEventLog = + getTestListenerFinishEventLog(SUITE_A, SUITE_A_TEST_A); + + suiteTwoTestOneListenerOnStartEventLog = getTestListenerStartEventLog(SUITE_B, SUITE_B_TEST_A); + suiteTwoTestOneListenerOnFinishEventLog = + getTestListenerFinishEventLog(SUITE_B, SUITE_B_TEST_A); + + suiteTwoTestTwoListenerOnStartEventLog = getTestListenerStartEventLog(SUITE_B, SUITE_B_TEST_B); + suiteTwoTestTwoListenerOnFinishEventLog = + getTestListenerFinishEventLog(SUITE_B, SUITE_B_TEST_B); + } + + // Verifies that the expected number of suite, test and test method level events were logged for + // each of the three + // suites. + @Test + public void sanityCheck() { + assertEquals( + suiteLevelEventLogs.size(), + 4, + "There should be 4 suite level events logged for " + + SUITE_A + + ", " + + SUITE_B + + ": " + + suiteLevelEventLogs); + assertEquals( + testLevelEventLogs.size(), + 6, + "There should be 6 test level events logged for " + + SUITE_A + + ", " + + SUITE_B + + ": " + + testLevelEventLogs); + + assertEquals( + testMethodLevelEventLogs.size(), + 150, + "There should 150 test method level events logged for " + + SUITE_A + + ", " + + SUITE_B + + ": " + + testMethodLevelEventLogs); + + assertEquals( + suiteOneSuiteLevelEventLogs.size(), + 2, + "There should be 2 suite level events logged for " + + SUITE_A + + ": " + + suiteOneSuiteLevelEventLogs); + assertEquals( + suiteOneTestLevelEventLogs.size(), + 2, + "There should be 2 test level events logged for " + + SUITE_A + + ": " + + suiteOneTestLevelEventLogs); + assertEquals( + suiteOneTestMethodLevelEventLogs.size(), + 69, + "There should be 69 test method level events " + + "logged for " + + SUITE_A + + ": " + + suiteOneTestMethodLevelEventLogs); + + assertEquals( + suiteTwoSuiteLevelEventLogs.size(), + 2, + "There should be 2 suite level events logged for " + + SUITE_B + + ": " + + suiteTwoSuiteLevelEventLogs); + assertEquals( + suiteTwoTestLevelEventLogs.size(), + 4, + "There should be 4 test level events logged for " + + SUITE_B + + ": " + + suiteTwoTestLevelEventLogs); + assertEquals( + suiteTwoTestMethodLevelEventLogs.size(), + 81, + "There should be 54 test method level events " + + "logged for " + + SUITE_B + + ": " + + suiteTwoTestMethodLevelEventLogs); + } + + // Verify that all the events in the second suite and third suites run have timestamps later than + // the suite + // listener's onFinish event for the first suite run. + // Verify that all the events in the third suite run have timestamps later than the suite + // listener's onFinish + // event for the second suite run. + // Verify that all suite level events run in the same thread + @Test + public void verifySuitesRunSequentiallyInSameThread() { + verifySequentialSuites(suiteLevelEventLogs, suiteEventLogsMap); + } + + // For all suites, verify that the test level events run sequentially because the parallel mode is + // by methods only. + @Test + public void verifySuiteAndTestLevelEventsRunInSequentialOrderForIndividualSuites() { + + verifySequentialTests( + suiteOneSuiteAndTestLevelEventLogs, + suiteOneTestLevelEventLogs, + suiteOneSuiteListenerOnStartEventLog, + suiteOneSuiteListenerOnFinishEventLog); + + verifySequentialTests( + suiteTwoSuiteAndTestLevelEventLogs, + suiteTwoTestLevelEventLogs, + suiteTwoSuiteListenerOnStartEventLog, + suiteTwoSuiteListenerOnFinishEventLog); + } + + // Verify that there is only a single test class instance associated with each of the test methods + // from the sample + // classes for every test in all the suites. + // Verify that the same test class instance is associated with each of the test methods from the + // sample test class + @Test + public void verifyOnlyOneInstanceOfTestClassForAllTestMethodsForAllSuites() { + + verifyNumberOfInstancesOfTestClassesForMethods( + SUITE_A, + SUITE_A_TEST_A, + Arrays.asList( + TestClassAFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class, + TestClassBSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class), + 1); + + verifySameInstancesOfTestClassesAssociatedWithMethods( + SUITE_A, + SUITE_A_TEST_A, + Arrays.asList( + TestClassAFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class, + TestClassBSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class)); + + verifyNumberOfInstancesOfTestClassForMethods( + SUITE_B, + SUITE_B_TEST_A, + TestClassCFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class, + 1); + + verifySameInstancesOfTestClassAssociatedWithMethods( + SUITE_B, + SUITE_B_TEST_A, + TestClassCFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class); + + verifyNumberOfInstancesOfTestClassesForMethods( + SUITE_B, + SUITE_B_TEST_B, + Arrays.asList( + TestClassDThreeMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class, + TestClassEFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class, + TestClassFSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class), + 1); + + verifySameInstancesOfTestClassesAssociatedWithMethods( + SUITE_B, + SUITE_B_TEST_B, + Arrays.asList( + TestClassDThreeMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class, + TestClassEFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class, + TestClassFSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class)); + } + + // Verify that the test method listener's onTestStart method runs after the test listener's + // onStart method for + // all the test methods in all tests and suites. + @Test + public void + verifyTestLevelMethodLevelEventLogsOccurBetweenAfterTestListenerStartAndFinishEventLogs() { + verifyEventsOccurBetween( + suiteOneTestOneListenerOnStartEventLog, + suiteOneTestOneTestMethodLevelEventLogs, + suiteOneTestOneListenerOnFinishEventLog, + "All of the test method level event logs for " + + SUITE_A_TEST_A + + " should have timestamps between the test listener's onStart and onFinish " + + "event logs for " + + SUITE_A_TEST_A + + ". Test listener onStart event log: " + + suiteOneTestOneListenerOnStartEventLog + + ". Test listener onFinish event log: " + + suiteOneTestOneListenerOnFinishEventLog + + ". Test method level event logs: " + + suiteOneTestOneTestMethodLevelEventLogs); + + verifyEventsOccurBetween( + suiteTwoTestOneListenerOnStartEventLog, + suiteTwoTestOneTestMethodLevelEventLogs, + suiteTwoTestOneListenerOnFinishEventLog, + "All of the test method level event logs for " + + SUITE_B_TEST_A + + " should have timestamps between the test listener's onStart and onFinish " + + "event logs for " + + SUITE_B_TEST_A + + ". Test listener onStart event log: " + + suiteTwoTestOneListenerOnStartEventLog + + ". Test listener onFinish event log: " + + suiteTwoTestOneListenerOnFinishEventLog + + ". Test method level event logs: " + + suiteTwoTestOneTestMethodLevelEventLogs); + + verifyEventsOccurBetween( + suiteTwoTestTwoListenerOnStartEventLog, + suiteTwoTestTwoTestMethodLevelEventLogs, + suiteTwoTestTwoListenerOnFinishEventLog, + "All of the test method level event logs for " + + SUITE_B_TEST_B + + " should have timestamps between the test listener's onStart and onFinish " + + "event logs for " + + SUITE_B_TEST_B + + ". Test listener onStart event log: " + + suiteTwoTestTwoListenerOnStartEventLog + + ". Test listener onFinish event log: " + + suiteTwoTestTwoListenerOnFinishEventLog + + ". Test method level event logs: " + + suiteTwoTestTwoTestMethodLevelEventLogs); + } + + // Verifies that the method level events all run in different threads from the test and suite + // level events. + // Verifies that the test method listener and execution events for a given test method all run in + // the same thread. + @Test + public void verifyThatMethodLevelEventsRunInDifferentThreadsFromSuiteAndTestLevelEvents() { + + verifyEventThreadsSpawnedAfter( + getAllSuiteListenerStartEventLogs().get(0).getThreadId(), + testMethodLevelEventLogs, + "All the thread IDs for the test method level events should be greater than the thread ID for the " + + "suite and test level events. The expectation is that since the suite and test level events " + + "are running sequentially, and all the test methods are running in parallel, new threads " + + "will be spawned after the thread executing the suite and test level events when new methods " + + "begin executing. Suite and test level events thread ID: " + + getAllSuiteListenerStartEventLogs().get(0).getThreadId() + + ". Test method level event logs: " + + testMethodLevelEventLogs); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassAFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class, + SUITE_A, + SUITE_A_TEST_A); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassBSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class, + SUITE_A, + SUITE_A_TEST_A); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassCFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class, + SUITE_B, + SUITE_B_TEST_A); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassDThreeMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class, + SUITE_B, + SUITE_B_TEST_B); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassEFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class, + SUITE_B, + SUITE_B_TEST_B); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassFSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class, + SUITE_B, + SUITE_B_TEST_B); + } + + // Verifies that the test methods execute in different threads in parallel fashion. + @Test + public void verifyThatTestMethodsRunInParallelThreads() { + verifyParallelTestMethodsWithNonParallelDataProvider( + getTestMethodLevelEventLogsForTest(SUITE_A, SUITE_A_TEST_A), + SUITE_A_TEST_A, + expectedInvocationCounts, + 11, + 3); + + verifyParallelTestMethodsWithNonParallelDataProvider( + getTestMethodLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_A), + SUITE_B_TEST_A, + expectedInvocationCounts, + 5, + 4); + + verifyParallelTestMethodsWithNonParallelDataProvider( + getTestMethodLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_B), + SUITE_B_TEST_B, + expectedInvocationCounts, + 13, + 4); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase4Scenario1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase4Scenario1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase4Scenario1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase4Scenario1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,1175 @@ +package test.thread.parallelization; + +import static org.testng.Assert.assertEquals; +import static test.thread.parallelization.TestNgRunStateTracker.getAllEventLogsForSuite; +import static test.thread.parallelization.TestNgRunStateTracker.getAllSuiteLevelEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getAllSuiteListenerStartEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getAllTestLevelEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getAllTestMethodLevelEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getSuiteAndTestLevelEventLogsForSuite; +import static test.thread.parallelization.TestNgRunStateTracker.getSuiteLevelEventLogsForSuite; +import static test.thread.parallelization.TestNgRunStateTracker.getSuiteListenerFinishEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getSuiteListenerStartEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getTestLevelEventLogsForSuite; +import static test.thread.parallelization.TestNgRunStateTracker.getTestLevelEventLogsForTest; +import static test.thread.parallelization.TestNgRunStateTracker.getTestListenerFinishEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getTestListenerStartEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getTestMethodLevelEventLogsForSuite; +import static test.thread.parallelization.TestNgRunStateTracker.getTestMethodLevelEventLogsForTest; +import static test.thread.parallelization.TestNgRunStateTracker.reset; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.testng.ITestNGListener; +import org.testng.TestNG; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import org.testng.log4testng.Logger; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.thread.parallelization.sample.TestClassAFiveMethodsWithDataProviderOnAllMethodsAndNoDepsSample; +import test.thread.parallelization.sample.TestClassAFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample; +import test.thread.parallelization.sample.TestClassBFourMethodsWithDataProviderOnAllMethodsAndNoDepsSample; +import test.thread.parallelization.sample.TestClassBSixMethodsWithDataProviderOnAllMethodsAndNoDepsSample; +import test.thread.parallelization.sample.TestClassBSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample; +import test.thread.parallelization.sample.TestClassCFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample; +import test.thread.parallelization.sample.TestClassDThreeMethodsWithDataProviderOnAllMethodsAndNoDepsSample; +import test.thread.parallelization.sample.TestClassDThreeMethodsWithDataProviderOnSomeMethodsAndNoDepsSample; +import test.thread.parallelization.sample.TestClassEFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample; +import test.thread.parallelization.sample.TestClassFSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample; +import test.thread.parallelization.sample.TestClassGFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample; +import test.thread.parallelization.sample.TestClassHFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample; +import test.thread.parallelization.sample.TestClassIThreeMethodsWithDataProviderOnSomeMethodsAndNoDepsSample; +import test.thread.parallelization.sample.TestClassJFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample; +import test.thread.parallelization.sample.TestClassKFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample; + +/** + * This class covers PTP_TC_4, Scenario 1 in the Parallelization Test Plan. + * + *

Test Case Summary: Parallel by methods mode with parallel test suites using a non-parallel + * data provider but no dependencies and no factories. + * + *

Scenario Description: Three suites with 1, 2 and 3 tests respectively. One test for a suite + * shall consist of a single test class while the rest shall consist of more than one test class. + * Some test classes have a mixture of some methods that use a data provider and some which do not. + * The data providers provide data sets of varying sizes. + * + *

1) The suite thread pool is 2, so one suite will have to wait for one of the others to + * complete execution before it can begin execution 2) For one of the suites, the thread count and + * parallel mode are specified at the suite level 3) For one of the suites, the thread count and + * parallel mode are specified at the test level 4) For one of the suites, the parallel mode is + * specified at the suite level, and the thread counts are specified at the test level (thread + * counts for each test differ) 5) The thread count is less than the number of test methods for the + * tests in two of the suites, so some methods will have to wait the active thread count to drop + * below the maximum thread count before they can begin execution. The expectation is that a thread + * for a method does not terminate until the method has been invoked for all sets of data if it uses + * a data provider. 6) The thread count is more than the number of test methods for the tests in one + * of the suites, ensuring that none of the methods in that suite should have to wait for any other + * method to complete execution. The expectation is that a thread for a method does not terminate + * until the method has been invoked for all sets of data if it uses a data provider. 7) There are + * NO configuration methods 8) All test methods pass 9) NO ordering is specified 10) + * group-by-instances is NOT set 11) There are no method exclusions + */ +public class ParallelByMethodsTestCase4Scenario1 extends BaseParallelizationTest { + private static final Logger log = Logger.getLogger(ParallelByMethodsTestCase4Scenario1.class); + + private static final String SUITE_A = "TestSuiteA"; + private static final String SUITE_B = "TestSuiteB"; + private static final String SUITE_C = "TestSuiteC"; + + private static final String SUITE_A_TEST_A = "TestSuiteA-TwoTestClassTest"; + + private static final String SUITE_B_TEST_A = "TestSuiteB-SingleTestClassTest"; + private static final String SUITE_B_TEST_B = "TestSuiteB-ThreeTestClassTest"; + + private static final String SUITE_C_TEST_A = "TestSuiteC-ThreeTestClassTest"; + private static final String SUITE_C_TEST_B = "TestSuiteC-TwoTestClassTest"; + private static final String SUITE_C_TEST_C = "TestSuiteC-FourTestClassTest"; + + private static final int THREAD_POOL_SIZE = 2; + + private Map> suiteEventLogsMap = new HashMap<>(); + private Map expectedInvocationCounts = new HashMap<>(); + + private Map> testEventLogsMap = new HashMap<>(); + + private List suiteLevelEventLogs; + private List testLevelEventLogs; + private List testMethodLevelEventLogs; + + private List suiteOneSuiteAndTestLevelEventLogs; + private List suiteOneSuiteLevelEventLogs; + private List suiteOneTestLevelEventLogs; + private List suiteOneTestMethodLevelEventLogs; + + private List suiteTwoSuiteAndTestLevelEventLogs; + private List suiteTwoSuiteLevelEventLogs; + private List suiteTwoTestLevelEventLogs; + private List suiteTwoTestMethodLevelEventLogs; + + private List suiteThreeSuiteAndTestLevelEventLogs; + private List suiteThreeSuiteLevelEventLogs; + private List suiteThreeTestLevelEventLogs; + private List suiteThreeTestMethodLevelEventLogs; + + private List suiteOneTestOneTestMethodLevelEventLogs; + + private List suiteTwoTestOneTestMethodLevelEventLogs; + private List suiteTwoTestTwoTestMethodLevelEventLogs; + + private List suiteThreeTestOneTestMethodLevelEventLogs; + private List suiteThreeTestTwoTestMethodLevelEventLogs; + private List suiteThreeTestThreeTestMethodLevelEventLogs; + + private TestNgRunStateTracker.EventLog suiteOneSuiteListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteOneSuiteListenerOnFinishEventLog; + + private TestNgRunStateTracker.EventLog suiteTwoSuiteListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteTwoSuiteListenerOnFinishEventLog; + + private TestNgRunStateTracker.EventLog suiteThreeSuiteListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteThreeSuiteListenerOnFinishEventLog; + + private TestNgRunStateTracker.EventLog suiteOneTestOneListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteOneTestOneListenerOnFinishEventLog; + + private TestNgRunStateTracker.EventLog suiteTwoTestOneListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteTwoTestOneListenerOnFinishEventLog; + private TestNgRunStateTracker.EventLog suiteTwoTestTwoListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteTwoTestTwoListenerOnFinishEventLog; + + private TestNgRunStateTracker.EventLog suiteThreeTestOneListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteThreeTestOneListenerOnFinishEventLog; + private TestNgRunStateTracker.EventLog suiteThreeTestTwoListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteThreeTestTwoListenerOnFinishEventLog; + private TestNgRunStateTracker.EventLog suiteThreeTestThreeListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteThreeTestThreeListenerOnFinishEventLog; + + @BeforeClass + public void setUp() { + reset(); + + XmlSuite suiteOne = createXmlSuite(SUITE_A); + XmlSuite suiteTwo = createXmlSuite(SUITE_B); + XmlSuite suiteThree = createXmlSuite(SUITE_C); + + suiteOne.setParallel(XmlSuite.ParallelMode.METHODS); + suiteOne.setThreadCount(3); + + createXmlTest( + suiteOne, + SUITE_A_TEST_A, + TestClassAFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class, + TestClassBSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class); + + createXmlTest( + suiteTwo, + SUITE_B_TEST_A, + TestClassCFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class); + createXmlTest( + suiteTwo, + SUITE_B_TEST_B, + TestClassDThreeMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class, + TestClassEFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class, + TestClassFSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class); + + suiteTwo.setParallel(XmlSuite.ParallelMode.METHODS); + + for (XmlTest test : suiteTwo.getTests()) { + if (test.getName().equals(SUITE_B_TEST_A)) { + test.setThreadCount(6); + } else { + test.setThreadCount(20); + } + } + + createXmlTest( + suiteThree, + SUITE_C_TEST_A, + TestClassDThreeMethodsWithDataProviderOnAllMethodsAndNoDepsSample.class, + TestClassGFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class, + TestClassAFiveMethodsWithDataProviderOnAllMethodsAndNoDepsSample.class); + createXmlTest( + suiteThree, + SUITE_C_TEST_B, + TestClassBFourMethodsWithDataProviderOnAllMethodsAndNoDepsSample.class, + TestClassHFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class); + createXmlTest( + suiteThree, + SUITE_C_TEST_C, + TestClassIThreeMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class, + TestClassJFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class, + TestClassKFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class, + TestClassBSixMethodsWithDataProviderOnAllMethodsAndNoDepsSample.class); + + for (XmlTest test : suiteThree.getTests()) { + test.setParallel(XmlSuite.ParallelMode.METHODS); + + switch (test.getName()) { + case SUITE_C_TEST_A: + test.setThreadCount(10); + break; + case SUITE_C_TEST_B: + test.setThreadCount(5); + break; + default: + test.setThreadCount(12); + break; + } + } + + addParams(suiteOne, SUITE_A, SUITE_A_TEST_A, "100", "paramOne,paramTwo,paramThree"); + + addParams(suiteTwo, SUITE_B, SUITE_B_TEST_A, "100", "paramOne,paramTwo"); + addParams(suiteTwo, SUITE_B, SUITE_B_TEST_B, "100", "paramOne,paramTwo"); + + addParams(suiteThree, SUITE_C, SUITE_C_TEST_A, "100", "paramOne,paramTwo,paramThree"); + addParams(suiteThree, SUITE_C, SUITE_C_TEST_B, "100", "paramOne,paramTwo"); + addParams(suiteThree, SUITE_C, SUITE_C_TEST_C, "100", "paramOne,paramTwo,paramThree"); + + TestNG tng = create(suiteOne, suiteTwo, suiteThree); + tng.setSuiteThreadPoolSize(2); + tng.addListener((ITestNGListener) new TestNgRunStateListener()); + + log.debug( + "Beginning ParallelByMethodsTestCase4Scenario1. This test scenario consists of three " + + "suites with 1, 2 and 3 tests respectively. The suites run in parallel and the thread pool size is " + + "2. One test for a suite shall consist of a single test class while the rest shall consist of more " + + "han one test class. Some test classes have a mixture of some methods that use a data provider and " + + "some which do not. The data providers provide data sets of varying sizes. There are no " + + "dependencies or factories."); + + log.debug( + "Suite: " + + SUITE_A + + ", Test: " + + SUITE_A_TEST_A + + ", Test classes: " + + TestClassAFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class + .getCanonicalName() + + ", " + + TestClassBSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class + .getCanonicalName() + + ". Thread count: 3"); + + log.debug( + "Suite: " + + SUITE_B + + ", Test: " + + SUITE_B_TEST_A + + ", Test class: " + + TestClassCFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class + .getCanonicalName() + + ". Thread count: 6"); + + log.debug( + "Suite: " + + SUITE_B + + ", Test: " + + SUITE_B_TEST_B + + ", Test classes: " + + TestClassDThreeMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class + + ", " + + TestClassEFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class + + ", " + + TestClassFSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class + + ". Thread count: 20"); + + log.debug( + "Suite: " + + SUITE_C + + ", Test: " + + SUITE_C_TEST_A + + ", Test classes: " + + TestClassDThreeMethodsWithDataProviderOnAllMethodsAndNoDepsSample.class + .getCanonicalName() + + ", " + + TestClassGFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class + .getCanonicalName() + + ", " + + TestClassAFiveMethodsWithDataProviderOnAllMethodsAndNoDepsSample.class + + ". Thread count: 10"); + + log.debug( + "Suite: " + + SUITE_C + + ", Test: " + + SUITE_C_TEST_B + + ", Test classes: " + + TestClassBFourMethodsWithDataProviderOnAllMethodsAndNoDepsSample.class + .getCanonicalName() + + ", " + + TestClassHFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class + + ". Thread count: 5"); + + log.debug( + "Suite: " + + SUITE_C + + ", Test: " + + SUITE_C_TEST_C + + ", Test classes: " + + TestClassIThreeMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class + .getCanonicalName() + + ", " + + TestClassJFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class + .getCanonicalName() + + ", " + + TestClassKFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class + .getCanonicalName() + + ", " + + TestClassBSixMethodsWithDataProviderOnAllMethodsAndNoDepsSample.class + .getCanonicalName() + + ". Thread count: 12."); + + tng.run(); + + expectedInvocationCounts.put( + TestClassAFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodA", + 3); + expectedInvocationCounts.put( + TestClassAFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodB", + 1); + expectedInvocationCounts.put( + TestClassAFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodC", + 3); + expectedInvocationCounts.put( + TestClassAFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodD", + 1); + expectedInvocationCounts.put( + TestClassAFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodE", + 3); + + expectedInvocationCounts.put( + TestClassBSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodA", + 1); + expectedInvocationCounts.put( + TestClassBSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodB", + 3); + expectedInvocationCounts.put( + TestClassBSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodC", + 1); + expectedInvocationCounts.put( + TestClassBSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodD", + 3); + expectedInvocationCounts.put( + TestClassBSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodE", + 1); + expectedInvocationCounts.put( + TestClassBSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodF", + 3); + + expectedInvocationCounts.put( + TestClassCFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodA", + 2); + expectedInvocationCounts.put( + TestClassCFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodB", + 1); + expectedInvocationCounts.put( + TestClassCFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodC", + 2); + expectedInvocationCounts.put( + TestClassCFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodD", + 1); + expectedInvocationCounts.put( + TestClassCFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodE", + 2); + + expectedInvocationCounts.put( + TestClassDThreeMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodA", + 1); + expectedInvocationCounts.put( + TestClassDThreeMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodB", + 2); + expectedInvocationCounts.put( + TestClassDThreeMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodC", + 1); + + expectedInvocationCounts.put( + TestClassEFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodA", + 2); + expectedInvocationCounts.put( + TestClassEFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodB", + 2); + expectedInvocationCounts.put( + TestClassEFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodC", + 1); + expectedInvocationCounts.put( + TestClassEFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodD", + 1); + + expectedInvocationCounts.put( + TestClassFSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodA", + 1); + expectedInvocationCounts.put( + TestClassFSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodB", + 2); + expectedInvocationCounts.put( + TestClassFSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodC", + 1); + expectedInvocationCounts.put( + TestClassFSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodD", + 2); + expectedInvocationCounts.put( + TestClassFSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodE", + 1); + expectedInvocationCounts.put( + TestClassFSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodF", + 2); + + expectedInvocationCounts.put( + TestClassDThreeMethodsWithDataProviderOnAllMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodA", + 3); + expectedInvocationCounts.put( + TestClassDThreeMethodsWithDataProviderOnAllMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodB", + 3); + expectedInvocationCounts.put( + TestClassDThreeMethodsWithDataProviderOnAllMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodC", + 3); + + expectedInvocationCounts.put( + TestClassGFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodA", + 3); + expectedInvocationCounts.put( + TestClassGFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodB", + 3); + expectedInvocationCounts.put( + TestClassGFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodC", + 1); + expectedInvocationCounts.put( + TestClassGFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodD", + 1); + + expectedInvocationCounts.put( + TestClassAFiveMethodsWithDataProviderOnAllMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodA", + 3); + expectedInvocationCounts.put( + TestClassAFiveMethodsWithDataProviderOnAllMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodB", + 3); + expectedInvocationCounts.put( + TestClassAFiveMethodsWithDataProviderOnAllMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodC", + 3); + expectedInvocationCounts.put( + TestClassAFiveMethodsWithDataProviderOnAllMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodD", + 3); + expectedInvocationCounts.put( + TestClassAFiveMethodsWithDataProviderOnAllMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodE", + 3); + + expectedInvocationCounts.put( + TestClassBFourMethodsWithDataProviderOnAllMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodA", + 2); + expectedInvocationCounts.put( + TestClassBFourMethodsWithDataProviderOnAllMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodB", + 2); + expectedInvocationCounts.put( + TestClassBFourMethodsWithDataProviderOnAllMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodC", + 2); + expectedInvocationCounts.put( + TestClassBFourMethodsWithDataProviderOnAllMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodD", + 2); + + expectedInvocationCounts.put( + TestClassHFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodA", + 2); + expectedInvocationCounts.put( + TestClassHFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodB", + 1); + expectedInvocationCounts.put( + TestClassHFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodC", + 2); + expectedInvocationCounts.put( + TestClassHFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodD", + 1); + expectedInvocationCounts.put( + TestClassHFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodE", + 2); + + expectedInvocationCounts.put( + TestClassIThreeMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodA", + 1); + expectedInvocationCounts.put( + TestClassIThreeMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodB", + 3); + expectedInvocationCounts.put( + TestClassIThreeMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodC", + 1); + + expectedInvocationCounts.put( + TestClassJFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodA", + 3); + expectedInvocationCounts.put( + TestClassJFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodB", + 3); + expectedInvocationCounts.put( + TestClassJFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodC", + 1); + expectedInvocationCounts.put( + TestClassJFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodD", + 1); + + expectedInvocationCounts.put( + TestClassKFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodA", + 3); + expectedInvocationCounts.put( + TestClassKFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodB", + 1); + expectedInvocationCounts.put( + TestClassKFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodC", + 3); + expectedInvocationCounts.put( + TestClassKFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodD", + 1); + expectedInvocationCounts.put( + TestClassKFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodE", + 3); + + expectedInvocationCounts.put( + TestClassBSixMethodsWithDataProviderOnAllMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodA", + 3); + expectedInvocationCounts.put( + TestClassBSixMethodsWithDataProviderOnAllMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodB", + 3); + expectedInvocationCounts.put( + TestClassBSixMethodsWithDataProviderOnAllMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodC", + 3); + expectedInvocationCounts.put( + TestClassBSixMethodsWithDataProviderOnAllMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodD", + 3); + expectedInvocationCounts.put( + TestClassBSixMethodsWithDataProviderOnAllMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodE", + 3); + expectedInvocationCounts.put( + TestClassBSixMethodsWithDataProviderOnAllMethodsAndNoDepsSample.class.getCanonicalName() + + ".testMethodF", + 3); + + suiteLevelEventLogs = getAllSuiteLevelEventLogs(); + testLevelEventLogs = getAllTestLevelEventLogs(); + testMethodLevelEventLogs = getAllTestMethodLevelEventLogs(); + + suiteOneSuiteAndTestLevelEventLogs = getSuiteAndTestLevelEventLogsForSuite(SUITE_A); + suiteOneSuiteLevelEventLogs = getSuiteLevelEventLogsForSuite(SUITE_A); + suiteOneTestLevelEventLogs = getTestLevelEventLogsForSuite(SUITE_A); + + suiteTwoSuiteAndTestLevelEventLogs = getSuiteAndTestLevelEventLogsForSuite(SUITE_B); + suiteTwoSuiteLevelEventLogs = getSuiteLevelEventLogsForSuite(SUITE_B); + suiteTwoTestLevelEventLogs = getTestLevelEventLogsForSuite(SUITE_B); + + suiteThreeSuiteAndTestLevelEventLogs = getSuiteAndTestLevelEventLogsForSuite(SUITE_C); + suiteThreeSuiteLevelEventLogs = getSuiteLevelEventLogsForSuite(SUITE_C); + suiteThreeTestLevelEventLogs = getTestLevelEventLogsForSuite(SUITE_C); + + suiteEventLogsMap.put(SUITE_A, getAllEventLogsForSuite(SUITE_A)); + suiteEventLogsMap.put(SUITE_B, getAllEventLogsForSuite(SUITE_B)); + suiteEventLogsMap.put(SUITE_C, getAllEventLogsForSuite(SUITE_C)); + + suiteOneTestMethodLevelEventLogs = getTestMethodLevelEventLogsForSuite(SUITE_A); + suiteTwoTestMethodLevelEventLogs = getTestMethodLevelEventLogsForSuite(SUITE_B); + suiteThreeTestMethodLevelEventLogs = getTestMethodLevelEventLogsForSuite(SUITE_C); + + suiteOneTestOneTestMethodLevelEventLogs = + getTestMethodLevelEventLogsForTest(SUITE_A, SUITE_A_TEST_A); + + suiteTwoTestOneTestMethodLevelEventLogs = + getTestMethodLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_A); + suiteTwoTestTwoTestMethodLevelEventLogs = + getTestMethodLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_B); + + suiteThreeTestOneTestMethodLevelEventLogs = + getTestMethodLevelEventLogsForTest(SUITE_C, SUITE_C_TEST_A); + suiteThreeTestTwoTestMethodLevelEventLogs = + getTestMethodLevelEventLogsForTest(SUITE_C, SUITE_C_TEST_B); + suiteThreeTestThreeTestMethodLevelEventLogs = + getTestMethodLevelEventLogsForTest(SUITE_C, SUITE_C_TEST_C); + + testEventLogsMap.put(SUITE_B_TEST_A, getTestLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_A)); + testEventLogsMap.put(SUITE_B_TEST_B, getTestLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_B)); + + testEventLogsMap.put(SUITE_C_TEST_A, getTestLevelEventLogsForTest(SUITE_C, SUITE_C_TEST_A)); + testEventLogsMap.put(SUITE_C_TEST_B, getTestLevelEventLogsForTest(SUITE_C, SUITE_C_TEST_B)); + testEventLogsMap.put(SUITE_C_TEST_C, getTestLevelEventLogsForTest(SUITE_C, SUITE_C_TEST_C)); + + suiteOneSuiteListenerOnStartEventLog = getSuiteListenerStartEventLog(SUITE_A); + suiteOneSuiteListenerOnFinishEventLog = getSuiteListenerFinishEventLog(SUITE_A); + + suiteTwoSuiteListenerOnStartEventLog = getSuiteListenerStartEventLog(SUITE_B); + suiteTwoSuiteListenerOnFinishEventLog = getSuiteListenerFinishEventLog(SUITE_B); + + suiteThreeSuiteListenerOnStartEventLog = getSuiteListenerStartEventLog(SUITE_C); + suiteThreeSuiteListenerOnFinishEventLog = getSuiteListenerFinishEventLog(SUITE_C); + + suiteOneTestOneListenerOnStartEventLog = getTestListenerStartEventLog(SUITE_A, SUITE_A_TEST_A); + suiteOneTestOneListenerOnFinishEventLog = + getTestListenerFinishEventLog(SUITE_A, SUITE_A_TEST_A); + + suiteTwoTestOneListenerOnStartEventLog = getTestListenerStartEventLog(SUITE_B, SUITE_B_TEST_A); + suiteTwoTestOneListenerOnFinishEventLog = + getTestListenerFinishEventLog(SUITE_B, SUITE_B_TEST_A); + + suiteTwoTestTwoListenerOnStartEventLog = getTestListenerStartEventLog(SUITE_B, SUITE_B_TEST_B); + suiteTwoTestTwoListenerOnFinishEventLog = + getTestListenerFinishEventLog(SUITE_B, SUITE_B_TEST_B); + + suiteThreeTestOneListenerOnStartEventLog = + getTestListenerStartEventLog(SUITE_C, SUITE_C_TEST_A); + suiteThreeTestOneListenerOnFinishEventLog = + getTestListenerFinishEventLog(SUITE_C, SUITE_C_TEST_A); + suiteThreeTestTwoListenerOnStartEventLog = + getTestListenerStartEventLog(SUITE_C, SUITE_C_TEST_B); + suiteThreeTestTwoListenerOnFinishEventLog = + getTestListenerFinishEventLog(SUITE_C, SUITE_C_TEST_B); + suiteThreeTestThreeListenerOnStartEventLog = + getTestListenerStartEventLog(SUITE_C, SUITE_C_TEST_C); + suiteThreeTestThreeListenerOnFinishEventLog = + getTestListenerFinishEventLog(SUITE_C, SUITE_C_TEST_C); + } + + // Verifies that the expected number of suite, test and test method level events were logged for + // each of the three + // suites. + @Test + public void sanityCheck() { + assertEquals( + suiteLevelEventLogs.size(), + 6, + "There should be 6 suite level events logged for " + + SUITE_A + + ", " + + SUITE_B + + " and " + + SUITE_C + + ": " + + suiteLevelEventLogs); + assertEquals( + testLevelEventLogs.size(), + 12, + "There should be 12 test level events logged for " + + SUITE_A + + ", " + + SUITE_B + + " and " + + SUITE_C + + ": " + + testLevelEventLogs); + + assertEquals( + testMethodLevelEventLogs.size(), + 420, + "There should 420 test method level events logged for " + + SUITE_A + + ", " + + SUITE_B + + " and " + + SUITE_C + + ": " + + testMethodLevelEventLogs); + + assertEquals( + suiteOneSuiteLevelEventLogs.size(), + 2, + "There should be 2 suite level events logged for " + + SUITE_A + + ": " + + suiteOneSuiteLevelEventLogs); + assertEquals( + suiteOneTestLevelEventLogs.size(), + 2, + "There should be 2 test level events logged for " + + SUITE_A + + ": " + + suiteOneTestLevelEventLogs); + + assertEquals( + suiteOneTestMethodLevelEventLogs.size(), + 69, + "There should be 69 test method level events " + + "logged for " + + SUITE_A + + ": " + + suiteOneTestMethodLevelEventLogs); + + assertEquals( + suiteTwoSuiteLevelEventLogs.size(), + 2, + "There should be 2 suite level events logged for " + + SUITE_B + + ": " + + suiteTwoSuiteLevelEventLogs); + assertEquals( + suiteTwoTestLevelEventLogs.size(), + 4, + "There should be 4 test level events logged for " + + SUITE_B + + ": " + + suiteTwoTestLevelEventLogs); + assertEquals( + suiteTwoTestMethodLevelEventLogs.size(), + 81, + "There should be 81 test method level events " + + "logged for " + + SUITE_B + + ": " + + suiteTwoTestMethodLevelEventLogs); + + assertEquals( + suiteThreeSuiteLevelEventLogs.size(), + 2, + "There should be 2 suite level events logged for " + + SUITE_C + + ": " + + suiteThreeSuiteLevelEventLogs); + assertEquals( + suiteThreeTestLevelEventLogs.size(), + 6, + "There should be 6 test level events logged for " + + SUITE_C + + ": " + + suiteThreeTestLevelEventLogs); + assertEquals( + suiteThreeTestMethodLevelEventLogs.size(), + 270, + "There should be 270 test method level events " + + "logged for " + + SUITE_C + + ": " + + suiteThreeTestMethodLevelEventLogs); + } + + // Verify that the suites run in parallel by checking that the suite and test level events for + // both suites have + // overlapping timestamps. Verify that there are two separate threads executing the suite-level + // and test-level + // events for each suite. + @Test + public void verifyThatSuitesRunInParallelThreads() { + verifyParallelSuitesWithUnequalExecutionTimes(suiteLevelEventLogs, THREAD_POOL_SIZE); + } + + @Test + public void verifyTestLevelEventsRunInSequentialOrderForIndividualSuites() { + verifySequentialTests( + suiteOneSuiteAndTestLevelEventLogs, + suiteOneTestLevelEventLogs, + suiteOneSuiteListenerOnStartEventLog, + suiteOneSuiteListenerOnFinishEventLog); + + verifySequentialTests( + suiteTwoSuiteAndTestLevelEventLogs, + suiteTwoTestLevelEventLogs, + suiteTwoSuiteListenerOnStartEventLog, + suiteTwoSuiteListenerOnFinishEventLog); + + verifySequentialTests( + suiteThreeSuiteAndTestLevelEventLogs, + suiteThreeTestLevelEventLogs, + suiteThreeSuiteListenerOnStartEventLog, + suiteThreeSuiteListenerOnFinishEventLog); + } + + // Verify that there is only a single test class instance associated with each of the test methods + // from the sample + // classes for every test in all the suites. + // Verify that the same test class instance is associated with each of the test methods from the + // sample test class + @Test + public void verifyOnlyOneInstanceOfTestClassForAllTestMethodsForAllSuites() { + + verifyNumberOfInstancesOfTestClassesForMethods( + SUITE_A, + SUITE_A_TEST_A, + Arrays.asList( + TestClassAFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class, + TestClassBSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class), + 1); + + verifySameInstancesOfTestClassesAssociatedWithMethods( + SUITE_A, + SUITE_A_TEST_A, + Arrays.asList( + TestClassAFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class, + TestClassBSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class)); + + verifyNumberOfInstancesOfTestClassForMethods( + SUITE_B, + SUITE_B_TEST_A, + TestClassCFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class, + 1); + + verifySameInstancesOfTestClassAssociatedWithMethods( + SUITE_B, + SUITE_B_TEST_A, + TestClassCFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class); + + verifyNumberOfInstancesOfTestClassesForMethods( + SUITE_B, + SUITE_B_TEST_B, + Arrays.asList( + TestClassDThreeMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class, + TestClassEFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class, + TestClassFSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class), + 1); + + verifySameInstancesOfTestClassesAssociatedWithMethods( + SUITE_B, + SUITE_B_TEST_B, + Arrays.asList( + TestClassDThreeMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class, + TestClassEFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class, + TestClassFSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class)); + + verifyNumberOfInstancesOfTestClassesForMethods( + SUITE_C, + SUITE_C_TEST_A, + Arrays.asList( + TestClassDThreeMethodsWithDataProviderOnAllMethodsAndNoDepsSample.class, + TestClassGFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class, + TestClassAFiveMethodsWithDataProviderOnAllMethodsAndNoDepsSample.class), + 1); + + verifySameInstancesOfTestClassesAssociatedWithMethods( + SUITE_C, + SUITE_C_TEST_A, + Arrays.asList( + TestClassDThreeMethodsWithDataProviderOnAllMethodsAndNoDepsSample.class, + TestClassGFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class, + TestClassAFiveMethodsWithDataProviderOnAllMethodsAndNoDepsSample.class)); + + verifyNumberOfInstancesOfTestClassesForMethods( + SUITE_C, + SUITE_C_TEST_B, + Arrays.asList( + TestClassBFourMethodsWithDataProviderOnAllMethodsAndNoDepsSample.class, + TestClassHFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class), + 1); + + verifySameInstancesOfTestClassesAssociatedWithMethods( + SUITE_C, + SUITE_C_TEST_B, + Arrays.asList( + TestClassBFourMethodsWithDataProviderOnAllMethodsAndNoDepsSample.class, + TestClassHFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class)); + + verifyNumberOfInstancesOfTestClassesForMethods( + SUITE_C, + SUITE_C_TEST_C, + Arrays.asList( + TestClassIThreeMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class, + TestClassJFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class, + TestClassKFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class, + TestClassBSixMethodsWithDataProviderOnAllMethodsAndNoDepsSample.class), + 1); + + verifySameInstancesOfTestClassesAssociatedWithMethods( + SUITE_C, + SUITE_C_TEST_C, + Arrays.asList( + TestClassIThreeMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class, + TestClassJFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class, + TestClassKFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class, + TestClassBSixMethodsWithDataProviderOnAllMethodsAndNoDepsSample.class)); + } + + // Verify that the test method listener's onTestStart method runs after the test listener's + // onStart method for + // all the test methods in all tests and suites. + @Test + public void + verifyTestLevelMethodLevelEventLogsOccurBetweenAfterTestListenerStartAndFinishEventLogs() { + verifyEventsOccurBetween( + suiteOneTestOneListenerOnStartEventLog, + suiteOneTestOneTestMethodLevelEventLogs, + suiteOneTestOneListenerOnFinishEventLog, + "All of the test method level event logs for " + + SUITE_A_TEST_A + + " should have timestamps between the test listener's onStart and onFinish " + + "event logs for " + + SUITE_A_TEST_A + + ". Test listener onStart event log: " + + suiteOneTestOneListenerOnStartEventLog + + ". Test listener onFinish event log: " + + suiteOneTestOneListenerOnFinishEventLog + + ". Test method level event logs: " + + suiteOneTestOneTestMethodLevelEventLogs); + + verifyEventsOccurBetween( + suiteTwoTestOneListenerOnStartEventLog, + suiteTwoTestOneTestMethodLevelEventLogs, + suiteTwoTestOneListenerOnFinishEventLog, + "All of the test method level event logs for " + + SUITE_B_TEST_A + + " should have timestamps between the test listener's onStart and onFinish " + + "event logs for " + + SUITE_B_TEST_A + + ". Test listener onStart event log: " + + suiteTwoTestOneListenerOnStartEventLog + + ". Test listener onFinish event log: " + + suiteTwoTestOneListenerOnFinishEventLog + + ". Test method level event logs: " + + suiteTwoTestOneTestMethodLevelEventLogs); + + verifyEventsOccurBetween( + suiteTwoTestTwoListenerOnStartEventLog, + suiteTwoTestTwoTestMethodLevelEventLogs, + suiteTwoTestTwoListenerOnFinishEventLog, + "All of the test method level event logs for " + + SUITE_B_TEST_B + + " should have timestamps between the test listener's onStart and onFinish " + + "event logs for " + + SUITE_B_TEST_B + + ". Test listener onStart event log: " + + suiteTwoTestTwoListenerOnStartEventLog + + ". Test listener onFinish event log: " + + suiteTwoTestTwoListenerOnFinishEventLog + + ". Test method level event logs: " + + suiteTwoTestTwoTestMethodLevelEventLogs); + + verifyEventsOccurBetween( + suiteThreeTestOneListenerOnStartEventLog, + suiteThreeTestOneTestMethodLevelEventLogs, + suiteThreeTestOneListenerOnFinishEventLog, + "All of the test method level event logs for " + + SUITE_C_TEST_A + + " should have timestamps between the test listener's onStart and onFinish " + + "event logs for " + + SUITE_C_TEST_A + + ". Test listener onStart event log: " + + suiteThreeTestOneListenerOnStartEventLog + + ". Test listener onFinish event log: " + + suiteThreeTestOneListenerOnFinishEventLog + + ". Test method level event logs: " + + suiteThreeTestOneTestMethodLevelEventLogs); + + verifyEventsOccurBetween( + suiteThreeTestTwoListenerOnStartEventLog, + suiteThreeTestTwoTestMethodLevelEventLogs, + suiteThreeTestTwoListenerOnFinishEventLog, + "All of the test method level event logs for " + + SUITE_C_TEST_B + + " should have timestamps between the test listener's onStart and onFinish " + + "event logs for " + + SUITE_C_TEST_B + + ". Test listener onStart event log: " + + suiteThreeTestTwoListenerOnStartEventLog + + ". Test listener onFinish event log: " + + suiteThreeTestTwoListenerOnFinishEventLog + + ". Test method level event logs: " + + suiteThreeTestTwoTestMethodLevelEventLogs); + + verifyEventsOccurBetween( + suiteThreeTestThreeListenerOnStartEventLog, + suiteThreeTestThreeTestMethodLevelEventLogs, + suiteThreeTestThreeListenerOnFinishEventLog, + "All of the test method level event logs for " + + SUITE_C_TEST_C + + " should have timestamps between the test listener's onStart and onFinish " + + "event logs for " + + SUITE_C_TEST_C + + ". Test listener onStart event log: " + + suiteThreeTestThreeListenerOnStartEventLog + + ". Test listener onFinish event log: " + + suiteThreeTestThreeListenerOnFinishEventLog + + ". Test method level event logs: " + + suiteThreeTestThreeTestMethodLevelEventLogs); + } + + @Test + public void verifyThatMethodLevelEventsRunInDifferentThreadsFromSuiteAndTestLevelEvents() { + + verifyEventThreadsSpawnedAfter( + getAllSuiteListenerStartEventLogs().get(0).getThreadId(), + testMethodLevelEventLogs, + "All the thread IDs for the test method level events should be greater " + + "than the thread ID for the suite and test level events. The expectation is that since the " + + "suite and test level events are running sequentially, and all the test methods are running " + + "in parallel, new threads will be spawned after the thread executing the suite and test " + + "level events when new methods begin executing. Suite and test level events thread ID: " + + getAllSuiteListenerStartEventLogs().get(0).getThreadId() + + ". Test method level event logs: " + + testMethodLevelEventLogs); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassAFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class, + SUITE_A, + SUITE_A_TEST_A); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassBSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class, + SUITE_A, + SUITE_A_TEST_A); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassCFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class, + SUITE_B, + SUITE_B_TEST_A); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassDThreeMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class, + SUITE_B, + SUITE_B_TEST_B); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassEFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class, + SUITE_B, + SUITE_B_TEST_B); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassFSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class, + SUITE_B, + SUITE_B_TEST_B); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassDThreeMethodsWithDataProviderOnAllMethodsAndNoDepsSample.class, + SUITE_C, + SUITE_C_TEST_A); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassGFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class, + SUITE_C, + SUITE_C_TEST_A); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassBFourMethodsWithDataProviderOnAllMethodsAndNoDepsSample.class, + SUITE_C, + SUITE_C_TEST_B); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassHFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class, + SUITE_C, + SUITE_C_TEST_B); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassIThreeMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class, + SUITE_C, + SUITE_C_TEST_C); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassJFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class, + SUITE_C, + SUITE_C_TEST_C); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassKFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.class, + SUITE_C, + SUITE_C_TEST_C); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassBSixMethodsWithDataProviderOnAllMethodsAndNoDepsSample.class, + SUITE_C, + SUITE_C_TEST_C); + } + + // Verifies that the test methods execute in different threads in parallel fashion. + @Test + public void verifyThatTestMethodsRunInParallelThreads() { + verifyParallelTestMethodsWithNonParallelDataProvider( + getTestMethodLevelEventLogsForTest(SUITE_A, SUITE_A_TEST_A), + SUITE_A_TEST_A, + expectedInvocationCounts, + 11, + 3); + + verifyParallelTestMethodsWithNonParallelDataProvider( + getTestMethodLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_A), + SUITE_B_TEST_A, + expectedInvocationCounts, + 5, + 6); + + verifyParallelTestMethodsWithNonParallelDataProvider( + getTestMethodLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_B), + SUITE_B_TEST_B, + expectedInvocationCounts, + 13, + 20); + + verifyParallelTestMethodsWithNonParallelDataProvider( + getTestMethodLevelEventLogsForTest(SUITE_C, SUITE_C_TEST_A), + SUITE_C_TEST_A, + expectedInvocationCounts, + 12, + 10); + + verifyParallelTestMethodsWithNonParallelDataProvider( + getTestMethodLevelEventLogsForTest(SUITE_C, SUITE_C_TEST_B), + SUITE_C_TEST_B, + expectedInvocationCounts, + 9, + 5); + + verifyParallelTestMethodsWithNonParallelDataProvider( + getTestMethodLevelEventLogsForTest(SUITE_C, SUITE_C_TEST_C), + SUITE_C_TEST_C, + expectedInvocationCounts, + 18, + 12); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase5Scenario1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase5Scenario1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase5Scenario1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase5Scenario1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,221 @@ +package test.thread.parallelization; + +import static org.testng.Assert.assertEquals; +import static test.thread.parallelization.TestNgRunStateTracker.getAllSuiteAndTestLevelEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getAllSuiteLevelEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getAllTestLevelEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getAllTestMethodLevelEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getSuiteListenerFinishEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getSuiteListenerStartEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getTestListenerFinishEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getTestListenerStartEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getTestListenerStartThreadId; +import static test.thread.parallelization.TestNgRunStateTracker.reset; + +import java.util.List; +import org.testng.ITestNGListener; +import org.testng.TestNG; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import org.testng.log4testng.Logger; +import org.testng.xml.XmlSuite; +import test.thread.parallelization.TestNgRunStateTracker.EventLog; +import test.thread.parallelization.sample.FactoryForTestClassAFiveMethodsWithNoDepsTwoInstancesSample; +import test.thread.parallelization.sample.TestClassAFiveMethodsWithNoDepsSample; + +/** + * This class covers PTP_TC_5, Scenario 1 in the Parallelization Test Plan. + * + *

Test Case Summary: Parallel by methods mode with sequential test suites using a factory but no + * dependencies and no data providers. + * + *

Scenario Description: Single suite with a single test consisting of a factory that provides + * two instances of a single test class with five methods + * + *

1) Thread count and parallel mode are specified at the suite level 2) The thread count is + * equal to the number of test methods times 2, the number of times each method will be invoked + * because there are two instances of the test class. Expectation is that 10 threads will be spawned + * because each method will run once for each of the two instances and that each instance of a test + * method will run in separate threads. 3) There are NO configuration methods 4) All test methods + * pass 5) ordering is specified 6) group-by-instances is NOT set 7) There are no method exclusions + */ +public class ParallelByMethodsTestCase5Scenario1 extends BaseParallelizationTest { + private static final Logger log = Logger.getLogger(ParallelByMethodsTestCase5Scenario1.class); + + private static final String SUITE = "SingleTestSuite"; + private static final String TEST = "SingleTestClassTest"; + + private List suiteLevelEventLogs; + private List testLevelEventLogs; + private List suiteAndTestLevelEventLogs; + private List testMethodLevelEventLogs; + + private EventLog suiteListenerOnStartEventLog; + private EventLog suiteListenerOnFinishEventLog; + + private EventLog testListenerOnStartEventLog; + private EventLog testListenerOnFinishEventLog; + + private Long testListenerOnStartThreadId; + + @BeforeClass + public void setUp() { + reset(); + + XmlSuite suite = createXmlSuite(SUITE); + suite.setParallel(XmlSuite.ParallelMode.METHODS); + suite.setThreadCount(15); + + createXmlTest(suite, TEST, FactoryForTestClassAFiveMethodsWithNoDepsTwoInstancesSample.class); + + addParams(suite, SUITE, TEST, "100"); + + TestNG tng = create(suite); + + tng.addListener((ITestNGListener) new TestNgRunStateListener()); + + log.debug( + "Beginning ParallelByMethodsTestCase5Scenario1. This test scenario consists of a " + + "single suite with a single test consisting of a factory that provides two instances of a single" + + "test class with five methods. There are no dependencies or data providers."); + + log.debug( + "Suite: " + + SUITE + + ", Test: " + + TEST + + ", Test class: " + + TestClassAFiveMethodsWithNoDepsSample.class.getCanonicalName() + + ". Thread count: 15"); + + tng.run(); + + suiteLevelEventLogs = getAllSuiteLevelEventLogs(); + testLevelEventLogs = getAllTestLevelEventLogs(); + suiteAndTestLevelEventLogs = getAllSuiteAndTestLevelEventLogs(); + testMethodLevelEventLogs = getAllTestMethodLevelEventLogs(); + + suiteListenerOnStartEventLog = getSuiteListenerStartEventLog(SUITE); + suiteListenerOnFinishEventLog = getSuiteListenerFinishEventLog(SUITE); + + testListenerOnStartEventLog = getTestListenerStartEventLog(SUITE, TEST); + testListenerOnFinishEventLog = getTestListenerFinishEventLog(SUITE, TEST); + + testListenerOnStartThreadId = getTestListenerStartThreadId(SUITE, TEST); + } + + // Verifies that the expected number of suite, test and test method level events were logged. + @Test + public void sanityCheck() { + assertEquals( + suiteLevelEventLogs.size(), + 2, + "There should be 2 suite level events logged for " + SUITE + ": " + suiteLevelEventLogs); + assertEquals( + testLevelEventLogs.size(), + 2, + "There should be 2 test level events logged for " + SUITE + ": " + testLevelEventLogs); + assertEquals( + testMethodLevelEventLogs.size(), + 30, + "There should be 15 test method level event logged for " + + SUITE + + ": " + + testMethodLevelEventLogs); + } + + // Verify that the suite listener and test listener events have timestamps in the following order: + // suite start, + // test start, test finish, suite finish. Verify that all of these events run in the same thread + // because the + // parallelization mode is by methods only. + @Test + public void verifySuiteAndTestLevelEventsRunInSequentialOrderInSameThread() { + verifySameThreadIdForAllEvents( + suiteAndTestLevelEventLogs, + "The thread ID for all the suite and test level " + + "event logs should be the same because there is no parallelism specified at the suite or test level: " + + suiteAndTestLevelEventLogs); + verifySequentialTimingOfEvents( + suiteAndTestLevelEventLogs, + "The timestamps of suite and test level events " + + "logged first should be earlier than those which are logged afterwards because there is no " + + "parallelism specified at the suite or test level: " + + suiteAndTestLevelEventLogs); + verifyEventsOccurBetween( + suiteListenerOnStartEventLog, + testLevelEventLogs, + suiteListenerOnFinishEventLog, + "All of the test level event logs should have timestamps between the suite listener's onStart and " + + "onFinish event logs. Suite listener onStart event log: " + + suiteListenerOnStartEventLog + + ". Suite listener onFinish event log: " + + suiteListenerOnFinishEventLog + + ". Test level " + + "event logs: " + + testLevelEventLogs); + } + + // Verify that there are two test class instances associated with each of the test methods from + // the sample test class + // Verify that the same test class instances are associated with each of the test methods from the + // sample test class + @Test + public void verifyTwoInstancesOfTestClassForAllTestMethods() { + verifyNumberOfInstancesOfTestClassForMethods( + SUITE, TEST, TestClassAFiveMethodsWithNoDepsSample.class, 2); + verifySameInstancesOfTestClassAssociatedWithMethods( + SUITE, TEST, TestClassAFiveMethodsWithNoDepsSample.class); + } + + // Verifies that all the test method level events execute between the test listener onStart and + // onFinish methods + @Test + public void verifyTestMethodLevelEventsAllOccurBetweenTestListenerStartAndFinish() { + verifyEventsOccurBetween( + testListenerOnStartEventLog, + testMethodLevelEventLogs, + testListenerOnFinishEventLog, + "All of the test method level event logs should have timestamps between the test listener's onStart " + + "and onFinish event logs. Test Listener onStart event log: " + + testListenerOnStartEventLog + + ". Test Listener onFinish event log: " + + testListenerOnFinishEventLog + + ". Test method level " + + "event logs: " + + testMethodLevelEventLogs); + } + + // Verifies that the method level events all run in different threads from the test and suite + // level events. + @Test + public void verifyThatMethodLevelEventsRunInDifferentThreadsFromSuiteAndTestLevelEvents() { + verifyEventThreadsSpawnedAfter( + testListenerOnStartThreadId, + testMethodLevelEventLogs, + "All the thread IDs " + + "for the test method level events should be greater than the thread ID for the suite and test level " + + "events. The expectation is that since the suite and test level events are running sequentially, and " + + "all the test methods are running in parallel, new threads will be spawned after the thread " + + "executing the suite and test level events when new methods begin executing. Suite and test level " + + "events thread ID: " + + testListenerOnStartThreadId + + ". Test method level event logs: " + + testMethodLevelEventLogs); + } + + // Verifies that the test methods execute in different threads in parallel fashion. + @Test + public void verifyThatTestMethodsRunInParallelThreads() { + verifySimultaneousTestMethods(testMethodLevelEventLogs, TEST, 10); + } + + // Verifies that all the test method level events for any given test method occur twice and that + // there are two + // thread IDs because there are two instances of the test class that run. + @Test + public void verifyThatAllEventsForATestMethodInClassInstanceExecuteInSameThread() { + verifyEventsForTestMethodsRunInTheSameThread( + TestClassAFiveMethodsWithNoDepsSample.class, SUITE, TEST); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase5Scenario2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase5Scenario2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase5Scenario2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase5Scenario2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,498 @@ +package test.thread.parallelization; + +import static org.testng.Assert.assertEquals; +import static test.thread.parallelization.TestNgRunStateTracker.getAllEventLogsForSuite; +import static test.thread.parallelization.TestNgRunStateTracker.getAllSuiteLevelEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getAllSuiteListenerStartEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getAllTestLevelEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getAllTestMethodLevelEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getSuiteAndTestLevelEventLogsForSuite; +import static test.thread.parallelization.TestNgRunStateTracker.getSuiteLevelEventLogsForSuite; +import static test.thread.parallelization.TestNgRunStateTracker.getSuiteListenerFinishEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getSuiteListenerStartEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getTestLevelEventLogsForSuite; +import static test.thread.parallelization.TestNgRunStateTracker.getTestLevelEventLogsForTest; +import static test.thread.parallelization.TestNgRunStateTracker.getTestListenerFinishEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getTestListenerStartEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getTestMethodLevelEventLogsForSuite; +import static test.thread.parallelization.TestNgRunStateTracker.getTestMethodLevelEventLogsForTest; +import static test.thread.parallelization.TestNgRunStateTracker.reset; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.testng.ITestNGListener; +import org.testng.TestNG; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import org.testng.log4testng.Logger; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.thread.parallelization.sample.FactoryForTestClassAFiveMethodsWithNoDepsTwoInstancesSample; +import test.thread.parallelization.sample.FactoryForTestClassBFourMethodsWithNoDepsFiveInstancesSample; +import test.thread.parallelization.sample.FactoryForTestClassCSixMethodsWithNoDepsThreeInstancesSample; +import test.thread.parallelization.sample.FactoryForTestClassDThreeMethodsWithNoDepsFourInstancesSample; +import test.thread.parallelization.sample.FactoryForTestClassFSixMethodsWithNoDepsSixInstancesSample; +import test.thread.parallelization.sample.TestClassAFiveMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassBFourMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassCSixMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassDThreeMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassEFiveMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassFSixMethodsWithNoDepsSample; + +/** + * This class covers PTP_TC_5, Scenario 2 in the Parallelization Test Plan. + * + *

Test Case Summary: Parallel by methods mode with sequential test suites using a factory but no + * dependencies and no data providers. + * + *

Scenario Description: Two suites with 1 and 2 tests respectively. One suite with two tests has + * a test consisting of a single test class without a factory while the other consists of factories + * which provide multiple instances of multiple test classes. One suite shall consist of a single + * test with multiple test classes which uses factories. + * + *

1) For both suites, the thread count and parallel mode are specified at the suite level 2) The + * thread count is less than the number of test methods for all tests in both suites, so methods + * will have to wait for the active thread count to drop below the maximum thread count before they + * can begin execution. The expectation is that threads will be spawned for each test method that + * executes just as they would if there were no factories and test suites simply used the default + * mechanism for instantiating single instances of the test classes. 3) There are NO configuration + * methods 4) All test methods pass 5) NO ordering is specified 6) group-by-instances is NOT set 7) + * There are no method exclusions + */ +public class ParallelByMethodsTestCase5Scenario2 extends BaseParallelizationTest { + private static final Logger log = Logger.getLogger(ParallelByMethodsTestCase5Scenario2.class); + + private static final String SUITE_A = "TestSuiteA"; + private static final String SUITE_B = "TestSuiteB"; + + private static final String SUITE_A_TEST_A = "TestSuiteA-TwoTestClassTest"; + + private static final String SUITE_B_TEST_A = "TestSuiteB-SingleTestClassTest"; + private static final String SUITE_B_TEST_B = "TestSuiteB-ThreeTestClassTest"; + + private Map> suiteEventLogsMap = new HashMap<>(); + private Map> testEventLogsMap = new HashMap<>(); + + private List suiteLevelEventLogs; + private List testLevelEventLogs; + private List testMethodLevelEventLogs; + + private List suiteOneSuiteAndTestLevelEventLogs; + private List suiteOneSuiteLevelEventLogs; + private List suiteOneTestLevelEventLogs; + private List suiteOneTestMethodLevelEventLogs; + + private List suiteTwoSuiteAndTestLevelEventLogs; + private List suiteTwoSuiteLevelEventLogs; + private List suiteTwoTestLevelEventLogs; + private List suiteTwoTestMethodLevelEventLogs; + + private List suiteOneTestOneTestMethodLevelEventLogs; + + private List suiteTwoTestOneTestMethodLevelEventLogs; + private List suiteTwoTestTwoTestMethodLevelEventLogs; + + private TestNgRunStateTracker.EventLog suiteOneSuiteListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteOneSuiteListenerOnFinishEventLog; + + private TestNgRunStateTracker.EventLog suiteTwoSuiteListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteTwoSuiteListenerOnFinishEventLog; + + private TestNgRunStateTracker.EventLog suiteOneTestOneListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteOneTestOneListenerOnFinishEventLog; + + private TestNgRunStateTracker.EventLog suiteTwoTestOneListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteTwoTestOneListenerOnFinishEventLog; + private TestNgRunStateTracker.EventLog suiteTwoTestTwoListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteTwoTestTwoListenerOnFinishEventLog; + + @BeforeClass + public void setUp() { + reset(); + + XmlSuite suiteOne = createXmlSuite(SUITE_A); + XmlSuite suiteTwo = createXmlSuite(SUITE_B); + + suiteOne.setParallel(XmlSuite.ParallelMode.METHODS); + suiteOne.setThreadCount(10); + + createXmlTest( + suiteOne, + SUITE_A_TEST_A, + FactoryForTestClassAFiveMethodsWithNoDepsTwoInstancesSample.class, + FactoryForTestClassCSixMethodsWithNoDepsThreeInstancesSample.class); + createXmlTest(suiteTwo, SUITE_B_TEST_A, TestClassEFiveMethodsWithNoDepsSample.class); + createXmlTest( + suiteTwo, + SUITE_B_TEST_B, + FactoryForTestClassDThreeMethodsWithNoDepsFourInstancesSample.class, + FactoryForTestClassBFourMethodsWithNoDepsFiveInstancesSample.class, + FactoryForTestClassFSixMethodsWithNoDepsSixInstancesSample.class); + + suiteTwo.setParallel(XmlSuite.ParallelMode.METHODS); + + for (XmlTest test : suiteTwo.getTests()) { + if (test.getName().equals(SUITE_B_TEST_A)) { + test.setThreadCount(3); + } else { + test.setThreadCount(20); + } + } + + addParams(suiteOne, SUITE_A, SUITE_A_TEST_A, "100"); + + addParams(suiteTwo, SUITE_B, SUITE_B_TEST_A, "100"); + addParams(suiteTwo, SUITE_B, SUITE_B_TEST_B, "100"); + + TestNG tng = create(suiteOne, suiteTwo); + tng.addListener((ITestNGListener) new TestNgRunStateListener()); + + log.debug( + "Beginning ParallelByMethodsTestCase5Scenario2. This test scenario consists of two " + + "suites with 1 and 2 tests respectively. One suite with two tests has a test consisting of a single " + + "test class without a factory while the other consists of factories which provide multiple instances " + + "of multiple test classes. One suite shall consist of a single test with multiple test classes which " + + "uses factories. There are no dependencies or data providers."); + + log.debug( + "Suite: " + + SUITE_A + + ", Test: " + + SUITE_A_TEST_A + + ", Test classes: " + + TestClassAFiveMethodsWithNoDepsSample.class.getCanonicalName() + + ", " + + TestClassCSixMethodsWithNoDepsSample.class.getCanonicalName() + + ". Thread count: 10"); + + log.debug( + "Suite: " + + SUITE_B + + ", Test: " + + SUITE_B_TEST_A + + ", Test class: " + + TestClassEFiveMethodsWithNoDepsSample.class.getCanonicalName() + + ". Thread count: 3"); + + log.debug( + "Suite " + + SUITE_B + + ", Test: " + + SUITE_B_TEST_B + + ", Test classes: " + + TestClassDThreeMethodsWithNoDepsSample.class + + ", " + + TestClassBFourMethodsWithNoDepsSample.class + + ", " + + TestClassFSixMethodsWithNoDepsSample.class + + ". Thread count: 20"); + + tng.run(); + + suiteLevelEventLogs = getAllSuiteLevelEventLogs(); + testLevelEventLogs = getAllTestLevelEventLogs(); + testMethodLevelEventLogs = getAllTestMethodLevelEventLogs(); + + suiteOneSuiteAndTestLevelEventLogs = getSuiteAndTestLevelEventLogsForSuite(SUITE_A); + suiteOneSuiteLevelEventLogs = getSuiteLevelEventLogsForSuite(SUITE_A); + suiteOneTestLevelEventLogs = getTestLevelEventLogsForSuite(SUITE_A); + + suiteTwoSuiteAndTestLevelEventLogs = getSuiteAndTestLevelEventLogsForSuite(SUITE_B); + suiteTwoSuiteLevelEventLogs = getSuiteLevelEventLogsForSuite(SUITE_B); + suiteTwoTestLevelEventLogs = getTestLevelEventLogsForSuite(SUITE_B); + + suiteEventLogsMap.put(SUITE_A, getAllEventLogsForSuite(SUITE_A)); + suiteEventLogsMap.put(SUITE_B, getAllEventLogsForSuite(SUITE_B)); + + suiteOneTestMethodLevelEventLogs = getTestMethodLevelEventLogsForSuite(SUITE_A); + suiteTwoTestMethodLevelEventLogs = getTestMethodLevelEventLogsForSuite(SUITE_B); + + suiteOneTestOneTestMethodLevelEventLogs = + getTestMethodLevelEventLogsForTest(SUITE_A, SUITE_A_TEST_A); + + suiteTwoTestOneTestMethodLevelEventLogs = + getTestMethodLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_A); + suiteTwoTestTwoTestMethodLevelEventLogs = + getTestMethodLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_B); + + testEventLogsMap.put(SUITE_B_TEST_A, getTestLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_A)); + testEventLogsMap.put(SUITE_B_TEST_B, getTestLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_B)); + + suiteOneSuiteListenerOnStartEventLog = getSuiteListenerStartEventLog(SUITE_A); + suiteOneSuiteListenerOnFinishEventLog = getSuiteListenerFinishEventLog(SUITE_A); + + suiteTwoSuiteListenerOnStartEventLog = getSuiteListenerStartEventLog(SUITE_B); + suiteTwoSuiteListenerOnFinishEventLog = getSuiteListenerFinishEventLog(SUITE_B); + + suiteOneTestOneListenerOnStartEventLog = getTestListenerStartEventLog(SUITE_A, SUITE_A_TEST_A); + suiteOneTestOneListenerOnFinishEventLog = + getTestListenerFinishEventLog(SUITE_A, SUITE_A_TEST_A); + + suiteTwoTestOneListenerOnStartEventLog = getTestListenerStartEventLog(SUITE_B, SUITE_B_TEST_A); + suiteTwoTestOneListenerOnFinishEventLog = + getTestListenerFinishEventLog(SUITE_B, SUITE_B_TEST_A); + + suiteTwoTestTwoListenerOnStartEventLog = getTestListenerStartEventLog(SUITE_B, SUITE_B_TEST_B); + suiteTwoTestTwoListenerOnFinishEventLog = + getTestListenerFinishEventLog(SUITE_B, SUITE_B_TEST_B); + } + + // Verifies that the expected number of suite, test and test method level events were logged for + // each of the three + // suites. + @Test + public void sanityCheck() { + assertEquals( + suiteLevelEventLogs.size(), + 4, + "There should be 4 suite level events logged for " + + SUITE_A + + " and " + + SUITE_B + + ": " + + suiteLevelEventLogs); + assertEquals( + testLevelEventLogs.size(), + 6, + "There should be 6 test level events logged for " + + SUITE_A + + " and " + + SUITE_B + + ": " + + testLevelEventLogs); + + assertEquals( + testMethodLevelEventLogs.size(), + 303, + "There should 303 test method level events logged for " + + SUITE_A + + " and " + + SUITE_B + + ": " + + testMethodLevelEventLogs); + + assertEquals( + suiteOneSuiteLevelEventLogs.size(), + 2, + "There should be 2 suite level events logged for " + + SUITE_A + + ": " + + suiteOneSuiteLevelEventLogs); + assertEquals( + suiteOneTestLevelEventLogs.size(), + 2, + "There should be 2 test level events logged for " + + SUITE_A + + ": " + + suiteOneTestLevelEventLogs); + assertEquals( + suiteOneTestMethodLevelEventLogs.size(), + 84, + "There should be 84 test method level events " + + "logged for " + + SUITE_A + + ": " + + suiteOneTestMethodLevelEventLogs); + + assertEquals( + suiteTwoSuiteLevelEventLogs.size(), + 2, + "There should be 2 suite level events logged for " + + SUITE_B + + ": " + + suiteTwoSuiteLevelEventLogs); + assertEquals( + suiteTwoTestLevelEventLogs.size(), + 4, + "There should be 4 test level events logged for " + + SUITE_B + + ": " + + suiteTwoTestLevelEventLogs); + assertEquals( + suiteTwoTestMethodLevelEventLogs.size(), + 219, + "There should be 219 test method level events " + + "logged for " + + SUITE_B + + ": " + + suiteTwoTestMethodLevelEventLogs); + } + + // Verify that all the events in the second suite run have timestamps later than the suite + // listener's onFinish event + // for the first suite run. + // Verify that all suite level events run in the same thread + @Test + public void verifySuitesRunSequentiallyInSameThread() { + verifySequentialSuites(suiteLevelEventLogs, suiteEventLogsMap); + } + + // For all suites, verify that the test level events run sequentially because the parallel mode is + // by methods only. + @Test + public void verifySuiteAndTestLevelEventsRunInSequentialOrderForIndividualSuites() { + + verifySequentialTests( + suiteOneSuiteAndTestLevelEventLogs, + suiteOneTestLevelEventLogs, + suiteOneSuiteListenerOnStartEventLog, + suiteOneSuiteListenerOnFinishEventLog); + + verifySequentialTests( + suiteTwoSuiteAndTestLevelEventLogs, + suiteTwoTestLevelEventLogs, + suiteTwoSuiteListenerOnStartEventLog, + suiteTwoSuiteListenerOnFinishEventLog); + } + + // Verify the expected number of test class instances for the test method events. + // Verify that the same test class instances are associated with each of the test methods from the + // sample test class + @Test + public void verifyNumberOfInstanceOfTestClassForAllTestMethodsForAllSuites() { + + verifyNumberOfInstancesOfTestClassesForMethods( + SUITE_A, + SUITE_A_TEST_A, + Arrays.asList( + TestClassAFiveMethodsWithNoDepsSample.class, + TestClassCSixMethodsWithNoDepsSample.class), + 2, + 3); + + verifySameInstancesOfTestClassesAssociatedWithMethods( + SUITE_A, + SUITE_A_TEST_A, + Arrays.asList( + TestClassAFiveMethodsWithNoDepsSample.class, + TestClassCSixMethodsWithNoDepsSample.class)); + + verifyNumberOfInstancesOfTestClassForMethods( + SUITE_B, SUITE_B_TEST_A, TestClassEFiveMethodsWithNoDepsSample.class, 1); + + verifySameInstancesOfTestClassAssociatedWithMethods( + SUITE_B, SUITE_B_TEST_A, TestClassEFiveMethodsWithNoDepsSample.class); + + verifyNumberOfInstancesOfTestClassesForMethods( + SUITE_B, + SUITE_B_TEST_B, + Arrays.asList( + TestClassDThreeMethodsWithNoDepsSample.class, + TestClassBFourMethodsWithNoDepsSample.class, + TestClassFSixMethodsWithNoDepsSample.class), + 4, + 5, + 6); + + verifySameInstancesOfTestClassesAssociatedWithMethods( + SUITE_B, + SUITE_B_TEST_B, + Arrays.asList( + TestClassDThreeMethodsWithNoDepsSample.class, + TestClassBFourMethodsWithNoDepsSample.class, + TestClassFSixMethodsWithNoDepsSample.class)); + } + + // Verify that the test method listener's onTestStart method runs after the test listener's + // onStart method for + // all the test methods in all tests and suites. + @Test + public void + verifyTestLevelMethodLevelEventLogsOccurBetweenAfterTestListenerStartAndFinishEventLogs() { + verifyEventsOccurBetween( + suiteOneTestOneListenerOnStartEventLog, + suiteOneTestOneTestMethodLevelEventLogs, + suiteOneTestOneListenerOnFinishEventLog, + "All of the test method level event logs for " + + SUITE_A_TEST_A + + " should have timestamps between the test listener's onStart and onFinish " + + "event logs for " + + SUITE_A_TEST_A + + ". Test listener onStart event log: " + + suiteOneTestOneListenerOnStartEventLog + + ". Test listener onFinish event log: " + + suiteOneTestOneListenerOnFinishEventLog + + ". Test method level event logs: " + + suiteOneTestOneTestMethodLevelEventLogs); + + verifyEventsOccurBetween( + suiteTwoTestOneListenerOnStartEventLog, + suiteTwoTestOneTestMethodLevelEventLogs, + suiteTwoTestOneListenerOnFinishEventLog, + "All of the test method level event logs for " + + SUITE_B_TEST_A + + " should have timestamps between the test listener's onStart and onFinish " + + "event logs for " + + SUITE_B_TEST_A + + ". Test listener onStart event log: " + + suiteTwoTestOneListenerOnStartEventLog + + ". Test listener onFinish event log: " + + suiteTwoTestOneListenerOnFinishEventLog + + ". Test method level event logs: " + + suiteTwoTestOneTestMethodLevelEventLogs); + + verifyEventsOccurBetween( + suiteTwoTestTwoListenerOnStartEventLog, + suiteTwoTestTwoTestMethodLevelEventLogs, + suiteTwoTestTwoListenerOnFinishEventLog, + "All of the test method level event logs for " + + SUITE_B_TEST_B + + " should have timestamps between the test listener's onStart and onFinish " + + "event logs for " + + SUITE_B_TEST_B + + ". Test listener onStart event log: " + + suiteTwoTestTwoListenerOnStartEventLog + + ". Test listener onFinish event log: " + + suiteTwoTestTwoListenerOnFinishEventLog + + ". Test method level event logs: " + + suiteTwoTestTwoTestMethodLevelEventLogs); + } + + // Verifies that the method level events all run in different threads from the test and suite + // level events. + // Verifies that the test method listener and execution events for a given test method all run in + // the same thread. + @Test + public void verifyThatMethodLevelEventsRunInDifferentThreadsFromSuiteAndTestLevelEvents() { + + verifyEventThreadsSpawnedAfter( + getAllSuiteListenerStartEventLogs().get(0).getThreadId(), + testMethodLevelEventLogs, + "All the thread IDs for the test method level events should be greater than the thread ID for the " + + "suite and test level events. The expectation is that since the suite and test level events " + + "are running sequentially, and all the test methods are running in parallel, new threads " + + "will be spawned after the thread executing the suite and test level events when new methods " + + "begin executing. Suite and test level events thread ID: " + + getAllSuiteListenerStartEventLogs().get(0).getThreadId() + + ". Test method level event logs: " + + testMethodLevelEventLogs); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassAFiveMethodsWithNoDepsSample.class, SUITE_A, SUITE_A_TEST_A); + verifyEventsForTestMethodsRunInTheSameThread( + TestClassCSixMethodsWithNoDepsSample.class, SUITE_A, SUITE_A_TEST_A); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassEFiveMethodsWithNoDepsSample.class, SUITE_B, SUITE_B_TEST_A); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassDThreeMethodsWithNoDepsSample.class, SUITE_B, SUITE_B_TEST_B); + verifyEventsForTestMethodsRunInTheSameThread( + TestClassBFourMethodsWithNoDepsSample.class, SUITE_B, SUITE_B_TEST_B); + verifyEventsForTestMethodsRunInTheSameThread( + TestClassFSixMethodsWithNoDepsSample.class, SUITE_B, SUITE_B_TEST_B); + } + + // Verify that the methods are run in separate threads. + @Test + public void verifyThatTestMethodsRunInParallelThreads() { + verifySimultaneousTestMethods( + getTestMethodLevelEventLogsForTest(SUITE_A, SUITE_A_TEST_A), SUITE_A_TEST_A, 10); + verifySimultaneousTestMethods( + getTestMethodLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_A), SUITE_B_TEST_A, 3); + verifySimultaneousTestMethods( + getTestMethodLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_B), SUITE_B_TEST_B, 20); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase6Scenario1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase6Scenario1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase6Scenario1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase6Scenario1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,814 @@ +package test.thread.parallelization; + +import static org.testng.Assert.assertEquals; +import static test.thread.parallelization.TestNgRunStateTracker.getAllSuiteLevelEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getAllSuiteListenerStartEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getAllTestLevelEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getAllTestMethodLevelEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getSuiteAndTestLevelEventLogsForSuite; +import static test.thread.parallelization.TestNgRunStateTracker.getSuiteLevelEventLogsForSuite; +import static test.thread.parallelization.TestNgRunStateTracker.getSuiteListenerFinishEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getSuiteListenerStartEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getTestLevelEventLogsForSuite; +import static test.thread.parallelization.TestNgRunStateTracker.getTestLevelEventLogsForTest; +import static test.thread.parallelization.TestNgRunStateTracker.getTestListenerFinishEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getTestListenerStartEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getTestMethodLevelEventLogsForSuite; +import static test.thread.parallelization.TestNgRunStateTracker.getTestMethodLevelEventLogsForTest; +import static test.thread.parallelization.TestNgRunStateTracker.reset; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.testng.ITestNGListener; +import org.testng.TestNG; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import org.testng.log4testng.Logger; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.thread.parallelization.sample.FactoryForTestClassAFiveMethodsWithNoDepsTwoInstancesSample; +import test.thread.parallelization.sample.FactoryForTestClassBFourMethodsWithNoDepsFiveInstancesSample; +import test.thread.parallelization.sample.FactoryForTestClassCSixMethodsWithNoDepsThreeInstancesSample; +import test.thread.parallelization.sample.FactoryForTestClassDThreeMethodsWithNoDepsFourInstancesSample; +import test.thread.parallelization.sample.FactoryForTestClassFSixMethodsWithNoDepsSixInstancesSample; +import test.thread.parallelization.sample.TestClassAFiveMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassBFourMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassCSixMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassDThreeMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassEFiveMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassFSixMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassGThreeMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassHFourMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassIFiveMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassJFourMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassKFiveMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassLThreeMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassMFourMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassNFiveMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassOSixMethodsWithNoDepsSample; + +/** + * This class covers PTP_TC_6, Scenario 1 in the Parallelization Test Plan. + * + *

Test Case Summary: Parallel by methods mode with parallel test suites using factories but no + * dependencies and no data providers. + * + *

Scenario Description: Three suites with 1, 2 and 3 tests respectively. One suite with two + * tests has a test consisting of a single test class without a factory while the other shall + * consist of factories which provide multiple instances of multiple test classes. One suite shall + * consist of a single test with multiple test classes which uses factories. One suite shall have + * multiple tests with multiple classes, none of which use a factory. + * + *

1) The suite thread pool is 2, so one suite will have to wait for one of the others to + * complete execution before it can begin execution 2) For one of the suites, the thread count and + * parallel mode are specified at the suite level 3) For one of the suites, the thread count and + * parallel mode are specified at the test level 4) For one of the suites, the parallel mode is + * specified at the suite level, and the thread counts are specified at the test level (thread + * counts for each test differ) 5) The thread count is less than the number of test methods for the + * tests in two of the suites, so some methods will have to wait for the active thread count to drop + * below the maximum thread count before they can begin execution. 6) The thread count is more than + * the number of test methods for the tests in one of the suites, ensuring that none of the methods + * in that suite should have to wait for any other method to complete execution 7) The expectation + * is that threads will be spawned for each test method that executes just as they would if there + * were no factories and test suites simply used the default mechanism for instantiating single + * instances of the test classes. 8) There are NO configuration methods 9) All test methods pass 10) + * NO ordering is specified 11) group-by-instances is NOT set 12) There are no method exclusions + */ +public class ParallelByMethodsTestCase6Scenario1 extends BaseParallelizationTest { + private static final Logger log = Logger.getLogger(ParallelByMethodsTestCase6Scenario1.class); + + private static final String SUITE_A = "TestSuiteA"; + private static final String SUITE_B = "TestSuiteB"; + private static final String SUITE_C = "TestSuiteC"; + + private static final String SUITE_A_TEST_A = "TestSuiteA-TwoTestClassTest"; + + private static final String SUITE_B_TEST_A = "TestSuiteB-SingleTestClassTest"; + private static final String SUITE_B_TEST_B = "TestSuiteB-ThreeTestClassTest"; + + private static final String SUITE_C_TEST_A = "TestSuiteC-ThreeTestClassTest"; + private static final String SUITE_C_TEST_B = "TestSuiteC-TwoTestClassTest"; + private static final String SUITE_C_TEST_C = "TestSuiteC-FourTestClassTest"; + + private static final int THREAD_POOL_SIZE = 2; + + private Map> testEventLogsMap = new HashMap<>(); + + private List suiteLevelEventLogs; + private List testLevelEventLogs; + private List testMethodLevelEventLogs; + + private List suiteOneSuiteAndTestLevelEventLogs; + private List suiteOneSuiteLevelEventLogs; + private List suiteOneTestLevelEventLogs; + private List suiteOneTestMethodLevelEventLogs; + + private List suiteTwoSuiteAndTestLevelEventLogs; + private List suiteTwoSuiteLevelEventLogs; + private List suiteTwoTestLevelEventLogs; + private List suiteTwoTestMethodLevelEventLogs; + + private List suiteThreeSuiteAndTestLevelEventLogs; + private List suiteThreeSuiteLevelEventLogs; + private List suiteThreeTestLevelEventLogs; + private List suiteThreeTestMethodLevelEventLogs; + + private List suiteOneTestOneTestMethodLevelEventLogs; + + private List suiteTwoTestOneTestMethodLevelEventLogs; + private List suiteTwoTestTwoTestMethodLevelEventLogs; + + private List suiteThreeTestOneTestMethodLevelEventLogs; + private List suiteThreeTestTwoTestMethodLevelEventLogs; + private List suiteThreeTestThreeTestMethodLevelEventLogs; + + private TestNgRunStateTracker.EventLog suiteOneSuiteListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteOneSuiteListenerOnFinishEventLog; + + private TestNgRunStateTracker.EventLog suiteTwoSuiteListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteTwoSuiteListenerOnFinishEventLog; + + private TestNgRunStateTracker.EventLog suiteThreeSuiteListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteThreeSuiteListenerOnFinishEventLog; + + private TestNgRunStateTracker.EventLog suiteOneTestOneListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteOneTestOneListenerOnFinishEventLog; + + private TestNgRunStateTracker.EventLog suiteTwoTestOneListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteTwoTestOneListenerOnFinishEventLog; + private TestNgRunStateTracker.EventLog suiteTwoTestTwoListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteTwoTestTwoListenerOnFinishEventLog; + + private TestNgRunStateTracker.EventLog suiteThreeTestOneListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteThreeTestOneListenerOnFinishEventLog; + private TestNgRunStateTracker.EventLog suiteThreeTestTwoListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteThreeTestTwoListenerOnFinishEventLog; + private TestNgRunStateTracker.EventLog suiteThreeTestThreeListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteThreeTestThreeListenerOnFinishEventLog; + + @BeforeClass + public void setUp() { + reset(); + + XmlSuite suiteOne = createXmlSuite(SUITE_A); + XmlSuite suiteTwo = createXmlSuite(SUITE_B); + XmlSuite suiteThree = createXmlSuite(SUITE_C); + + suiteOne.setParallel(XmlSuite.ParallelMode.METHODS); + suiteOne.setThreadCount(10); + + createXmlTest( + suiteOne, + SUITE_A_TEST_A, + FactoryForTestClassAFiveMethodsWithNoDepsTwoInstancesSample.class, + FactoryForTestClassCSixMethodsWithNoDepsThreeInstancesSample.class); + createXmlTest(suiteTwo, SUITE_B_TEST_A, TestClassEFiveMethodsWithNoDepsSample.class); + createXmlTest( + suiteTwo, + SUITE_B_TEST_B, + FactoryForTestClassDThreeMethodsWithNoDepsFourInstancesSample.class, + FactoryForTestClassBFourMethodsWithNoDepsFiveInstancesSample.class, + FactoryForTestClassFSixMethodsWithNoDepsSixInstancesSample.class); + + suiteTwo.setParallel(XmlSuite.ParallelMode.METHODS); + + for (XmlTest test : suiteTwo.getTests()) { + if (test.getName().equals(SUITE_B_TEST_A)) { + test.setThreadCount(3); + } else { + test.setThreadCount(20); + } + } + + createXmlTest( + suiteThree, + SUITE_C_TEST_A, + TestClassGThreeMethodsWithNoDepsSample.class, + TestClassHFourMethodsWithNoDepsSample.class, + TestClassIFiveMethodsWithNoDepsSample.class); + createXmlTest( + suiteThree, + SUITE_C_TEST_B, + TestClassJFourMethodsWithNoDepsSample.class, + TestClassKFiveMethodsWithNoDepsSample.class); + createXmlTest( + suiteThree, + SUITE_C_TEST_C, + TestClassLThreeMethodsWithNoDepsSample.class, + TestClassMFourMethodsWithNoDepsSample.class, + TestClassNFiveMethodsWithNoDepsSample.class, + TestClassOSixMethodsWithNoDepsSample.class); + + for (XmlTest test : suiteThree.getTests()) { + test.setParallel(XmlSuite.ParallelMode.METHODS); + + switch (test.getName()) { + case SUITE_C_TEST_A: + test.setThreadCount(10); + break; + case SUITE_C_TEST_B: + test.setThreadCount(5); + break; + default: + test.setThreadCount(12); + break; + } + } + + addParams(suiteOne, SUITE_A, SUITE_A_TEST_A, "100"); + + addParams(suiteTwo, SUITE_B, SUITE_B_TEST_A, "100"); + addParams(suiteTwo, SUITE_B, SUITE_B_TEST_B, "100"); + + addParams(suiteThree, SUITE_C, SUITE_C_TEST_A, "100"); + addParams(suiteThree, SUITE_C, SUITE_C_TEST_B, "100"); + addParams(suiteThree, SUITE_C, SUITE_C_TEST_C, "100"); + + TestNG tng = create(suiteOne, suiteTwo, suiteThree); + tng.setSuiteThreadPoolSize(2); + tng.addListener((ITestNGListener) new TestNgRunStateListener()); + + log.debug( + "Beginning ParallelByMethodsTestCase6Scenario1. This test scenario consists of three " + + "suites with 1, 2 and 3 tests respectively. The suites run in parallel and the thread pool size is " + + "2. One suite with two tests has a test consisting of a single test class without a factory while " + + "the other shall consist of factories which provide multiple instances of multiple test classes. One " + + "suite shall consist of a single test with multiple test classes which uses factories. One suite " + + "shall have multiple tests with multiple classes, none of which use a factory. There are no " + + "dependencies."); + + log.debug( + "Suite: " + + SUITE_A + + ", Test: " + + SUITE_A_TEST_A + + ", Test classes: " + + TestClassAFiveMethodsWithNoDepsSample.class.getCanonicalName() + + ", " + + TestClassCSixMethodsWithNoDepsSample.class.getCanonicalName() + + ". Thread count: 10"); + + log.debug( + "Suite: " + + SUITE_B + + ", Test: " + + SUITE_B_TEST_A + + ", Test class: " + + TestClassEFiveMethodsWithNoDepsSample.class.getCanonicalName() + + ". Thread count: 3"); + + log.debug( + "Suite " + + SUITE_B + + ", Test: " + + SUITE_B_TEST_B + + ", Test classes: " + + TestClassDThreeMethodsWithNoDepsSample.class + + ", " + + TestClassBFourMethodsWithNoDepsSample.class + + ", " + + TestClassFSixMethodsWithNoDepsSample.class + + ". Thread count: 20"); + + log.debug( + "Suite: " + + SUITE_C + + ", Test: " + + SUITE_C_TEST_A + + ", Test classes: " + + TestClassGThreeMethodsWithNoDepsSample.class.getCanonicalName() + + ", " + + TestClassHFourMethodsWithNoDepsSample.class.getCanonicalName() + + ", " + + TestClassIFiveMethodsWithNoDepsSample.class + + ". Thread count: 10"); + + log.debug( + "Suite: " + + SUITE_C + + ", Test: " + + SUITE_C_TEST_B + + ", Test classes: " + + TestClassJFourMethodsWithNoDepsSample.class.getCanonicalName() + + ", " + + TestClassKFiveMethodsWithNoDepsSample.class + + ". Thread count: 5"); + + log.debug( + "Suite: " + + SUITE_C + + ", Test: " + + SUITE_C_TEST_C + + ", Test classes: " + + TestClassLThreeMethodsWithNoDepsSample.class.getCanonicalName() + + ", " + + TestClassMFourMethodsWithNoDepsSample.class.getCanonicalName() + + ", " + + TestClassNFiveMethodsWithNoDepsSample.class.getCanonicalName() + + ", " + + TestClassOSixMethodsWithNoDepsSample.class.getCanonicalName() + + ". Thread count: 12."); + + tng.run(); + + suiteLevelEventLogs = getAllSuiteLevelEventLogs(); + testLevelEventLogs = getAllTestLevelEventLogs(); + testMethodLevelEventLogs = getAllTestMethodLevelEventLogs(); + + suiteOneSuiteAndTestLevelEventLogs = getSuiteAndTestLevelEventLogsForSuite(SUITE_A); + suiteOneSuiteLevelEventLogs = getSuiteLevelEventLogsForSuite(SUITE_A); + suiteOneTestLevelEventLogs = getTestLevelEventLogsForSuite(SUITE_A); + + suiteTwoSuiteAndTestLevelEventLogs = getSuiteAndTestLevelEventLogsForSuite(SUITE_B); + suiteTwoSuiteLevelEventLogs = getSuiteLevelEventLogsForSuite(SUITE_B); + suiteTwoTestLevelEventLogs = getTestLevelEventLogsForSuite(SUITE_B); + + suiteThreeSuiteAndTestLevelEventLogs = getSuiteAndTestLevelEventLogsForSuite(SUITE_C); + suiteThreeSuiteLevelEventLogs = getSuiteLevelEventLogsForSuite(SUITE_C); + suiteThreeTestLevelEventLogs = getTestLevelEventLogsForSuite(SUITE_C); + + suiteOneTestMethodLevelEventLogs = getTestMethodLevelEventLogsForSuite(SUITE_A); + suiteTwoTestMethodLevelEventLogs = getTestMethodLevelEventLogsForSuite(SUITE_B); + suiteThreeTestMethodLevelEventLogs = getTestMethodLevelEventLogsForSuite(SUITE_C); + + suiteOneTestOneTestMethodLevelEventLogs = + getTestMethodLevelEventLogsForTest(SUITE_A, SUITE_A_TEST_A); + + suiteTwoTestOneTestMethodLevelEventLogs = + getTestMethodLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_A); + suiteTwoTestTwoTestMethodLevelEventLogs = + getTestMethodLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_B); + + suiteThreeTestOneTestMethodLevelEventLogs = + getTestMethodLevelEventLogsForTest(SUITE_C, SUITE_C_TEST_A); + suiteThreeTestTwoTestMethodLevelEventLogs = + getTestMethodLevelEventLogsForTest(SUITE_C, SUITE_C_TEST_B); + suiteThreeTestThreeTestMethodLevelEventLogs = + getTestMethodLevelEventLogsForTest(SUITE_C, SUITE_C_TEST_C); + + testEventLogsMap.put(SUITE_B_TEST_A, getTestLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_A)); + testEventLogsMap.put(SUITE_B_TEST_B, getTestLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_B)); + + testEventLogsMap.put(SUITE_C_TEST_A, getTestLevelEventLogsForTest(SUITE_C, SUITE_C_TEST_A)); + testEventLogsMap.put(SUITE_C_TEST_B, getTestLevelEventLogsForTest(SUITE_C, SUITE_C_TEST_B)); + testEventLogsMap.put(SUITE_C_TEST_C, getTestLevelEventLogsForTest(SUITE_C, SUITE_C_TEST_C)); + + suiteOneSuiteListenerOnStartEventLog = getSuiteListenerStartEventLog(SUITE_A); + suiteOneSuiteListenerOnFinishEventLog = getSuiteListenerFinishEventLog(SUITE_A); + + suiteTwoSuiteListenerOnStartEventLog = getSuiteListenerStartEventLog(SUITE_B); + suiteTwoSuiteListenerOnFinishEventLog = getSuiteListenerFinishEventLog(SUITE_B); + + suiteThreeSuiteListenerOnStartEventLog = getSuiteListenerStartEventLog(SUITE_C); + suiteThreeSuiteListenerOnFinishEventLog = getSuiteListenerFinishEventLog(SUITE_C); + + suiteOneTestOneListenerOnStartEventLog = getTestListenerStartEventLog(SUITE_A, SUITE_A_TEST_A); + suiteOneTestOneListenerOnFinishEventLog = + getTestListenerFinishEventLog(SUITE_A, SUITE_A_TEST_A); + + suiteTwoTestOneListenerOnStartEventLog = getTestListenerStartEventLog(SUITE_B, SUITE_B_TEST_A); + suiteTwoTestOneListenerOnFinishEventLog = + getTestListenerFinishEventLog(SUITE_B, SUITE_B_TEST_A); + + suiteTwoTestTwoListenerOnStartEventLog = getTestListenerStartEventLog(SUITE_B, SUITE_B_TEST_B); + suiteTwoTestTwoListenerOnFinishEventLog = + getTestListenerFinishEventLog(SUITE_B, SUITE_B_TEST_B); + + suiteThreeTestOneListenerOnStartEventLog = + getTestListenerStartEventLog(SUITE_C, SUITE_C_TEST_A); + suiteThreeTestOneListenerOnFinishEventLog = + getTestListenerFinishEventLog(SUITE_C, SUITE_C_TEST_A); + suiteThreeTestTwoListenerOnStartEventLog = + getTestListenerStartEventLog(SUITE_C, SUITE_C_TEST_B); + suiteThreeTestTwoListenerOnFinishEventLog = + getTestListenerFinishEventLog(SUITE_C, SUITE_C_TEST_B); + suiteThreeTestThreeListenerOnStartEventLog = + getTestListenerStartEventLog(SUITE_C, SUITE_C_TEST_C); + suiteThreeTestThreeListenerOnFinishEventLog = + getTestListenerFinishEventLog(SUITE_C, SUITE_C_TEST_C); + } + + // Verifies that the expected number of suite, test and test method level events were logged for + // each of the three + // suites. + @Test + public void sanityCheck() { + assertEquals( + suiteLevelEventLogs.size(), + 6, + "There should be 6 suite level events logged for " + + SUITE_A + + ", " + + SUITE_B + + " and " + + SUITE_C + + ": " + + suiteLevelEventLogs); + assertEquals( + testLevelEventLogs.size(), + 12, + "There should be 12 test level events logged for " + + SUITE_A + + ", " + + SUITE_B + + " and " + + SUITE_C + + ": " + + testLevelEventLogs); + + assertEquals( + testMethodLevelEventLogs.size(), + 420, + "There should 420 test method level events logged for " + + SUITE_A + + ", " + + SUITE_B + + " and " + + SUITE_C + + ": " + + testMethodLevelEventLogs); + + assertEquals( + suiteOneSuiteLevelEventLogs.size(), + 2, + "There should be 2 suite level events logged for " + + SUITE_A + + ": " + + suiteOneSuiteLevelEventLogs); + assertEquals( + suiteOneTestLevelEventLogs.size(), + 2, + "There should be 2 test level events logged for " + + SUITE_A + + ": " + + suiteOneTestLevelEventLogs); + assertEquals( + suiteOneTestMethodLevelEventLogs.size(), + 84, + "There should be 84 test method level events " + + "logged for " + + SUITE_A + + ": " + + suiteOneTestMethodLevelEventLogs); + + assertEquals( + suiteTwoSuiteLevelEventLogs.size(), + 2, + "There should be 2 suite level events logged for " + + SUITE_B + + ": " + + suiteTwoSuiteLevelEventLogs); + assertEquals( + suiteTwoTestLevelEventLogs.size(), + 4, + "There should be 4 test level events logged for " + + SUITE_B + + ": " + + suiteTwoTestLevelEventLogs); + assertEquals( + suiteTwoTestMethodLevelEventLogs.size(), + 219, + "There should be 219 test method level events " + + "logged for " + + SUITE_B + + ": " + + suiteTwoTestMethodLevelEventLogs); + + assertEquals( + suiteThreeSuiteLevelEventLogs.size(), + 2, + "There should be 2 suite level events logged for " + + SUITE_C + + ": " + + suiteThreeSuiteLevelEventLogs); + assertEquals( + suiteThreeTestLevelEventLogs.size(), + 6, + "There should be 6 test level events logged for " + + SUITE_C + + ": " + + suiteThreeTestLevelEventLogs); + assertEquals( + suiteThreeTestMethodLevelEventLogs.size(), + 117, + "There should be 87 test method level events " + + "logged for " + + SUITE_C + + ": " + + suiteThreeTestMethodLevelEventLogs); + } + + // Verify that the suites run in parallel by checking that the suite and test level events for + // both suites have + // overlapping timestamps. Verify that there are two separate threads executing the suite-level + // and test-level + // events for each suite. + @Test + public void verifyThatSuitesRunInParallelThreads() { + verifyParallelSuitesWithUnequalExecutionTimes(suiteLevelEventLogs, THREAD_POOL_SIZE); + } + + @Test + public void verifyTestLevelEventsRunInSequentialOrderForIndividualSuites() { + verifySequentialTests( + suiteOneSuiteAndTestLevelEventLogs, + suiteOneTestLevelEventLogs, + suiteOneSuiteListenerOnStartEventLog, + suiteOneSuiteListenerOnFinishEventLog); + + verifySequentialTests( + suiteTwoSuiteAndTestLevelEventLogs, + suiteTwoTestLevelEventLogs, + suiteTwoSuiteListenerOnStartEventLog, + suiteTwoSuiteListenerOnFinishEventLog); + + verifySequentialTests( + suiteThreeSuiteAndTestLevelEventLogs, + suiteThreeTestLevelEventLogs, + suiteThreeSuiteListenerOnStartEventLog, + suiteThreeSuiteListenerOnFinishEventLog); + } + + // Verify the expected number of test class instances for the test method events. + // Verify that the same test class instances are associated with each of the test methods from the + // sample test class + @Test + public void verifyNumberOfInstanceOfTestClassForAllTestMethodsForAllSuites() { + + verifyNumberOfInstancesOfTestClassesForMethods( + SUITE_A, + SUITE_A_TEST_A, + Arrays.asList( + TestClassAFiveMethodsWithNoDepsSample.class, + TestClassCSixMethodsWithNoDepsSample.class), + 2, + 3); + + verifySameInstancesOfTestClassesAssociatedWithMethods( + SUITE_A, + SUITE_A_TEST_A, + Arrays.asList( + TestClassAFiveMethodsWithNoDepsSample.class, + TestClassCSixMethodsWithNoDepsSample.class)); + + verifyNumberOfInstancesOfTestClassForMethods( + SUITE_B, SUITE_B_TEST_A, TestClassEFiveMethodsWithNoDepsSample.class, 1); + + verifySameInstancesOfTestClassAssociatedWithMethods( + SUITE_B, SUITE_B_TEST_A, TestClassEFiveMethodsWithNoDepsSample.class); + + verifyNumberOfInstancesOfTestClassesForMethods( + SUITE_B, + SUITE_B_TEST_B, + Arrays.asList( + TestClassDThreeMethodsWithNoDepsSample.class, + TestClassBFourMethodsWithNoDepsSample.class, + TestClassFSixMethodsWithNoDepsSample.class), + 4, + 5, + 6); + + verifySameInstancesOfTestClassesAssociatedWithMethods( + SUITE_B, + SUITE_B_TEST_B, + Arrays.asList( + TestClassDThreeMethodsWithNoDepsSample.class, + TestClassBFourMethodsWithNoDepsSample.class, + TestClassFSixMethodsWithNoDepsSample.class)); + + verifyNumberOfInstancesOfTestClassesForMethods( + SUITE_C, + SUITE_C_TEST_A, + Arrays.asList( + TestClassGThreeMethodsWithNoDepsSample.class, + TestClassHFourMethodsWithNoDepsSample.class, + TestClassIFiveMethodsWithNoDepsSample.class), + 1); + + verifySameInstancesOfTestClassesAssociatedWithMethods( + SUITE_C, + SUITE_C_TEST_A, + Arrays.asList( + TestClassGThreeMethodsWithNoDepsSample.class, + TestClassHFourMethodsWithNoDepsSample.class, + TestClassIFiveMethodsWithNoDepsSample.class)); + + verifyNumberOfInstancesOfTestClassesForMethods( + SUITE_C, + SUITE_C_TEST_B, + Arrays.asList( + TestClassJFourMethodsWithNoDepsSample.class, + TestClassKFiveMethodsWithNoDepsSample.class), + 1); + + verifySameInstancesOfTestClassesAssociatedWithMethods( + SUITE_C, + SUITE_C_TEST_B, + Arrays.asList( + TestClassJFourMethodsWithNoDepsSample.class, + TestClassKFiveMethodsWithNoDepsSample.class)); + + verifyNumberOfInstancesOfTestClassesForMethods( + SUITE_C, + SUITE_C_TEST_C, + Arrays.asList( + TestClassLThreeMethodsWithNoDepsSample.class, + TestClassMFourMethodsWithNoDepsSample.class, + TestClassNFiveMethodsWithNoDepsSample.class, + TestClassOSixMethodsWithNoDepsSample.class), + 1); + + verifySameInstancesOfTestClassesAssociatedWithMethods( + SUITE_C, + SUITE_C_TEST_C, + Arrays.asList( + TestClassLThreeMethodsWithNoDepsSample.class, + TestClassMFourMethodsWithNoDepsSample.class, + TestClassNFiveMethodsWithNoDepsSample.class, + TestClassOSixMethodsWithNoDepsSample.class)); + } + + // Verify that the test method listener's onTestStart method runs after the test listener's + // onStart method for + // all the test methods in all tests and suites. + @Test + public void + verifyTestLevelMethodLevelEventLogsOccurBetweenAfterTestListenerStartAndFinishEventLogs() { + verifyEventsOccurBetween( + suiteOneTestOneListenerOnStartEventLog, + suiteOneTestOneTestMethodLevelEventLogs, + suiteOneTestOneListenerOnFinishEventLog, + "All of the test method level event logs for " + + SUITE_A_TEST_A + + " should have timestamps between the test listener's onStart and onFinish " + + "event logs for " + + SUITE_A_TEST_A + + ". Test listener onStart event log: " + + suiteOneTestOneListenerOnStartEventLog + + ". Test listener onFinish event log: " + + suiteOneTestOneListenerOnFinishEventLog + + ". Test method level event logs: " + + suiteOneTestOneTestMethodLevelEventLogs); + + verifyEventsOccurBetween( + suiteTwoTestOneListenerOnStartEventLog, + suiteTwoTestOneTestMethodLevelEventLogs, + suiteTwoTestOneListenerOnFinishEventLog, + "All of the test method level event logs for " + + SUITE_B_TEST_A + + " should have timestamps between the test listener's onStart and onFinish " + + "event logs for " + + SUITE_B_TEST_A + + ". Test listener onStart event log: " + + suiteTwoTestOneListenerOnStartEventLog + + ". Test listener onFinish event log: " + + suiteTwoTestOneListenerOnFinishEventLog + + ". Test method level event logs: " + + suiteTwoTestOneTestMethodLevelEventLogs); + + verifyEventsOccurBetween( + suiteTwoTestTwoListenerOnStartEventLog, + suiteTwoTestTwoTestMethodLevelEventLogs, + suiteTwoTestTwoListenerOnFinishEventLog, + "All of the test method level event logs for " + + SUITE_B_TEST_B + + " should have timestamps between the test listener's onStart and onFinish " + + "event logs for " + + SUITE_B_TEST_B + + ". Test listener onStart event log: " + + suiteTwoTestTwoListenerOnStartEventLog + + ". Test listener onFinish event log: " + + suiteTwoTestTwoListenerOnFinishEventLog + + ". Test method level event logs: " + + suiteTwoTestTwoTestMethodLevelEventLogs); + + verifyEventsOccurBetween( + suiteThreeTestOneListenerOnStartEventLog, + suiteThreeTestOneTestMethodLevelEventLogs, + suiteThreeTestOneListenerOnFinishEventLog, + "All of the test method level event logs for " + + SUITE_C_TEST_A + + " should have timestamps between the test listener's onStart and onFinish " + + "event logs for " + + SUITE_C_TEST_A + + ". Test listener onStart event log: " + + suiteThreeTestOneListenerOnStartEventLog + + ". Test listener onFinish event log: " + + suiteThreeTestOneListenerOnFinishEventLog + + ". Test method level event logs: " + + suiteThreeTestOneTestMethodLevelEventLogs); + + verifyEventsOccurBetween( + suiteThreeTestTwoListenerOnStartEventLog, + suiteThreeTestTwoTestMethodLevelEventLogs, + suiteThreeTestTwoListenerOnFinishEventLog, + "All of the test method level event logs for " + + SUITE_C_TEST_B + + " should have timestamps between the test listener's onStart and onFinish " + + "event logs for " + + SUITE_C_TEST_B + + ". Test listener onStart event log: " + + suiteThreeTestTwoListenerOnStartEventLog + + ". Test listener onFinish event log: " + + suiteThreeTestTwoListenerOnFinishEventLog + + ". Test method level event logs: " + + suiteThreeTestTwoTestMethodLevelEventLogs); + + verifyEventsOccurBetween( + suiteThreeTestThreeListenerOnStartEventLog, + suiteThreeTestThreeTestMethodLevelEventLogs, + suiteThreeTestThreeListenerOnFinishEventLog, + "All of the test method level event logs for " + + SUITE_C_TEST_C + + " should have timestamps between the test listener's onStart and onFinish " + + "event logs for " + + SUITE_C_TEST_C + + ". Test listener onStart event log: " + + suiteThreeTestThreeListenerOnStartEventLog + + ". Test listener onFinish event log: " + + suiteThreeTestThreeListenerOnFinishEventLog + + ". Test method level event logs: " + + suiteThreeTestThreeTestMethodLevelEventLogs); + } + + // Verifies that the method level events all run in different threads from the test and suite + // level events. + // Verifies that the test method listener and execution events for a given test method all run in + // the same thread. + @Test + public void verifyThatMethodLevelEventsRunInDifferentThreadsFromSuiteAndTestLevelEvents() { + + verifyEventThreadsSpawnedAfter( + getAllSuiteListenerStartEventLogs().get(0).getThreadId(), + testMethodLevelEventLogs, + "All the thread IDs for the test method level events should be greater than the thread ID for the " + + "suite and test level events. The expectation is that since the suite and test level events " + + "are running sequentially, and all the test methods are running in parallel, new threads " + + "will be spawned after the thread executing the suite and test level events when new methods " + + "begin executing. Suite and test level events thread ID: " + + getAllSuiteListenerStartEventLogs().get(0).getThreadId() + + ". Test method level event logs: " + + testMethodLevelEventLogs); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassAFiveMethodsWithNoDepsSample.class, SUITE_A, SUITE_A_TEST_A); + verifyEventsForTestMethodsRunInTheSameThread( + TestClassCSixMethodsWithNoDepsSample.class, SUITE_A, SUITE_A_TEST_A); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassEFiveMethodsWithNoDepsSample.class, SUITE_B, SUITE_B_TEST_A); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassDThreeMethodsWithNoDepsSample.class, SUITE_B, SUITE_B_TEST_B); + verifyEventsForTestMethodsRunInTheSameThread( + TestClassBFourMethodsWithNoDepsSample.class, SUITE_B, SUITE_B_TEST_B); + verifyEventsForTestMethodsRunInTheSameThread( + TestClassFSixMethodsWithNoDepsSample.class, SUITE_B, SUITE_B_TEST_B); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassGThreeMethodsWithNoDepsSample.class, SUITE_C, SUITE_C_TEST_A); + verifyEventsForTestMethodsRunInTheSameThread( + TestClassHFourMethodsWithNoDepsSample.class, SUITE_C, SUITE_C_TEST_A); + verifyEventsForTestMethodsRunInTheSameThread( + TestClassIFiveMethodsWithNoDepsSample.class, SUITE_C, SUITE_C_TEST_A); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassJFourMethodsWithNoDepsSample.class, SUITE_C, SUITE_C_TEST_B); + verifyEventsForTestMethodsRunInTheSameThread( + TestClassKFiveMethodsWithNoDepsSample.class, SUITE_C, SUITE_C_TEST_B); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassLThreeMethodsWithNoDepsSample.class, SUITE_C, SUITE_C_TEST_C); + verifyEventsForTestMethodsRunInTheSameThread( + TestClassMFourMethodsWithNoDepsSample.class, SUITE_C, SUITE_C_TEST_C); + verifyEventsForTestMethodsRunInTheSameThread( + TestClassNFiveMethodsWithNoDepsSample.class, SUITE_C, SUITE_C_TEST_C); + verifyEventsForTestMethodsRunInTheSameThread( + TestClassOSixMethodsWithNoDepsSample.class, SUITE_C, SUITE_C_TEST_C); + } + + // Verify that the methods are run in separate threads in true parallel fashion by checking that + // the start and run + // times of events that should be run simultaneously start basically at the same time using the + // timestamps and the + // known values of the wait time specified for the event. Verify that the thread IDs of parallel + // events are + // different. + @Test + public void verifyThatTestMethodsRunInParallelThreads() { + verifySimultaneousTestMethods( + getTestMethodLevelEventLogsForTest(SUITE_A, SUITE_A_TEST_A), SUITE_A_TEST_A, 10); + verifySimultaneousTestMethods( + getTestMethodLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_A), SUITE_B_TEST_A, 3); + verifySimultaneousTestMethods( + getTestMethodLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_B), SUITE_B_TEST_B, 20); + verifySimultaneousTestMethods( + getTestMethodLevelEventLogsForTest(SUITE_C, SUITE_C_TEST_A), SUITE_C_TEST_A, 10); + verifySimultaneousTestMethods( + getTestMethodLevelEventLogsForTest(SUITE_C, SUITE_C_TEST_B), SUITE_C_TEST_B, 5); + verifySimultaneousTestMethods( + getTestMethodLevelEventLogsForTest(SUITE_C, SUITE_C_TEST_C), SUITE_C_TEST_C, 12); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase7Scenario1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase7Scenario1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase7Scenario1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase7Scenario1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,229 @@ +package test.thread.parallelization; + +import static org.testng.Assert.assertEquals; +import static test.thread.parallelization.TestNgRunStateTracker.getAllSuiteAndTestLevelEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getAllSuiteLevelEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getAllTestLevelEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getAllTestMethodLevelEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getSuiteListenerFinishEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getSuiteListenerStartEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getTestListenerFinishEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getTestListenerStartEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getTestListenerStartThreadId; +import static test.thread.parallelization.TestNgRunStateTracker.getTestMethodLevelEventLogsForTest; +import static test.thread.parallelization.TestNgRunStateTracker.reset; + +import java.util.List; +import org.testng.ITestNGListener; +import org.testng.TestNG; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import org.testng.log4testng.Logger; +import org.testng.xml.XmlSuite; +import test.thread.parallelization.TestNgRunStateTracker.EventLog; +import test.thread.parallelization.sample.TestClassAFiveMethodsWithFactoryUsingDataProviderAndNoDepsSample; + +/** + * This class covers PTP_TC_7, Scenario 1 in the Parallelization Test Plan. + * + *

Test Case Summary: Parallel by methods mode with sequential test suites using a factory which + * uses a non-parallel data provider and there are no dependencies. + * + *

Scenario Description: Single suite with a single test consisting of a single test class with + * five methods with a factory method using a data provider specifying 3 sets of data. + * + *

1) Thread count and parallel mode are specified at the suite level 2) The thread count is + * equal to the number of test methods times 3, the number of times each method will be invoked with + * a data set from the data provider. Expectation is that only 15 threads will be spawned at once. + * There will be three instances of the test class, one for each of the three data sets and each + * instance will have the five test methods defined on the class, for a total of 15 test method + * invocations. 3) No test method invocation should be queued because the thread count is sufficient + * to service all the test method invocations. 4) There are NO configuration methods 5) All test + * methods pass 6) NO ordering is specified 7) group-by-instances is NOT set 8) There are no method + * exclusions + */ +public class ParallelByMethodsTestCase7Scenario1 extends BaseParallelizationTest { + private static final Logger log = Logger.getLogger(ParallelByMethodsTestCase7Scenario1.class); + + private static final String SUITE = "SingleTestSuite"; + private static final String TEST = "SingleTestClassTest"; + + private List suiteLevelEventLogs; + private List testLevelEventLogs; + private List suiteAndTestLevelEventLogs; + private List testMethodLevelEventLogs; + + private EventLog suiteListenerOnStartEventLog; + private EventLog suiteListenerOnFinishEventLog; + + private EventLog testListenerOnStartEventLog; + private EventLog testListenerOnFinishEventLog; + + private Long testListenerOnStartThreadId; + + @BeforeClass + public void setUp() { + reset(); + + XmlSuite suite = createXmlSuite(SUITE); + suite.setParallel(XmlSuite.ParallelMode.METHODS); + suite.setThreadCount(15); + + createXmlTest( + suite, TEST, TestClassAFiveMethodsWithFactoryUsingDataProviderAndNoDepsSample.class); + + addParams(suite, SUITE, TEST, "100", "paramOne,paramTwo,paramThree"); + + TestNG tng = create(suite); + + tng.addListener((ITestNGListener) new TestNgRunStateListener()); + + log.debug( + "Beginning ParallelByMethodsTestCase7Scenario1. This test scenario consists of a " + + "single suite with a single test consisting of a single test class with five methods with a " + + "factory method using a data provider specifying 3 sets of data. There are no dependencies."); + + log.debug( + "Suite: " + + SUITE + + ", Test: " + + TEST + + ", Test class: " + + TestClassAFiveMethodsWithFactoryUsingDataProviderAndNoDepsSample.class + .getCanonicalName() + + ". Thread count: 15"); + + tng.run(); + + suiteLevelEventLogs = getAllSuiteLevelEventLogs(); + testLevelEventLogs = getAllTestLevelEventLogs(); + suiteAndTestLevelEventLogs = getAllSuiteAndTestLevelEventLogs(); + testMethodLevelEventLogs = getAllTestMethodLevelEventLogs(); + + suiteListenerOnStartEventLog = getSuiteListenerStartEventLog(SUITE); + suiteListenerOnFinishEventLog = getSuiteListenerFinishEventLog(SUITE); + + testListenerOnStartEventLog = getTestListenerStartEventLog(SUITE, TEST); + testListenerOnFinishEventLog = getTestListenerFinishEventLog(SUITE, TEST); + + testListenerOnStartThreadId = getTestListenerStartThreadId(SUITE, TEST); + } + + // Verifies that the expected number of suite, test and test method level events were logged. + @Test + public void sanityCheck() { + assertEquals( + suiteLevelEventLogs.size(), + 2, + "There should be 2 suite level events logged for " + SUITE + ": " + suiteLevelEventLogs); + assertEquals( + testLevelEventLogs.size(), + 2, + "There should be 2 test level events logged for " + SUITE + ": " + testLevelEventLogs); + assertEquals( + testMethodLevelEventLogs.size(), + 45, + "There should be 45 test method level events logged for " + + SUITE + + ": " + + testMethodLevelEventLogs); + } + + // Verify that the suite listener and test listener events have timestamps in the following order: + // suite start, + // test start, test finish, suite finish. Verify that all of these events run in the same thread + // because the + // parallelization mode is by methods only. + @Test + public void verifySuiteAndTestLevelEventsRunInSequentialOrderInSameThread() { + verifySameThreadIdForAllEvents( + suiteAndTestLevelEventLogs, + "The thread ID for all the suite and test level " + + "event logs should be the same because there is no parallelism specified at the suite or test level: " + + suiteAndTestLevelEventLogs); + verifySequentialTimingOfEvents( + suiteAndTestLevelEventLogs, + "The timestamps of suite and test level events " + + "logged first should be earlier than those which are logged afterwards because there is no " + + "parallelism specified at the suite or test level: " + + suiteAndTestLevelEventLogs); + verifyEventsOccurBetween( + suiteListenerOnStartEventLog, + testLevelEventLogs, + suiteListenerOnFinishEventLog, + "All of the test level event logs should have timestamps between the suite listener's onStart and " + + "onFinish event logs. Suite listener onStart event log: " + + suiteListenerOnStartEventLog + + ". Suite listener onFinish event log: " + + suiteListenerOnFinishEventLog + + ". Test level " + + "event logs: " + + testLevelEventLogs); + } + + // Verify that there are three test class instance associated with each of the test methods from + // the sample test + // class + // Verify that the same test class instances are associated with each of the test methods from the + // sample test class + @Test + public void verifyThreeInstancesOfTestClassForAllTestMethods() { + + verifyNumberOfInstancesOfTestClassForMethods( + SUITE, TEST, TestClassAFiveMethodsWithFactoryUsingDataProviderAndNoDepsSample.class, 3); + + verifySameInstancesOfTestClassAssociatedWithMethods( + SUITE, TEST, TestClassAFiveMethodsWithFactoryUsingDataProviderAndNoDepsSample.class); + } + + // Verifies that all the test method level events execute between the test listener onStart and + // onFinish methods + @Test + public void verifyTestMethodLevelEventsAllOccurBetweenTestListenerStartAndFinish() { + verifyEventsOccurBetween( + testListenerOnStartEventLog, + testMethodLevelEventLogs, + testListenerOnFinishEventLog, + "All of the test method level event logs should have timestamps between the test listener's onStart " + + "and onFinish event logs. Test Listener onStart event log: " + + testListenerOnStartEventLog + + ". Test Listener onFinish event log: " + + testListenerOnFinishEventLog + + ". Test method level " + + "event logs: " + + testMethodLevelEventLogs); + } + + // Verifies that the method level events all run in different threads from the test and suite + // level events. + @Test + public void verifyThatMethodLevelEventsRunInDifferentThreadsFromSuiteAndTestLevelEvents() { + verifyEventThreadsSpawnedAfter( + testListenerOnStartThreadId, + testMethodLevelEventLogs, + "All the thread IDs " + + "for the test method level events should be greater than the thread ID for the suite and test level " + + "events. The expectation is that since the suite and test level events are running sequentially, and " + + "all the test methods are running in parallel, new threads will be spawned after the thread " + + "executing the suite and test level events when new methods begin executing. Suite and test level " + + "events thread ID: " + + testListenerOnStartThreadId + + ". Test method level event logs: " + + testMethodLevelEventLogs); + } + + // Verifies that all the test method level events for any given test method in any given instance + // run in the same + // thread. + @Test + public void verifyThatAllEventsForATestMethodExecuteInSameThread() { + verifyEventsForTestMethodsRunInTheSameThread( + TestClassAFiveMethodsWithFactoryUsingDataProviderAndNoDepsSample.class, SUITE, TEST); + } + + // Verifies that the test methods execute in different threads in parallel fashion. + @Test + public void verifyThatTestMethodsRunInParallelThreads() { + verifySimultaneousTestMethods(getTestMethodLevelEventLogsForTest(SUITE, TEST), TEST, 15); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase7Scenario2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase7Scenario2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase7Scenario2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase7Scenario2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,521 @@ +package test.thread.parallelization; + +import static org.testng.Assert.assertEquals; +import static test.thread.parallelization.TestNgRunStateTracker.getAllEventLogsForSuite; +import static test.thread.parallelization.TestNgRunStateTracker.getAllSuiteLevelEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getAllSuiteListenerStartEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getAllTestLevelEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getAllTestMethodLevelEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getSuiteAndTestLevelEventLogsForSuite; +import static test.thread.parallelization.TestNgRunStateTracker.getSuiteLevelEventLogsForSuite; +import static test.thread.parallelization.TestNgRunStateTracker.getSuiteListenerFinishEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getSuiteListenerStartEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getTestLevelEventLogsForSuite; +import static test.thread.parallelization.TestNgRunStateTracker.getTestLevelEventLogsForTest; +import static test.thread.parallelization.TestNgRunStateTracker.getTestListenerFinishEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getTestListenerStartEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getTestMethodLevelEventLogsForSuite; +import static test.thread.parallelization.TestNgRunStateTracker.getTestMethodLevelEventLogsForTest; +import static test.thread.parallelization.TestNgRunStateTracker.reset; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.testng.ITestNGListener; +import org.testng.TestNG; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import org.testng.log4testng.Logger; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.thread.parallelization.sample.TestClassAFiveMethodsWithFactoryUsingDataProviderAndNoDepsSample; +import test.thread.parallelization.sample.TestClassBFourMethodsWithFactoryUsingDataProviderAndNoDepsSample; +import test.thread.parallelization.sample.TestClassCSixMethodsWithFactoryUsingDataProviderAndNoDepsSample; +import test.thread.parallelization.sample.TestClassDThreeMethodsWithFactoryUsingDataProviderAndNoDepsSample; +import test.thread.parallelization.sample.TestClassEFiveMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassFSixMethodsWithFactoryUsingDataProviderAndNoDepsSample; + +/** + * This class covers PTP_TC_7, Scenario 2 in the Parallelization Test Plan. + * + *

Test Case Summary: Parallel by methods mode with sequential test suites using a factory with a + * non-parallel data provider and there are no dependencies. + * + *

Scenario Description: Two suites with 1 and 2 tests respectively. One suite with two tests has + * a test consisting of a single test class without a factory while the other consists of factories + * using data providers with varying numbers of data sets which provide multiple instances of + * multiple test classes. One suite shall consist of a single test with multiple test classes which + * use factories with data providers with varying numbers of data sets. + * + *

1) For both suites, the thread count and parallel mode are specified at the suite level 2) The + * thread count is less than the number of test methods for all tests in both suites, so methods + * will have to wait for the active thread count to drop below the maximum thread count before they + * can begin execution. The expectation is that threads will be spawned for each test method that + * executes just as they would if there were no factories and data providers and test suites simply + * use the default mechanism for instantiating single instances of the test classes. 3) There are NO + * configuration methods 4) All test methods pass 5) NO ordering is specified 6) group-by-instances + * is NOT set 7) There are no method exclusions + */ +public class ParallelByMethodsTestCase7Scenario2 extends BaseParallelizationTest { + private static final Logger log = Logger.getLogger(ParallelByMethodsTestCase7Scenario2.class); + + private static final String SUITE_A = "TestSuiteA"; + private static final String SUITE_B = "TestSuiteB"; + + private static final String SUITE_A_TEST_A = "TestSuiteA-TwoTestClassTest"; + + private static final String SUITE_B_TEST_A = "TestSuiteB-SingleTestClassTest"; + private static final String SUITE_B_TEST_B = "TestSuiteB-ThreeTestClassTest"; + + private Map> suiteEventLogsMap = new HashMap<>(); + private Map> testEventLogsMap = new HashMap<>(); + + private List suiteLevelEventLogs; + private List testLevelEventLogs; + private List testMethodLevelEventLogs; + + private List suiteOneSuiteAndTestLevelEventLogs; + private List suiteOneSuiteLevelEventLogs; + private List suiteOneTestLevelEventLogs; + private List suiteOneTestMethodLevelEventLogs; + + private List suiteTwoSuiteAndTestLevelEventLogs; + private List suiteTwoSuiteLevelEventLogs; + private List suiteTwoTestLevelEventLogs; + private List suiteTwoTestMethodLevelEventLogs; + + private List suiteOneTestOneTestMethodLevelEventLogs; + + private List suiteTwoTestOneTestMethodLevelEventLogs; + private List suiteTwoTestTwoTestMethodLevelEventLogs; + + private TestNgRunStateTracker.EventLog suiteOneSuiteListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteOneSuiteListenerOnFinishEventLog; + + private TestNgRunStateTracker.EventLog suiteTwoSuiteListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteTwoSuiteListenerOnFinishEventLog; + + private TestNgRunStateTracker.EventLog suiteOneTestOneListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteOneTestOneListenerOnFinishEventLog; + + private TestNgRunStateTracker.EventLog suiteTwoTestOneListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteTwoTestOneListenerOnFinishEventLog; + private TestNgRunStateTracker.EventLog suiteTwoTestTwoListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteTwoTestTwoListenerOnFinishEventLog; + + @BeforeClass + public void setUp() { + reset(); + + XmlSuite suiteOne = createXmlSuite(SUITE_A); + XmlSuite suiteTwo = createXmlSuite(SUITE_B); + + suiteOne.setParallel(XmlSuite.ParallelMode.METHODS); + suiteOne.setThreadCount(25); + + createXmlTest( + suiteOne, + SUITE_A_TEST_A, + TestClassAFiveMethodsWithFactoryUsingDataProviderAndNoDepsSample.class, + TestClassCSixMethodsWithFactoryUsingDataProviderAndNoDepsSample.class); + createXmlTest(suiteTwo, SUITE_B_TEST_A, TestClassEFiveMethodsWithNoDepsSample.class); + createXmlTest( + suiteTwo, + SUITE_B_TEST_B, + TestClassDThreeMethodsWithFactoryUsingDataProviderAndNoDepsSample.class, + TestClassBFourMethodsWithFactoryUsingDataProviderAndNoDepsSample.class, + TestClassFSixMethodsWithFactoryUsingDataProviderAndNoDepsSample.class); + + suiteTwo.setParallel(XmlSuite.ParallelMode.METHODS); + + for (XmlTest test : suiteTwo.getTests()) { + if (test.getName().equals(SUITE_B_TEST_A)) { + test.setThreadCount(3); + } else { + test.setThreadCount(40); + } + } + + addParams( + suiteOne, + SUITE_A, + SUITE_A_TEST_A, + "100", + TestClassAFiveMethodsWithFactoryUsingDataProviderAndNoDepsSample.class.getCanonicalName() + + "(paramOne,paramTwo,paramThree)" + + TestClassCSixMethodsWithFactoryUsingDataProviderAndNoDepsSample.class + .getCanonicalName() + + "(paramOne,paramTwo,paramThree,paramFour)"); + + addParams(suiteTwo, SUITE_B, SUITE_B_TEST_A, "100"); + + addParams( + suiteTwo, + SUITE_B, + SUITE_B_TEST_B, + "100", + TestClassDThreeMethodsWithFactoryUsingDataProviderAndNoDepsSample.class.getCanonicalName() + + "(paramOne,paramTwo,paramThree)" + + TestClassBFourMethodsWithFactoryUsingDataProviderAndNoDepsSample.class + .getCanonicalName() + + "(paramOne,paramTwo,paramThree,paramFour)" + + TestClassFSixMethodsWithFactoryUsingDataProviderAndNoDepsSample.class + .getCanonicalName() + + "(paramOne,paramTwo,paramThree,paramFour,paramFive)"); + + TestNG tng = create(suiteOne, suiteTwo); + tng.addListener((ITestNGListener) new TestNgRunStateListener()); + + log.debug( + "Beginning ParallelByMethodsTestCase7Scenario2. This test scenario consists of two " + + "suites with 1 and 2 tests respectively. One suite with two tests has a test consisting of a single " + + "test class without a factory while the other consists of factories using data providers with " + + "varying numbers of data sets which provide multiple instances of multiple test classes. One suite " + + "shall consist of a single test with multiple test classes which use factories with data providers " + + "with varying numbers of data sets. There are no dependencies."); + + log.debug( + "Suite: " + + SUITE_A + + ", Test: " + + SUITE_A_TEST_A + + ", Test classes: " + + TestClassAFiveMethodsWithFactoryUsingDataProviderAndNoDepsSample.class + .getCanonicalName() + + ", " + + TestClassCSixMethodsWithFactoryUsingDataProviderAndNoDepsSample.class + .getCanonicalName() + + ". Thread count: 25"); + + log.debug( + "Suite: " + + SUITE_B + + ", Test: " + + SUITE_B_TEST_A + + ", Test class: " + + TestClassEFiveMethodsWithNoDepsSample.class.getCanonicalName() + + ". Thread count: 3"); + + log.debug( + "Suite " + + SUITE_B + + ", Test: " + + SUITE_B_TEST_B + + ", Test classes: " + + TestClassDThreeMethodsWithFactoryUsingDataProviderAndNoDepsSample.class + + ", " + + TestClassBFourMethodsWithFactoryUsingDataProviderAndNoDepsSample.class + + ", " + + TestClassFSixMethodsWithFactoryUsingDataProviderAndNoDepsSample.class + + ". Thread count: 40"); + + tng.run(); + + suiteLevelEventLogs = getAllSuiteLevelEventLogs(); + testLevelEventLogs = getAllTestLevelEventLogs(); + testMethodLevelEventLogs = getAllTestMethodLevelEventLogs(); + + suiteOneSuiteAndTestLevelEventLogs = getSuiteAndTestLevelEventLogsForSuite(SUITE_A); + suiteOneSuiteLevelEventLogs = getSuiteLevelEventLogsForSuite(SUITE_A); + suiteOneTestLevelEventLogs = getTestLevelEventLogsForSuite(SUITE_A); + + suiteTwoSuiteAndTestLevelEventLogs = getSuiteAndTestLevelEventLogsForSuite(SUITE_B); + suiteTwoSuiteLevelEventLogs = getSuiteLevelEventLogsForSuite(SUITE_B); + suiteTwoTestLevelEventLogs = getTestLevelEventLogsForSuite(SUITE_B); + + suiteEventLogsMap.put(SUITE_A, getAllEventLogsForSuite(SUITE_A)); + suiteEventLogsMap.put(SUITE_B, getAllEventLogsForSuite(SUITE_B)); + + suiteOneTestMethodLevelEventLogs = getTestMethodLevelEventLogsForSuite(SUITE_A); + suiteTwoTestMethodLevelEventLogs = getTestMethodLevelEventLogsForSuite(SUITE_B); + + suiteOneTestOneTestMethodLevelEventLogs = + getTestMethodLevelEventLogsForTest(SUITE_A, SUITE_A_TEST_A); + + suiteTwoTestOneTestMethodLevelEventLogs = + getTestMethodLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_A); + suiteTwoTestTwoTestMethodLevelEventLogs = + getTestMethodLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_B); + + testEventLogsMap.put(SUITE_B_TEST_A, getTestLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_A)); + testEventLogsMap.put(SUITE_B_TEST_B, getTestLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_B)); + + suiteOneSuiteListenerOnStartEventLog = getSuiteListenerStartEventLog(SUITE_A); + suiteOneSuiteListenerOnFinishEventLog = getSuiteListenerFinishEventLog(SUITE_A); + + suiteTwoSuiteListenerOnStartEventLog = getSuiteListenerStartEventLog(SUITE_B); + suiteTwoSuiteListenerOnFinishEventLog = getSuiteListenerFinishEventLog(SUITE_B); + + suiteOneTestOneListenerOnStartEventLog = getTestListenerStartEventLog(SUITE_A, SUITE_A_TEST_A); + suiteOneTestOneListenerOnFinishEventLog = + getTestListenerFinishEventLog(SUITE_A, SUITE_A_TEST_A); + + suiteTwoTestOneListenerOnStartEventLog = getTestListenerStartEventLog(SUITE_B, SUITE_B_TEST_A); + suiteTwoTestOneListenerOnFinishEventLog = + getTestListenerFinishEventLog(SUITE_B, SUITE_B_TEST_A); + + suiteTwoTestTwoListenerOnStartEventLog = getTestListenerStartEventLog(SUITE_B, SUITE_B_TEST_B); + suiteTwoTestTwoListenerOnFinishEventLog = + getTestListenerFinishEventLog(SUITE_B, SUITE_B_TEST_B); + } + + // Verifies that the expected number of suite, test and test method level events were logged for + // each of the three + // suites. + @Test + public void sanityCheck() { + assertEquals( + suiteLevelEventLogs.size(), + 4, + "There should be 4 suite level events logged for " + + SUITE_A + + " and " + + SUITE_B + + ": " + + suiteLevelEventLogs); + assertEquals( + testLevelEventLogs.size(), + 6, + "There should be 6 test level events logged for " + + SUITE_A + + " and " + + SUITE_B + + ": " + + testLevelEventLogs); + + assertEquals( + testMethodLevelEventLogs.size(), + 297, + "There should 267 test method level events logged for " + + SUITE_A + + " and " + + SUITE_B + + ": " + + testMethodLevelEventLogs); + + assertEquals( + suiteOneSuiteLevelEventLogs.size(), + 2, + "There should be 2 suite level events logged for " + + SUITE_A + + ": " + + suiteOneSuiteLevelEventLogs); + assertEquals( + suiteOneTestLevelEventLogs.size(), + 2, + "There should be 2 test level events logged for " + + SUITE_A + + ": " + + suiteOneTestLevelEventLogs); + assertEquals( + suiteOneTestMethodLevelEventLogs.size(), + 117, + "There should be 117 test method level events " + + "logged for " + + SUITE_A + + ": " + + suiteOneTestMethodLevelEventLogs); + + assertEquals( + suiteTwoSuiteLevelEventLogs.size(), + 2, + "There should be 2 suite level events logged for " + + SUITE_B + + ": " + + suiteTwoSuiteLevelEventLogs); + assertEquals( + suiteTwoTestLevelEventLogs.size(), + 4, + "There should be 4 test level events logged for " + + SUITE_B + + ": " + + suiteTwoTestLevelEventLogs); + assertEquals( + suiteTwoTestMethodLevelEventLogs.size(), + 180, + "There should be 180 test method level events " + + "logged for " + + SUITE_B + + ": " + + suiteTwoTestMethodLevelEventLogs); + } + + // Verify that all the events in the second suite run have timestamps later than the suite + // listener's onFinish event + // for the first suite run. + // Verify that all suite level events run in the same thread + @Test + public void verifySuitesRunSequentiallyInSameThread() { + verifySequentialSuites(suiteLevelEventLogs, suiteEventLogsMap); + } + + // For all suites, verify that the test level events run sequentially because the parallel mode is + // by methods only. + @Test + public void verifySuiteAndTestLevelEventsRunInSequentialOrderForIndividualSuites() { + + verifySequentialTests( + suiteOneSuiteAndTestLevelEventLogs, + suiteOneTestLevelEventLogs, + suiteOneSuiteListenerOnStartEventLog, + suiteOneSuiteListenerOnFinishEventLog); + + verifySequentialTests( + suiteTwoSuiteAndTestLevelEventLogs, + suiteTwoTestLevelEventLogs, + suiteTwoSuiteListenerOnStartEventLog, + suiteTwoSuiteListenerOnFinishEventLog); + } + + // Verify the expected number of test class instances for the test method events. + // Verify that the same test class instances are associated with each of the test methods from the + // sample test class + @Test + public void verifyNumberOfInstanceOfTestClassForAllTestMethodsForAllSuites() { + + verifyNumberOfInstancesOfTestClassesForMethods( + SUITE_A, + SUITE_A_TEST_A, + Arrays.asList( + TestClassAFiveMethodsWithFactoryUsingDataProviderAndNoDepsSample.class, + TestClassCSixMethodsWithFactoryUsingDataProviderAndNoDepsSample.class), + 3, + 4); + + verifySameInstancesOfTestClassesAssociatedWithMethods( + SUITE_A, + SUITE_A_TEST_A, + Arrays.asList( + TestClassAFiveMethodsWithFactoryUsingDataProviderAndNoDepsSample.class, + TestClassCSixMethodsWithFactoryUsingDataProviderAndNoDepsSample.class)); + + verifyNumberOfInstancesOfTestClassForMethods( + SUITE_B, SUITE_B_TEST_A, TestClassEFiveMethodsWithNoDepsSample.class, 1); + + verifySameInstancesOfTestClassAssociatedWithMethods( + SUITE_B, SUITE_B_TEST_A, TestClassEFiveMethodsWithNoDepsSample.class); + + verifyNumberOfInstancesOfTestClassesForMethods( + SUITE_B, + SUITE_B_TEST_B, + Arrays.asList( + TestClassDThreeMethodsWithFactoryUsingDataProviderAndNoDepsSample.class, + TestClassBFourMethodsWithFactoryUsingDataProviderAndNoDepsSample.class, + TestClassFSixMethodsWithFactoryUsingDataProviderAndNoDepsSample.class), + 3, + 4, + 5); + } + + // Verify that the test method listener's onTestStart method runs after the test listener's + // onStart method for + // all the test methods in all tests and suites. + @Test + public void + verifyTestLevelMethodLevelEventLogsOccurBetweenAfterTestListenerStartAndFinishEventLogs() { + verifyEventsOccurBetween( + suiteOneTestOneListenerOnStartEventLog, + suiteOneTestOneTestMethodLevelEventLogs, + suiteOneTestOneListenerOnFinishEventLog, + "All of the test method level event logs for " + + SUITE_A_TEST_A + + " should have timestamps between the test listener's onStart and onFinish " + + "event logs for " + + SUITE_A_TEST_A + + ". Test listener onStart event log: " + + suiteOneTestOneListenerOnStartEventLog + + ". Test listener onFinish event log: " + + suiteOneTestOneListenerOnFinishEventLog + + ". Test method level event logs: " + + suiteOneTestOneTestMethodLevelEventLogs); + + verifyEventsOccurBetween( + suiteTwoTestOneListenerOnStartEventLog, + suiteTwoTestOneTestMethodLevelEventLogs, + suiteTwoTestOneListenerOnFinishEventLog, + "All of the test method level event logs for " + + SUITE_B_TEST_A + + " should have timestamps between the test listener's onStart and onFinish " + + "event logs for " + + SUITE_B_TEST_A + + ". Test listener onStart event log: " + + suiteTwoTestOneListenerOnStartEventLog + + ". Test listener onFinish event log: " + + suiteTwoTestOneListenerOnFinishEventLog + + ". Test method level event logs: " + + suiteTwoTestOneTestMethodLevelEventLogs); + + verifyEventsOccurBetween( + suiteTwoTestTwoListenerOnStartEventLog, + suiteTwoTestTwoTestMethodLevelEventLogs, + suiteTwoTestTwoListenerOnFinishEventLog, + "All of the test method level event logs for " + + SUITE_B_TEST_B + + " should have timestamps between the test listener's onStart and onFinish " + + "event logs for " + + SUITE_B_TEST_B + + ". Test listener onStart event log: " + + suiteTwoTestTwoListenerOnStartEventLog + + ". Test listener onFinish event log: " + + suiteTwoTestTwoListenerOnFinishEventLog + + ". Test method level event logs: " + + suiteTwoTestTwoTestMethodLevelEventLogs); + } + + // Verifies that the method level events all run in different threads from the test and suite + // level events. + // Verifies that the test method listener and execution events for a given test method all run in + // the same thread. + @Test + public void verifyThatMethodLevelEventsRunInDifferentThreadsFromSuiteAndTestLevelEvents() { + + verifyEventThreadsSpawnedAfter( + getAllSuiteListenerStartEventLogs().get(0).getThreadId(), + testMethodLevelEventLogs, + "All the thread IDs for the test method level events should be greater than the thread ID for the " + + "suite and test level events. The expectation is that since the suite and test level events " + + "are running sequentially, and all the test methods are running in parallel, new threads " + + "will be spawned after the thread executing the suite and test level events when new methods " + + "begin executing. Suite and test level events thread ID: " + + getAllSuiteListenerStartEventLogs().get(0).getThreadId() + + ". Test method level event logs: " + + testMethodLevelEventLogs); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassAFiveMethodsWithFactoryUsingDataProviderAndNoDepsSample.class, + SUITE_A, + SUITE_A_TEST_A); + verifyEventsForTestMethodsRunInTheSameThread( + TestClassCSixMethodsWithFactoryUsingDataProviderAndNoDepsSample.class, + SUITE_A, + SUITE_A_TEST_A); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassEFiveMethodsWithNoDepsSample.class, SUITE_B, SUITE_B_TEST_A); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassDThreeMethodsWithFactoryUsingDataProviderAndNoDepsSample.class, + SUITE_B, + SUITE_B_TEST_B); + verifyEventsForTestMethodsRunInTheSameThread( + TestClassBFourMethodsWithFactoryUsingDataProviderAndNoDepsSample.class, + SUITE_B, + SUITE_B_TEST_B); + verifyEventsForTestMethodsRunInTheSameThread( + TestClassFSixMethodsWithFactoryUsingDataProviderAndNoDepsSample.class, + SUITE_B, + SUITE_B_TEST_B); + } + + // Verify that the methods are run in separate threads. + @Test + public void verifyThatTestMethodsRunInParallelThreads() { + verifySimultaneousTestMethods( + getTestMethodLevelEventLogsForTest(SUITE_A, SUITE_A_TEST_A), SUITE_A_TEST_A, 25); + verifySimultaneousTestMethods( + getTestMethodLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_A), SUITE_B_TEST_A, 3); + verifySimultaneousTestMethods( + getTestMethodLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_B), SUITE_B_TEST_B, 40); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase8Scenario1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase8Scenario1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase8Scenario1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/ParallelByMethodsTestCase8Scenario1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,1028 @@ +package test.thread.parallelization; + +import static org.testng.Assert.assertEquals; +import static test.thread.parallelization.TestNgRunStateTracker.getAllSuiteLevelEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getAllSuiteListenerStartEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getAllTestLevelEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getAllTestMethodLevelEventLogs; +import static test.thread.parallelization.TestNgRunStateTracker.getSuiteAndTestLevelEventLogsForSuite; +import static test.thread.parallelization.TestNgRunStateTracker.getSuiteLevelEventLogsForSuite; +import static test.thread.parallelization.TestNgRunStateTracker.getSuiteListenerFinishEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getSuiteListenerStartEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getTestLevelEventLogsForSuite; +import static test.thread.parallelization.TestNgRunStateTracker.getTestLevelEventLogsForTest; +import static test.thread.parallelization.TestNgRunStateTracker.getTestListenerFinishEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getTestListenerStartEventLog; +import static test.thread.parallelization.TestNgRunStateTracker.getTestMethodLevelEventLogsForSuite; +import static test.thread.parallelization.TestNgRunStateTracker.getTestMethodLevelEventLogsForTest; +import static test.thread.parallelization.TestNgRunStateTracker.reset; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.testng.ITestNGListener; +import org.testng.TestNG; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import org.testng.log4testng.Logger; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.thread.parallelization.sample.TestClassAFiveMethodsWithFactoryUsingDataProviderAndNoDepsSample; +import test.thread.parallelization.sample.TestClassBFourMethodsWithFactoryUsingDataProviderAndNoDepsSample; +import test.thread.parallelization.sample.TestClassCSixMethodsWithFactoryUsingDataProviderAndNoDepsSample; +import test.thread.parallelization.sample.TestClassDThreeMethodsWithFactoryUsingDataProviderAndNoDepsSample; +import test.thread.parallelization.sample.TestClassEFiveMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassFSixMethodsWithFactoryUsingDataProviderAndNoDepsSample; +import test.thread.parallelization.sample.TestClassGThreeMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassHFourMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassIFiveMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassJFourMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassKFiveMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassLThreeMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassMFourMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassNFiveMethodsWithNoDepsSample; +import test.thread.parallelization.sample.TestClassOSixMethodsWithNoDepsSample; + +/** + * This class covers PTP_TC_8, Scenario 1 in the Parallelization Test Plan. + * + *

Test Case Summary: Parallel by methods mode with parallel test suites using factories with + * data providers but no dependencies. + * + *

Scenario Description: Three suites with 1, 2 and 3 tests respectively. One suite with two + * tests has a test consisting of a single test class without a factory while the other shall + * consist of test classes with factories using data providers with varying numbers of data sets. + * One suite shall consist of a single test with multiple test classes with factories using data + * providers with varying numbers of data sets. One suite shall have multiple tests with multiple + * classes, none of which use a factory. + * + *

1) The suite thread pool is 2, so one suite will have to wait for one of the others to + * complete execution before it can begin execution 2) For one of the suites, the thread count and + * parallel mode are specified at the suite level 3) For one of the suites, the thread count and + * parallel mode are specified at the test level 4) For one of the suites, the parallel mode is + * specified at the suite level, and the thread counts are specified at the test level (thread + * counts for each test differ) 5) The thread count is less than the number of test methods for the + * tests in two of the suites, so some methods will have to wait for the active thread count to drop + * below the maximum thread count before they can begin execution. 6) The thread count is more than + * the number of test methods for the tests in one of the suites, ensuring that none of the methods + * in that suite should have to wait for any other method to complete execution 7) The expectation + * is that threads will be spawned for each test method that executes just as they would if there + * were no factories and test suites simply used the default mechanism for instantiating single + * instances of the test classes. 8) There are NO configuration methods 9) All test methods pass 10) + * NO ordering is specified 11) `group-by-instances is NOT set 12) here are no method exclusions + */ +public class ParallelByMethodsTestCase8Scenario1 extends BaseParallelizationTest { + private static final Logger log = Logger.getLogger(ParallelByMethodsTestCase8Scenario1.class); + + private static final String SUITE_A = "TestSuiteA"; + private static final String SUITE_B = "TestSuiteB"; + private static final String SUITE_C = "TestSuiteC"; + + private static final String SUITE_A_TEST_A = "TestSuiteA-TwoTestClassTest"; + + private static final String SUITE_B_TEST_A = "TestSuiteB-SingleTestClassTest"; + private static final String SUITE_B_TEST_B = "TestSuiteB-ThreeTestClassTest"; + + private static final String SUITE_C_TEST_A = "TestSuiteC-ThreeTestClassTest"; + private static final String SUITE_C_TEST_B = "TestSuiteC-TwoTestClassTest"; + private static final String SUITE_C_TEST_C = "TestSuiteC-FourTestClassTest"; + + private static final int THREAD_POOL_SIZE = 2; + + private Map expectedInvocationCounts = new HashMap<>(); + + private Map> testEventLogsMap = new HashMap<>(); + + private List suiteLevelEventLogs; + private List testLevelEventLogs; + private List testMethodLevelEventLogs; + + private List suiteOneSuiteAndTestLevelEventLogs; + private List suiteOneSuiteLevelEventLogs; + private List suiteOneTestLevelEventLogs; + private List suiteOneTestMethodLevelEventLogs; + + private List suiteTwoSuiteAndTestLevelEventLogs; + private List suiteTwoSuiteLevelEventLogs; + private List suiteTwoTestLevelEventLogs; + private List suiteTwoTestMethodLevelEventLogs; + + private List suiteThreeSuiteAndTestLevelEventLogs; + private List suiteThreeSuiteLevelEventLogs; + private List suiteThreeTestLevelEventLogs; + private List suiteThreeTestMethodLevelEventLogs; + + private List suiteOneTestOneTestMethodLevelEventLogs; + + private List suiteTwoTestOneTestMethodLevelEventLogs; + private List suiteTwoTestTwoTestMethodLevelEventLogs; + + private List suiteThreeTestOneTestMethodLevelEventLogs; + private List suiteThreeTestTwoTestMethodLevelEventLogs; + private List suiteThreeTestThreeTestMethodLevelEventLogs; + + private TestNgRunStateTracker.EventLog suiteOneSuiteListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteOneSuiteListenerOnFinishEventLog; + + private TestNgRunStateTracker.EventLog suiteTwoSuiteListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteTwoSuiteListenerOnFinishEventLog; + + private TestNgRunStateTracker.EventLog suiteThreeSuiteListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteThreeSuiteListenerOnFinishEventLog; + + private TestNgRunStateTracker.EventLog suiteOneTestOneListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteOneTestOneListenerOnFinishEventLog; + + private TestNgRunStateTracker.EventLog suiteTwoTestOneListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteTwoTestOneListenerOnFinishEventLog; + private TestNgRunStateTracker.EventLog suiteTwoTestTwoListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteTwoTestTwoListenerOnFinishEventLog; + + private TestNgRunStateTracker.EventLog suiteThreeTestOneListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteThreeTestOneListenerOnFinishEventLog; + private TestNgRunStateTracker.EventLog suiteThreeTestTwoListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteThreeTestTwoListenerOnFinishEventLog; + private TestNgRunStateTracker.EventLog suiteThreeTestThreeListenerOnStartEventLog; + private TestNgRunStateTracker.EventLog suiteThreeTestThreeListenerOnFinishEventLog; + + @BeforeClass + public void setUp() { + reset(); + + XmlSuite suiteOne = createXmlSuite(SUITE_A); + XmlSuite suiteTwo = createXmlSuite(SUITE_B); + XmlSuite suiteThree = createXmlSuite(SUITE_C); + + suiteOne.setParallel(XmlSuite.ParallelMode.METHODS); + suiteOne.setThreadCount(10); + + createXmlTest( + suiteOne, + SUITE_A_TEST_A, + TestClassAFiveMethodsWithFactoryUsingDataProviderAndNoDepsSample.class, + TestClassCSixMethodsWithFactoryUsingDataProviderAndNoDepsSample.class); + createXmlTest(suiteTwo, SUITE_B_TEST_A, TestClassEFiveMethodsWithNoDepsSample.class); + createXmlTest( + suiteTwo, + SUITE_B_TEST_B, + TestClassDThreeMethodsWithFactoryUsingDataProviderAndNoDepsSample.class, + TestClassBFourMethodsWithFactoryUsingDataProviderAndNoDepsSample.class, + TestClassFSixMethodsWithFactoryUsingDataProviderAndNoDepsSample.class); + + suiteTwo.setParallel(XmlSuite.ParallelMode.METHODS); + + for (XmlTest test : suiteTwo.getTests()) { + if (test.getName().equals(SUITE_B_TEST_A)) { + test.setThreadCount(3); + } else { + test.setThreadCount(20); + } + } + + createXmlTest( + suiteThree, + SUITE_C_TEST_A, + TestClassGThreeMethodsWithNoDepsSample.class, + TestClassHFourMethodsWithNoDepsSample.class, + TestClassIFiveMethodsWithNoDepsSample.class); + createXmlTest( + suiteThree, + SUITE_C_TEST_B, + TestClassJFourMethodsWithNoDepsSample.class, + TestClassKFiveMethodsWithNoDepsSample.class); + createXmlTest( + suiteThree, + SUITE_C_TEST_C, + TestClassLThreeMethodsWithNoDepsSample.class, + TestClassMFourMethodsWithNoDepsSample.class, + TestClassNFiveMethodsWithNoDepsSample.class, + TestClassOSixMethodsWithNoDepsSample.class); + + for (XmlTest test : suiteThree.getTests()) { + test.setParallel(XmlSuite.ParallelMode.METHODS); + + switch (test.getName()) { + case SUITE_C_TEST_A: + test.setThreadCount(25); + break; + case SUITE_C_TEST_B: + test.setThreadCount(5); + break; + default: + test.setThreadCount(12); + break; + } + } + + addParams( + suiteOne, + SUITE_A, + SUITE_A_TEST_A, + "100", + TestClassAFiveMethodsWithFactoryUsingDataProviderAndNoDepsSample.class.getCanonicalName() + + "(paramOne,paramTwo,paramThree)" + + TestClassCSixMethodsWithFactoryUsingDataProviderAndNoDepsSample.class + .getCanonicalName() + + "(paramOne,paramTwo,paramThree,paramFour)"); + + addParams(suiteTwo, SUITE_B, SUITE_B_TEST_A, "100"); + addParams(suiteTwo, SUITE_B, SUITE_B_TEST_B, "100", "paramOne,paramTwo,paramThree,paramFour"); + + addParams(suiteThree, SUITE_C, SUITE_C_TEST_A, "100"); + addParams(suiteThree, SUITE_C, SUITE_C_TEST_B, "100"); + addParams(suiteThree, SUITE_C, SUITE_C_TEST_C, "100"); + + TestNG tng = create(suiteOne, suiteTwo, suiteThree); + tng.setSuiteThreadPoolSize(2); + tng.addListener((ITestNGListener) new TestNgRunStateListener()); + + log.debug( + "Beginning ParallelByMethodsTestCase8Scenario1. This test scenario consists of three " + + "suites with 1, 2 and 3 tests respectively. One suite with two tests has a test consisting of a " + + "single test class without a factory while the other shall consist of test classes with factories " + + "using data providers with varying numbers of data sets. One suite shall consist of a single test " + + "with multiple test classes with factories using data providers with varying numbers of data sets. " + + "One suite shall have multiple tests with multiple classes, none of which use a factory."); + + log.debug( + "Suite: " + + SUITE_A + + ", Test: " + + SUITE_A_TEST_A + + ", Test classes: " + + TestClassAFiveMethodsWithFactoryUsingDataProviderAndNoDepsSample.class + .getCanonicalName() + + ", " + + TestClassCSixMethodsWithFactoryUsingDataProviderAndNoDepsSample.class + .getCanonicalName() + + ". Thread count: 10"); + + log.debug( + "Suite: " + + SUITE_B + + ", Test: " + + SUITE_B_TEST_A + + ", Test class: " + + TestClassEFiveMethodsWithNoDepsSample.class.getCanonicalName() + + ". Thread count: 3"); + + log.debug( + "Suite " + + SUITE_B + + ", Test: " + + SUITE_B_TEST_B + + ", Test classes: " + + TestClassDThreeMethodsWithFactoryUsingDataProviderAndNoDepsSample.class + + ", " + + TestClassBFourMethodsWithFactoryUsingDataProviderAndNoDepsSample.class + + ", " + + TestClassFSixMethodsWithFactoryUsingDataProviderAndNoDepsSample.class + + ". Thread count: 20"); + + log.debug( + "Suite: " + + SUITE_C + + ", Test: " + + SUITE_C_TEST_A + + ", Test classes: " + + TestClassGThreeMethodsWithNoDepsSample.class.getCanonicalName() + + ", " + + TestClassHFourMethodsWithNoDepsSample.class.getCanonicalName() + + ", " + + TestClassIFiveMethodsWithNoDepsSample.class + + ". Thread count: 10"); + + log.debug( + "Suite: " + + SUITE_C + + ", Test: " + + SUITE_C_TEST_B + + ", Test classes: " + + TestClassJFourMethodsWithNoDepsSample.class.getCanonicalName() + + ", " + + TestClassKFiveMethodsWithNoDepsSample.class + + ". Thread count: 5"); + + log.debug( + "Suite: " + + SUITE_C + + ", Test: " + + SUITE_C_TEST_C + + ", Test classes: " + + TestClassLThreeMethodsWithNoDepsSample.class.getCanonicalName() + + ", " + + TestClassMFourMethodsWithNoDepsSample.class.getCanonicalName() + + ", " + + TestClassNFiveMethodsWithNoDepsSample.class.getCanonicalName() + + ", " + + TestClassOSixMethodsWithNoDepsSample.class.getCanonicalName() + + ". Thread count: 12."); + + tng.run(); + + expectedInvocationCounts.put( + TestClassAFiveMethodsWithFactoryUsingDataProviderAndNoDepsSample.class.getCanonicalName() + + ".testMethodA", + 3); + expectedInvocationCounts.put( + TestClassAFiveMethodsWithFactoryUsingDataProviderAndNoDepsSample.class.getCanonicalName() + + ".testMethodB", + 3); + expectedInvocationCounts.put( + TestClassAFiveMethodsWithFactoryUsingDataProviderAndNoDepsSample.class.getCanonicalName() + + ".testMethodC", + 3); + expectedInvocationCounts.put( + TestClassAFiveMethodsWithFactoryUsingDataProviderAndNoDepsSample.class.getCanonicalName() + + ".testMethodD", + 3); + expectedInvocationCounts.put( + TestClassAFiveMethodsWithFactoryUsingDataProviderAndNoDepsSample.class.getCanonicalName() + + ".testMethodE", + 3); + + expectedInvocationCounts.put( + TestClassCSixMethodsWithFactoryUsingDataProviderAndNoDepsSample.class.getCanonicalName() + + ".testMethodA", + 4); + expectedInvocationCounts.put( + TestClassCSixMethodsWithFactoryUsingDataProviderAndNoDepsSample.class.getCanonicalName() + + ".testMethodB", + 4); + expectedInvocationCounts.put( + TestClassCSixMethodsWithFactoryUsingDataProviderAndNoDepsSample.class.getCanonicalName() + + ".testMethodC", + 4); + expectedInvocationCounts.put( + TestClassCSixMethodsWithFactoryUsingDataProviderAndNoDepsSample.class.getCanonicalName() + + ".testMethodD", + 4); + expectedInvocationCounts.put( + TestClassCSixMethodsWithFactoryUsingDataProviderAndNoDepsSample.class.getCanonicalName() + + ".testMethodE", + 4); + expectedInvocationCounts.put( + TestClassCSixMethodsWithFactoryUsingDataProviderAndNoDepsSample.class.getCanonicalName() + + ".testMethodF", + 4); + + expectedInvocationCounts.put( + TestClassEFiveMethodsWithNoDepsSample.class.getCanonicalName() + ".testMethodA", 1); + expectedInvocationCounts.put( + TestClassEFiveMethodsWithNoDepsSample.class.getCanonicalName() + ".testMethodB", 1); + expectedInvocationCounts.put( + TestClassEFiveMethodsWithNoDepsSample.class.getCanonicalName() + ".testMethodC", 1); + expectedInvocationCounts.put( + TestClassEFiveMethodsWithNoDepsSample.class.getCanonicalName() + ".testMethodD", 1); + expectedInvocationCounts.put( + TestClassEFiveMethodsWithNoDepsSample.class.getCanonicalName() + ".testMethodE", 1); + + expectedInvocationCounts.put( + TestClassDThreeMethodsWithFactoryUsingDataProviderAndNoDepsSample.class.getCanonicalName() + + ".testMethodA", + 4); + expectedInvocationCounts.put( + TestClassDThreeMethodsWithFactoryUsingDataProviderAndNoDepsSample.class.getCanonicalName() + + ".testMethodB", + 4); + expectedInvocationCounts.put( + TestClassDThreeMethodsWithFactoryUsingDataProviderAndNoDepsSample.class.getCanonicalName() + + ".testMethodC", + 4); + + expectedInvocationCounts.put( + TestClassBFourMethodsWithFactoryUsingDataProviderAndNoDepsSample.class.getCanonicalName() + + ".testMethodA", + 4); + expectedInvocationCounts.put( + TestClassBFourMethodsWithFactoryUsingDataProviderAndNoDepsSample.class.getCanonicalName() + + ".testMethodB", + 4); + expectedInvocationCounts.put( + TestClassBFourMethodsWithFactoryUsingDataProviderAndNoDepsSample.class.getCanonicalName() + + ".testMethodC", + 4); + expectedInvocationCounts.put( + TestClassBFourMethodsWithFactoryUsingDataProviderAndNoDepsSample.class.getCanonicalName() + + ".testMethodD", + 4); + + expectedInvocationCounts.put( + TestClassFSixMethodsWithFactoryUsingDataProviderAndNoDepsSample.class.getCanonicalName() + + ".testMethodA", + 4); + expectedInvocationCounts.put( + TestClassFSixMethodsWithFactoryUsingDataProviderAndNoDepsSample.class.getCanonicalName() + + ".testMethodB", + 4); + expectedInvocationCounts.put( + TestClassFSixMethodsWithFactoryUsingDataProviderAndNoDepsSample.class.getCanonicalName() + + ".testMethodC", + 4); + expectedInvocationCounts.put( + TestClassFSixMethodsWithFactoryUsingDataProviderAndNoDepsSample.class.getCanonicalName() + + ".testMethodD", + 4); + expectedInvocationCounts.put( + TestClassFSixMethodsWithFactoryUsingDataProviderAndNoDepsSample.class.getCanonicalName() + + ".testMethodE", + 4); + expectedInvocationCounts.put( + TestClassFSixMethodsWithFactoryUsingDataProviderAndNoDepsSample.class.getCanonicalName() + + ".testMethodF", + 4); + + expectedInvocationCounts.put( + TestClassGThreeMethodsWithNoDepsSample.class.getCanonicalName() + ".testMethodA", 1); + expectedInvocationCounts.put( + TestClassGThreeMethodsWithNoDepsSample.class.getCanonicalName() + ".testMethodB", 1); + expectedInvocationCounts.put( + TestClassGThreeMethodsWithNoDepsSample.class.getCanonicalName() + ".testMethodC", 1); + + expectedInvocationCounts.put( + TestClassHFourMethodsWithNoDepsSample.class.getCanonicalName() + ".testMethodA", 1); + expectedInvocationCounts.put( + TestClassHFourMethodsWithNoDepsSample.class.getCanonicalName() + ".testMethodB", 1); + expectedInvocationCounts.put( + TestClassHFourMethodsWithNoDepsSample.class.getCanonicalName() + ".testMethodC", 1); + expectedInvocationCounts.put( + TestClassHFourMethodsWithNoDepsSample.class.getCanonicalName() + ".testMethodD", 1); + + expectedInvocationCounts.put( + TestClassIFiveMethodsWithNoDepsSample.class.getCanonicalName() + ".testMethodA", 1); + expectedInvocationCounts.put( + TestClassIFiveMethodsWithNoDepsSample.class.getCanonicalName() + ".testMethodB", 1); + expectedInvocationCounts.put( + TestClassIFiveMethodsWithNoDepsSample.class.getCanonicalName() + ".testMethodC", 1); + expectedInvocationCounts.put( + TestClassIFiveMethodsWithNoDepsSample.class.getCanonicalName() + ".testMethodD", 1); + expectedInvocationCounts.put( + TestClassIFiveMethodsWithNoDepsSample.class.getCanonicalName() + ".testMethodE", 1); + + expectedInvocationCounts.put( + TestClassJFourMethodsWithNoDepsSample.class.getCanonicalName() + ".testMethodA", 1); + expectedInvocationCounts.put( + TestClassJFourMethodsWithNoDepsSample.class.getCanonicalName() + ".testMethodB", 1); + expectedInvocationCounts.put( + TestClassJFourMethodsWithNoDepsSample.class.getCanonicalName() + ".testMethodC", 1); + expectedInvocationCounts.put( + TestClassJFourMethodsWithNoDepsSample.class.getCanonicalName() + ".testMethodD", 1); + + expectedInvocationCounts.put( + TestClassKFiveMethodsWithNoDepsSample.class.getCanonicalName() + ".testMethodA", 1); + expectedInvocationCounts.put( + TestClassKFiveMethodsWithNoDepsSample.class.getCanonicalName() + ".testMethodB", 1); + expectedInvocationCounts.put( + TestClassKFiveMethodsWithNoDepsSample.class.getCanonicalName() + ".testMethodC", 1); + expectedInvocationCounts.put( + TestClassKFiveMethodsWithNoDepsSample.class.getCanonicalName() + ".testMethodD", 1); + expectedInvocationCounts.put( + TestClassKFiveMethodsWithNoDepsSample.class.getCanonicalName() + ".testMethodE", 1); + + expectedInvocationCounts.put( + TestClassLThreeMethodsWithNoDepsSample.class.getCanonicalName() + ".testMethodA", 1); + expectedInvocationCounts.put( + TestClassLThreeMethodsWithNoDepsSample.class.getCanonicalName() + ".testMethodB", 1); + expectedInvocationCounts.put( + TestClassLThreeMethodsWithNoDepsSample.class.getCanonicalName() + ".testMethodC", 1); + + expectedInvocationCounts.put( + TestClassMFourMethodsWithNoDepsSample.class.getCanonicalName() + ".testMethodA", 1); + expectedInvocationCounts.put( + TestClassMFourMethodsWithNoDepsSample.class.getCanonicalName() + ".testMethodB", 1); + expectedInvocationCounts.put( + TestClassMFourMethodsWithNoDepsSample.class.getCanonicalName() + ".testMethodC", 1); + expectedInvocationCounts.put( + TestClassMFourMethodsWithNoDepsSample.class.getCanonicalName() + ".testMethodD", 1); + + expectedInvocationCounts.put( + TestClassNFiveMethodsWithNoDepsSample.class.getCanonicalName() + ".testMethodA", 1); + expectedInvocationCounts.put( + TestClassNFiveMethodsWithNoDepsSample.class.getCanonicalName() + ".testMethodB", 1); + expectedInvocationCounts.put( + TestClassNFiveMethodsWithNoDepsSample.class.getCanonicalName() + ".testMethodC", 1); + expectedInvocationCounts.put( + TestClassNFiveMethodsWithNoDepsSample.class.getCanonicalName() + ".testMethodD", 1); + expectedInvocationCounts.put( + TestClassNFiveMethodsWithNoDepsSample.class.getCanonicalName() + ".testMethodE", 1); + + expectedInvocationCounts.put( + TestClassOSixMethodsWithNoDepsSample.class.getCanonicalName() + ".testMethodA", 1); + expectedInvocationCounts.put( + TestClassOSixMethodsWithNoDepsSample.class.getCanonicalName() + ".testMethodB", 1); + expectedInvocationCounts.put( + TestClassOSixMethodsWithNoDepsSample.class.getCanonicalName() + ".testMethodC", 1); + expectedInvocationCounts.put( + TestClassOSixMethodsWithNoDepsSample.class.getCanonicalName() + ".testMethodD", 1); + expectedInvocationCounts.put( + TestClassOSixMethodsWithNoDepsSample.class.getCanonicalName() + ".testMethodE", 1); + expectedInvocationCounts.put( + TestClassOSixMethodsWithNoDepsSample.class.getCanonicalName() + ".testMethodF", 1); + + suiteLevelEventLogs = getAllSuiteLevelEventLogs(); + testLevelEventLogs = getAllTestLevelEventLogs(); + testMethodLevelEventLogs = getAllTestMethodLevelEventLogs(); + + suiteOneSuiteAndTestLevelEventLogs = getSuiteAndTestLevelEventLogsForSuite(SUITE_A); + suiteOneSuiteLevelEventLogs = getSuiteLevelEventLogsForSuite(SUITE_A); + suiteOneTestLevelEventLogs = getTestLevelEventLogsForSuite(SUITE_A); + + suiteTwoSuiteAndTestLevelEventLogs = getSuiteAndTestLevelEventLogsForSuite(SUITE_B); + suiteTwoSuiteLevelEventLogs = getSuiteLevelEventLogsForSuite(SUITE_B); + suiteTwoTestLevelEventLogs = getTestLevelEventLogsForSuite(SUITE_B); + + suiteThreeSuiteAndTestLevelEventLogs = getSuiteAndTestLevelEventLogsForSuite(SUITE_C); + suiteThreeSuiteLevelEventLogs = getSuiteLevelEventLogsForSuite(SUITE_C); + suiteThreeTestLevelEventLogs = getTestLevelEventLogsForSuite(SUITE_C); + + suiteOneTestMethodLevelEventLogs = getTestMethodLevelEventLogsForSuite(SUITE_A); + suiteTwoTestMethodLevelEventLogs = getTestMethodLevelEventLogsForSuite(SUITE_B); + suiteThreeTestMethodLevelEventLogs = getTestMethodLevelEventLogsForSuite(SUITE_C); + + suiteOneTestOneTestMethodLevelEventLogs = + getTestMethodLevelEventLogsForTest(SUITE_A, SUITE_A_TEST_A); + + suiteTwoTestOneTestMethodLevelEventLogs = + getTestMethodLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_A); + suiteTwoTestTwoTestMethodLevelEventLogs = + getTestMethodLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_B); + + suiteThreeTestOneTestMethodLevelEventLogs = + getTestMethodLevelEventLogsForTest(SUITE_C, SUITE_C_TEST_A); + suiteThreeTestTwoTestMethodLevelEventLogs = + getTestMethodLevelEventLogsForTest(SUITE_C, SUITE_C_TEST_B); + suiteThreeTestThreeTestMethodLevelEventLogs = + getTestMethodLevelEventLogsForTest(SUITE_C, SUITE_C_TEST_C); + + testEventLogsMap.put(SUITE_B_TEST_A, getTestLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_A)); + testEventLogsMap.put(SUITE_B_TEST_B, getTestLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_B)); + + testEventLogsMap.put(SUITE_C_TEST_A, getTestLevelEventLogsForTest(SUITE_C, SUITE_C_TEST_A)); + testEventLogsMap.put(SUITE_C_TEST_B, getTestLevelEventLogsForTest(SUITE_C, SUITE_C_TEST_B)); + testEventLogsMap.put(SUITE_C_TEST_C, getTestLevelEventLogsForTest(SUITE_C, SUITE_C_TEST_C)); + + suiteOneSuiteListenerOnStartEventLog = getSuiteListenerStartEventLog(SUITE_A); + suiteOneSuiteListenerOnFinishEventLog = getSuiteListenerFinishEventLog(SUITE_A); + + suiteTwoSuiteListenerOnStartEventLog = getSuiteListenerStartEventLog(SUITE_B); + suiteTwoSuiteListenerOnFinishEventLog = getSuiteListenerFinishEventLog(SUITE_B); + + suiteThreeSuiteListenerOnStartEventLog = getSuiteListenerStartEventLog(SUITE_C); + suiteThreeSuiteListenerOnFinishEventLog = getSuiteListenerFinishEventLog(SUITE_C); + + suiteOneTestOneListenerOnStartEventLog = getTestListenerStartEventLog(SUITE_A, SUITE_A_TEST_A); + suiteOneTestOneListenerOnFinishEventLog = + getTestListenerFinishEventLog(SUITE_A, SUITE_A_TEST_A); + + suiteTwoTestOneListenerOnStartEventLog = getTestListenerStartEventLog(SUITE_B, SUITE_B_TEST_A); + suiteTwoTestOneListenerOnFinishEventLog = + getTestListenerFinishEventLog(SUITE_B, SUITE_B_TEST_A); + + suiteTwoTestTwoListenerOnStartEventLog = getTestListenerStartEventLog(SUITE_B, SUITE_B_TEST_B); + suiteTwoTestTwoListenerOnFinishEventLog = + getTestListenerFinishEventLog(SUITE_B, SUITE_B_TEST_B); + + suiteThreeTestOneListenerOnStartEventLog = + getTestListenerStartEventLog(SUITE_C, SUITE_C_TEST_A); + suiteThreeTestOneListenerOnFinishEventLog = + getTestListenerFinishEventLog(SUITE_C, SUITE_C_TEST_A); + suiteThreeTestTwoListenerOnStartEventLog = + getTestListenerStartEventLog(SUITE_C, SUITE_C_TEST_B); + suiteThreeTestTwoListenerOnFinishEventLog = + getTestListenerFinishEventLog(SUITE_C, SUITE_C_TEST_B); + suiteThreeTestThreeListenerOnStartEventLog = + getTestListenerStartEventLog(SUITE_C, SUITE_C_TEST_C); + suiteThreeTestThreeListenerOnFinishEventLog = + getTestListenerFinishEventLog(SUITE_C, SUITE_C_TEST_C); + } + + // Verifies that the expected number of suite, test and test method level events were logged for + // each of the three + // suites. + @Test + public void sanityCheck() { + assertEquals( + suiteLevelEventLogs.size(), + 6, + "There should be 6 suite level events logged for " + + SUITE_A + + ", " + + SUITE_B + + " and " + + SUITE_C + + ": " + + suiteLevelEventLogs); + assertEquals( + testLevelEventLogs.size(), + 12, + "There should be 12 test level events logged for " + + SUITE_A + + ", " + + SUITE_B + + " and " + + SUITE_C + + ": " + + testLevelEventLogs); + + assertEquals( + testMethodLevelEventLogs.size(), + 405, + "There should 405 test method level events logged for " + + SUITE_A + + ", " + + SUITE_B + + " and " + + SUITE_C + + ": " + + testMethodLevelEventLogs); + + assertEquals( + suiteOneSuiteLevelEventLogs.size(), + 2, + "There should be 2 suite level events logged for " + + SUITE_A + + ": " + + suiteOneSuiteLevelEventLogs); + assertEquals( + suiteOneTestLevelEventLogs.size(), + 2, + "There should be 2 test level events logged for " + + SUITE_A + + ": " + + suiteOneTestLevelEventLogs); + assertEquals( + suiteOneTestMethodLevelEventLogs.size(), + 117, + "There should be 117 test method level events " + + "logged for " + + SUITE_A + + ": " + + suiteOneTestMethodLevelEventLogs); + + assertEquals( + suiteTwoSuiteLevelEventLogs.size(), + 2, + "There should be 2 suite level events logged for " + + SUITE_B + + ": " + + suiteTwoSuiteLevelEventLogs); + assertEquals( + suiteTwoTestLevelEventLogs.size(), + 4, + "There should be 4 test level events logged for " + + SUITE_B + + ": " + + suiteTwoTestLevelEventLogs); + assertEquals( + suiteTwoTestMethodLevelEventLogs.size(), + 171, + "There should be 171 test method level events " + + "logged for " + + SUITE_B + + ": " + + suiteTwoTestMethodLevelEventLogs); + + assertEquals( + suiteThreeSuiteLevelEventLogs.size(), + 2, + "There should be 2 suite level events logged for " + + SUITE_C + + ": " + + suiteThreeSuiteLevelEventLogs); + assertEquals( + suiteThreeTestLevelEventLogs.size(), + 6, + "There should be 6 test level events logged for " + + SUITE_C + + ": " + + suiteThreeTestLevelEventLogs); + assertEquals( + suiteThreeTestMethodLevelEventLogs.size(), + 117, + "There should be 117 test method level events " + + "logged for " + + SUITE_C + + ": " + + suiteThreeTestMethodLevelEventLogs); + } + + // Verify that the suites run in parallel by checking that the suite and test level events for + // both suites have + // overlapping timestamps. Verify that there are two separate threads executing the suite-level + // and test-level + // events for each suite. + @Test + public void verifyThatSuitesRunInParallelThreads() { + verifyParallelSuitesWithUnequalExecutionTimes(suiteLevelEventLogs, THREAD_POOL_SIZE); + } + + @Test + public void verifyTestLevelEventsRunInSequentialOrderForIndividualSuites() { + verifySequentialTests( + suiteOneSuiteAndTestLevelEventLogs, + suiteOneTestLevelEventLogs, + suiteOneSuiteListenerOnStartEventLog, + suiteOneSuiteListenerOnFinishEventLog); + + verifySequentialTests( + suiteTwoSuiteAndTestLevelEventLogs, + suiteTwoTestLevelEventLogs, + suiteTwoSuiteListenerOnStartEventLog, + suiteTwoSuiteListenerOnFinishEventLog); + + verifySequentialTests( + suiteThreeSuiteAndTestLevelEventLogs, + suiteThreeTestLevelEventLogs, + suiteThreeSuiteListenerOnStartEventLog, + suiteThreeSuiteListenerOnFinishEventLog); + } + + // Verify the expected number of test class instances for the test method events. + // Verify that the same test class instances are associated with each of the test methods from the + // sample test class + @Test + public void verifyNumberOfInstanceOfTestClassForAllTestMethodsForAllSuites() { + + verifyNumberOfInstancesOfTestClassesForMethods( + SUITE_A, + SUITE_A_TEST_A, + Arrays.asList( + TestClassAFiveMethodsWithFactoryUsingDataProviderAndNoDepsSample.class, + TestClassCSixMethodsWithFactoryUsingDataProviderAndNoDepsSample.class), + 3, + 4); + + verifySameInstancesOfTestClassesAssociatedWithMethods( + SUITE_A, + SUITE_A_TEST_A, + Arrays.asList( + TestClassAFiveMethodsWithFactoryUsingDataProviderAndNoDepsSample.class, + TestClassCSixMethodsWithFactoryUsingDataProviderAndNoDepsSample.class)); + + verifyNumberOfInstancesOfTestClassForMethods( + SUITE_B, SUITE_B_TEST_A, TestClassEFiveMethodsWithNoDepsSample.class, 1); + + verifySameInstancesOfTestClassAssociatedWithMethods( + SUITE_B, SUITE_B_TEST_A, TestClassEFiveMethodsWithNoDepsSample.class); + + verifyNumberOfInstancesOfTestClassesForMethods( + SUITE_B, + SUITE_B_TEST_B, + Arrays.asList( + TestClassDThreeMethodsWithFactoryUsingDataProviderAndNoDepsSample.class, + TestClassBFourMethodsWithFactoryUsingDataProviderAndNoDepsSample.class, + TestClassFSixMethodsWithFactoryUsingDataProviderAndNoDepsSample.class), + 4, + 4, + 4); + + verifySameInstancesOfTestClassesAssociatedWithMethods( + SUITE_B, + SUITE_B_TEST_B, + Arrays.asList( + TestClassDThreeMethodsWithFactoryUsingDataProviderAndNoDepsSample.class, + TestClassBFourMethodsWithFactoryUsingDataProviderAndNoDepsSample.class, + TestClassFSixMethodsWithFactoryUsingDataProviderAndNoDepsSample.class)); + + verifyNumberOfInstancesOfTestClassesForMethods( + SUITE_C, + SUITE_C_TEST_A, + Arrays.asList( + TestClassGThreeMethodsWithNoDepsSample.class, + TestClassHFourMethodsWithNoDepsSample.class, + TestClassIFiveMethodsWithNoDepsSample.class), + 1); + + verifySameInstancesOfTestClassesAssociatedWithMethods( + SUITE_C, + SUITE_C_TEST_A, + Arrays.asList( + TestClassGThreeMethodsWithNoDepsSample.class, + TestClassHFourMethodsWithNoDepsSample.class, + TestClassIFiveMethodsWithNoDepsSample.class)); + + verifyNumberOfInstancesOfTestClassesForMethods( + SUITE_C, + SUITE_C_TEST_B, + Arrays.asList( + TestClassJFourMethodsWithNoDepsSample.class, + TestClassKFiveMethodsWithNoDepsSample.class), + 1); + + verifySameInstancesOfTestClassesAssociatedWithMethods( + SUITE_C, + SUITE_C_TEST_B, + Arrays.asList( + TestClassJFourMethodsWithNoDepsSample.class, + TestClassKFiveMethodsWithNoDepsSample.class)); + + verifyNumberOfInstancesOfTestClassesForMethods( + SUITE_C, + SUITE_C_TEST_C, + Arrays.asList( + TestClassLThreeMethodsWithNoDepsSample.class, + TestClassMFourMethodsWithNoDepsSample.class, + TestClassNFiveMethodsWithNoDepsSample.class, + TestClassOSixMethodsWithNoDepsSample.class), + 1); + + verifySameInstancesOfTestClassesAssociatedWithMethods( + SUITE_C, + SUITE_C_TEST_C, + Arrays.asList( + TestClassLThreeMethodsWithNoDepsSample.class, + TestClassMFourMethodsWithNoDepsSample.class, + TestClassNFiveMethodsWithNoDepsSample.class, + TestClassOSixMethodsWithNoDepsSample.class)); + } + + // Verify that the test method listener's onTestStart method runs after the test listener's + // onStart method for + // all the test methods in all tests and suites. + @Test + public void + verifyTestLevelMethodLevelEventLogsOccurBetweenAfterTestListenerStartAndFinishEventLogs() { + verifyEventsOccurBetween( + suiteOneTestOneListenerOnStartEventLog, + suiteOneTestOneTestMethodLevelEventLogs, + suiteOneTestOneListenerOnFinishEventLog, + "All of the test method level event logs for " + + SUITE_A_TEST_A + + " should have timestamps between the test listener's onStart and onFinish " + + "event logs for " + + SUITE_A_TEST_A + + ". Test listener onStart event log: " + + suiteOneTestOneListenerOnStartEventLog + + ". Test listener onFinish event log: " + + suiteOneTestOneListenerOnFinishEventLog + + ". Test method level event logs: " + + suiteOneTestOneTestMethodLevelEventLogs); + + verifyEventsOccurBetween( + suiteTwoTestOneListenerOnStartEventLog, + suiteTwoTestOneTestMethodLevelEventLogs, + suiteTwoTestOneListenerOnFinishEventLog, + "All of the test method level event logs for " + + SUITE_B_TEST_A + + " should have timestamps between the test listener's onStart and onFinish " + + "event logs for " + + SUITE_B_TEST_A + + ". Test listener onStart event log: " + + suiteTwoTestOneListenerOnStartEventLog + + ". Test listener onFinish event log: " + + suiteTwoTestOneListenerOnFinishEventLog + + ". Test method level event logs: " + + suiteTwoTestOneTestMethodLevelEventLogs); + + verifyEventsOccurBetween( + suiteTwoTestTwoListenerOnStartEventLog, + suiteTwoTestTwoTestMethodLevelEventLogs, + suiteTwoTestTwoListenerOnFinishEventLog, + "All of the test method level event logs for " + + SUITE_B_TEST_B + + " should have timestamps between the test listener's onStart and onFinish " + + "event logs for " + + SUITE_B_TEST_B + + ". Test listener onStart event log: " + + suiteTwoTestTwoListenerOnStartEventLog + + ". Test listener onFinish event log: " + + suiteTwoTestTwoListenerOnFinishEventLog + + ". Test method level event logs: " + + suiteTwoTestTwoTestMethodLevelEventLogs); + + verifyEventsOccurBetween( + suiteThreeTestOneListenerOnStartEventLog, + suiteThreeTestOneTestMethodLevelEventLogs, + suiteThreeTestOneListenerOnFinishEventLog, + "All of the test method level event logs for " + + SUITE_C_TEST_A + + " should have timestamps between the test listener's onStart and onFinish " + + "event logs for " + + SUITE_C_TEST_A + + ". Test listener onStart event log: " + + suiteThreeTestOneListenerOnStartEventLog + + ". Test listener onFinish event log: " + + suiteThreeTestOneListenerOnFinishEventLog + + ". Test method level event logs: " + + suiteThreeTestOneTestMethodLevelEventLogs); + + verifyEventsOccurBetween( + suiteThreeTestTwoListenerOnStartEventLog, + suiteThreeTestTwoTestMethodLevelEventLogs, + suiteThreeTestTwoListenerOnFinishEventLog, + "All of the test method level event logs for " + + SUITE_C_TEST_B + + " should have timestamps between the test listener's onStart and onFinish " + + "event logs for " + + SUITE_C_TEST_B + + ". Test listener onStart event log: " + + suiteThreeTestTwoListenerOnStartEventLog + + ". Test listener onFinish event log: " + + suiteThreeTestTwoListenerOnFinishEventLog + + ". Test method level event logs: " + + suiteThreeTestTwoTestMethodLevelEventLogs); + + verifyEventsOccurBetween( + suiteThreeTestThreeListenerOnStartEventLog, + suiteThreeTestThreeTestMethodLevelEventLogs, + suiteThreeTestThreeListenerOnFinishEventLog, + "All of the test method level event logs for " + + SUITE_C_TEST_C + + " should have timestamps between the test listener's onStart and onFinish " + + "event logs for " + + SUITE_C_TEST_C + + ". Test listener onStart event log: " + + suiteThreeTestThreeListenerOnStartEventLog + + ". Test listener onFinish event log: " + + suiteThreeTestThreeListenerOnFinishEventLog + + ". Test method level event logs: " + + suiteThreeTestThreeTestMethodLevelEventLogs); + } + + // Verifies that the method level events all run in different threads from the test and suite + // level events. + // Verifies that the test method listener and execution events for a given test method all run in + // the same thread. + @Test + public void verifyThatMethodLevelEventsRunInDifferentThreadsFromSuiteAndTestLevelEvents() { + + verifyEventThreadsSpawnedAfter( + getAllSuiteListenerStartEventLogs().get(0).getThreadId(), + testMethodLevelEventLogs, + "All the thread IDs for the test method level events should be greater than the thread ID for the " + + "suite and test level events. The expectation is that since the suite and test level events " + + "are running sequentially, and all the test methods are running in parallel, new threads " + + "will be spawned after the thread executing the suite and test level events when new methods " + + "begin executing. Suite and test level events thread ID: " + + getAllSuiteListenerStartEventLogs().get(0).getThreadId() + + ". Test method level event logs: " + + testMethodLevelEventLogs); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassAFiveMethodsWithFactoryUsingDataProviderAndNoDepsSample.class, + SUITE_A, + SUITE_A_TEST_A); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassCSixMethodsWithFactoryUsingDataProviderAndNoDepsSample.class, + SUITE_A, + SUITE_A_TEST_A); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassEFiveMethodsWithNoDepsSample.class, SUITE_B, SUITE_B_TEST_A); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassDThreeMethodsWithFactoryUsingDataProviderAndNoDepsSample.class, + SUITE_B, + SUITE_B_TEST_B); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassBFourMethodsWithFactoryUsingDataProviderAndNoDepsSample.class, + SUITE_B, + SUITE_B_TEST_B); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassFSixMethodsWithFactoryUsingDataProviderAndNoDepsSample.class, + SUITE_B, + SUITE_B_TEST_B); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassGThreeMethodsWithNoDepsSample.class, SUITE_C, SUITE_C_TEST_A); + verifyEventsForTestMethodsRunInTheSameThread( + TestClassHFourMethodsWithNoDepsSample.class, SUITE_C, SUITE_C_TEST_A); + verifyEventsForTestMethodsRunInTheSameThread( + TestClassIFiveMethodsWithNoDepsSample.class, SUITE_C, SUITE_C_TEST_A); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassJFourMethodsWithNoDepsSample.class, SUITE_C, SUITE_C_TEST_B); + verifyEventsForTestMethodsRunInTheSameThread( + TestClassKFiveMethodsWithNoDepsSample.class, SUITE_C, SUITE_C_TEST_B); + + verifyEventsForTestMethodsRunInTheSameThread( + TestClassLThreeMethodsWithNoDepsSample.class, SUITE_C, SUITE_C_TEST_C); + verifyEventsForTestMethodsRunInTheSameThread( + TestClassMFourMethodsWithNoDepsSample.class, SUITE_C, SUITE_C_TEST_C); + verifyEventsForTestMethodsRunInTheSameThread( + TestClassNFiveMethodsWithNoDepsSample.class, SUITE_C, SUITE_C_TEST_C); + verifyEventsForTestMethodsRunInTheSameThread( + TestClassOSixMethodsWithNoDepsSample.class, SUITE_C, SUITE_C_TEST_C); + } + + // Verifies that the test methods execute in different threads in parallel fashion. + @Test + public void verifyThatTestMethodsRunInParallelThreads() { + verifySimultaneousTestMethods( + getTestMethodLevelEventLogsForTest(SUITE_A, SUITE_A_TEST_A), SUITE_A_TEST_A, 10); + verifySimultaneousTestMethods( + getTestMethodLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_A), SUITE_B_TEST_A, 3); + verifySimultaneousTestMethods( + getTestMethodLevelEventLogsForTest(SUITE_B, SUITE_B_TEST_B), SUITE_B_TEST_B, 20); + verifySimultaneousTestMethods( + getTestMethodLevelEventLogsForTest(SUITE_C, SUITE_C_TEST_A), SUITE_C_TEST_A, 25); + verifySimultaneousTestMethods( + getTestMethodLevelEventLogsForTest(SUITE_C, SUITE_C_TEST_B), SUITE_C_TEST_B, 5); + verifySimultaneousTestMethods( + getTestMethodLevelEventLogsForTest(SUITE_C, SUITE_C_TEST_C), SUITE_C_TEST_C, 12); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/TestNgRunStateListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/TestNgRunStateListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/TestNgRunStateListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/TestNgRunStateListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,121 @@ +package test.thread.parallelization; + +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_INSTANCE; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_BELONGING_TO; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHODS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHOD_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.SUITE_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.TEST_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.LISTENER_SUITE_FINISH; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.LISTENER_SUITE_START; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.LISTENER_TEST_FINISH; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.LISTENER_TEST_METHOD_FAIL; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.LISTENER_TEST_METHOD_FAIL_PERCENTAGE; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.LISTENER_TEST_METHOD_PASS; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.LISTENER_TEST_METHOD_SKIPPED; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.LISTENER_TEST_METHOD_START; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.LISTENER_TEST_START; +import static test.thread.parallelization.TestNgRunStateTracker.logEvent; + +import java.util.concurrent.TimeUnit; +import org.testng.ISuite; +import org.testng.ISuiteListener; +import org.testng.ITestContext; +import org.testng.ITestListener; +import org.testng.ITestResult; +import test.thread.parallelization.TestNgRunStateTracker.EventLog; +import test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent; + +public class TestNgRunStateListener implements ISuiteListener, ITestListener { + + @Override + public void onStart(ISuite suite) { + logEvent(buildEventLog(suite, LISTENER_SUITE_START).build()); + delayAfterEvent(LISTENER_SUITE_START); + } + + @Override + public void onFinish(ISuite suite) { + logEvent(buildEventLog(suite, LISTENER_SUITE_FINISH).build()); + delayAfterEvent(LISTENER_SUITE_FINISH); + } + + @Override + public void onStart(ITestContext context) { + logEvent(buildEventLog(context, LISTENER_TEST_START).build()); + delayAfterEvent(LISTENER_TEST_START); + } + + @Override + public void onFinish(ITestContext context) { + logEvent(buildEventLog(context, LISTENER_TEST_FINISH).build()); + delayAfterEvent(LISTENER_TEST_FINISH); + } + + @Override + public void onTestStart(ITestResult result) { + logEvent(buildEventLog(result, LISTENER_TEST_METHOD_START).build()); + delayAfterEvent(LISTENER_TEST_METHOD_START); + } + + @Override + public void onTestSuccess(ITestResult result) { + logEvent(buildEventLog(result, LISTENER_TEST_METHOD_PASS).build()); + delayAfterEvent(LISTENER_TEST_METHOD_PASS); + } + + @Override + public void onTestFailure(ITestResult result) { + logEvent(buildEventLog(result, LISTENER_TEST_METHOD_FAIL).build()); + delayAfterEvent(LISTENER_TEST_METHOD_FAIL); + } + + @Override + public void onTestSkipped(ITestResult result) { + logEvent(buildEventLog(result, LISTENER_TEST_METHOD_SKIPPED).build()); + delayAfterEvent(LISTENER_TEST_METHOD_SKIPPED); + } + + @Override + public void onTestFailedButWithinSuccessPercentage(ITestResult result) { + logEvent(buildEventLog(result, LISTENER_TEST_METHOD_FAIL_PERCENTAGE).build()); + delayAfterEvent(LISTENER_TEST_METHOD_FAIL_PERCENTAGE); + } + + private TestNgRunStateTracker.EventLogBuilder buildEventLog(ISuite suite, TestNgRunEvent event) { + long time = System.currentTimeMillis(); + + return EventLog.builder() + .setEvent(event) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(SUITE_NAME, suite.getName()); + } + + private TestNgRunStateTracker.EventLogBuilder buildEventLog( + ITestContext context, TestNgRunEvent event) { + return buildEventLog(context.getSuite(), event).addData(TEST_NAME, context.getName()); + } + + private TestNgRunStateTracker.EventLogBuilder buildEventLog( + ITestResult result, TestNgRunEvent event) { + + return (buildEventLog(result.getTestContext(), event)) + .addData(METHOD_NAME, result.getMethod().getMethodName()) + .addData(CLASS_NAME, result.getMethod().getRealClass().getCanonicalName()) + .addData(CLASS_INSTANCE, result.getMethod().getInstance()) + .addData(GROUPS_DEPENDED_ON, result.getMethod().getGroupsDependedUpon()) + .addData(METHODS_DEPENDED_ON, result.getMethod().getMethodsDependedUpon()) + .addData(GROUPS_BELONGING_TO, result.getMethod().getGroups()); + } + + private void delayAfterEvent(TestNgRunEvent event) { + try { + TimeUnit.MILLISECONDS.sleep(500); + } catch (InterruptedException e) { + throw new RuntimeException("Problem with delaying after listener event: " + event, e); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/TestNgRunStateTracker.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/TestNgRunStateTracker.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/TestNgRunStateTracker.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/TestNgRunStateTracker.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,1049 @@ +package test.thread.parallelization; + +import com.google.common.collect.ArrayListMultimap; +import com.google.common.collect.Multimap; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentLinkedQueue; + +/** + * {@code TestNgRunStateTracker} tracks state information for a TestNG run: suite listener start, + * suite listener end, test listener start, test listener end, method listener start, method + * execution, and method listener completion. {@code TestNgRunStateListener} can be used in + * conjunction with {@code TestNgRunStateTracker} to log the time and thread IDs for each of these + * events. + */ +public class TestNgRunStateTracker { + + private static final Collection eventLogs = new ConcurrentLinkedQueue<>(); + + public static void logEvent(EventLog eventLog) { + eventLogs.add(eventLog); + } + + // Get all event logs for all suites + public static Collection getAllEventLogs() { + return eventLogs; + } + + // Get all suite level event logs + public static List getAllSuiteLevelEventLogs() { + List suiteEventLogs = new ArrayList<>(); + + for (EventLog eventLog : eventLogs) { + if (isSuiteLevelEventLog(eventLog)) { + suiteEventLogs.add(eventLog); + } + } + return suiteEventLogs; + } + + // Get all suite listener onStart event logs + public static List getAllSuiteListenerStartEventLogs() { + List suiteStartEventLogs = new ArrayList<>(); + + for (EventLog eventLog : eventLogs) { + if (eventLog.getEvent() == TestNgRunEvent.LISTENER_SUITE_START) { + suiteStartEventLogs.add(eventLog); + } + } + + return suiteStartEventLogs; + } + + // Get all suite listener onFinish event logs + public static List getAllSuiteListenerFinishEventLogs() { + List suiteFinishEventLogs = new ArrayList<>(); + + for (EventLog eventLog : eventLogs) { + if (eventLog.getEvent() == TestNgRunEvent.LISTENER_SUITE_FINISH) { + suiteFinishEventLogs.add(eventLog); + } + } + + return suiteFinishEventLogs; + } + + // Get all suite level event logs associated with the specified suite + public static List getSuiteLevelEventLogsForSuite(String suiteName) { + List suiteEventLogs = new ArrayList<>(); + + for (EventLog eventLog : eventLogs) { + if (isSuiteLevelEventLog(eventLog) && belongsToSuite(suiteName, eventLog)) { + suiteEventLogs.add(eventLog); + } + } + return suiteEventLogs; + } + + // Get all event logs associated with the specified suite + public static List getAllEventLogsForSuite(String suiteName) { + List suiteEventLogs = new ArrayList<>(); + + for (EventLog eventLog : eventLogs) { + if (belongsToSuite(suiteName, eventLog)) { + suiteEventLogs.add(eventLog); + } + } + return suiteEventLogs; + } + + // Get event logs for the specified suite and event + public static List getEventLogsByEventTypeForSuite( + String suiteName, TestNgRunEvent event) { + List suiteEventLogs = new ArrayList<>(); + + for (EventLog eventLog : eventLogs) { + if (eventLog.getEvent() == event && belongsToSuite(suiteName, eventLog)) { + suiteEventLogs.add(eventLog); + } + } + + return suiteEventLogs; + } + + // Get the event log for the suite listener's onStart method for the specified suite + public static EventLog getSuiteListenerStartEventLog(String suiteName) { + for (EventLog eventLog : eventLogs) { + if (eventLog.getEvent() == TestNgRunEvent.LISTENER_SUITE_START + && belongsToSuite(suiteName, eventLog)) { + return eventLog; + } + } + + return null; + } + + // Get the event log for the suite listener's onStart method for the specified suite + public static EventLog getSuiteListenerFinishEventLog(String suiteName) { + for (EventLog eventLog : eventLogs) { + if (eventLog.getEvent() == TestNgRunEvent.LISTENER_SUITE_FINISH + && belongsToSuite(suiteName, eventLog)) { + return eventLog; + } + } + + return null; + } + + // Get the timestamp for the suite listener's onStart method for the specified suite + public static Long getSuiteListenerStartTimestamp(String suiteName) { + EventLog eventLog = getSuiteListenerStartEventLog(suiteName); + + return eventLog == null ? null : eventLog.getTimeOfEvent(); + } + + // Get the timestamp for suite listener's onFinish method for the specified suite + public static Long getSuiteListenerFinishTimestamp(String suiteName) { + EventLog eventLog = getSuiteListenerFinishEventLog(suiteName); + + return eventLog == null ? null : eventLog.getTimeOfEvent(); + } + + // Get the threadId for suite listener's onStart method for the specified suite + public static Long getSuiteListenerStartThreadId(String suiteName) { + EventLog eventLog = getSuiteListenerStartEventLog(suiteName); + + return eventLog == null ? null : eventLog.getThreadId(); + } + + // Get the threadId for suite listener's onFinish method for the specified suite + public static Long getSuiteListenerFinishThreadId(String suiteName) { + EventLog eventLog = getSuiteListenerFinishEventLog(suiteName); + + return eventLog == null ? null : eventLog.getThreadId(); + } + + // Get all test level event logs + public static List getAllTestLevelEventLogs() { + List testEventLogs = new ArrayList<>(); + + for (EventLog eventLog : eventLogs) { + if (isTestLevelEventLog(eventLog)) { + testEventLogs.add(eventLog); + } + } + return testEventLogs; + } + + // Get all suite and test level event logs + public static List getAllSuiteAndTestLevelEventLogs() { + List testEventLogs = new ArrayList<>(); + + for (EventLog eventLog : eventLogs) { + if (isSuiteLevelEventLog(eventLog) || isTestLevelEventLog(eventLog)) { + testEventLogs.add(eventLog); + } + } + return testEventLogs; + } + + // Get all test level event logs for the specified suite + public static List getTestLevelEventLogsForSuite(String suiteName) { + List testEventLogs = new ArrayList<>(); + + for (EventLog eventLog : eventLogs) { + if (isTestLevelEventLog(eventLog) && belongsToSuite(suiteName, eventLog)) { + testEventLogs.add(eventLog); + } + } + return testEventLogs; + } + + // Get all suite and test level event logs for the specified suite + public static List getSuiteAndTestLevelEventLogsForSuite(String suiteName) { + List testEventLogs = new ArrayList<>(); + + for (EventLog eventLog : eventLogs) { + if ((isSuiteLevelEventLog(eventLog) || isTestLevelEventLog(eventLog)) + && belongsToSuite(suiteName, eventLog)) { + testEventLogs.add(eventLog); + } + } + return testEventLogs; + } + + // Get all the test listener onStart event logs for the specified suite + public static List getTestListenerStartEventLogsForSuite(String suiteName) { + List testStartEventLogs = new ArrayList<>(); + + for (EventLog eventLog : eventLogs) { + if (eventLog.getEvent() == TestNgRunEvent.LISTENER_TEST_START + && belongsToSuite(suiteName, eventLog)) { + testStartEventLogs.add(eventLog); + } + } + + return testStartEventLogs; + } + + // Get all the test listener onFinish event logs for the specified suite + public static List getTestListenerFinishEventLogsForSuite(String suiteName) { + List testFinishEventLogs = new ArrayList<>(); + + for (EventLog eventLog : eventLogs) { + if (eventLog.getEvent() == TestNgRunEvent.LISTENER_TEST_FINISH + && belongsToSuite(suiteName, eventLog)) { + testFinishEventLogs.add(eventLog); + } + } + + return testFinishEventLogs; + } + + // Get all test level event logs for with the specified test + public static List getTestLevelEventLogsForTest(String suiteName, String testName) { + List testEventLogs = new ArrayList<>(); + + for (EventLog eventLog : eventLogs) { + if (isTestLevelEventLog(eventLog) && belongsToTest(suiteName, testName, eventLog)) { + testEventLogs.add(eventLog); + } + } + return testEventLogs; + } + + // Get all event logs associated with the specified test + public static List getAllEventLogsForTest(String suiteName, String testName) { + List testEventLogs = new ArrayList<>(); + + for (EventLog eventLog : eventLogs) { + if (belongsToTest(suiteName, testName, eventLog)) { + testEventLogs.add(eventLog); + } + } + return testEventLogs; + } + + // Get event logs for the specified test and event + public static List getEventLogsByEventTypeForTest( + String suiteName, String testName, TestNgRunEvent event) { + List testEventLogs = new ArrayList<>(); + + for (EventLog eventLog : eventLogs) { + if (eventLog.getEvent() == event && belongsToTest(suiteName, testName, eventLog)) { + testEventLogs.add(eventLog); + } + } + + return testEventLogs; + } + + // Get event log for test listener's onStart method for the specified test + public static EventLog getTestListenerStartEventLog(String suiteName, String testName) { + + for (EventLog eventLog : eventLogs) { + if (eventLog.getEvent() == TestNgRunEvent.LISTENER_TEST_START + && belongsToTest(suiteName, testName, eventLog)) { + return eventLog; + } + } + + return null; + } + + // Get event log for test listener's onFinish method for the specified test + public static EventLog getTestListenerFinishEventLog(String suiteName, String testName) { + + for (EventLog eventLog : eventLogs) { + if (eventLog.getEvent() == TestNgRunEvent.LISTENER_TEST_FINISH + && belongsToTest(suiteName, testName, eventLog)) { + return eventLog; + } + } + + return null; + } + + // Get the timestamp for test listener's onStart method for the specified test + public static Long getTestListenerStartTimestamp(String suiteName, String testName) { + EventLog eventLog = getTestListenerStartEventLog(suiteName, testName); + + return eventLog == null ? null : eventLog.getTimeOfEvent(); + } + + // Get the timestamp for test listener's onFinish method for the specified test + public static Long getTestListenerFinishTimestamp(String suiteName, String testName) { + EventLog eventLog = getTestListenerFinishEventLog(suiteName, testName); + + return eventLog == null ? null : eventLog.getTimeOfEvent(); + } + + // Get the threadId for test listener's onStart method for the specified test + public static Long getTestListenerStartThreadId(String suiteName, String testName) { + EventLog eventLog = getTestListenerStartEventLog(suiteName, testName); + + return eventLog == null ? null : eventLog.getThreadId(); + } + + // Get the threadId for test listener's onFinish method for the specified test + public static Long getTestListenerFinishThreadId(String suiteName, String testName) { + EventLog eventLog = getTestListenerFinishEventLog(suiteName, testName); + + return eventLog == null ? null : eventLog.getThreadId(); + } + + // Get all test method level event logs + public static List getAllTestMethodLevelEventLogs() { + List testMethodEventLogs = new ArrayList<>(); + + for (EventLog eventLog : eventLogs) { + if (isTestMethodLevelEventLog(eventLog)) { + testMethodEventLogs.add(eventLog); + } + } + return testMethodEventLogs; + } + + // Get all test method level event logs for the specified suite + public static List getTestMethodLevelEventLogsForSuite(String suiteName) { + List testMethodEventLogs = new ArrayList<>(); + + for (EventLog eventLog : eventLogs) { + if (isTestMethodLevelEventLog(eventLog) && belongsToSuite(suiteName, eventLog)) { + testMethodEventLogs.add(eventLog); + } + } + return testMethodEventLogs; + } + + // Get all test method level event logs for the specified test + public static List getTestMethodLevelEventLogsForTest( + String suiteName, String testName) { + List testMethodEventLogs = new ArrayList<>(); + + for (EventLog eventLog : eventLogs) { + if (isTestMethodLevelEventLog(eventLog) && belongsToTest(suiteName, testName, eventLog)) { + testMethodEventLogs.add(eventLog); + } + } + return testMethodEventLogs; + } + + // Get the test method listener onTestStart event logs for the specified suite and test + public static List getTestMethodListenerStartEventLogsForTest( + String suiteName, String testName) { + List testMethodStartEventLogs = new ArrayList<>(); + + for (EventLog eventLog : eventLogs) { + if (eventLog.getEvent() == TestNgRunEvent.LISTENER_TEST_METHOD_START + && belongsToTest(suiteName, testName, eventLog)) { + testMethodStartEventLogs.add(eventLog); + } + } + + return testMethodStartEventLogs; + } + + // Get the test method listener onTestSuccess event logs for the specified suite and test + public static List getTestMethodListenerPassEventLogsForTest( + String suiteName, String testName) { + List testMethodPassEventLogs = new ArrayList<>(); + + for (EventLog eventLog : eventLogs) { + if (eventLog.getEvent() == TestNgRunEvent.LISTENER_TEST_METHOD_PASS + && belongsToTest(suiteName, testName, eventLog)) { + testMethodPassEventLogs.add(eventLog); + } + } + + return testMethodPassEventLogs; + } + + // Get the test method execution event logs for the specified suite and test + public static List getTestMethodExecutionEventLogsForTest( + String suiteName, String testName) { + List testMethodExecuteEventLogs = new ArrayList<>(); + + for (EventLog eventLog : eventLogs) { + if (eventLog.getEvent() == TestNgRunEvent.TEST_METHOD_EXECUTION + && belongsToTest(suiteName, testName, eventLog)) { + testMethodExecuteEventLogs.add(eventLog); + } + } + + return testMethodExecuteEventLogs; + } + + // Get the test method level event logs for the test methods from the specified suite, test and + // test class, separated + // out in a map where the keys are the class instances on which the methods were run. + public static Multimap getTestMethodEventLogsForClass( + String suiteName, String testName, String className) { + Multimap testMethodEventLogs = ArrayListMultimap.create(); + + for (EventLog eventLog : eventLogs) { + if (isTestMethodLevelEventLog(eventLog) + && belongsToClass(suiteName, testName, className, eventLog)) { + testMethodEventLogs.put(eventLog.getData(EventInfo.CLASS_INSTANCE), eventLog); + } + } + + return testMethodEventLogs; + } + + // Get the test method level event logs for the test method from the specified suite, test and + // test class, separated + // out in a map where the keys are the class instances on which the method was run. + public static Multimap getTestMethodEventLogsForMethod( + String suiteName, String testName, String className, String methodName) { + Multimap testMethodEventLogs = ArrayListMultimap.create(); + + for (EventLog eventLog : eventLogs) { + if (belongsToMethod(suiteName, testName, className, methodName, eventLog)) { + testMethodEventLogs.put(eventLog.getData(EventInfo.CLASS_INSTANCE), eventLog); + } + } + return testMethodEventLogs; + } + + public static Multimap getTestMethodEventLogsForMethodsBelongingToGroup( + String groupName) { + Multimap testMethodEventLogs = ArrayListMultimap.create(); + + for (EventLog eventLog : getAllTestMethodLevelEventLogs()) { + String[] groupsBelongingTo = (String[]) eventLog.getData(EventInfo.GROUPS_BELONGING_TO); + + if (Arrays.asList(groupsBelongingTo).contains(groupName)) { + testMethodEventLogs.put(eventLog.getData(EventInfo.CLASS_INSTANCE), eventLog); + } + } + return testMethodEventLogs; + } + + public static Multimap getTestMethodEventLogsForMethodsDependedOn( + String suiteName, String testName, String className, String methodName) { + + Multimap testMethodEventLogs = ArrayListMultimap.create(); + Map startEventLogs = + getTestMethodListenerStartEventLogsForMethod(suiteName, testName, className, methodName); + + EventLog eventLog = new ArrayList<>(startEventLogs.values()).get(0); + + String[] methodsDependedOn = (String[]) eventLog.getData(EventInfo.METHODS_DEPENDED_ON); + + for (String methodDependOn : methodsDependedOn) { + testMethodEventLogs.putAll( + getTestMethodEventLogsForMethod(suiteName, testName, className, methodDependOn)); + } + + return testMethodEventLogs; + } + + public static Multimap + getTestMethodEventLogsForMethodsBelongingToGroupsDependedOn( + String suiteName, String testName, String className, String methodName) { + + Multimap testMethodEventLogs = ArrayListMultimap.create(); + Map startEventLogs = + getTestMethodListenerStartEventLogsForMethod(suiteName, testName, className, methodName); + + EventLog eventLog = new ArrayList<>(startEventLogs.values()).get(0); + + String[] groupsDependedOn = (String[]) eventLog.getData(EventInfo.GROUPS_DEPENDED_ON); + + for (String groupDependedOn : groupsDependedOn) { + testMethodEventLogs.putAll(getTestMethodEventLogsForMethodsBelongingToGroup(groupDependedOn)); + } + + return testMethodEventLogs; + } + + // Get the test method event logs of the specified type for the specified test class from the + // specified suite and + // test in a multimap where the keys are the class instances for the test class + public static Multimap getTestMethodEventLogsByEventTypeForClass( + String suiteName, String testName, String className, TestNgRunEvent event) { + Multimap testMethodEventLogs = ArrayListMultimap.create(); + + for (EventLog eventLog : eventLogs) { + if (eventLog.getEvent() == event + && belongsToClass(suiteName, testName, className, eventLog)) { + testMethodEventLogs.put(eventLog.getData(EventInfo.CLASS_INSTANCE), eventLog); + } + } + + return testMethodEventLogs; + } + + // Get the test method level event logs for the test method from the specified suite, test, test + // class, and event + // separated out in a map where the keys are the class instances on which the method was run. + public static Map getTestMethodEventLogsByEventTypeForMethod( + String suiteName, + String testName, + String className, + String methodName, + TestNgRunEvent event) { + + Map testMethodEventLogs = new HashMap<>(); + + for (EventLog eventLog : eventLogs) { + if (eventLog.getEvent() == event + && belongsToMethod(suiteName, testName, className, methodName, eventLog)) { + testMethodEventLogs.put(eventLog.getData(EventInfo.CLASS_INSTANCE), eventLog); + } + } + + return testMethodEventLogs; + } + + // Get the event logs for test method listener's onTestStart method for the specified test method + // from the + // specified suite, test and test class as a map where the keys are the test class instances on + // which the method was + // run + public static Map getTestMethodListenerStartEventLogsForMethod( + String suiteName, String testName, String className, String methodName) { + return getTestMethodEventLogsByEventTypeForMethod( + suiteName, testName, className, methodName, TestNgRunEvent.LISTENER_TEST_METHOD_START); + } + + // Get the event logs for test method listener's onTestSuccess method for the specified test + // method from the + // specified suite, test and test class as a map where the keys are the test class instances on + // which the method was + // run + public static Map getTestMethodListenerPassEventLogsForMethod( + String suiteName, String testName, String className, String methodName) { + + Map testMethodEventLogs = new HashMap<>(); + + for (EventLog eventLog : eventLogs) { + if (belongsToMethod(suiteName, testName, className, methodName, eventLog) + && eventLog.getEvent() == TestNgRunEvent.LISTENER_TEST_METHOD_PASS) { + testMethodEventLogs.put(eventLog.getData(EventInfo.CLASS_INSTANCE), eventLog); + } + } + + return testMethodEventLogs; + } + + // Get the event logs for test method listener's onTestFailure method for the specified test + // method from the + // specified suite, test and test class as a map where the keys are the test class instances on + // which the method was + // run + public static Map getTestMethodListenerFailEventLogsForMethod( + String suiteName, String testName, String className, String methodName) { + + Map testMethodEventLogs = new HashMap<>(); + + for (EventLog eventLog : eventLogs) { + if (belongsToMethod(suiteName, testName, className, methodName, eventLog) + && eventLog.getEvent() == TestNgRunEvent.LISTENER_TEST_METHOD_FAIL) { + testMethodEventLogs.put(eventLog.getData(EventInfo.CLASS_INSTANCE), eventLog); + } + } + + return testMethodEventLogs; + } + + // Get the event logs for test method listener's onTestFailedButWithinSuccessPercentage method for + // the specified + // test method from the specified suite, test and test class as a map where the keys are the test + // class instances on + // which the method was run + public static Map + getTestMethodListenerFailWithinSuccessPercentageEventLogsForMethod( + String suiteName, String testName, String className, String methodName) { + + Map testMethodEventLogs = new HashMap<>(); + + for (EventLog eventLog : eventLogs) { + if (belongsToMethod(suiteName, testName, className, methodName, eventLog) + && eventLog.getEvent() == TestNgRunEvent.LISTENER_TEST_METHOD_FAIL_PERCENTAGE) { + testMethodEventLogs.put(eventLog.getData(EventInfo.CLASS_INSTANCE), eventLog); + } + } + + return testMethodEventLogs; + } + + // Get the event logs for test method listener's nTestSkipped method for the specified test method + // from the + // specified suite, test and test class as a map where the keys are the test class instances on + // which the method was run + public static Map getTestMethodListenerSkippedEventLogsForMethod( + String suiteName, String testName, String className, String methodName) { + + Map testMethodEventLogs = new HashMap<>(); + + for (EventLog eventLog : eventLogs) { + if (belongsToMethod(suiteName, testName, className, methodName, eventLog) + && eventLog.getEvent() == TestNgRunEvent.LISTENER_TEST_METHOD_SKIPPED) { + testMethodEventLogs.put(eventLog.getData(EventInfo.CLASS_INSTANCE), eventLog); + } + } + + return testMethodEventLogs; + } + + // Get the event logs for execution of the test method's body for the specified test method from + // the + // specified suite, test and test class as a map where the keys are the test class instances on + // which the method was run + public static Map getTestMethodExecutionEventLogsForMethod( + String suiteName, String testName, String className, String methodName) { + + Map testMethodEventLogs = new HashMap<>(); + + for (EventLog eventLog : eventLogs) { + if (belongsToMethod(suiteName, testName, className, methodName, eventLog) + && eventLog.getEvent() == TestNgRunEvent.TEST_METHOD_EXECUTION) { + testMethodEventLogs.put(eventLog.getData(EventInfo.CLASS_INSTANCE), eventLog); + } + } + + return testMethodEventLogs; + } + + // Get the timestamps for test method listener's onTestStart method for the specified test method + // from the specified + // suite, test and test class separated out in a map where the keys are the class instances on + // which the method was + // run. + public static Map getTestMethodListenerStartTimestamps( + String suiteName, String testName, String className, String methodName) { + Map testMethodEventTimes = new HashMap<>(); + Map testMethodEventLogs = + getTestMethodListenerStartEventLogsForMethod(suiteName, testName, className, methodName); + + for (Object instance : testMethodEventLogs.keySet()) { + testMethodEventTimes.put(instance, testMethodEventLogs.get(instance).getTimeOfEvent()); + } + + return testMethodEventTimes; + } + + // Get the timestamps for test listener's onTestSuccess method for the specified test method from + // the specified + // suite, test and test class separated out in a map where the keys are the class instances on + // which the method was + // run. + public static Map getTestMethodListenerPassTimestamps( + String suiteName, String testName, String className, String methodName) { + Map testMethodEventTimes = new HashMap<>(); + Map testMethodEventLogs = + getTestMethodListenerPassEventLogsForMethod(suiteName, testName, className, methodName); + + for (Object instance : testMethodEventLogs.keySet()) { + testMethodEventTimes.put(instance, testMethodEventLogs.get(instance).getTimeOfEvent()); + } + + return testMethodEventTimes; + } + + // Get the timestamps for test listener's onTestFailure method for the specified test method from + // the specified + // suite, test and test class separated out in a map where the keys are the class instances on + // which the method was + // run. + public static Map getTestMethodListenerFailTimestamps( + String suiteName, String testName, String className, String methodName) { + Map testMethodEventTimes = new HashMap<>(); + Map testMethodEventLogs = + getTestMethodListenerFailEventLogsForMethod(suiteName, testName, className, methodName); + + for (Object instance : testMethodEventLogs.keySet()) { + testMethodEventTimes.put(instance, testMethodEventLogs.get(instance).getTimeOfEvent()); + } + + return testMethodEventTimes; + } + + // Get the timestamps for test listener's onTestFailedButWithinSuccessPercentage method for the + // specified test method + // from the specified suite, test and test class separated out in a map where the keys are the + // class instances on + // which the method was run. + public static Map getTestMethodListenerFailWithinSuccessPercentageTimestamps( + String suiteName, String testName, String className, String methodName) { + Map testMethodEventTimes = new HashMap<>(); + Map testMethodEventLogs = + getTestMethodListenerFailWithinSuccessPercentageEventLogsForMethod( + suiteName, testName, className, methodName); + + for (Object instance : testMethodEventLogs.keySet()) { + testMethodEventTimes.put(instance, testMethodEventLogs.get(instance).getTimeOfEvent()); + } + + return testMethodEventTimes; + } + + // Get the timestamps for test method listener onTestSkipped event logs for the specified test + // method from the + // specified suite, test and test class. + public static Map getTestMethodListenerSkipTimestamps( + String suiteName, String testName, String className, String methodName) { + Map testMethodEventTimes = new HashMap<>(); + Map testMethodEventLogs = + getTestMethodListenerSkippedEventLogsForMethod(suiteName, testName, className, methodName); + + for (Object instance : testMethodEventLogs.keySet()) { + testMethodEventTimes.put(instance, testMethodEventLogs.get(instance).getTimeOfEvent()); + } + + return testMethodEventTimes; + } + + // Get the timestamps for execution of the test method's body for the specified test method from + // the specified + // suite, test and test class separated out in a map where the keys are the class instances on + // which the method was + // run. + public static Map getTestMethodExecutionTimestamps( + String suiteName, String testName, String className, String methodName) { + Map testMethodEventTimes = new HashMap<>(); + Map testMethodEventLogs = + getTestMethodExecutionEventLogsForMethod(suiteName, testName, className, methodName); + + for (Object instance : testMethodEventLogs.keySet()) { + testMethodEventTimes.put(instance, testMethodEventLogs.get(instance).getTimeOfEvent()); + } + + return testMethodEventTimes; + } + + // Get the thread IDs for test method listener's onTestStart method for the specified test method + // from the specified + // suite, test and test class separated out in a map where the keys are the class instances on + // which the method was + // run. + public static Map getTestMethodListenerStartThreadIds( + String suiteName, String testName, String className, String methodName) { + Map testMethodEventThreadIds = new HashMap<>(); + Map testMethodEventLogs = + getTestMethodListenerStartEventLogsForMethod(suiteName, testName, className, methodName); + + for (Object instance : testMethodEventLogs.keySet()) { + testMethodEventThreadIds.put(instance, testMethodEventLogs.get(instance).getThreadId()); + } + + return testMethodEventThreadIds; + } + + // Get the thread IDs for test listener's onTestSuccess method for the specified test method from + // the specified + // suite, test and test class separated out in a map where the keys are the class instances on + // which the method was + // run. + public static Map getTestMethodListenerPassThreadIds( + String suiteName, String testName, String className, String methodName) { + Map testMethodEventThreadIds = new HashMap<>(); + Map testMethodEventLogs = + getTestMethodListenerPassEventLogsForMethod(suiteName, testName, className, methodName); + + for (Object instance : testMethodEventLogs.keySet()) { + testMethodEventThreadIds.put(instance, testMethodEventLogs.get(instance).getThreadId()); + } + + return testMethodEventThreadIds; + } + + // Get the thread IDs for test listener's onTestFailure method for the specified test method from + // the specified + // suite, test and test class separated out in a map where the keys are the class instances on + // which the method was + // run. + public static Map getTestMethodListenerFailThreadIds( + String suiteName, String testName, String className, String methodName) { + Map testMethodEventThreadIds = new HashMap<>(); + Map testMethodEventLogs = + getTestMethodListenerFailEventLogsForMethod(suiteName, testName, className, methodName); + + for (Object instance : testMethodEventLogs.keySet()) { + testMethodEventThreadIds.put(instance, testMethodEventLogs.get(instance).getThreadId()); + } + + return testMethodEventThreadIds; + } + + // Get the thread IDs for test listener's onTestFailedButWithinSuccessPercentage method for the + // specified test + // method from the specified suite, test and test class separated out in a map where the keys are + // the class + // instances on which the method was run. + public static Map getTestMethodListenerFailWithSuccessPercentageThreadIds( + String suiteName, String testName, String className, String methodName) { + Map testMethodEventThreadIds = new HashMap<>(); + Map testMethodEventLogs = + getTestMethodListenerFailWithinSuccessPercentageEventLogsForMethod( + suiteName, testName, className, methodName); + + for (Object instance : testMethodEventLogs.keySet()) { + testMethodEventThreadIds.put(instance, testMethodEventLogs.get(instance).getThreadId()); + } + + return testMethodEventThreadIds; + } + + // Get the thread IDs for test listener's onTestSkipped method for the specified test method from + // the specified + // suite, test and test class separated out in a map where the keys are the class instances on + // which the method was + // run. + public static Map getTestMethodListenerSkipThreadIds( + String suiteName, String testName, String className, String methodName) { + Map testMethodEventThreadIds = new HashMap<>(); + Map testMethodEventLogs = + getTestMethodListenerSkippedEventLogsForMethod(suiteName, testName, className, methodName); + + for (Object instance : testMethodEventLogs.keySet()) { + testMethodEventThreadIds.put(instance, testMethodEventLogs.get(instance).getThreadId()); + } + + return testMethodEventThreadIds; + } + + // Get the thread IDs for execution of the test method's body for the specified test method from + // the specified + // suite, test and test class separated out in a map where the keys are the class instances on + // which the method was + // run. + public static Map getTestMethodExecutionThreadIds( + String suiteName, String testName, String className, String methodName) { + Map testMethodEventThreadIds = new HashMap<>(); + Map testMethodEventLogs = + getTestMethodExecutionEventLogsForMethod(suiteName, testName, className, methodName); + + for (Object instance : testMethodEventLogs.keySet()) { + testMethodEventThreadIds.put(instance, testMethodEventLogs.get(instance).getThreadId()); + } + + return testMethodEventThreadIds; + } + + public static void reset() { + eventLogs.clear(); + } + + private static boolean isSuiteLevelEventLog(EventLog eventLog) { + return eventLog.getEvent() == TestNgRunEvent.LISTENER_SUITE_START + || eventLog.getEvent() == TestNgRunEvent.LISTENER_SUITE_FINISH; + } + + private static boolean isTestLevelEventLog(EventLog eventLog) { + return eventLog.getEvent() == TestNgRunEvent.LISTENER_TEST_START + || eventLog.getEvent() == TestNgRunEvent.LISTENER_TEST_FINISH; + } + + private static boolean isTestMethodLevelEventLog(EventLog eventLog) { + return eventLog.getEvent() == TestNgRunEvent.LISTENER_TEST_METHOD_START + || eventLog.getEvent() == TestNgRunEvent.LISTENER_TEST_METHOD_PASS + || eventLog.getEvent() == TestNgRunEvent.LISTENER_TEST_METHOD_FAIL + || eventLog.getEvent() == TestNgRunEvent.LISTENER_TEST_METHOD_FAIL_PERCENTAGE + || eventLog.getEvent() == TestNgRunEvent.LISTENER_TEST_METHOD_SKIPPED + || eventLog.getEvent() == TestNgRunEvent.TEST_METHOD_EXECUTION; + } + + private static boolean belongsToSuite(String suiteName, EventLog eventLog) { + return suiteName.equals(eventLog.getData(EventInfo.SUITE_NAME)); + } + + private static boolean belongsToTest(String suiteName, String testName, EventLog eventLog) { + return suiteName.equals(eventLog.getData(EventInfo.SUITE_NAME)) + && testName.equals(eventLog.getData(EventInfo.TEST_NAME)); + } + + private static boolean belongsToClass( + String suiteName, String testName, String className, EventLog eventLog) { + return suiteName.equals(eventLog.getData(EventInfo.SUITE_NAME)) + && testName.equals(eventLog.getData(EventInfo.TEST_NAME)) + && className.equals(eventLog.getData(EventInfo.CLASS_NAME)); + } + + private static boolean belongsToMethod( + String suiteName, String testName, String className, String methodName, EventLog eventLog) { + return suiteName.equals(eventLog.getData(EventInfo.SUITE_NAME)) + && testName.equals(eventLog.getData(EventInfo.TEST_NAME)) + && className.equals(eventLog.getData(EventInfo.CLASS_NAME)) + && methodName.equals(eventLog.getData(EventInfo.METHOD_NAME)); + } + + public enum TestNgRunEvent { + LISTENER_SUITE_START, + LISTENER_SUITE_FINISH, + LISTENER_TEST_START, + LISTENER_TEST_FINISH, + LISTENER_TEST_METHOD_START, + TEST_METHOD_EXECUTION, + LISTENER_TEST_METHOD_PASS, + LISTENER_TEST_METHOD_FAIL, + LISTENER_TEST_METHOD_FAIL_PERCENTAGE, + LISTENER_TEST_METHOD_SKIPPED, + } + + public enum EventInfo { + SUITE_NAME, + TEST_NAME, + CLASS_NAME, + METHOD_NAME, + CLASS_INSTANCE, + DATA_PROVIDER_PARAM, + GROUPS_DEPENDED_ON, + METHODS_DEPENDED_ON, + GROUPS_BELONGING_TO + } + + public static class EventLog { + private TestNgRunEvent event; + private long timeOfEvent; + private long threadId; + private Thread thread; + + private Map data = new HashMap<>(); + + public void setEvent(TestNgRunEvent event) { + this.event = event; + } + + public TestNgRunEvent getEvent() { + return event; + } + + public void setTimeOfEvent(long timeOfEvent) { + this.timeOfEvent = timeOfEvent; + } + + public long getTimeOfEvent() { + return timeOfEvent; + } + + public void setThread(Thread thread) { + this.thread = thread; + this.threadId = thread.getId(); + } + + public long getThreadId() { + return threadId; + } + + public void addData(EventInfo key, Object value) { + data.put(key, value); + } + + public Object getData(EventInfo key) { + return data.get(key); + } + + private Thread getThread() { + return thread; + } + + public static EventLogBuilder builder() { + return new EventLogBuilder(); + } + + @Override + public String toString() { + final StringBuffer sb = new StringBuffer("EventLog{"); + sb.append("Event: ").append(event); + + sb.append(", Suite: ").append(getData(EventInfo.SUITE_NAME)); + + if (getData(EventInfo.TEST_NAME) != null) { + sb.append(", Test: ").append(getData(EventInfo.TEST_NAME)); + } + + if (getData(EventInfo.CLASS_NAME) != null) { + sb.append(", Class: ").append(getData(EventInfo.CLASS_NAME)); + } + + if (getData(EventInfo.CLASS_INSTANCE) != null) { + sb.append(", Class instance hash code: ") + .append(getData(EventInfo.CLASS_INSTANCE).hashCode()); + } + + if (getData(EventInfo.METHOD_NAME) != null) { + sb.append(", Method name: ").append(getData(EventInfo.METHOD_NAME)); + } + + if (getData(EventInfo.DATA_PROVIDER_PARAM) != null) { + sb.append(", Data provider param: ").append(getData(EventInfo.DATA_PROVIDER_PARAM)); + } + + Date now = new Date(timeOfEvent); + SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); + + sb.append(", Time of event: ").append(sdfDate.format(timeOfEvent)); + sb.append(", Thread ID: ").append(threadId); + sb.append("}"); + return sb.toString(); + } + } + + public static class EventLogBuilder { + private EventLog eventLog = new EventLog(); + + public EventLogBuilder setEvent(TestNgRunEvent event) { + eventLog.setEvent(event); + return this; + } + + public EventLogBuilder setTimeOfEvent(long timeOfEvent) { + eventLog.setTimeOfEvent(timeOfEvent); + return this; + } + + public EventLogBuilder setThread(Thread thread) { + eventLog.setThread(thread); + return this; + } + + public EventLogBuilder addData(EventInfo key, Object value) { + eventLog.addData(key, value); + return this; + } + + public EventLog build() { + return eventLog; + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/ThreadAffinityTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/ThreadAffinityTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/ThreadAffinityTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/ThreadAffinityTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,126 @@ +package test.thread.parallelization; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Arrays; +import java.util.Map; +import java.util.Set; +import org.assertj.core.api.Assertions; +import org.assertj.core.api.SoftAssertions; +import org.testng.TestNG; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import org.testng.internal.RuntimeBehavior; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlSuite.ParallelMode; +import test.SimpleBaseTest; +import test.thread.parallelization.issue1773.LogGatheringListener; +import test.thread.parallelization.issue1773.MethodDependenciesSample1; +import test.thread.parallelization.issue1773.MethodDependenciesSample2; +import test.thread.parallelization.issue1773.PriorityTestSample1; +import test.thread.parallelization.issue1773.PriorityTestSample2; +import test.thread.parallelization.issue2110.TestClass; +import test.thread.parallelization.issue2321.TestMultipleInstance; + +public class ThreadAffinityTest extends SimpleBaseTest { + @BeforeClass + public void setup() { + System.setProperty(RuntimeBehavior.TESTNG_THREAD_AFFINITY, "true"); + } + + @BeforeMethod + public void beforeMethod() { + LogGatheringListener.reset(); + } + + @Test(dataProvider = "dp1") + public void testThreadAffinity(Class... classes) { + XmlSuite xmlsuite = createXmlSuite("test_suite"); + xmlsuite.setParallel(XmlSuite.ParallelMode.CLASSES); + xmlsuite.setThreadCount(6); + createXmlTest(xmlsuite, "Test_1", classes); + TestNG testng = create(xmlsuite); + testng.run(); + Map, Set> map = LogGatheringListener.getLog().get("Test_1"); + SoftAssertions softly = new SoftAssertions(); + Arrays.stream(classes) + .forEach( + each -> + softly + .assertThat(map.get(each)) + .withFailMessage( + "All tests within " + + each.getName() + + " should have run in the same thread") + .hasSize(1)); + softly.assertAll(); + } + + @Test(dataProvider = "dp2") + public void testThreadAffinityAcrossTests(XmlSuite.ParallelMode mode) { + XmlSuite xmlsuite = createXmlSuite("test_suite"); + xmlsuite.setParallel(XmlSuite.ParallelMode.TESTS); + xmlsuite.setThreadCount(6); + Class[] testClasses = new Class[] {PriorityTestSample1.class, PriorityTestSample2.class}; + createXmlTest(xmlsuite, "Test_1", testClasses).setParallel(mode); + createXmlTest(xmlsuite, "Test_2", testClasses).setParallel(mode); + TestNG testng = create(xmlsuite); + testng.run(); + SoftAssertions softly = new SoftAssertions(); + for (String test : Arrays.asList("Test_1", "Test_2")) { + Map, Set> map = LogGatheringListener.getLog().get(test); + for (Class cls : testClasses) { + softly + .assertThat(map.get(cls)) + .withFailMessage( + "All tests within " + cls.getName() + " should have run in the same thread") + .hasSize(1); + } + } + softly.assertAll(); + } + + @DataProvider(name = "dp2") + public Object[][] createTestData() { + return new Object[][] {{XmlSuite.ParallelMode.NONE}, {XmlSuite.ParallelMode.CLASSES}}; + } + + @DataProvider(name = "dp1") + public Object[][] getData() { + return new Object[][] { + {PriorityTestSample1.class, PriorityTestSample2.class}, + {MethodDependenciesSample1.class, MethodDependenciesSample2.class} + }; + } + + @Test(description = "GITHUB-2321") + public void testThreadAffinityInFactoryInstances() { + ParallelMode mode = ParallelMode.INSTANCES; + XmlSuite xmlsuite = createXmlSuite("test_suite"); + xmlsuite.setParallel(mode); + xmlsuite.setThreadCount(6); + createXmlTest(xmlsuite, "Test_1", TestMultipleInstance.class).setParallel(mode); + TestNG testng = create(xmlsuite); + testng.run(); + Assertions.assertThat(testng.getStatus()).isEqualTo(0); + } + + @Test(description = "GITHUB-2110") + public void ensureNoNPEIsThrown() { + XmlSuite xmlsuite = createXmlSuite("2110_suite"); + xmlsuite.setParallel(ParallelMode.CLASSES); + xmlsuite.setThreadCount(50); + createXmlTest(xmlsuite, "2110_test", TestClass.class); + TestNG testng = create(xmlsuite); + testng.run(); + assertThat(TestClass.getThreadIds()).hasSize(1); + } + + @AfterClass(alwaysRun = true) + public void teardown() { + System.setProperty(RuntimeBehavior.TESTNG_THREAD_AFFINITY, "false"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/issue1773/LogGatheringListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/issue1773/LogGatheringListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/issue1773/LogGatheringListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/issue1773/LogGatheringListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,25 @@ +package test.thread.parallelization.issue1773; + +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; + +public class LogGatheringListener { + + private static Map, Set>> log = new ConcurrentHashMap<>(); + + public static Map, Set>> getLog() { + return log; + } + + public static void addLog(String testname, Class cls, long threadId) { + log.computeIfAbsent(testname, t -> new ConcurrentHashMap<>()) + .computeIfAbsent(cls, c -> new HashSet<>()) + .add(threadId); + } + + public static void reset() { + log = new ConcurrentHashMap<>(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/issue1773/MethodDependenciesSample1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/issue1773/MethodDependenciesSample1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/issue1773/MethodDependenciesSample1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/issue1773/MethodDependenciesSample1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package test.thread.parallelization.issue1773; + +import org.testng.Reporter; +import org.testng.annotations.Test; + +public class MethodDependenciesSample1 { + + @Test + public void parentMethod() { + log(); + } + + @Test(dependsOnMethods = "parentMethod") + public void childMethod() { + log(); + } + + private void log() { + String testname = Reporter.getCurrentTestResult().getTestContext().getName(); + LogGatheringListener.addLog( + testname, MethodDependenciesSample1.class, Thread.currentThread().getId()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/issue1773/MethodDependenciesSample2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/issue1773/MethodDependenciesSample2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/issue1773/MethodDependenciesSample2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/issue1773/MethodDependenciesSample2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package test.thread.parallelization.issue1773; + +import org.testng.Reporter; +import org.testng.annotations.Test; + +public class MethodDependenciesSample2 { + + @Test + public void parentMethod() { + log(); + } + + @Test(dependsOnMethods = "parentMethod") + public void childMethod() { + log(); + } + + private void log() { + String testname = Reporter.getCurrentTestResult().getTestContext().getName(); + LogGatheringListener.addLog( + testname, MethodDependenciesSample2.class, Thread.currentThread().getId()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/issue1773/PriorityTestSample1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/issue1773/PriorityTestSample1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/issue1773/PriorityTestSample1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/issue1773/PriorityTestSample1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,28 @@ +package test.thread.parallelization.issue1773; + +import org.testng.Reporter; +import org.testng.annotations.Test; + +public class PriorityTestSample1 { + + @Test(priority = 1) + public void FirstTest() { + log(); + } + + @Test(priority = 2) + public void SecondTest() { + log(); + } + + @Test(priority = 3) + public void ThridTest() { + log(); + } + + private void log() { + String testname = Reporter.getCurrentTestResult().getTestContext().getName(); + LogGatheringListener.addLog( + testname, PriorityTestSample1.class, Thread.currentThread().getId()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/issue1773/PriorityTestSample2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/issue1773/PriorityTestSample2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/issue1773/PriorityTestSample2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/issue1773/PriorityTestSample2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,28 @@ +package test.thread.parallelization.issue1773; + +import org.testng.Reporter; +import org.testng.annotations.Test; + +public class PriorityTestSample2 { + + @Test(priority = 1) + public void FirstTest() { + log(); + } + + @Test(priority = 2) + public void SecondTest() { + log(); + } + + @Test(priority = 3) + public void ThridTest() { + log(); + } + + private void log() { + String testname = Reporter.getCurrentTestResult().getTestContext().getName(); + LogGatheringListener.addLog( + testname, PriorityTestSample2.class, Thread.currentThread().getId()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/issue2110/TestClass.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/issue2110/TestClass.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/issue2110/TestClass.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/issue2110/TestClass.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,40 @@ +package test.thread.parallelization.issue2110; + +import java.util.Collections; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import org.testng.annotations.Test; + +public class TestClass { + + static Set threadIds = Collections.newSetFromMap(new ConcurrentHashMap<>()); + + public static Set getThreadIds() { + return threadIds; + } + + @Test + public void test0() { + threadIds.add(Thread.currentThread().getId()); + } + + @Test + public void test1() { + threadIds.add(Thread.currentThread().getId()); + } + + @Test(dependsOnMethods = "test1") + public void test2() { + threadIds.add(Thread.currentThread().getId()); + } + + @Test(dependsOnMethods = "test2") + public void test3() { + threadIds.add(Thread.currentThread().getId()); + } + + @Test + public void test4() { + threadIds.add(Thread.currentThread().getId()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/issue2321/TestMultipleInstance.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/issue2321/TestMultipleInstance.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/issue2321/TestMultipleInstance.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/issue2321/TestMultipleInstance.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,30 @@ +package test.thread.parallelization.issue2321; + +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +public class TestMultipleInstance { + + private long threadId; + + @Factory(dataProvider = "dp") + public TestMultipleInstance(int part) {} + + @Test + public void independent() { + threadId = Thread.currentThread().getId(); + } + + @Test(dependsOnMethods = "independent") + public void dependent() { + long currentThreadId = Thread.currentThread().getId(); + Assert.assertEquals(currentThreadId, threadId, "Thread Ids didn't match"); + } + + @DataProvider(name = "dp") + public static Object[][] getData() { + return new Object[][] {{1}, {2}}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/FactoryForTestClassAFiveMethodsWithNoDepsTwoInstancesSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/FactoryForTestClassAFiveMethodsWithNoDepsTwoInstancesSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/FactoryForTestClassAFiveMethodsWithNoDepsTwoInstancesSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/FactoryForTestClassAFiveMethodsWithNoDepsTwoInstancesSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,25 @@ +package test.thread.parallelization.sample; + +import java.util.ArrayList; +import java.util.List; +import org.testng.TestNGException; +import org.testng.annotations.Factory; +import org.testng.internal.objects.InstanceCreator; + +public class FactoryForTestClassAFiveMethodsWithNoDepsTwoInstancesSample { + + @Factory + public Object[] init() { + List instances = new ArrayList<>(); + + try { + instances.add(InstanceCreator.newInstance(TestClassAFiveMethodsWithNoDepsSample.class)); + instances.add(InstanceCreator.newInstance(TestClassAFiveMethodsWithNoDepsSample.class)); + } catch (TestNGException e) { + throw new RuntimeException( + "Could not instantiate an instance of TestClassAFiveMethodsWithNoDepsSample", e); + } + + return instances.toArray(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/FactoryForTestClassBFourMethodsWithNoDepsFiveInstancesSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/FactoryForTestClassBFourMethodsWithNoDepsFiveInstancesSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/FactoryForTestClassBFourMethodsWithNoDepsFiveInstancesSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/FactoryForTestClassBFourMethodsWithNoDepsFiveInstancesSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +package test.thread.parallelization.sample; + +import java.util.ArrayList; +import java.util.List; +import org.testng.TestNGException; +import org.testng.annotations.Factory; +import org.testng.internal.objects.InstanceCreator; + +public class FactoryForTestClassBFourMethodsWithNoDepsFiveInstancesSample { + @Factory + public Object[] init() { + List instances = new ArrayList<>(); + + try { + instances.add(InstanceCreator.newInstance(TestClassBFourMethodsWithNoDepsSample.class)); + instances.add(InstanceCreator.newInstance(TestClassBFourMethodsWithNoDepsSample.class)); + instances.add(InstanceCreator.newInstance(TestClassBFourMethodsWithNoDepsSample.class)); + instances.add(InstanceCreator.newInstance(TestClassBFourMethodsWithNoDepsSample.class)); + instances.add(InstanceCreator.newInstance(TestClassBFourMethodsWithNoDepsSample.class)); + } catch (TestNGException e) { + throw new RuntimeException( + "Could not instantiate an instance of TestClassBFourMethodsWithNoDepsSample", e); + } + + return instances.toArray(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/FactoryForTestClassCSixMethodsWithNoDepsThreeInstancesSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/FactoryForTestClassCSixMethodsWithNoDepsThreeInstancesSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/FactoryForTestClassCSixMethodsWithNoDepsThreeInstancesSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/FactoryForTestClassCSixMethodsWithNoDepsThreeInstancesSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,25 @@ +package test.thread.parallelization.sample; + +import java.util.ArrayList; +import java.util.List; +import org.testng.TestNGException; +import org.testng.annotations.Factory; +import org.testng.internal.objects.InstanceCreator; + +public class FactoryForTestClassCSixMethodsWithNoDepsThreeInstancesSample { + @Factory + public Object[] init() { + List instances = new ArrayList<>(); + + try { + instances.add(InstanceCreator.newInstance(TestClassCSixMethodsWithNoDepsSample.class)); + instances.add(InstanceCreator.newInstance(TestClassCSixMethodsWithNoDepsSample.class)); + instances.add(InstanceCreator.newInstance(TestClassCSixMethodsWithNoDepsSample.class)); + } catch (TestNGException e) { + throw new RuntimeException( + "Could not instantiate an instance of TestClassCSixMethodsWithNoDepsSample", e); + } + + return instances.toArray(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/FactoryForTestClassDThreeMethodsWithNoDepsFourInstancesSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/FactoryForTestClassDThreeMethodsWithNoDepsFourInstancesSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/FactoryForTestClassDThreeMethodsWithNoDepsFourInstancesSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/FactoryForTestClassDThreeMethodsWithNoDepsFourInstancesSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,26 @@ +package test.thread.parallelization.sample; + +import java.util.ArrayList; +import java.util.List; +import org.testng.TestNGException; +import org.testng.annotations.Factory; +import org.testng.internal.objects.InstanceCreator; + +public class FactoryForTestClassDThreeMethodsWithNoDepsFourInstancesSample { + @Factory + public Object[] init() { + List instances = new ArrayList<>(); + + try { + instances.add(InstanceCreator.newInstance(TestClassDThreeMethodsWithNoDepsSample.class)); + instances.add(InstanceCreator.newInstance(TestClassDThreeMethodsWithNoDepsSample.class)); + instances.add(InstanceCreator.newInstance(TestClassDThreeMethodsWithNoDepsSample.class)); + instances.add(InstanceCreator.newInstance(TestClassDThreeMethodsWithNoDepsSample.class)); + } catch (TestNGException e) { + throw new RuntimeException( + "Could not instantiate an instance of TestClassDThreeMethodsWithNoDepsSample", e); + } + + return instances.toArray(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/FactoryForTestClassFSixMethodsWithNoDepsSixInstancesSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/FactoryForTestClassFSixMethodsWithNoDepsSixInstancesSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/FactoryForTestClassFSixMethodsWithNoDepsSixInstancesSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/FactoryForTestClassFSixMethodsWithNoDepsSixInstancesSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,28 @@ +package test.thread.parallelization.sample; + +import java.util.ArrayList; +import java.util.List; +import org.testng.TestNGException; +import org.testng.annotations.Factory; +import org.testng.internal.objects.InstanceCreator; + +public class FactoryForTestClassFSixMethodsWithNoDepsSixInstancesSample { + @Factory + public Object[] init() { + List instances = new ArrayList<>(); + + try { + instances.add(InstanceCreator.newInstance(TestClassFSixMethodsWithNoDepsSample.class)); + instances.add(InstanceCreator.newInstance(TestClassFSixMethodsWithNoDepsSample.class)); + instances.add(InstanceCreator.newInstance(TestClassFSixMethodsWithNoDepsSample.class)); + instances.add(InstanceCreator.newInstance(TestClassFSixMethodsWithNoDepsSample.class)); + instances.add(InstanceCreator.newInstance(TestClassFSixMethodsWithNoDepsSample.class)); + instances.add(InstanceCreator.newInstance(TestClassFSixMethodsWithNoDepsSample.class)); + } catch (TestNGException e) { + throw new RuntimeException( + "Could not instantiate an instance of TestClassFSixMethodsWithNoDepsSample", e); + } + + return instances.toArray(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassAFiveMethodsWithDataProviderOnAllMethodsAndNoDepsSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassAFiveMethodsWithDataProviderOnAllMethodsAndNoDepsSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassAFiveMethodsWithDataProviderOnAllMethodsAndNoDepsSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassAFiveMethodsWithDataProviderOnAllMethodsAndNoDepsSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,165 @@ +package test.thread.parallelization.sample; + +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_INSTANCE; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.DATA_PROVIDER_PARAM; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_BELONGING_TO; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHODS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHOD_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.SUITE_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.TEST_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.TEST_METHOD_EXECUTION; + +import java.util.Map; +import java.util.concurrent.TimeUnit; +import org.testng.ITestContext; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import test.thread.parallelization.TestNgRunStateTracker; + +public class TestClassAFiveMethodsWithDataProviderOnAllMethodsAndNoDepsSample { + + @Test(dataProvider = "data-provider") + public void testMethodA(String suiteName, String testName, String sleepFor, String dpVal) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodA") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Test(dataProvider = "data-provider") + public void testMethodB(String suiteName, String testName, String sleepFor, String dpVal) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodB") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Test(dataProvider = "data-provider") + public void testMethodC(String suiteName, String testName, String sleepFor, String dpVal) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodC") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Test(dataProvider = "data-provider") + public void testMethodD(String suiteName, String testName, String sleepFor, String dpVal) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodD") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Test(dataProvider = "data-provider") + public void testMethodE(String suiteName, String testName, String sleepFor, String dpVal) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodE") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @DataProvider(name = "data-provider") + public Object[][] dataProvider(ITestContext context) { + Map params = context.getCurrentXmlTest().getAllParameters(); + + String suiteName = params.get("suiteName"); + String testName = params.get("testName"); + String sleepFor = params.get("sleepFor"); + + String dataProviderParam = params.get("dataProviderParam"); + String[] dataProviderVals = dataProviderParam.split(","); + + Object[][] dataToProvide = new Object[dataProviderVals.length][4]; + + for (int i = 0; i < dataProviderVals.length; i++) { + dataToProvide[i][0] = suiteName; + dataToProvide[i][1] = testName; + dataToProvide[i][2] = sleepFor; + dataToProvide[i][3] = dataProviderVals[i]; + } + + return dataToProvide; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassAFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassAFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassAFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassAFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,166 @@ +package test.thread.parallelization.sample; + +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_INSTANCE; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.DATA_PROVIDER_PARAM; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_BELONGING_TO; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHODS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHOD_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.SUITE_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.TEST_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.TEST_METHOD_EXECUTION; + +import java.util.Map; +import java.util.concurrent.TimeUnit; +import org.testng.ITestContext; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; +import test.thread.parallelization.TestNgRunStateTracker; + +public class TestClassAFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample { + + @Test(dataProvider = "data-provider") + public void testMethodA(String suiteName, String testName, String sleepFor, String dpVal) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodA") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodB(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodB") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Test(dataProvider = "data-provider") + public void testMethodC(String suiteName, String testName, String sleepFor, String dpVal) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodC") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodD(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodD") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Test(dataProvider = "data-provider") + public void testMethodE(String suiteName, String testName, String sleepFor, String dpVal) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodE") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @DataProvider(name = "data-provider") + public Object[][] dataProvider(ITestContext context) { + Map params = context.getCurrentXmlTest().getAllParameters(); + + String suiteName = params.get("suiteName"); + String testName = params.get("testName"); + String sleepFor = params.get("sleepFor"); + + String dataProviderParam = params.get("dataProviderParam"); + String[] dataProviderVals = dataProviderParam.split(","); + + Object[][] dataToProvide = new Object[dataProviderVals.length][4]; + + for (int i = 0; i < dataProviderVals.length; i++) { + dataToProvide[i][0] = suiteName; + dataToProvide[i][1] = testName; + dataToProvide[i][2] = sleepFor; + dataToProvide[i][3] = dataProviderVals[i]; + } + + return dataToProvide; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassAFiveMethodsWithFactoryUsingDataProviderAndNoDepsSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassAFiveMethodsWithFactoryUsingDataProviderAndNoDepsSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassAFiveMethodsWithFactoryUsingDataProviderAndNoDepsSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassAFiveMethodsWithFactoryUsingDataProviderAndNoDepsSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,189 @@ +package test.thread.parallelization.sample; + +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_INSTANCE; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.DATA_PROVIDER_PARAM; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_BELONGING_TO; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHODS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHOD_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.SUITE_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.TEST_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.TEST_METHOD_EXECUTION; + +import java.util.Map; +import java.util.concurrent.TimeUnit; +import org.testng.ITestContext; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; +import test.thread.parallelization.TestNgRunStateTracker; + +public class TestClassAFiveMethodsWithFactoryUsingDataProviderAndNoDepsSample { + + private final String suiteName; + private final String testName; + private final int sleepFor; + private final String dpVal; + + @Factory(dataProvider = "data-provider") + public TestClassAFiveMethodsWithFactoryUsingDataProviderAndNoDepsSample( + String suiteName, String testName, String sleepFor, String dpVal) { + + this.suiteName = suiteName; + this.testName = testName; + this.sleepFor = Integer.parseInt(sleepFor); + this.dpVal = dpVal; + } + + @Test + public void testMethodA() throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodA") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(sleepFor); + } + + @Test + public void testMethodB() throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodB") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(sleepFor); + } + + @Test + public void testMethodC() throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodC") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(sleepFor); + } + + @Test + public void testMethodD() throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodD") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(sleepFor); + } + + @Test + public void testMethodE() throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodE") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(sleepFor); + } + + @DataProvider(name = "data-provider") + public static Object[][] dataProvider(ITestContext context) { + Map params = context.getCurrentXmlTest().getAllParameters(); + + String suiteName = params.get("suiteName"); + String testName = params.get("testName"); + String sleepFor = params.get("sleepFor"); + + String dataProviderParam = params.get("dataProviderParam"); + + String[] dataProviderVals = null; + String classNamePattern = + TestClassAFiveMethodsWithFactoryUsingDataProviderAndNoDepsSample.class.getSimpleName() + + "("; + + if (dataProviderParam.contains(classNamePattern)) { + dataProviderParam = + dataProviderParam.substring( + dataProviderParam.indexOf(classNamePattern) + classNamePattern.length()); + dataProviderParam = dataProviderParam.substring(0, dataProviderParam.indexOf(")")); + } + + dataProviderVals = dataProviderParam.split(","); + + Object[][] dataToProvide = new Object[dataProviderVals.length][4]; + + for (int i = 0; i < dataProviderVals.length; i++) { + dataToProvide[i][0] = suiteName; + dataToProvide[i][1] = testName; + dataToProvide[i][2] = sleepFor; + dataToProvide[i][3] = dataProviderVals[i]; + } + + return dataToProvide; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassAFiveMethodsWithNoDepsSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassAFiveMethodsWithNoDepsSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassAFiveMethodsWithNoDepsSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassAFiveMethodsWithNoDepsSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,139 @@ +package test.thread.parallelization.sample; + +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_INSTANCE; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_BELONGING_TO; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHODS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHOD_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.SUITE_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.TEST_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.TEST_METHOD_EXECUTION; + +import java.util.concurrent.TimeUnit; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; +import test.thread.parallelization.TestNgRunStateTracker; + +public class TestClassAFiveMethodsWithNoDepsSample { + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodA(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodA") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodB(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodB") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodC(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodC") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodD(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodD") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodE(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodE") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassBFourMethodsWithDataProviderOnAllMethodsAndNoDepsSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassBFourMethodsWithDataProviderOnAllMethodsAndNoDepsSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassBFourMethodsWithDataProviderOnAllMethodsAndNoDepsSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassBFourMethodsWithDataProviderOnAllMethodsAndNoDepsSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,140 @@ +package test.thread.parallelization.sample; + +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_INSTANCE; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.DATA_PROVIDER_PARAM; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_BELONGING_TO; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHODS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHOD_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.SUITE_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.TEST_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.TEST_METHOD_EXECUTION; + +import java.util.Map; +import java.util.concurrent.TimeUnit; +import org.testng.ITestContext; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import test.thread.parallelization.TestNgRunStateTracker; + +public class TestClassBFourMethodsWithDataProviderOnAllMethodsAndNoDepsSample { + @Test(dataProvider = "data-provider") + public void testMethodA(String suiteName, String testName, String sleepFor, String dpVal) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodA") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Test(dataProvider = "data-provider") + public void testMethodB(String suiteName, String testName, String sleepFor, String dpVal) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodB") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Test(dataProvider = "data-provider") + public void testMethodC(String suiteName, String testName, String sleepFor, String dpVal) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodC") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Test(dataProvider = "data-provider") + public void testMethodD(String suiteName, String testName, String sleepFor, String dpVal) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodD") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @DataProvider(name = "data-provider") + public Object[][] dataProvider(ITestContext context) { + Map params = context.getCurrentXmlTest().getAllParameters(); + + String suiteName = params.get("suiteName"); + String testName = params.get("testName"); + String sleepFor = params.get("sleepFor"); + + String dataProviderParam = params.get("dataProviderParam"); + String[] dataProviderVals = dataProviderParam.split(","); + + Object[][] dataToProvide = new Object[dataProviderVals.length][4]; + + for (int i = 0; i < dataProviderVals.length; i++) { + dataToProvide[i][0] = suiteName; + dataToProvide[i][1] = testName; + dataToProvide[i][2] = sleepFor; + dataToProvide[i][3] = dataProviderVals[i]; + } + + return dataToProvide; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassBFourMethodsWithFactoryUsingDataProviderAndNoDepsSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassBFourMethodsWithFactoryUsingDataProviderAndNoDepsSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassBFourMethodsWithFactoryUsingDataProviderAndNoDepsSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassBFourMethodsWithFactoryUsingDataProviderAndNoDepsSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,166 @@ +package test.thread.parallelization.sample; + +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_INSTANCE; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.DATA_PROVIDER_PARAM; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_BELONGING_TO; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHODS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHOD_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.SUITE_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.TEST_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.TEST_METHOD_EXECUTION; + +import java.util.Map; +import java.util.concurrent.TimeUnit; +import org.testng.ITestContext; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; +import test.thread.parallelization.TestNgRunStateTracker; + +public class TestClassBFourMethodsWithFactoryUsingDataProviderAndNoDepsSample { + + private final String suiteName; + private final String testName; + private final int sleepFor; + private final String dpVal; + + @Factory(dataProvider = "data-provider") + public TestClassBFourMethodsWithFactoryUsingDataProviderAndNoDepsSample( + String suiteName, String testName, String sleepFor, String dpVal) { + + this.suiteName = suiteName; + this.testName = testName; + this.sleepFor = Integer.parseInt(sleepFor); + this.dpVal = dpVal; + } + + @Test + public void testMethodA() throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodA") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(sleepFor); + } + + @Test + public void testMethodB() throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodB") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(sleepFor); + } + + @Test + public void testMethodC() throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodC") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(sleepFor); + } + + @Test + public void testMethodD() throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodD") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(sleepFor); + } + + @DataProvider(name = "data-provider") + public static Object[][] dataProvider(ITestContext context) { + Map params = context.getCurrentXmlTest().getAllParameters(); + + String suiteName = params.get("suiteName"); + String testName = params.get("testName"); + String sleepFor = params.get("sleepFor"); + + String dataProviderParam = params.get("dataProviderParam"); + + String[] dataProviderVals = null; + String classNamePattern = + TestClassBFourMethodsWithFactoryUsingDataProviderAndNoDepsSample.class.getSimpleName() + + "("; + + if (dataProviderParam.contains(classNamePattern)) { + dataProviderParam = + dataProviderParam.substring( + dataProviderParam.indexOf(classNamePattern) + classNamePattern.length()); + dataProviderParam = dataProviderParam.substring(0, dataProviderParam.indexOf(")")); + } + + dataProviderVals = dataProviderParam.split(","); + + Object[][] dataToProvide = new Object[dataProviderVals.length][4]; + + for (int i = 0; i < dataProviderVals.length; i++) { + dataToProvide[i][0] = suiteName; + dataToProvide[i][1] = testName; + dataToProvide[i][2] = sleepFor; + dataToProvide[i][3] = dataProviderVals[i]; + } + + return dataToProvide; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassBFourMethodsWithNoDepsSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassBFourMethodsWithNoDepsSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassBFourMethodsWithNoDepsSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassBFourMethodsWithNoDepsSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,115 @@ +package test.thread.parallelization.sample; + +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_INSTANCE; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_BELONGING_TO; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHODS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHOD_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.SUITE_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.TEST_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.TEST_METHOD_EXECUTION; + +import java.util.concurrent.TimeUnit; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; +import test.thread.parallelization.TestNgRunStateTracker; + +public class TestClassBFourMethodsWithNoDepsSample { + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodA(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodA") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodB(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodB") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodC(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodC") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodD(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodD") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassBSixMethodsWithDataProviderOnAllMethodsAndNoDepsSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassBSixMethodsWithDataProviderOnAllMethodsAndNoDepsSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassBSixMethodsWithDataProviderOnAllMethodsAndNoDepsSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassBSixMethodsWithDataProviderOnAllMethodsAndNoDepsSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,189 @@ +package test.thread.parallelization.sample; + +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_INSTANCE; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.DATA_PROVIDER_PARAM; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_BELONGING_TO; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHODS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHOD_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.SUITE_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.TEST_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.TEST_METHOD_EXECUTION; + +import java.util.Map; +import java.util.concurrent.TimeUnit; +import org.testng.ITestContext; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import test.thread.parallelization.TestNgRunStateTracker; + +public class TestClassBSixMethodsWithDataProviderOnAllMethodsAndNoDepsSample { + + @Test(dataProvider = "data-provider") + public void testMethodA(String suiteName, String testName, String sleepFor, String dpVal) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodA") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Test(dataProvider = "data-provider") + public void testMethodB(String suiteName, String testName, String sleepFor, String dpVal) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodB") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Test(dataProvider = "data-provider") + public void testMethodC(String suiteName, String testName, String sleepFor, String dpVal) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodC") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Test(dataProvider = "data-provider") + public void testMethodD(String suiteName, String testName, String sleepFor, String dpVal) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodD") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Test(dataProvider = "data-provider") + public void testMethodE(String suiteName, String testName, String sleepFor, String dpVal) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodE") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Test(dataProvider = "data-provider") + public void testMethodF(String suiteName, String testName, String sleepFor, String dpVal) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodF") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @DataProvider(name = "data-provider") + public Object[][] dataProvider(ITestContext context) { + Map params = context.getCurrentXmlTest().getAllParameters(); + + String suiteName = params.get("suiteName"); + String testName = params.get("testName"); + String sleepFor = params.get("sleepFor"); + + String dataProviderParam = params.get("dataProviderParam"); + String[] dataProviderVals = dataProviderParam.split(","); + + Object[][] dataToProvide = new Object[dataProviderVals.length][4]; + + for (int i = 0; i < dataProviderVals.length; i++) { + dataToProvide[i][0] = suiteName; + dataToProvide[i][1] = testName; + dataToProvide[i][2] = sleepFor; + dataToProvide[i][3] = dataProviderVals[i]; + } + + return dataToProvide; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassBSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassBSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassBSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassBSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,190 @@ +package test.thread.parallelization.sample; + +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_INSTANCE; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.DATA_PROVIDER_PARAM; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_BELONGING_TO; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHODS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHOD_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.SUITE_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.TEST_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.TEST_METHOD_EXECUTION; + +import java.util.Map; +import java.util.concurrent.TimeUnit; +import org.testng.ITestContext; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; +import test.thread.parallelization.TestNgRunStateTracker; + +public class TestClassBSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample { + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodA(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodA") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Test(dataProvider = "data-provider") + public void testMethodB(String suiteName, String testName, String sleepFor, String dpVal) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodB") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodC(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodC") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Test(dataProvider = "data-provider") + public void testMethodD(String suiteName, String testName, String sleepFor, String dpVal) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodD") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodE(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodE") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Test(dataProvider = "data-provider") + public void testMethodF(String suiteName, String testName, String sleepFor, String dpVal) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodF") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @DataProvider(name = "data-provider") + public Object[][] dataProvider(ITestContext context) { + Map params = context.getCurrentXmlTest().getAllParameters(); + + String suiteName = params.get("suiteName"); + String testName = params.get("testName"); + String sleepFor = params.get("sleepFor"); + + String dataProviderParam = params.get("dataProviderParam"); + String[] dataProviderVals = dataProviderParam.split(","); + + Object[][] dataToProvide = new Object[dataProviderVals.length][4]; + + for (int i = 0; i < dataProviderVals.length; i++) { + dataToProvide[i][0] = suiteName; + dataToProvide[i][1] = testName; + dataToProvide[i][2] = sleepFor; + dataToProvide[i][3] = dataProviderVals[i]; + } + + return dataToProvide; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassCFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassCFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassCFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassCFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,166 @@ +package test.thread.parallelization.sample; + +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_INSTANCE; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.DATA_PROVIDER_PARAM; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_BELONGING_TO; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHODS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHOD_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.SUITE_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.TEST_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.TEST_METHOD_EXECUTION; + +import java.util.Map; +import java.util.concurrent.TimeUnit; +import org.testng.ITestContext; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; +import test.thread.parallelization.TestNgRunStateTracker; + +public class TestClassCFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample { + + @Test(dataProvider = "data-provider") + public void testMethodA(String suiteName, String testName, String sleepFor, String dpVal) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodA") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodB(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodB") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Test(dataProvider = "data-provider") + public void testMethodC(String suiteName, String testName, String sleepFor, String dpVal) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodC") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodD(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodD") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Test(dataProvider = "data-provider") + public void testMethodE(String suiteName, String testName, String sleepFor, String dpVal) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodE") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @DataProvider(name = "data-provider") + public Object[][] dataProvider(ITestContext context) { + Map params = context.getCurrentXmlTest().getAllParameters(); + + String suiteName = params.get("suiteName"); + String testName = params.get("testName"); + String sleepFor = params.get("sleepFor"); + + String dataProviderParam = params.get("dataProviderParam"); + String[] dataProviderVals = dataProviderParam.split(","); + + Object[][] dataToProvide = new Object[dataProviderVals.length][4]; + + for (int i = 0; i < dataProviderVals.length; i++) { + dataToProvide[i][0] = suiteName; + dataToProvide[i][1] = testName; + dataToProvide[i][2] = sleepFor; + dataToProvide[i][3] = dataProviderVals[i]; + } + + return dataToProvide; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassCSixMethodsWithFactoryUsingDataProviderAndNoDepsSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassCSixMethodsWithFactoryUsingDataProviderAndNoDepsSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassCSixMethodsWithFactoryUsingDataProviderAndNoDepsSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassCSixMethodsWithFactoryUsingDataProviderAndNoDepsSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,211 @@ +package test.thread.parallelization.sample; + +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_INSTANCE; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.DATA_PROVIDER_PARAM; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_BELONGING_TO; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHODS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHOD_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.SUITE_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.TEST_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.TEST_METHOD_EXECUTION; + +import java.util.Map; +import java.util.concurrent.TimeUnit; +import org.testng.ITestContext; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; +import test.thread.parallelization.TestNgRunStateTracker; + +public class TestClassCSixMethodsWithFactoryUsingDataProviderAndNoDepsSample { + + private final String suiteName; + private final String testName; + private final int sleepFor; + private final String dpVal; + + @Factory(dataProvider = "data-provider") + public TestClassCSixMethodsWithFactoryUsingDataProviderAndNoDepsSample( + String suiteName, String testName, String sleepFor, String dpVal) { + + this.suiteName = suiteName; + this.testName = testName; + this.sleepFor = Integer.parseInt(sleepFor); + this.dpVal = dpVal; + } + + @Test + public void testMethodA() throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodA") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(sleepFor); + } + + @Test + public void testMethodB() throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodB") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(sleepFor); + } + + @Test + public void testMethodC() throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodC") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(sleepFor); + } + + @Test + public void testMethodD() throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodD") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(sleepFor); + } + + @Test + public void testMethodE() throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodE") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(sleepFor); + } + + @Test + public void testMethodF() throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodF") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(sleepFor); + } + + @DataProvider(name = "data-provider") + public static Object[][] dataProvider(ITestContext context) { + Map params = context.getCurrentXmlTest().getAllParameters(); + + String suiteName = params.get("suiteName"); + String testName = params.get("testName"); + String sleepFor = params.get("sleepFor"); + + String dataProviderParam = params.get("dataProviderParam"); + + String[] dataProviderVals = null; + String classNamePattern = + TestClassCSixMethodsWithFactoryUsingDataProviderAndNoDepsSample.class.getSimpleName() + "("; + + if (dataProviderParam.contains(classNamePattern)) { + dataProviderParam = + dataProviderParam.substring( + dataProviderParam.indexOf(classNamePattern) + classNamePattern.length()); + dataProviderParam = dataProviderParam.substring(0, dataProviderParam.indexOf(")")); + } + + dataProviderVals = dataProviderParam.split(","); + + Object[][] dataToProvide = new Object[dataProviderVals.length][4]; + + for (int i = 0; i < dataProviderVals.length; i++) { + dataToProvide[i][0] = suiteName; + dataToProvide[i][1] = testName; + dataToProvide[i][2] = sleepFor; + dataToProvide[i][3] = dataProviderVals[i]; + } + + return dataToProvide; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassCSixMethodsWithNoDepsSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassCSixMethodsWithNoDepsSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassCSixMethodsWithNoDepsSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassCSixMethodsWithNoDepsSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,163 @@ +package test.thread.parallelization.sample; + +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_INSTANCE; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_BELONGING_TO; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHODS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHOD_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.SUITE_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.TEST_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.TEST_METHOD_EXECUTION; + +import java.util.concurrent.TimeUnit; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; +import test.thread.parallelization.TestNgRunStateTracker; + +public class TestClassCSixMethodsWithNoDepsSample { + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodA(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodA") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodB(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodB") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodC(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodC") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodD(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodD") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodE(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodE") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodF(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodF") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassDThreeMethodsWithDataProviderOnAllMethodsAndNoDepsSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassDThreeMethodsWithDataProviderOnAllMethodsAndNoDepsSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassDThreeMethodsWithDataProviderOnAllMethodsAndNoDepsSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassDThreeMethodsWithDataProviderOnAllMethodsAndNoDepsSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,116 @@ +package test.thread.parallelization.sample; + +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_INSTANCE; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.DATA_PROVIDER_PARAM; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_BELONGING_TO; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHODS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHOD_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.SUITE_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.TEST_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.TEST_METHOD_EXECUTION; + +import java.util.Map; +import java.util.concurrent.TimeUnit; +import org.testng.ITestContext; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import test.thread.parallelization.TestNgRunStateTracker; + +public class TestClassDThreeMethodsWithDataProviderOnAllMethodsAndNoDepsSample { + @Test(dataProvider = "data-provider") + public void testMethodA(String suiteName, String testName, String sleepFor, String dpVal) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodA") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Test(dataProvider = "data-provider") + public void testMethodB(String suiteName, String testName, String sleepFor, String dpVal) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodB") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Test(dataProvider = "data-provider") + public void testMethodC(String suiteName, String testName, String sleepFor, String dpVal) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodC") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @DataProvider(name = "data-provider") + public Object[][] dataProvider(ITestContext context) { + Map params = context.getCurrentXmlTest().getAllParameters(); + + String suiteName = params.get("suiteName"); + String testName = params.get("testName"); + String sleepFor = params.get("sleepFor"); + + String dataProviderParam = params.get("dataProviderParam"); + String[] dataProviderVals = dataProviderParam.split(","); + + Object[][] dataToProvide = new Object[dataProviderVals.length][4]; + + for (int i = 0; i < dataProviderVals.length; i++) { + dataToProvide[i][0] = suiteName; + dataToProvide[i][1] = testName; + dataToProvide[i][2] = sleepFor; + dataToProvide[i][3] = dataProviderVals[i]; + } + + return dataToProvide; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassDThreeMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassDThreeMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassDThreeMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassDThreeMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,118 @@ +package test.thread.parallelization.sample; + +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_INSTANCE; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.DATA_PROVIDER_PARAM; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_BELONGING_TO; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHODS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHOD_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.SUITE_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.TEST_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.TEST_METHOD_EXECUTION; + +import java.util.Map; +import java.util.concurrent.TimeUnit; +import org.testng.ITestContext; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; +import test.thread.parallelization.TestNgRunStateTracker; + +public class TestClassDThreeMethodsWithDataProviderOnSomeMethodsAndNoDepsSample { + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodA(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodA") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Test(dataProvider = "data-provider") + public void testMethodB(String suiteName, String testName, String sleepFor, String dpVal) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodB") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodC(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodC") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @DataProvider(name = "data-provider") + public Object[][] dataProvider(ITestContext context) { + Map params = context.getCurrentXmlTest().getAllParameters(); + + String suiteName = params.get("suiteName"); + String testName = params.get("testName"); + String sleepFor = params.get("sleepFor"); + + String dataProviderParam = params.get("dataProviderParam"); + String[] dataProviderVals = dataProviderParam.split(","); + + Object[][] dataToProvide = new Object[dataProviderVals.length][4]; + + for (int i = 0; i < dataProviderVals.length; i++) { + dataToProvide[i][0] = suiteName; + dataToProvide[i][1] = testName; + dataToProvide[i][2] = sleepFor; + dataToProvide[i][3] = dataProviderVals[i]; + } + + return dataToProvide; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassDThreeMethodsWithFactoryUsingDataProviderAndNoDepsSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassDThreeMethodsWithFactoryUsingDataProviderAndNoDepsSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassDThreeMethodsWithFactoryUsingDataProviderAndNoDepsSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassDThreeMethodsWithFactoryUsingDataProviderAndNoDepsSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,143 @@ +package test.thread.parallelization.sample; + +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_INSTANCE; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.DATA_PROVIDER_PARAM; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_BELONGING_TO; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHODS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHOD_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.SUITE_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.TEST_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.TEST_METHOD_EXECUTION; + +import java.util.Map; +import java.util.concurrent.TimeUnit; +import org.testng.ITestContext; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; +import test.thread.parallelization.TestNgRunStateTracker; + +public class TestClassDThreeMethodsWithFactoryUsingDataProviderAndNoDepsSample { + + private final String suiteName; + private final String testName; + private final int sleepFor; + private final String dpVal; + + @Factory(dataProvider = "data-provider") + public TestClassDThreeMethodsWithFactoryUsingDataProviderAndNoDepsSample( + String suiteName, String testName, String sleepFor, String dpVal) { + + this.suiteName = suiteName; + this.testName = testName; + this.sleepFor = Integer.parseInt(sleepFor); + this.dpVal = dpVal; + } + + @Test + public void testMethodA() throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodA") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(sleepFor); + } + + @Test + public void testMethodB() throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodB") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(sleepFor); + } + + @Test + public void testMethodC() throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodC") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(sleepFor); + } + + @DataProvider(name = "data-provider") + public static Object[][] dataProvider(ITestContext context) { + Map params = context.getCurrentXmlTest().getAllParameters(); + + String suiteName = params.get("suiteName"); + String testName = params.get("testName"); + String sleepFor = params.get("sleepFor"); + + String dataProviderParam = params.get("dataProviderParam"); + + String[] dataProviderVals = null; + String classNamePattern = + TestClassDThreeMethodsWithFactoryUsingDataProviderAndNoDepsSample.class.getSimpleName() + + "("; + + if (dataProviderParam.contains(classNamePattern)) { + dataProviderParam = + dataProviderParam.substring( + dataProviderParam.indexOf(classNamePattern) + classNamePattern.length()); + dataProviderParam = dataProviderParam.substring(0, dataProviderParam.indexOf(")")); + } + + dataProviderVals = dataProviderParam.split(","); + + Object[][] dataToProvide = new Object[dataProviderVals.length][4]; + + for (int i = 0; i < dataProviderVals.length; i++) { + dataToProvide[i][0] = suiteName; + dataToProvide[i][1] = testName; + dataToProvide[i][2] = sleepFor; + dataToProvide[i][3] = dataProviderVals[i]; + } + + return dataToProvide; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassDThreeMethodsWithNoDepsSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassDThreeMethodsWithNoDepsSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassDThreeMethodsWithNoDepsSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassDThreeMethodsWithNoDepsSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,91 @@ +package test.thread.parallelization.sample; + +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_INSTANCE; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_BELONGING_TO; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHODS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHOD_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.SUITE_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.TEST_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.TEST_METHOD_EXECUTION; + +import java.util.concurrent.TimeUnit; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; +import test.thread.parallelization.TestNgRunStateTracker; + +public class TestClassDThreeMethodsWithNoDepsSample { + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodA(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodA") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodB(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodB") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodC(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodC") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassEFiveMethodsWithNoDepsSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassEFiveMethodsWithNoDepsSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassEFiveMethodsWithNoDepsSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassEFiveMethodsWithNoDepsSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,139 @@ +package test.thread.parallelization.sample; + +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_INSTANCE; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_BELONGING_TO; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHODS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHOD_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.SUITE_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.TEST_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.TEST_METHOD_EXECUTION; + +import java.util.concurrent.TimeUnit; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; +import test.thread.parallelization.TestNgRunStateTracker; + +public class TestClassEFiveMethodsWithNoDepsSample { + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodA(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodA") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodB(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodB") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodC(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodC") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodD(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodD") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodE(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodE") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassEFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassEFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassEFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassEFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,142 @@ +package test.thread.parallelization.sample; + +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_INSTANCE; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.DATA_PROVIDER_PARAM; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_BELONGING_TO; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHODS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHOD_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.SUITE_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.TEST_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.TEST_METHOD_EXECUTION; + +import java.util.Map; +import java.util.concurrent.TimeUnit; +import org.testng.ITestContext; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; +import test.thread.parallelization.TestNgRunStateTracker; + +public class TestClassEFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample { + + @Test(dataProvider = "data-provider") + public void testMethodA(String suiteName, String testName, String sleepFor, String dpVal) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodA") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Test(dataProvider = "data-provider") + public void testMethodB(String suiteName, String testName, String sleepFor, String dpVal) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodB") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodC(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodC") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodD(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodD") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @DataProvider(name = "data-provider") + public Object[][] dataProvider(ITestContext context) { + Map params = context.getCurrentXmlTest().getAllParameters(); + + String suiteName = params.get("suiteName"); + String testName = params.get("testName"); + String sleepFor = params.get("sleepFor"); + + String dataProviderParam = params.get("dataProviderParam"); + String[] dataProviderVals = dataProviderParam.split(","); + + Object[][] dataToProvide = new Object[dataProviderVals.length][4]; + + for (int i = 0; i < dataProviderVals.length; i++) { + dataToProvide[i][0] = suiteName; + dataToProvide[i][1] = testName; + dataToProvide[i][2] = sleepFor; + dataToProvide[i][3] = dataProviderVals[i]; + } + + return dataToProvide; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassFSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassFSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassFSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassFSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,190 @@ +package test.thread.parallelization.sample; + +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_INSTANCE; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.DATA_PROVIDER_PARAM; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_BELONGING_TO; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHODS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHOD_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.SUITE_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.TEST_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.TEST_METHOD_EXECUTION; + +import java.util.Map; +import java.util.concurrent.TimeUnit; +import org.testng.ITestContext; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; +import test.thread.parallelization.TestNgRunStateTracker; + +public class TestClassFSixMethodsWithDataProviderOnSomeMethodsAndNoDepsSample { + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodA(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodA") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Test(dataProvider = "data-provider") + public void testMethodB(String suiteName, String testName, String sleepFor, String dpVal) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodB") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodC(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodC") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Test(dataProvider = "data-provider") + public void testMethodD(String suiteName, String testName, String sleepFor, String dpVal) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodD") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodE(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodE") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Test(dataProvider = "data-provider") + public void testMethodF(String suiteName, String testName, String sleepFor, String dpVal) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodF") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @DataProvider(name = "data-provider") + public Object[][] dataProvider(ITestContext context) { + Map params = context.getCurrentXmlTest().getAllParameters(); + + String suiteName = params.get("suiteName"); + String testName = params.get("testName"); + String sleepFor = params.get("sleepFor"); + + String dataProviderParam = params.get("dataProviderParam"); + String[] dataProviderVals = dataProviderParam.split(","); + + Object[][] dataToProvide = new Object[dataProviderVals.length][4]; + + for (int i = 0; i < dataProviderVals.length; i++) { + dataToProvide[i][0] = suiteName; + dataToProvide[i][1] = testName; + dataToProvide[i][2] = sleepFor; + dataToProvide[i][3] = dataProviderVals[i]; + } + + return dataToProvide; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassFSixMethodsWithFactoryUsingDataProviderAndNoDepsSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassFSixMethodsWithFactoryUsingDataProviderAndNoDepsSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassFSixMethodsWithFactoryUsingDataProviderAndNoDepsSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassFSixMethodsWithFactoryUsingDataProviderAndNoDepsSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,211 @@ +package test.thread.parallelization.sample; + +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_INSTANCE; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.DATA_PROVIDER_PARAM; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_BELONGING_TO; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHODS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHOD_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.SUITE_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.TEST_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.TEST_METHOD_EXECUTION; + +import java.util.Map; +import java.util.concurrent.TimeUnit; +import org.testng.ITestContext; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; +import test.thread.parallelization.TestNgRunStateTracker; + +public class TestClassFSixMethodsWithFactoryUsingDataProviderAndNoDepsSample { + + private final String suiteName; + private final String testName; + private final int sleepFor; + private final String dpVal; + + @Factory(dataProvider = "data-provider") + public TestClassFSixMethodsWithFactoryUsingDataProviderAndNoDepsSample( + String suiteName, String testName, String sleepFor, String dpVal) { + + this.suiteName = suiteName; + this.testName = testName; + this.sleepFor = Integer.parseInt(sleepFor); + this.dpVal = dpVal; + } + + @Test + public void testMethodA() throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodA") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(sleepFor); + } + + @Test + public void testMethodB() throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodB") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(sleepFor); + } + + @Test + public void testMethodC() throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodC") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(sleepFor); + } + + @Test + public void testMethodD() throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodD") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(sleepFor); + } + + @Test + public void testMethodE() throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodE") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(sleepFor); + } + + @Test + public void testMethodF() throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodF") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(sleepFor); + } + + @DataProvider(name = "data-provider") + public static Object[][] dataProvider(ITestContext context) { + Map params = context.getCurrentXmlTest().getAllParameters(); + + String suiteName = params.get("suiteName"); + String testName = params.get("testName"); + String sleepFor = params.get("sleepFor"); + + String dataProviderParam = params.get("dataProviderParam"); + + String[] dataProviderVals = null; + String classNamePattern = + TestClassFSixMethodsWithFactoryUsingDataProviderAndNoDepsSample.class.getSimpleName() + "("; + + if (dataProviderParam.contains(classNamePattern)) { + dataProviderParam = + dataProviderParam.substring( + dataProviderParam.indexOf(classNamePattern) + classNamePattern.length()); + dataProviderParam = dataProviderParam.substring(0, dataProviderParam.indexOf(")")); + } + + dataProviderVals = dataProviderParam.split(","); + + Object[][] dataToProvide = new Object[dataProviderVals.length][4]; + + for (int i = 0; i < dataProviderVals.length; i++) { + dataToProvide[i][0] = suiteName; + dataToProvide[i][1] = testName; + dataToProvide[i][2] = sleepFor; + dataToProvide[i][3] = dataProviderVals[i]; + } + + return dataToProvide; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassFSixMethodsWithNoDepsSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassFSixMethodsWithNoDepsSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassFSixMethodsWithNoDepsSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassFSixMethodsWithNoDepsSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,162 @@ +package test.thread.parallelization.sample; + +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_INSTANCE; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_BELONGING_TO; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHODS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHOD_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.SUITE_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.TEST_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.TEST_METHOD_EXECUTION; + +import java.util.concurrent.TimeUnit; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; +import test.thread.parallelization.TestNgRunStateTracker; + +public class TestClassFSixMethodsWithNoDepsSample { + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodA(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodA") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodB(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodB") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodC(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodC") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodD(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodD") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodE(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodE") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodF(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodF") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassGFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassGFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassGFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassGFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,142 @@ +package test.thread.parallelization.sample; + +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_INSTANCE; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.DATA_PROVIDER_PARAM; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_BELONGING_TO; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHODS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHOD_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.SUITE_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.TEST_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.TEST_METHOD_EXECUTION; + +import java.util.Map; +import java.util.concurrent.TimeUnit; +import org.testng.ITestContext; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; +import test.thread.parallelization.TestNgRunStateTracker; + +public class TestClassGFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample { + + @Test(dataProvider = "data-provider") + public void testMethodA(String suiteName, String testName, String sleepFor, String dpVal) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodA") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Test(dataProvider = "data-provider") + public void testMethodB(String suiteName, String testName, String sleepFor, String dpVal) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodB") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodC(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodC") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodD(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodD") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @DataProvider(name = "data-provider") + public Object[][] dataProvider(ITestContext context) { + Map params = context.getCurrentXmlTest().getAllParameters(); + + String suiteName = params.get("suiteName"); + String testName = params.get("testName"); + String sleepFor = params.get("sleepFor"); + + String dataProviderParam = params.get("dataProviderParam"); + String[] dataProviderVals = dataProviderParam.split(","); + + Object[][] dataToProvide = new Object[dataProviderVals.length][4]; + + for (int i = 0; i < dataProviderVals.length; i++) { + dataToProvide[i][0] = suiteName; + dataToProvide[i][1] = testName; + dataToProvide[i][2] = sleepFor; + dataToProvide[i][3] = dataProviderVals[i]; + } + + return dataToProvide; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassGThreeMethodsWithNoDepsSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassGThreeMethodsWithNoDepsSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassGThreeMethodsWithNoDepsSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassGThreeMethodsWithNoDepsSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,91 @@ +package test.thread.parallelization.sample; + +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_INSTANCE; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_BELONGING_TO; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHODS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHOD_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.SUITE_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.TEST_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.TEST_METHOD_EXECUTION; + +import java.util.concurrent.TimeUnit; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; +import test.thread.parallelization.TestNgRunStateTracker; + +public class TestClassGThreeMethodsWithNoDepsSample { + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodA(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodA") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodB(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodB") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodC(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodC") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassHFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassHFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassHFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassHFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,166 @@ +package test.thread.parallelization.sample; + +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_INSTANCE; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.DATA_PROVIDER_PARAM; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_BELONGING_TO; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHODS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHOD_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.SUITE_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.TEST_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.TEST_METHOD_EXECUTION; + +import java.util.Map; +import java.util.concurrent.TimeUnit; +import org.testng.ITestContext; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; +import test.thread.parallelization.TestNgRunStateTracker; + +public class TestClassHFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample { + + @Test(dataProvider = "data-provider") + public void testMethodA(String suiteName, String testName, String sleepFor, String dpVal) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodA") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodB(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodB") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Test(dataProvider = "data-provider") + public void testMethodC(String suiteName, String testName, String sleepFor, String dpVal) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodC") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodD(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodD") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Test(dataProvider = "data-provider") + public void testMethodE(String suiteName, String testName, String sleepFor, String dpVal) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodE") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @DataProvider(name = "data-provider") + public Object[][] dataProvider(ITestContext context) { + Map params = context.getCurrentXmlTest().getAllParameters(); + + String suiteName = params.get("suiteName"); + String testName = params.get("testName"); + String sleepFor = params.get("sleepFor"); + + String dataProviderParam = params.get("dataProviderParam"); + String[] dataProviderVals = dataProviderParam.split(","); + + Object[][] dataToProvide = new Object[dataProviderVals.length][4]; + + for (int i = 0; i < dataProviderVals.length; i++) { + dataToProvide[i][0] = suiteName; + dataToProvide[i][1] = testName; + dataToProvide[i][2] = sleepFor; + dataToProvide[i][3] = dataProviderVals[i]; + } + + return dataToProvide; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassHFourMethodsWithNoDepsSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassHFourMethodsWithNoDepsSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassHFourMethodsWithNoDepsSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassHFourMethodsWithNoDepsSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,114 @@ +package test.thread.parallelization.sample; + +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_INSTANCE; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_BELONGING_TO; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHODS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHOD_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.SUITE_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.TEST_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.TEST_METHOD_EXECUTION; + +import java.util.concurrent.TimeUnit; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; +import test.thread.parallelization.TestNgRunStateTracker; + +public class TestClassHFourMethodsWithNoDepsSample { + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodA(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodA") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodB(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodB") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodC(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodC") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodD(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodD") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassIFiveMethodsWithNoDepsSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassIFiveMethodsWithNoDepsSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassIFiveMethodsWithNoDepsSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassIFiveMethodsWithNoDepsSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,139 @@ +package test.thread.parallelization.sample; + +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_INSTANCE; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_BELONGING_TO; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHODS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHOD_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.SUITE_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.TEST_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.TEST_METHOD_EXECUTION; + +import java.util.concurrent.TimeUnit; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; +import test.thread.parallelization.TestNgRunStateTracker; + +public class TestClassIFiveMethodsWithNoDepsSample { + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodA(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodA") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodB(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodB") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodC(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodC") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodD(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodD") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodE(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodE") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassIThreeMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassIThreeMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassIThreeMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassIThreeMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,118 @@ +package test.thread.parallelization.sample; + +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_INSTANCE; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.DATA_PROVIDER_PARAM; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_BELONGING_TO; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHODS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHOD_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.SUITE_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.TEST_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.TEST_METHOD_EXECUTION; + +import java.util.Map; +import java.util.concurrent.TimeUnit; +import org.testng.ITestContext; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; +import test.thread.parallelization.TestNgRunStateTracker; + +public class TestClassIThreeMethodsWithDataProviderOnSomeMethodsAndNoDepsSample { + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodA(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodA") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Test(dataProvider = "data-provider") + public void testMethodB(String suiteName, String testName, String sleepFor, String dpVal) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodB") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodC(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodC") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @DataProvider(name = "data-provider") + public Object[][] dataProvider(ITestContext context) { + Map params = context.getCurrentXmlTest().getAllParameters(); + + String suiteName = params.get("suiteName"); + String testName = params.get("testName"); + String sleepFor = params.get("sleepFor"); + + String dataProviderParam = params.get("dataProviderParam"); + String[] dataProviderVals = dataProviderParam.split(","); + + Object[][] dataToProvide = new Object[dataProviderVals.length][4]; + + for (int i = 0; i < dataProviderVals.length; i++) { + dataToProvide[i][0] = suiteName; + dataToProvide[i][1] = testName; + dataToProvide[i][2] = sleepFor; + dataToProvide[i][3] = dataProviderVals[i]; + } + + return dataToProvide; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassJFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassJFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassJFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassJFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,142 @@ +package test.thread.parallelization.sample; + +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_INSTANCE; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.DATA_PROVIDER_PARAM; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_BELONGING_TO; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHODS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHOD_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.SUITE_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.TEST_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.TEST_METHOD_EXECUTION; + +import java.util.Map; +import java.util.concurrent.TimeUnit; +import org.testng.ITestContext; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; +import test.thread.parallelization.TestNgRunStateTracker; + +public class TestClassJFourMethodsWithDataProviderOnSomeMethodsAndNoDepsSample { + + @Test(dataProvider = "data-provider") + public void testMethodA(String suiteName, String testName, String sleepFor, String dpVal) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodA") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Test(dataProvider = "data-provider") + public void testMethodB(String suiteName, String testName, String sleepFor, String dpVal) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodB") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodC(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodC") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodD(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodD") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @DataProvider(name = "data-provider") + public Object[][] dataProvider(ITestContext context) { + Map params = context.getCurrentXmlTest().getAllParameters(); + + String suiteName = params.get("suiteName"); + String testName = params.get("testName"); + String sleepFor = params.get("sleepFor"); + + String dataProviderParam = params.get("dataProviderParam"); + String[] dataProviderVals = dataProviderParam.split(","); + + Object[][] dataToProvide = new Object[dataProviderVals.length][4]; + + for (int i = 0; i < dataProviderVals.length; i++) { + dataToProvide[i][0] = suiteName; + dataToProvide[i][1] = testName; + dataToProvide[i][2] = sleepFor; + dataToProvide[i][3] = dataProviderVals[i]; + } + + return dataToProvide; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassJFourMethodsWithNoDepsSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassJFourMethodsWithNoDepsSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassJFourMethodsWithNoDepsSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassJFourMethodsWithNoDepsSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,114 @@ +package test.thread.parallelization.sample; + +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_INSTANCE; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_BELONGING_TO; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHODS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHOD_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.SUITE_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.TEST_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.TEST_METHOD_EXECUTION; + +import java.util.concurrent.TimeUnit; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; +import test.thread.parallelization.TestNgRunStateTracker; + +public class TestClassJFourMethodsWithNoDepsSample { + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodA(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodA") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodB(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodB") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodC(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodC") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodD(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodD") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassKFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassKFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassKFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassKFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,166 @@ +package test.thread.parallelization.sample; + +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_INSTANCE; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.DATA_PROVIDER_PARAM; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_BELONGING_TO; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHODS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHOD_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.SUITE_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.TEST_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.TEST_METHOD_EXECUTION; + +import java.util.Map; +import java.util.concurrent.TimeUnit; +import org.testng.ITestContext; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; +import test.thread.parallelization.TestNgRunStateTracker; + +public class TestClassKFiveMethodsWithDataProviderOnSomeMethodsAndNoDepsSample { + + @Test(dataProvider = "data-provider") + public void testMethodA(String suiteName, String testName, String sleepFor, String dpVal) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodA") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodB(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodB") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Test(dataProvider = "data-provider") + public void testMethodC(String suiteName, String testName, String sleepFor, String dpVal) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodC") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodD(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodD") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Test(dataProvider = "data-provider") + public void testMethodE(String suiteName, String testName, String sleepFor, String dpVal) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodE") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(DATA_PROVIDER_PARAM, dpVal) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @DataProvider(name = "data-provider") + public Object[][] dataProvider(ITestContext context) { + Map params = context.getCurrentXmlTest().getAllParameters(); + + String suiteName = params.get("suiteName"); + String testName = params.get("testName"); + String sleepFor = params.get("sleepFor"); + + String dataProviderParam = params.get("dataProviderParam"); + String[] dataProviderVals = dataProviderParam.split(","); + + Object[][] dataToProvide = new Object[dataProviderVals.length][4]; + + for (int i = 0; i < dataProviderVals.length; i++) { + dataToProvide[i][0] = suiteName; + dataToProvide[i][1] = testName; + dataToProvide[i][2] = sleepFor; + dataToProvide[i][3] = dataProviderVals[i]; + } + + return dataToProvide; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassKFiveMethodsWithNoDepsSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassKFiveMethodsWithNoDepsSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassKFiveMethodsWithNoDepsSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassKFiveMethodsWithNoDepsSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,139 @@ +package test.thread.parallelization.sample; + +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_INSTANCE; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_BELONGING_TO; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHODS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHOD_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.SUITE_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.TEST_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.TEST_METHOD_EXECUTION; + +import java.util.concurrent.TimeUnit; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; +import test.thread.parallelization.TestNgRunStateTracker; + +public class TestClassKFiveMethodsWithNoDepsSample { + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodA(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodA") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodB(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodB") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodC(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodC") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodD(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodD") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodE(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodE") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassLThreeMethodsWithNoDepsSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassLThreeMethodsWithNoDepsSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassLThreeMethodsWithNoDepsSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassLThreeMethodsWithNoDepsSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,91 @@ +package test.thread.parallelization.sample; + +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_INSTANCE; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_BELONGING_TO; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHODS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHOD_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.SUITE_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.TEST_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.TEST_METHOD_EXECUTION; + +import java.util.concurrent.TimeUnit; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; +import test.thread.parallelization.TestNgRunStateTracker; + +public class TestClassLThreeMethodsWithNoDepsSample { + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodA(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodA") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodB(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodB") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodC(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodC") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassMFourMethodsWithNoDepsSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassMFourMethodsWithNoDepsSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassMFourMethodsWithNoDepsSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassMFourMethodsWithNoDepsSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,114 @@ +package test.thread.parallelization.sample; + +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_INSTANCE; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_BELONGING_TO; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHODS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHOD_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.SUITE_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.TEST_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.TEST_METHOD_EXECUTION; + +import java.util.concurrent.TimeUnit; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; +import test.thread.parallelization.TestNgRunStateTracker; + +public class TestClassMFourMethodsWithNoDepsSample { + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodA(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodA") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodB(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodB") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodC(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodC") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodD(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodD") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassNFiveMethodsWithNoDepsSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassNFiveMethodsWithNoDepsSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassNFiveMethodsWithNoDepsSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassNFiveMethodsWithNoDepsSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,139 @@ +package test.thread.parallelization.sample; + +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_INSTANCE; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_BELONGING_TO; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHODS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHOD_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.SUITE_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.TEST_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.TEST_METHOD_EXECUTION; + +import java.util.concurrent.TimeUnit; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; +import test.thread.parallelization.TestNgRunStateTracker; + +public class TestClassNFiveMethodsWithNoDepsSample { + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodA(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodA") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodB(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodB") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodC(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodC") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodD(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodD") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodE(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodE") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassOSixMethodsWithNoDepsSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassOSixMethodsWithNoDepsSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassOSixMethodsWithNoDepsSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/parallelization/sample/TestClassOSixMethodsWithNoDepsSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,162 @@ +package test.thread.parallelization.sample; + +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_INSTANCE; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.CLASS_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_BELONGING_TO; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.GROUPS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHODS_DEPENDED_ON; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.METHOD_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.SUITE_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.EventInfo.TEST_NAME; +import static test.thread.parallelization.TestNgRunStateTracker.TestNgRunEvent.TEST_METHOD_EXECUTION; + +import java.util.concurrent.TimeUnit; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; +import test.thread.parallelization.TestNgRunStateTracker; + +public class TestClassOSixMethodsWithNoDepsSample { + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodA(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodA") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodB(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodB") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodC(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodC") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodD(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodD") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodE(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodE") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } + + @Parameters({"suiteName", "testName", "sleepFor"}) + @Test + public void testMethodF(String suiteName, String testName, String sleepFor) + throws InterruptedException { + long time = System.currentTimeMillis(); + + TestNgRunStateTracker.logEvent( + TestNgRunStateTracker.EventLog.builder() + .setEvent(TEST_METHOD_EXECUTION) + .setTimeOfEvent(time) + .setThread(Thread.currentThread()) + .addData(METHOD_NAME, "testMethodF") + .addData(CLASS_NAME, getClass().getCanonicalName()) + .addData(CLASS_INSTANCE, this) + .addData(TEST_NAME, testName) + .addData(SUITE_NAME, suiteName) + .addData(GROUPS_DEPENDED_ON, new String[0]) + .addData(METHODS_DEPENDED_ON, new String[0]) + .addData(GROUPS_BELONGING_TO, new String[0]) + .build()); + + TimeUnit.MILLISECONDS.sleep(Integer.parseInt(sleepFor)); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/testng.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/testng.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/thread/testng.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/thread/testng.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/timeout/GitHub1314Sample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/timeout/GitHub1314Sample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/timeout/GitHub1314Sample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/timeout/GitHub1314Sample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,26 @@ +package test.timeout; + +import org.testng.annotations.Test; + +public class GitHub1314Sample { + + @Test + private void iWorkWell() { + System.out.println("Test1"); + } + + @Test( + timeOut = 100, + dependsOnMethods = {"iWorkWell"}) + private void iHangHorribly() { + System.out.println("Test2"); + while (true) { + int two = 1 + 1; + } + } + + @Test(dependsOnMethods = {"iHangHorribly"}) + private void iAmNeverRun() { + System.out.println("Test3"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/timeout/InvocationTimeOutSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/timeout/InvocationTimeOutSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/timeout/InvocationTimeOutSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/timeout/InvocationTimeOutSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,24 @@ +package test.timeout; + +import org.testng.annotations.Test; + +public class InvocationTimeOutSampleTest { + + @Test(invocationCount = 5, invocationTimeOut = 2_000) + public void shouldPass() { + try { + Thread.sleep(250); + } catch (InterruptedException handled) { + Thread.currentThread().interrupt(); + } + } + + @Test(invocationCount = 5, invocationTimeOut = 1_000) + public void shouldFail() { + try { + Thread.sleep(250); + } catch (InterruptedException handled) { + Thread.currentThread().interrupt(); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/timeout/TestTimeOutSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/timeout/TestTimeOutSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/timeout/TestTimeOutSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/timeout/TestTimeOutSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ +package test.timeout; + +import org.testng.annotations.Test; + +public class TestTimeOutSampleTest { + + @Test + public void timeoutTest() { + try { + Thread.sleep(2_000); + } catch (InterruptedException handled) { + Thread.currentThread().interrupt(); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/timeout/TimeOutFromXmlTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/timeout/TimeOutFromXmlTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/timeout/TimeOutFromXmlTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/timeout/TimeOutFromXmlTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,90 @@ +package test.timeout; + +import java.io.FileInputStream; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import org.testng.annotations.Test; +import org.testng.xml.SuiteXmlParser; +import org.testng.xml.XmlClass; +import org.testng.xml.XmlInclude; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.BaseTest; + +public class TimeOutFromXmlTest extends BaseTest { + + private void timeOutTest(boolean onSuite) { + addClass(TestTimeOutSampleTest.class); + if (onSuite) { + setSuiteTimeOut(1_000); + } else { + setTestTimeOut(1_000); + } + run(); + + verifyPassedTests(); + verifyFailedTests("timeoutTest"); + } + + @Test + public void timeOutOnSuiteTag() { + timeOutTest(true /* on suite */); + } + + @Test + public void timeOutOnTestTag() { + timeOutTest(false /* on test */); + } + + @Test + public void noTimeOut() { + addClass(TestTimeOutSampleTest.class); + run(); + + verifyPassedTests("timeoutTest"); + verifyFailedTests(); + } + + @Test + public void twoDifferentTests() { + XmlSuite result = new XmlSuite(); + result.setName("Suite"); + + createXmlTest(result, "WithoutTimeOut"); + createXmlTest(result, "WithTimeOut").setTimeOut(1_000); + + setSuite(result); + run(); + + verifyPassedTests("timeoutTest"); + verifyFailedTests("timeoutTest"); + } + + private XmlTest createXmlTest(XmlSuite suite, String name) { + XmlTest result = new XmlTest(suite); + result.setName(name); + List classes = new ArrayList<>(); + XmlClass cls = new XmlClass(TestTimeOutSampleTest.class); + cls.setIncludedMethods(Collections.singletonList(new XmlInclude("timeoutTest"))); + classes.add(cls); + result.setXmlClasses(classes); + + return result; + } + + @Test + public void timeOutInParallelTestsFromXml() throws IOException { + String file = "src/test/resources/test/timeout/issue575.xml"; + try (FileInputStream stream = new FileInputStream(file)) { + SuiteXmlParser suiteParser = new SuiteXmlParser(); + XmlSuite suite = suiteParser.parse(file, stream, true); + setSuite(suite); + run(); + + verifyPassedTests("timeoutShouldPass"); + verifyFailedTests("timeoutShouldFailByException", "timeoutShouldFailByTimeOut"); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/timeout/TimeOutIntegrationTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/timeout/TimeOutIntegrationTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/timeout/TimeOutIntegrationTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/timeout/TimeOutIntegrationTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,42 @@ +package test.timeout; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.ITestNGListener; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlSuite; +import test.InvokedMethodNameListener; +import test.SimpleBaseTest; + +public class TimeOutIntegrationTest extends SimpleBaseTest { + + @Test(description = "https://github.com/cbeust/testng/issues/811") + public void testTimeOutWhenParallelIsTest() { + TestNG tng = create(TimeOutWithParallelSample.class); + tng.setParallel(XmlSuite.ParallelMode.TESTS); + + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener((ITestNGListener) listener); + + tng.run(); + + assertThat(listener.getFailedMethodNames()).containsExactly("myTestMethod"); + assertThat(listener.getSkippedMethodNames()).isEmpty(); + assertThat(listener.getSucceedMethodNames()).isEmpty(); + } + + @Test(description = "https://github.com/cbeust/testng/issues/1314") + public void testGitHub1314() { + TestNG tng = create(GitHub1314Sample.class); + + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener((ITestNGListener) listener); + + tng.run(); + + assertThat(listener.getSucceedMethodNames()).containsExactly("iWorkWell"); + assertThat(listener.getFailedMethodNames()).containsExactly("iHangHorribly"); + assertThat(listener.getSkippedMethodNames()).containsExactly("iAmNeverRun"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/timeout/TimeOutSample2Test.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/timeout/TimeOutSample2Test.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/timeout/TimeOutSample2Test.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/timeout/TimeOutSample2Test.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.timeout; + +import org.testng.annotations.Test; + +/** + * Tests timeouts set from testng.xml + * + * @author cbeust + */ +public class TimeOutSample2Test { + + @Test(timeOut = 1_500) + public void timeoutShouldFailByTimeOut() throws InterruptedException { + Thread.sleep(10_000); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/timeout/TimeOutSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/timeout/TimeOutSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/timeout/TimeOutSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/timeout/TimeOutSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,24 @@ +package test.timeout; + +import org.testng.annotations.Test; + +/** + * This class tests timeouts + * + * @author cbeust + */ +public class TimeOutSampleTest { + + @Test(timeOut = 5_000 /* 5 seconds */) + public void timeoutShouldPass() {} + + @Test(timeOut = 5_000 /* 5 seconds */) + public void timeoutShouldFailByException() { + throw new RuntimeException("EXCEPTION SHOULD MAKE THIS METHOD FAIL"); + } + + @Test(timeOut = 1_000 /* 1 second */) + public void timeoutShouldFailByTimeOut() throws InterruptedException { + Thread.sleep(10_000 /* 10 seconds */); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/timeout/TimeOutTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/timeout/TimeOutTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/timeout/TimeOutTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/timeout/TimeOutTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,108 @@ +package test.timeout; + +import java.util.Arrays; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import org.testng.Assert; +import org.testng.ITestResult; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import org.testng.internal.thread.ThreadTimeoutException; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlSuite.ParallelMode; +import test.BaseTest; +import test.timeout.github1493.TestClassSample; +import test.timeout.issue2009.TimeOutWithParallelSample; + +public class TimeOutTest extends BaseTest { + private final long m_id; + + public TimeOutTest() { + m_id = System.currentTimeMillis(); + } + + private void privateTimeOutTest(XmlSuite.ParallelMode parallel) { + addClass(TimeOutSampleTest.class); + if (parallel != null) { + setParallel(parallel); + } + run(); + + verifyPassedTests("timeoutShouldPass"); + verifyFailedTests("timeoutShouldFailByException", "timeoutShouldFailByTimeOut"); + } + + @DataProvider(name = "parallelModes") + public Iterator createData() { + final Iterator parallelModes = + Arrays.asList(XmlSuite.ParallelMode.values()).iterator(); + return new Iterator() { + @Override + public boolean hasNext() { + return parallelModes.hasNext(); + } + + @Override + public Object[] next() { + return new Object[] {parallelModes.next()}; + } + + @Override + public void remove() { + throw new UnsupportedOperationException("remove"); + } + }; + } + + @Test(dataProvider = "parallelModes") + public void timeOutInParallel(XmlSuite.ParallelMode parallelMode) { + privateTimeOutTest(parallelMode); + } + + @Test + public void timeOutInNonParallel() { + privateTimeOutTest(null); + } + + @Test + public void verifyInvocationTimeOut() { + addClass(InvocationTimeOutSampleTest.class); + run(); + verifyPassedTests("shouldPass"); + verifyFailedTests("shouldFail"); + } + + @Test + public void testWithOnlyOneThread() { + addClass(TestClassSample.class); + run(); + Collection> failed = getFailedTests().values(); + Assert.assertEquals(failed.size(), 1); + ITestResult failedResult = failed.iterator().next().get(0); + Assert.assertTrue(failedResult.getThrowable() instanceof ThreadTimeoutException); + Assert.assertEquals( + failedResult.getThrowable().getMessage(), + String.format( + "Method %s.testMethod() didn't finish within the time-out 1000", + TestClassSample.class.getName())); + } + + @Test(description = "GITHUB-2009") + public void testTimeOutWhenParallelIsMethods() { + addClass(TimeOutWithParallelSample.class); + setParallel(ParallelMode.METHODS); + run(); + Assert.assertEquals(getFailedTests().values().size(), 1); + Assert.assertEquals(getSkippedTests().values().size(), 0); + Assert.assertEquals(getPassedTests().values().size(), 0); + ITestResult result = getFailedTests().values().iterator().next().get(0); + long time = result.getEndMillis() - result.getStartMillis(); + Assert.assertTrue(time < 2000); + } + + @Override + public Long getId() { + return m_id; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/timeout/TimeOutWithParallelSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/timeout/TimeOutWithParallelSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/timeout/TimeOutWithParallelSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/timeout/TimeOutWithParallelSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.timeout; + +import org.testng.annotations.Test; + +public class TimeOutWithParallelSample { + + @Test(timeOut = 1_000) + public void myTestMethod() throws InterruptedException { + Thread.sleep(1_500); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/timeout/github1493/TestClassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/timeout/github1493/TestClassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/timeout/github1493/TestClassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/timeout/github1493/TestClassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.timeout.github1493; + +import java.util.concurrent.TimeUnit; +import org.testng.annotations.Test; + +public class TestClassSample { + @Test(timeOut = 1000) + public void testMethod() throws Exception { + TimeUnit.SECONDS.sleep(2); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/timeout/github2440/TimeoutTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/timeout/github2440/TimeoutTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/timeout/github2440/TimeoutTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/timeout/github2440/TimeoutTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,21 @@ +package test.timeout.github2440; + +import org.testng.annotations.Test; +import org.testng.internal.thread.ThreadTimeoutException; + +public class TimeoutTest { + @Test(description = "First", timeOut = 1000) + public void test1() throws InterruptedException { + Thread.sleep(500); + } + + @Test(description = "Second") + public void test2() throws InterruptedException { + Thread.sleep(1000); + } + + @Test(description = "Third", expectedExceptions = ThreadTimeoutException.class, timeOut = 100) + public void test3() throws InterruptedException { + Thread.sleep(1000); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/timeout/github2440/TimeoutWithNoExecutorTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/timeout/github2440/TimeoutWithNoExecutorTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/timeout/github2440/TimeoutWithNoExecutorTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/timeout/github2440/TimeoutWithNoExecutorTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,29 @@ +package test.timeout.github2440; + +import java.util.Collections; +import org.testng.Assert; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.xml.XmlClass; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.SimpleBaseTest; + +public class TimeoutWithNoExecutorTest extends SimpleBaseTest { + + @Test + public void testTimeout() { + TestNG testNG = new TestNG(); + XmlSuite xmlSuite = new XmlSuite(); + XmlTest xmlTest = new XmlTest(xmlSuite); + xmlTest.setClasses(Collections.singletonList(new XmlClass(TimeoutTest.class))); + xmlSuite.setParallel(XmlSuite.ParallelMode.CLASSES); + testNG.setXmlSuites(Collections.singletonList(xmlSuite)); + TestListenerAdapter listener = new TestListenerAdapter(); + testNG.addListener(listener); + testNG.run(); + Assert.assertTrue(listener.getFailedTests().isEmpty()); + Assert.assertTrue(listener.getConfigurationFailures().isEmpty()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/timeout/github2672/TimeoutStacktraceTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/timeout/github2672/TimeoutStacktraceTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/timeout/github2672/TimeoutStacktraceTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/timeout/github2672/TimeoutStacktraceTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,42 @@ +package test.timeout.github2672; + +import static org.testng.Assert.assertTrue; + +import java.util.Arrays; +import org.testng.ITestListener; +import org.testng.ITestResult; +import org.testng.TestNG; +import org.testng.annotations.Test; +import org.testng.internal.thread.ThreadTimeoutException; + +public class TimeoutStacktraceTest { + + private static class TimeoutStacktraceTestListener implements ITestListener { + private Throwable testError = null; + + @Override + public void onTestSuccess(ITestResult result) { + testError = result.getThrowable(); + } + + public Throwable getTestError() { + return testError; + } + } + + @Test + public void verifyTimeoutStacktrace() { + TestNG testng = new TestNG(); + testng.setTestClasses(new Class[] {TimeoutStacktraceTestSample.class}); + TimeoutStacktraceTestListener listener = new TimeoutStacktraceTestListener(); + testng.addListener(listener); + + testng.run(); + + Throwable testError = listener.getTestError(); + assertTrue(testError instanceof ThreadTimeoutException); + assertTrue( + Arrays.stream(testError.getStackTrace()) + .anyMatch(s -> s.getMethodName().equals("testTimeoutStacktrace"))); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/timeout/github2672/TimeoutStacktraceTestSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/timeout/github2672/TimeoutStacktraceTestSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/timeout/github2672/TimeoutStacktraceTestSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/timeout/github2672/TimeoutStacktraceTestSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package test.timeout.github2672; + +import org.testng.annotations.Test; +import org.testng.internal.thread.ThreadTimeoutException; + +class TimeoutStacktraceTestSample { + @Test( + description = "testTimeoutStacktrace", + expectedExceptions = ThreadTimeoutException.class, + timeOut = 100) + public void testTimeoutStacktrace() throws InterruptedException { + Thread.sleep(1000); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/timeout/issue2009/TimeOutWithParallelSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/timeout/issue2009/TimeOutWithParallelSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/timeout/issue2009/TimeOutWithParallelSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/timeout/issue2009/TimeOutWithParallelSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,10 @@ +package test.timeout.issue2009; + +import org.testng.annotations.Test; + +public class TimeOutWithParallelSample { + @Test(timeOut = 1000) + public void myTestMethod() throws InterruptedException { + Thread.sleep(2000); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/A.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/A.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/A.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/A.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,33 @@ +package test.tmp; + +import org.testng.annotations.Test; +import org.testng.asserts.SoftAssert; + +@Test +public class A { + // private FlexibleAssert m_assert = new FlexibleAssert(); + private SoftAssert m_assert = new SoftAssert(); + // private LoggingAssert m_assert = new LoggingAssert(); + + public void test1() { + m_assert.assertTrue(true, "test1()"); + } + + public void test2() { + m_assert.assertTrue(true, "test2()"); + } + + // @AfterClass + // public void ac() { + // System.out.println("Tests run in this class:" + m_assert.getMessages()); + // } + + public void multiple() { + m_assert.assertTrue(true, "Success 1"); + m_assert.assertTrue(true, "Success 2"); + m_assert.assertTrue(false, "Failure 1"); + m_assert.assertTrue(true, "Success 3"); + m_assert.assertTrue(false, "Failure 2"); + m_assert.assertAll(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/AA.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/AA.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/AA.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/AA.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,69 @@ +package test.tmp; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +@Test(singleThreaded = true) +public class AA { + private int m_n; + + public AA() {} + + public AA(int n) { + m_n = n; + } + + private void log(String s) { + System.out.println(" [AA(" + m_n + ") thread:" + Thread.currentThread().getId() + "] " + s); + } + + @DataProvider + public Object[][] dp() { + return new Object[][] { + new Object[] {42}, + }; + } + + // @BeforeClass + // public void bc() { + // log("beforeClass"); + // } + // + // @AfterClass + // public void ac() { + // log("afterClass"); + // } + + @Factory + public Object[] create() { + return new Object[] {new A(), new AA()}; + } + + @Test + public void aatest1() { + log("aatest1"); + } + + @Test(dependsOnMethods = "aatest1") + public void aatest2() { + log("aatest2"); + } + + // @Test(priority = 3) + public void atest3() {} + + public String getTestName() { + return "This is test A"; + } + + // @Test(groups = "mytest", dependsOnMethods = "g") + // public void f() { + // } + // + // + // @AfterMethod + // public void after() { + // } + +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/AFactory.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/AFactory.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/AFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/AFactory.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,10 @@ +package test.tmp; + +import org.testng.annotations.Factory; + +public class AFactory { + @Factory + public Object[] create() { + return new Object[] {new A(), new AA()}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/AnnotationTransformer.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/AnnotationTransformer.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/AnnotationTransformer.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/AnnotationTransformer.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,61 @@ +package test.tmp; + +import java.lang.reflect.Constructor; +import java.lang.reflect.Method; +import org.testng.IAnnotationTransformer; +import org.testng.ITestContext; +import org.testng.ITestListener; +import org.testng.ITestResult; +import org.testng.annotations.ITestAnnotation; + +public class AnnotationTransformer implements IAnnotationTransformer, ITestListener { + + @Override + public void transform( + ITestAnnotation annotation, + Class testClass, + Constructor testConstructor, + Method testMethod) {} + + @Override + public void onFinish(ITestContext context) { + // TODO Auto-generated method stub + + } + + @Override + public void onStart(ITestContext context) { + // TODO Auto-generated method stub + + } + + @Override + public void onTestFailedButWithinSuccessPercentage(ITestResult result) { + // TODO Auto-generated method stub + + } + + @Override + public void onTestFailure(ITestResult result) { + // TODO Auto-generated method stub + + } + + @Override + public void onTestSkipped(ITestResult result) { + // TODO Auto-generated method stub + + } + + @Override + public void onTestStart(ITestResult result) { + // TODO Auto-generated method stub + + } + + @Override + public void onTestSuccess(ITestResult result) { + // TODO Auto-generated method stub + + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/AssertEqualsTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/AssertEqualsTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/AssertEqualsTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/AssertEqualsTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,65 @@ +package test.tmp; + +import java.util.HashSet; +import java.util.LinkedHashSet; +import java.util.Random; +import java.util.Set; +import org.testng.Assert; +import org.testng.annotations.Test; + +public class AssertEqualsTest { + + private void log(String s) { + System.out.println("[" + Thread.currentThread().getId() + "] " + s); + } + + @Test(threadPoolSize = 3, invocationCount = 6) + public void f1() { + log("start"); + try { + int sleepTime = new Random().nextInt(500); + Thread.sleep(sleepTime); + } catch (Exception e) { + log(" *** INTERRUPTED"); + } + log("end"); + } + + @Test(threadPoolSize = 10, invocationCount = 10000) + public void verifyMethodIsThreadSafe() { + // foo(); + } + + @Test(dependsOnMethods = "verifyMethodIsThreadSafe") + public void verify() { + // make sure that nothing was broken + } + + public static void main(String[] args) { + Set set1 = new LinkedHashSet(); + Set set2 = new HashSet(); + + set1.add(5); + set2.add(5); + + set1.add(6); + set2.add(6); + + set1.add(1); + set2.add(1); + + set1.add(9); + set2.add(9); + + System.out.println("set1 is:" + set1.toString()); + System.out.println("set2 is:" + set2.toString()); + + System.out.println("is set1 equals set2 :" + set1.equals(set2)); + + try { + Assert.assertEquals(set1, set2, "set1 must equals with set2"); + } catch (Exception ex) { + ex.printStackTrace(); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/B.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/B.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/B.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/B.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ +package test.tmp; + +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class B extends C { + public static final String G = "group"; + + @BeforeMethod + public void bm() { + System.out.println("B.bm"); + } + + @Test + public void btest1() { + System.out.println("B.btest1"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/BListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/BListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/BListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/BListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,22 @@ +package test.tmp; + +import org.testng.ITestResult; +import org.testng.TestListenerAdapter; + +public class BListener extends TestListenerAdapter { + public BListener() { + System.out.println("BListener created"); + } + + @Override + public void onTestSuccess(ITestResult tr) { + System.out.println("Success"); + super.onTestSuccess(tr); + } + + @Override + public void onTestFailure(ITestResult tr) { + System.out.println("Failure"); + super.onTestFailure(tr); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/Base.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/Base.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/Base.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/Base.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,10 @@ +package test.tmp; + +import org.testng.annotations.BeforeMethod; + +public class Base { + @BeforeMethod + public void bm() { + System.out.println("Thread" + Thread.currentThread().getId()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/BeforeGroupTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/BeforeGroupTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/BeforeGroupTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/BeforeGroupTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.tmp; + +import org.testng.ITestContext; +import org.testng.annotations.BeforeGroups; + +public class BeforeGroupTest { + + // Logger l = LoggerFactory.getLogger(this.getClass()); + + @BeforeGroups( + groups = {"NewUser"}, + value = {"NewUser"}) + public void preNewUser(ITestContext itc) { + System.out.println("BEFOREGROUPS perfroming pre groups init"); + // m_inj = Guice.createInjector(new JUnitModule(), new RequestModule(), + // new GenericModule(), new SecurityModule()); + // itc.setAttribute("injector", m_inj); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/C.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/C.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/C.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/C.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,24 @@ +package test.tmp; + +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class C { + @BeforeMethod + public void cm() { + // System.out.println("C.cm"); + } + + @Test(dataProvider = "data") + public void c(String s) { + System.out.println("c(" + s + ")"); + } + + @DataProvider(name = "data") + public static Object[][] data() { + return new Object[][] { + new Object[] {"Foo"}, new Object[] {"Bar"}, + }; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/ChildTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/ChildTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/ChildTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/ChildTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ +package test.tmp; + +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class ChildTest extends ParentTest { + + @BeforeMethod + public void btm2() {} + + @AfterMethod + public void atm2() {} + + @Override + @Test + public void t1() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/ConcreteTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/ConcreteTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/ConcreteTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/ConcreteTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package test.tmp; + +import org.testng.annotations.AfterGroups; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.Test; + +public class ConcreteTest extends Fixturable { + @BeforeTest + @AfterGroups("fixture") + public void beforeFixture() {} + + @Test(groups = "fixture") + public void test() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/DataDrivenTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/DataDrivenTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/DataDrivenTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/DataDrivenTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,38 @@ +package test.tmp; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Enumeration; +import java.util.List; +import java.util.Properties; +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class DataDrivenTest { + + @DataProvider(name = "provider") + public Object[][] createData() throws FileNotFoundException, IOException { + Properties p = new Properties(); + List vResult = new ArrayList<>(); + p.load(new FileInputStream(new File("c:/t/data.properties"))); + for (Enumeration e = p.keys(); e.hasMoreElements(); ) { + vResult.add(e.nextElement()); + } + + Object[][] result = new Object[vResult.size()][1]; + for (int i = 0; i < result.length; i++) { + result[i] = new Object[] {vResult.get(i)}; + } + + return result; + } + + @Test(dataProvider = "provider") + public void foo(int n) { + Assert.assertTrue(n > 0); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/ExponentTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/ExponentTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/ExponentTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/ExponentTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,41 @@ +package test.tmp; + +import static org.testng.Assert.assertEquals; + +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import org.testng.log4testng.Logger; + +@Test(suiteName = "Exponent suite", testName = "Exponent test") +public class ExponentTest { + + @DataProvider(name = "random") + public Object[][] generateRandomExps() { + // This array should be generated with random numbers + return new Object[][] { + new Object[] {0.0, Math.exp(0)}, + new Object[] {1.0, Math.exp(1)}, + new Object[] {2.0, Math.exp(2)}, + }; + } + + @BeforeMethod + public void setUp() { + debug("BEFORE METHOD"); + } + + @Test(dataProvider = "random") + public void testExponent(double exponent, double expected) { + debug("COMPARING " + myExpFunction(exponent) + " AND " + expected); + assertEquals(myExpFunction(exponent), expected); + } + + private void debug(String s) { + Logger.getLogger(ExponentTest.class).info("[ExponentTest] " + s); + } + + private double myExpFunction(double exponent) { + return Math.exp(exponent); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/Fixturable.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/Fixturable.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/Fixturable.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/Fixturable.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ +package test.tmp; + +import org.testng.annotations.BeforeTest; + +public class Fixturable { + @BeforeTest(groups = "fixture") + public void setupFixture() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/IgnoreUntil.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/IgnoreUntil.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/IgnoreUntil.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/IgnoreUntil.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.tmp; + +import static java.lang.annotation.ElementType.CONSTRUCTOR; +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.ElementType.TYPE; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +@Retention(java.lang.annotation.RetentionPolicy.RUNTIME) +@Target({METHOD, TYPE, CONSTRUCTOR}) +public @interface IgnoreUntil { + + /** Format: hhmm */ + public String time(); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/ParamTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/ParamTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/ParamTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/ParamTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,22 @@ +package test.tmp; + +import org.testng.Reporter; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class ParamTest { + + @Test(dataProvider = "dp") + public void f(String s, int n) { + // if ("Alois".equals(s)) assert false; + Reporter.log("CALL " + n); + } + + @DataProvider(name = "dp") + public Object[][] create() { + return new Object[][] { + new Object[] {"Cedric", 36}, + new Object[] {"Alois", 35}, + }; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/ParentTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/ParentTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/ParentTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/ParentTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package test.tmp; + +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class ParentTest { + + @BeforeMethod + public void btm1() {} + + @AfterMethod + public void atm1() {} + + @Test + public void t1() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/RegisterCommandTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/RegisterCommandTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/RegisterCommandTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/RegisterCommandTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package test.tmp; + +import org.testng.ITestContext; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +@Test(groups = {"NewUser"}) +public class RegisterCommandTest { + + // Logger l = LoggerFactory.getLogger(this.getClass()); + + @BeforeClass + public void beforeClass(ITestContext itc) { + System.out.println("BEFORECLASS getting injector from context"); + // m_inj = (Injector) itc.getAttribute("injector"); + // m_inj.injectMembers(this); + + } + + public void testExecute(ITestContext itc) throws Exception { + System.out.println("TESTEXECUTE do somthing"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/RetryAnalyzer.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/RetryAnalyzer.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/RetryAnalyzer.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/RetryAnalyzer.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,13 @@ +package test.tmp; + +import org.testng.IRetryAnalyzer; +import org.testng.ITestResult; + +public class RetryAnalyzer implements IRetryAnalyzer { + + @Override + public boolean retry(ITestResult result) { + System.out.println("retry()"); + return true; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/StaticInitializerTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/StaticInitializerTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/StaticInitializerTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/StaticInitializerTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.tmp; + +import org.testng.annotations.Test; + +@Test +public class StaticInitializerTest { + + static { + foo(); + } + + public void testMe() { + System.err.println("**** testMe ****"); + } + + private static void foo() { + throw new RuntimeException("FAILING"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/Sub.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/Sub.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/Sub.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/Sub.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,33 @@ +package test.tmp; + +import org.testng.Assert; +import org.testng.annotations.AfterClass; +import org.testng.annotations.AfterSuite; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +@Test(groups = {"sub"}) +public class Sub extends Base { + boolean m_beforeTest; + boolean m_afterTest; + + @BeforeClass + public void subSetup() { + System.out.println("sub before class"); + } + + @AfterClass + public void subTeardown() { + System.out.println("sub after class"); + } + + public void subTest() { + System.out.println("sub test"); + } + + @AfterSuite + public void verify() { + Assert.assertTrue(m_beforeTest); + Assert.assertTrue(m_afterTest); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/Test0.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/Test0.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/Test0.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/Test0.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package test.tmp; + +import org.testng.annotations.AfterTest; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.Test; + +public class Test0 { + + @BeforeTest + public void setup() { + System.out.println("setup"); + } + + @Test(groups = {"G0"}) + public void test() { + System.out.println("Test0.test"); + } + + @AfterTest + public void tearDown() { + System.out.println("tearDown"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/Test1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/Test1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/Test1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/Test1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.tmp; + +import org.testng.annotations.Test; + +@Test(dependsOnGroups = {"G0"}) +public class Test1 { + + public void test() { + System.out.println("Test1.test"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/TestA.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/TestA.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/TestA.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/TestA.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,37 @@ +package test.tmp; + +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +public class TestA { + @BeforeClass + public void insertA() { + // Inserts an entity 'A'. This is an expensive operation. + // After this, the entity 'A' is the first row on the table. + } + + @Test + public void testGetA() { + // Checks that 'A' is the first row on the table, and loads it. + } + + @Test(dependsOnMethods = "testGetA") + public void testViewA_Details1() { + // Loads the first row (assumed A) and checks some details + } + + @Test(dependsOnMethods = "testGetA") + public void testViewA_Details2() { + // Loads the first row (assumed A) and checks some details + } + + @Test(dependsOnMethods = "testGetA") + public void testViewA_Details3() { + // Loads the first row (assumed A) and checks some details + } + + @Test(dependsOnMethods = "testGetA") + public void testViewA_Details4() { + // Loads the first row (assumed A) and checks some details + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/TestB.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/TestB.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/TestB.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/TestB.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,35 @@ +package test.tmp; + +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +public class TestB { + @BeforeClass + public void insertB() { + // Inserts an entity 'B'. This is an expensive operation. + // After this, the entity 'B' is the first row on the table. + } + + @Test + public void testGetB() { + // Checks that 'B' is the first row on the table, and loads it. + } + + @Test(dependsOnMethods = "testGetB") + public void testViewB_Details1() { + // Loads the first row (assumed B) and checks some details + } + + @Test(dependsOnMethods = "testGetB") + public void testViewB_Details2() { + // Loads the first row (assumed B) and checks some details + } + + @Test(dependsOnMethods = "testGetB") + public void testViewB_Details3() { + // Loads the first row (assumed B) and checks some details + } + + @Test(dependsOnMethods = "testGetB") + public void testViewB_Details4() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/TestCaseFactory.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/TestCaseFactory.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/TestCaseFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/TestCaseFactory.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ +package test.tmp; + +import org.testng.annotations.Factory; +import org.testng.annotations.Test; + +public class TestCaseFactory { + class MyTestClass { + @Test + public void testAll() {} + } + + @Factory + public Object[] createTestCases() { + Object[] testCases = new Object[1]; + testCases[0] = new MyTestClass() {}; + return testCases; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/TestFixture.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/TestFixture.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/TestFixture.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/TestFixture.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,25 @@ +package test.tmp; + +import org.testng.annotations.BeforeTest; + +public class TestFixture { + + public static int globalCallSequence = 0; + + public static int printGlobalCallSequence(String methodName) { + globalCallSequence++; + System.err.println("*** " + methodName + ": globalCallSequence=" + globalCallSequence); + return globalCallSequence; + } + + public int fixtureBeforeTestCallSequence; + + @BeforeTest(groups = "fixture") + public void beforeTest() { + fixtureBeforeTestCallSequence = printGlobalCallSequence("TestFixture.beforeTest"); + } + + public int getSomeRandomValue() { + return 20; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/TestNGBug.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/TestNGBug.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/TestNGBug.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/TestNGBug.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,24 @@ +package test.tmp; + +import org.testng.Reporter; +import org.testng.annotations.Test; + +public class TestNGBug { + // @Configuration(beforeTestMethod = true) + public void init() {} + + @Test + public void test1() { + Reporter.log("Child.test1"); + } + + @Test(enabled = false) + public void test2() { + Reporter.log("Child.test2"); + } + + @Test(groups = "a") + public void test3() { + Reporter.log("Child.test3"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/Test_TestListenerAppender.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/Test_TestListenerAppender.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/Test_TestListenerAppender.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/Test_TestListenerAppender.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.tmp; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class Test_TestListenerAppender { + + @DataProvider(name = "test1") + public Object[][] createData1() { + // throw new RuntimeException("Intentionally thrown exception"); + return new Object[][] { + {"Cedric", 36}, {"Anne", 37}, + }; + } + + @Test(dataProvider = "test1") + public void verifyData1(String n1, Integer n2) { + System.out.println(n1 + " " + n2); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/TimeBombTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/TimeBombTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/TimeBombTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/TimeBombTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,33 @@ +package test.tmp; + +import java.lang.reflect.Method; +import java.util.Calendar; +import org.testng.annotations.Test; +import org.testng.log4testng.Logger; + +public class TimeBombTest { + + @IgnoreUntil(time = "1022") + @Test + public void timeBomb() throws SecurityException, NoSuchMethodException { + Method m = TimeBombTest.class.getMethod("timeBomb"); + IgnoreUntil t = m.getAnnotation(IgnoreUntil.class); + long now = Calendar.getInstance().getTimeInMillis(); + long l = parseTime(t.time()); + debug("IGNORE:" + (now < l)); + } + + private long parseTime(String string) { + int hour = Integer.parseInt(string.substring(0, 2)); + int minute = Integer.parseInt(string.substring(2)); + Calendar result = Calendar.getInstance(); + result.set(Calendar.HOUR_OF_DAY, hour); + result.set(Calendar.MINUTE, minute); + + return result.getTimeInMillis(); + } + + private void debug(String string) { + Logger.getLogger(getClass()).debug("[TimeBombTest] " + string); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/Tmp.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/Tmp.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/Tmp.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/Tmp.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,25 @@ +package test.tmp; + +import java.util.Random; +import org.testng.annotations.Test; +import org.testng.log4testng.Logger; + +public class Tmp { + + @Test(invocationCount = 10, threadPoolSize = 5) + public void f() { + debug("START " + Thread.currentThread().getId()); + try { + Random r = new Random(); + Thread.sleep(Math.abs(r.nextInt() % 300)); + } catch (InterruptedException handled) { + Thread.currentThread().interrupt(); + handled.printStackTrace(); + } + debug("END " + Thread.currentThread().getId()); + } + + private void debug(String string) { + Logger.getLogger(getClass()).info("[Tmp] " + string); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/Tn.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/Tn.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/Tn.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/Tn.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,26 @@ +package test.tmp; + +import org.testng.Reporter; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; + +public class Tn { + @Test(groups = {"g1"}) + public void m1() { + System.out.println("1"); + } + + @Test( + groups = {"g1"}, + dependsOnMethods = "m1") + public void m2() { + System.out.println("2"); + } + + @Parameters(value = "param") + @Test(groups = {"g2"}) + public void m3(String param) { + System.out.println("3"); + Reporter.log("M3 WAS CALLED"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/b/TmpB.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/b/TmpB.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/b/TmpB.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/b/TmpB.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,10 @@ +package test.tmp.b; + +import org.testng.annotations.Test; + +public class TmpB { + @Test + public void tmpb1() { + System.out.println("tmpb1"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/p1/ContainerTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/p1/ContainerTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/p1/ContainerTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/p1/ContainerTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.tmp.p1; + +import static org.testng.AssertJUnit.assertNotNull; + +import org.testng.annotations.AfterSuite; +import org.testng.annotations.BeforeSuite; + +public class ContainerTest { + + @BeforeSuite + public void startup() { + assertNotNull(null); + } + + @AfterSuite + public void shutdown() { + assertNotNull(null); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/p2/ServiceTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/p2/ServiceTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/p2/ServiceTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/p2/ServiceTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.tmp.p2; + +import static org.testng.AssertJUnit.assertNotNull; + +import org.testng.annotations.Test; + +public class ServiceTest { + @Test(groups = {"group1"}) + public void service() { + assertNotNull(null); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/verify/Verify.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/verify/Verify.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/verify/Verify.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/verify/Verify.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ +package test.tmp.verify; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +@Retention(java.lang.annotation.RetentionPolicy.RUNTIME) +@Target(java.lang.annotation.ElementType.METHOD) +public @interface Verify {} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/verify/VerifyInterceptor.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/verify/VerifyInterceptor.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/verify/VerifyInterceptor.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/verify/VerifyInterceptor.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,68 @@ +package test.tmp.verify; + +import java.lang.annotation.Annotation; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import org.testng.IMethodInstance; +import org.testng.IMethodInterceptor; +import org.testng.ITestContext; +import org.testng.ITestNGMethod; +import org.testng.TestNGUtils; +import org.testng.collections.Maps; + +public class VerifyInterceptor implements IMethodInterceptor { + + /** + * @return the list of methods received in parameters with all methods annotated with @Verify + * inserted after each of these test methods. + *

This happens in two steps: - Find all the methods annotated with @Verify in the classes + * that contain test methods - Insert these verify methods after each method passed in + * parameter These @Verify methods are stored in a map keyed by the class in order to avoid + * looking them up more than once on the same class. + */ + @Override + public List intercept(List methods, ITestContext context) { + + List result = new ArrayList<>(); + Map, List> verifyMethods = Maps.newHashMap(); + for (IMethodInstance mi : methods) { + ITestNGMethod tm = mi.getMethod(); + List verify = verifyMethods.get(tm.getRealClass()); + if (verify == null) { + verify = findVerifyMethods(tm.getRealClass(), tm); + } + result.add(mi); + result.addAll(verify); + } + + return result; + } + + /** @return all the @Verify methods found on @code{realClass} */ + private List findVerifyMethods(Class realClass, final ITestNGMethod tm) { + List result = new ArrayList<>(); + for (final Method m : realClass.getDeclaredMethods()) { + Annotation a = m.getAnnotation(Verify.class); + if (a != null) { + final ITestNGMethod vm = TestNGUtils.createITestNGMethod(tm, m); + result.add( + new IMethodInstance() { + + @Override + public ITestNGMethod getMethod() { + return vm; + } + + @Override + public Object getInstance() { + return tm.getInstance(); + } + }); + } + } + + return result; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/verify/VerifyTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/verify/VerifyTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/tmp/verify/VerifyTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/tmp/verify/VerifyTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,22 @@ +package test.tmp.verify; + +import org.testng.annotations.Test; + +public class VerifyTest { + + @Test + public void f2() { + System.out.println("f2()"); + } + + @Test + public void f1() { + System.out.println("f1()"); + } + + @Verify + public void verify() { + // throw new RuntimeException(); + // System.out.println("verify()"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/triangle/Base.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/triangle/Base.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/triangle/Base.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/triangle/Base.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,29 @@ +package test.triangle; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeSuite; + +/** + * This class + * + * @author cbeust + */ +public class Base { + protected boolean m_isInitialized = false; + + @BeforeSuite + public void beforeSuite() { + CountCalls.numCalls = 0; + } + + @BeforeClass + public void initBeforeTestClass() { + m_isInitialized = true; + } + + @AfterClass + public void postAfterTestClass() { + CountCalls.incr(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/triangle/CheckCount.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/triangle/CheckCount.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/triangle/CheckCount.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/triangle/CheckCount.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.triangle; + +import org.testng.Assert; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; + +/** + * this test checks the CountCalls's static counter to see if we got the expected number of calls + */ +public class CheckCount { + + @Parameters({"expected-calls"}) + @Test + public void testCheckCount(String expectedCalls) { + int i = Integer.valueOf(expectedCalls); + int numCalls = CountCalls.getNumCalls(); + Assert.assertEquals(numCalls, i); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/triangle/Child1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/triangle/Child1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/triangle/Child1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/triangle/Child1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package test.triangle; + +import org.testng.annotations.Test; + +/** + * This class + * + * @author cbeust + */ +public class Child1 extends Base { + @Test + public void child1() { + assert m_isInitialized : "Wasn't initialized correctly " + hashCode() + " " + getClass(); + } + + @Test + public void child1a() { + assert m_isInitialized : "Wasn't initialized correctly " + hashCode() + " " + getClass(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/triangle/Child2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/triangle/Child2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/triangle/Child2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/triangle/Child2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package test.triangle; + +import org.testng.annotations.Test; + +/** + * This class + * + * @author cbeust + */ +public class Child2 extends Base { + + @Test + public void child2() { + assert m_isInitialized : "Wasn't initialized correctly"; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/triangle/CountCalls.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/triangle/CountCalls.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/triangle/CountCalls.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/triangle/CountCalls.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package test.triangle; + +/** + * count the number of times something is called used to check whether certain methods have been + * called + */ +public class CountCalls { + static int numCalls = 0; + + public static void incr() { + numCalls++; + } + + public static int getNumCalls() { + return numCalls; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/uniquesuite/BaseAfter.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/uniquesuite/BaseAfter.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/uniquesuite/BaseAfter.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/uniquesuite/BaseAfter.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ +package test.uniquesuite; + +import org.testng.annotations.AfterSuite; +import org.testng.annotations.BeforeSuite; + +public class BaseAfter { + public static int m_afterCount = 0; + + @BeforeSuite + public void beforeSuite() { + m_afterCount = 0; + } + + @AfterSuite + public void incrementAfter() { + m_afterCount++; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/uniquesuite/BaseBefore.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/uniquesuite/BaseBefore.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/uniquesuite/BaseBefore.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/uniquesuite/BaseBefore.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package test.uniquesuite; + +import org.testng.annotations.AfterSuite; +import org.testng.annotations.BeforeSuite; + +public class BaseBefore { + public static int m_beforeCount = 0; + public static int m_afterCount = 0; + + @BeforeSuite + public void incrementBefore() { + m_beforeCount++; + } + + @AfterSuite + public void incrementAfter() { + m_afterCount++; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/uniquesuite/TestAfter.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/uniquesuite/TestAfter.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/uniquesuite/TestAfter.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/uniquesuite/TestAfter.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,28 @@ +package test.uniquesuite; + +import org.testng.Assert; +import org.testng.TestNG; +import org.testng.annotations.AfterTest; +import org.testng.annotations.Test; +import testhelper.OutputDirectoryPatch; + +public class TestAfter { + + @Test + public void testAfter() { + TestNG tng = new TestNG(); + tng.setOutputDirectory(OutputDirectoryPatch.getOutputDirectory()); + tng.setTestClasses(new Class[] {TestAfter1.class, TestAfter2.class}); + tng.run(); + Assert.assertEquals(BaseAfter.m_afterCount, 1); + } + + @AfterTest + public void afterTest() { + BaseAfter.m_afterCount = 0; + BaseBefore.m_beforeCount = 0; + BaseBefore.m_afterCount = 0; + } +} + +///// diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/uniquesuite/TestAfter1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/uniquesuite/TestAfter1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/uniquesuite/TestAfter1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/uniquesuite/TestAfter1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.uniquesuite; + +import org.testng.annotations.Test; + +public class TestAfter1 extends BaseAfter { + + @Test + public void verify() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/uniquesuite/TestAfter2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/uniquesuite/TestAfter2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/uniquesuite/TestAfter2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/uniquesuite/TestAfter2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package test.uniquesuite; + +import org.testng.annotations.Test; + +public class TestAfter2 extends BaseAfter { + + @Test + public void verify() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/uniquesuite/TestBefore1.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/uniquesuite/TestBefore1.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/uniquesuite/TestBefore1.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/uniquesuite/TestBefore1.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.uniquesuite; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class TestBefore1 extends BaseBefore { + + @Test + public void verify() { + Assert.assertEquals(m_beforeCount, 1); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/uniquesuite/TestBefore2.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/uniquesuite/TestBefore2.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/uniquesuite/TestBefore2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/uniquesuite/TestBefore2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package test.uniquesuite; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class TestBefore2 extends BaseBefore { + + @Test + public void verify() { + Assert.assertEquals(m_beforeCount, 1); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/v6/A.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/v6/A.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/v6/A.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/v6/A.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,47 @@ +package test.v6; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.AfterGroups; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.AfterSuite; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeGroups; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.BeforeSuite; +import org.testng.annotations.Test; + +public class A { + + @Test(dependsOnMethods = "fa1") + public void fa2() {} + + @Test(groups = "1") + public void fa1() {} + + @Test + public void fa3() {} + + @BeforeGroups("1") + public void beforeGroups() {} + + @AfterGroups("1") + public void afterGroups() {} + + @BeforeMethod + public void beforeMethod() {} + + @AfterMethod + public void afterMethod() {} + + @BeforeSuite + public void beforeSuite() {} + + @AfterSuite + public void afterSuite() {} + + @BeforeClass + public void beforeClass() {} + + @AfterClass + public void afterClass() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/v6/B.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/v6/B.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/v6/B.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/v6/B.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,35 @@ +package test.v6; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.BeforeSuite; +import org.testng.annotations.Test; + +public class B { + + @Test(dependsOnMethods = "fb1") + public void fb2() {} + + @Test(groups = "1") + public void fb1() {} + + @Test + public void fb3() {} + + @BeforeMethod + public void beforeMethod() {} + + @AfterMethod(groups = "1") + public void afterMethod() {} + + @BeforeSuite + public void beforeSuite() {} + + @BeforeClass + public void beforeClass() {} + + @AfterClass + public void afterClass() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/v6/C.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/v6/C.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/v6/C.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/v6/C.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,25 @@ +package test.v6; + +import org.testng.annotations.AfterSuite; +import org.testng.annotations.AfterTest; +import org.testng.annotations.BeforeSuite; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.Test; + +public class C { + + @BeforeTest + public void beforeTest() {} + + @AfterTest + public void afterTest() {} + + @Test + public void fc1() {} + + @BeforeSuite + public void beforeSuite() {} + + @AfterSuite + public void afterSuite() {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/verify/Verifier.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/verify/Verifier.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/verify/Verifier.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/verify/Verifier.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.verify; + +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.ElementType.TYPE; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +@Retention(java.lang.annotation.RetentionPolicy.RUNTIME) +@Target({METHOD, TYPE}) +public @interface Verifier {} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/verify/Verify.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/verify/Verify.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/verify/Verify.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/verify/Verify.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.verify; + +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.ElementType.TYPE; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +@Retention(java.lang.annotation.RetentionPolicy.RUNTIME) +@Target({METHOD, TYPE}) +public @interface Verify {} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/verify/Verify2SampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/verify/Verify2SampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/verify/Verify2SampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/verify/Verify2SampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,48 @@ +package test.verify; + +import org.testng.ITestNGListener; +import org.testng.ITestNGListenerFactory; +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +/** + * Illustrate the implementation of a @Verify/@Verifier test. + * + *

One method should be annotated with @Verifier and then each test method annotated with @Verify + * will be followed with a call to the @Verifier method. + */ +@Listeners(VerifyTestListener.class) +public class Verify2SampleTest implements ITestNGListenerFactory { + + public Verify2SampleTest() {} + + @Verify + @Test + public void f1() { + log("f1"); + } + + @Verify + @Test + public void f2() { + log("f2"); + } + + @Verifier + @Test + public void verify() { + log("Verifying"); + } + + private void log(String string) { + if (false) { + System.out.println(hashCode() + " " + string); + } + } + + @Override + public ITestNGListener createListener(Class listenerClass) { + log("Creating a listener of type " + listenerClass); + return null; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/verify/Verify3Base.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/verify/Verify3Base.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/verify/Verify3Base.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/verify/Verify3Base.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,6 @@ +package test.verify; + +import org.testng.annotations.Listeners; + +@Listeners(VerifyTestListener.class) +public class Verify3Base {} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/verify/Verify3SampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/verify/Verify3SampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/verify/Verify3SampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/verify/Verify3SampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package test.verify; + +import org.testng.annotations.BeforeClass; + +/** Make sure that @Listeners annotations can come from superclasses */ +public class Verify3SampleTest extends Verify3Base { + @BeforeClass + public void bc() { + VerifyTestListener.m_count = 0; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/verify/VerifyMethodInterceptor.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/verify/VerifyMethodInterceptor.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/verify/VerifyMethodInterceptor.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/verify/VerifyMethodInterceptor.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,40 @@ +package test.verify; + +import java.util.List; +import org.testng.IMethodInstance; +import org.testng.IMethodInterceptor; +import org.testng.ITestContext; +import org.testng.collections.Lists; + +public class VerifyMethodInterceptor implements IMethodInterceptor { + @Override + public List intercept(List methods, ITestContext context) { + List result = Lists.newArrayList(); + IMethodInstance verifier = null; + + // Doing a naive approach here: we run through the list of methods + // twice, once to find the verifier and once more to actually create + // the result. Obviously, this can be done with just one loop + for (IMethodInstance m : methods) { + if (m.getMethod().getConstructorOrMethod().getMethod().getAnnotation(Verifier.class) + != null) { + verifier = m; + break; + } + } + + // Create the result with each @Verify method followed by a call + // to the @Verifier method + for (IMethodInstance m : methods) { + if (m != verifier) { + result.add(m); + } + + if (m.getMethod().getConstructorOrMethod().getMethod().getAnnotation(Verify.class) != null) { + result.add(verifier); + } + } + + return result; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/verify/VerifyNoListenersSampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/verify/VerifyNoListenersSampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/verify/VerifyNoListenersSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/verify/VerifyNoListenersSampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,31 @@ +package test.verify; + +import org.testng.annotations.Test; + +/** Same class as VerifySampleTest but without the @Listeners annotation. */ +public class VerifyNoListenersSampleTest { + + @Verify + @Test + public void f1() { + log("f1"); + } + + @Verify + @Test + public void f2() { + log("f2"); + } + + @Verifier + @Test + public void verify() { + log("Verifying"); + } + + private void log(String string) { + if (false) { + System.out.println(string); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/verify/VerifySampleTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/verify/VerifySampleTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/verify/VerifySampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/verify/VerifySampleTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,38 @@ +package test.verify; + +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +/** + * Illustrate the implementation of a @Verify/@Verifier test. + * + *

One method should be annotated with @Verifier and then each test method annotated with @Verify + * will be followed with a call to the @Verifier method. + */ +@Listeners(VerifyMethodInterceptor.class) +public class VerifySampleTest { + + @Verify + @Test + public void f1() { + log("f1"); + } + + @Verify + @Test + public void f2() { + log("f2"); + } + + @Verifier + @Test + public void verify() { + log("Verifying"); + } + + private void log(String string) { + if (false) { + System.out.println(string); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/verify/VerifyTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/verify/VerifyTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/verify/VerifyTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/verify/VerifyTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,46 @@ +package test.verify; + +import org.testng.Assert; +import org.testng.ITestNGListener; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; + +public class VerifyTest extends SimpleBaseTest { + + private void runTest(Class cls, int expected) { + TestNG tng = create(cls); + TestListenerAdapter tla = new TestListenerAdapter(); + tng.addListener((ITestNGListener) tla); + tng.run(); + + Assert.assertEquals(tla.getPassedTests().size(), expected); + } + + @Test + public void verifyWithAnnotation() { + runTest(VerifySampleTest.class, 4); + } + + @Test + public void verifyWithoutAnnotation() { + runTest(VerifyNoListenersSampleTest.class, 3); + } + + @Test + public void verifyTestListener() { + TestNG tng = create(Verify2SampleTest.class); + VerifyTestListener.m_count = 0; + tng.run(); + Assert.assertEquals(VerifyTestListener.m_count, 1); + } + + @Test + public void verifyBaseClassTestListener() { + TestNG tng = create(Verify3SampleTest.class); + VerifyTestListener.m_count = 0; + tng.run(); + Assert.assertEquals(VerifyTestListener.m_count, 1); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/verify/VerifyTestListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/verify/VerifyTestListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/verify/VerifyTestListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/verify/VerifyTestListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,32 @@ +package test.verify; + +import org.testng.ITestContext; +import org.testng.ITestListener; +import org.testng.ITestResult; + +public class VerifyTestListener implements ITestListener { + public static int m_count = 0; + + @Override + public void onFinish(ITestContext context) {} + + @Override + public void onStart(ITestContext context) { + m_count++; + } + + @Override + public void onTestFailedButWithinSuccessPercentage(ITestResult result) {} + + @Override + public void onTestFailure(ITestResult result) {} + + @Override + public void onTestSkipped(ITestResult result) {} + + @Override + public void onTestStart(ITestResult result) {} + + @Override + public void onTestSuccess(ITestResult result) {} +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/xml/TestNGContentHandlerTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/xml/TestNGContentHandlerTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/xml/TestNGContentHandlerTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/xml/TestNGContentHandlerTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,29 @@ +package test.xml; + +import java.io.FileInputStream; +import java.util.List; +import org.testng.Assert; +import org.testng.annotations.Test; +import org.testng.xml.SuiteXmlParser; +import org.testng.xml.TestNGContentHandler; +import org.testng.xml.XmlInclude; +import test.SimpleBaseTest; + +public class TestNGContentHandlerTest extends SimpleBaseTest { + @Test + public void testDescriptionInclusion() throws Exception { + final String xml = getPathToResource("xml/simple-suite-with-method-desc.xml"); + SuiteXmlParser parser = new SuiteXmlParser(); + TestNGContentHandler handler = new TestNGContentHandler(xml, false); + parser.parse(new FileInputStream(xml), handler); + List includes = + handler.getSuite().getTests().get(0).getXmlClasses().get(0).getIncludedMethods(); + String desc = includes.get(0).getDescription(); + Assert.assertEquals("simple-description", desc); + } + + public static class LocalTestClass { + @Test + public void helloWorld() {} + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/xml/XMLStringBufferTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/xml/XMLStringBufferTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/xml/XMLStringBufferTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/xml/XMLStringBufferTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,37 @@ +package test.xml; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.testng.reporters.XMLStringBuffer.EOL; + +import java.util.Properties; +import org.testng.annotations.Test; +import org.testng.reporters.Buffer; +import org.testng.reporters.IBuffer; +import org.testng.reporters.XMLStringBuffer; + +public class XMLStringBufferTest { + + @Test + public void testMethod() { + IBuffer result = Buffer.create(); + XMLStringBuffer sb = new XMLStringBuffer(result, ""); + + sb.push("family"); + Properties p = new Properties(); + p.setProperty("prop1", "value1"); + p.setProperty("prop2", "value2"); + sb.addRequired("cedric", "true", p); + sb.addRequired("alois", "true"); + sb.addOptional("anne-marie", (String) null); + sb.pop(); + String expected = + "" + + EOL + + " true" + + EOL + + " true" + + EOL + + ""; + assertThat(result.toString().trim()).isEqualTo(expected); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/xml/XmlVerifyTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/xml/XmlVerifyTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/xml/XmlVerifyTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/xml/XmlVerifyTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,111 @@ +package test.xml; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.lang.reflect.Method; +import java.util.Collections; +import org.testng.Assert; +import org.testng.ITestNGListener; +import org.testng.TestListenerAdapter; +import org.testng.TestNG; +import org.testng.TestNGException; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.Test; +import org.testng.xml.XmlClass; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlTest; +import test.SimpleBaseTest; + +public class XmlVerifyTest extends SimpleBaseTest { + static { + System.setProperty("testng.testmode", "true"); + } + + private static final String COMMAND_LINE_TEST = ""; + private static final String DEFAULT_SUITE = ""; + + @Test(description = "github-1455") + public void testToXmlWithComments() { + XmlSuite suite = createSuite(); + String xml = suite.toXml(); + assertThat(xml).contains(COMMAND_LINE_TEST); + assertThat(xml).contains(DEFAULT_SUITE); + } + + @Test(description = "github-1455", dependsOnMethods = "testToXmlWithComments") + public void testToXmlWithoutComments() { + System.setProperty("testng.xml.weaver", "org.testng.xml.CommentDisabledXmlWeaver"); + XmlSuite suite = createSuite(); + String xml = suite.toXml(); + assertThat(xml).doesNotContain(COMMAND_LINE_TEST); + assertThat(xml).doesNotContain(DEFAULT_SUITE); + } + + @AfterMethod + public void reset(Method method) { + if (method.getName().equals("testToXmlWithoutComments")) { + System.setProperty("testng.xml.weaver", "org.testng.xml.DefaultXmlWeaver"); + } + } + + private static XmlSuite createSuite() { + XmlSuite suite = new XmlSuite(); + XmlTest test = new XmlTest(suite); + test.setName("command_line_test"); + XmlClass xClass = new XmlClass(XmlVerifyTest.class); + test.getXmlClasses().add(xClass); + test.addExcludedGroup("fast"); + return suite; + } + + @Test( + description = + "Ensure that TestNG stops without running any tests if some class" + + " included in suite is missing") + public void handleInvalidSuites() { + TestListenerAdapter tla = new TestListenerAdapter(); + try { + TestNG tng = create(); + String testngXmlPath = getPathToResource("suite1.xml"); + tng.setTestSuites(Collections.singletonList(testngXmlPath)); + tng.addListener((ITestNGListener) tla); + tng.run(); + } catch (TestNGException ex) { + Assert.assertEquals(tla.getPassedTests().size(), 0); + } + } + + @Test + public void preserverOrderAttribute() { + XmlSuite suite = new XmlSuite(); + XmlTest test = new XmlTest(suite); + + suite.setPreserveOrder(true); + test.setPreserveOrder(false); + Assert.assertFalse(test.getPreserveOrder()); + + suite.setPreserveOrder(false); + test.setPreserveOrder(true); + Assert.assertTrue(test.getPreserveOrder()); + + suite.setPreserveOrder((Boolean) null); + test.setPreserveOrder(false); + Assert.assertFalse(test.getPreserveOrder()); + + suite.setPreserveOrder(false); + test.setPreserveOrder((Boolean) null); + Assert.assertFalse(test.getPreserveOrder()); + + suite.setPreserveOrder((Boolean) null); + test.setPreserveOrder(true); + Assert.assertTrue(test.getPreserveOrder()); + + suite.setPreserveOrder(true); + test.setPreserveOrder((Boolean) null); + Assert.assertTrue(test.getPreserveOrder()); + + suite.setPreserveOrder((Boolean) null); + test.setPreserveOrder((Boolean) null); + Assert.assertNull(test.getPreserveOrder()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/xml/issue2231/IssueTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/xml/issue2231/IssueTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test/xml/issue2231/IssueTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test/xml/issue2231/IssueTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,46 @@ +package test.xml.issue2231; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.testng.TestListenerAdapter; +import org.testng.annotations.Test; +import org.testng.xml.XmlClass; +import org.testng.xml.XmlSuite; +import org.testng.xml.XmlSuite.ParallelMode; +import org.testng.xml.XmlTest; +import org.testng.xml.internal.Parser; + +public class IssueTest { + + @Test(description = "GITHUB-2231") + public void ensureSuiteGenerationAdheresToDTD() throws IOException { + XmlSuite xmlSuite = new XmlSuite(); + xmlSuite.setName("CustomSuiteFile"); + xmlSuite.setParallel(ParallelMode.TESTS); + xmlSuite.setThreadCount(1); + List group = Arrays.asList("Regression", "Smoke"); + xmlSuite.setIncludedGroups(group); + xmlSuite.addListener(TestListenerAdapter.class.getName()); + Map parameters = new HashMap<>(); + parameters.put("reportPath", "somePath"); + xmlSuite.setParameters(parameters); + XmlTest xmlTest = new XmlTest(xmlSuite); + xmlTest.setName("Chrome"); + xmlTest.setXmlClasses(Collections.singletonList(new XmlClass(ExampleTestCase.class.getName()))); + File file = File.createTempFile("sample", ".xml"); + Files.write(file.toPath(), xmlSuite.toXml().getBytes()); + new Parser(file.getAbsolutePath()).parse(); + } + + public static class ExampleTestCase { + + @Test + public void testMethod() {} + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test_result/AfterListenerSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test_result/AfterListenerSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test_result/AfterListenerSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test_result/AfterListenerSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,54 @@ +package test_result; + +import org.testng.Assert; +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.ITestResult; +import org.testng.annotations.Test; + +public class AfterListenerSample { + + @Test + public void failedTest() {} + + @Test(expectedExceptions = IllegalStateException.class, enabled = false) + public void failedTest2() { + throw new IllegalStateException(); + } + + @Test + public void skippedTest() {} + + @Test + public void succeedTest() { + Assert.fail(); + } + + @Test + public void succeedTest2() { + throw new IllegalStateException(); + } + + public static class MySkipTestListener implements IInvokedMethodListener { + + @Override + public void afterInvocation(IInvokedMethod method, ITestResult result) { + switch (method.getTestMethod().getMethodName()) { + case "failedTest": + case "failedTest2": + result.setStatus(ITestResult.FAILURE); + break; + case "skippedTest": + result.setStatus(ITestResult.SKIP); + break; + case "succeedTest": + case "succeedTest2": + result.setStatus(ITestResult.SUCCESS); + break; + default: + throw new RuntimeException( + "Unknown method name: " + method.getTestMethod().getMethodName()); + } + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test_result/BeforeListenerSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test_result/BeforeListenerSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test_result/BeforeListenerSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test_result/BeforeListenerSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,53 @@ +package test_result; + +import org.testng.*; +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +@Listeners(BeforeListenerSample.MySkipTestListener.class) +public class BeforeListenerSample { + + @Test + public void failedTest() {} + + @Test(expectedExceptions = IllegalStateException.class, enabled = false) + public void failedTest2() { + throw new IllegalStateException(); + } + + @Test + public void skippedTest() {} + + @Test + public void succeedTest() { + Assert.fail(); + } + + @Test + public void succeedTest2() { + throw new IllegalStateException(); + } + + public static class MySkipTestListener implements IInvokedMethodListener { + + @Override + public void beforeInvocation(IInvokedMethod method, ITestResult result) { + switch (method.getTestMethod().getMethodName()) { + case "failedTest": + case "failedTest2": + result.setStatus(ITestResult.FAILURE); + break; + case "skippedTest": + result.setStatus(ITestResult.SKIP); + break; + case "succeedTest": + case "succeedTest2": + result.setStatus(ITestResult.SUCCESS); + break; + default: + throw new RuntimeException( + "Unknown method name: " + method.getTestMethod().getMethodName()); + } + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test_result/GitHub1197Sample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test_result/GitHub1197Sample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test_result/GitHub1197Sample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test_result/GitHub1197Sample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,37 @@ +package test_result; + +import org.testng.Assert; +import org.testng.ITestResult; +import org.testng.Reporter; +import org.testng.annotations.Test; + +public class GitHub1197Sample { + + @Test + public void failedTest() { + Reporter.getCurrentTestResult().setStatus(ITestResult.FAILURE); + } + + @Test(expectedExceptions = IllegalStateException.class, enabled = false) + public void failedTest2() { + Reporter.getCurrentTestResult().setStatus(ITestResult.FAILURE); + throw new IllegalStateException(); + } + + @Test + public void skippedTest() { + Reporter.getCurrentTestResult().setStatus(ITestResult.SKIP); + } + + @Test + public void succeedTest() { + Reporter.getCurrentTestResult().setStatus(ITestResult.SUCCESS); + Assert.fail(); + } + + @Test + public void succeedTest2() { + Reporter.getCurrentTestResult().setStatus(ITestResult.SUCCESS); + throw new IllegalStateException(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test_result/OrderAbidingListener.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test_result/OrderAbidingListener.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test_result/OrderAbidingListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test_result/OrderAbidingListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,116 @@ +package test_result; + +import java.util.Arrays; +import java.util.List; +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.ITestContext; +import org.testng.ITestListener; +import org.testng.ITestNGListener; +import org.testng.ITestResult; + +public class OrderAbidingListener implements IInvokedMethodListener, ITestListener { + + private final List listeners; + + public OrderAbidingListener(ITestNGListener... listeners) { + this.listeners = Arrays.asList(listeners); + } + + @Override + public void beforeInvocation(IInvokedMethod method, ITestResult testResult) { + listeners.stream() + .filter(l -> l instanceof IInvokedMethodListener) + .map(l -> (IInvokedMethodListener) l) + .forEach(l -> l.beforeInvocation(method, testResult)); + } + + @Override + public void beforeInvocation( + IInvokedMethod method, ITestResult testResult, ITestContext context) { + listeners.stream() + .filter(l -> l instanceof IInvokedMethodListener) + .map(l -> (IInvokedMethodListener) l) + .forEach(l -> l.beforeInvocation(method, testResult, context)); + } + + @Override + public void afterInvocation(IInvokedMethod method, ITestResult testResult) { + listeners.stream() + .filter(l -> l instanceof IInvokedMethodListener) + .map(l -> (IInvokedMethodListener) l) + .forEach(l -> l.afterInvocation(method, testResult)); + } + + @Override + public void afterInvocation(IInvokedMethod method, ITestResult testResult, ITestContext context) { + listeners.stream() + .filter(l -> l instanceof IInvokedMethodListener) + .map(l -> (IInvokedMethodListener) l) + .forEach(l -> l.afterInvocation(method, testResult, context)); + } + + @Override + public void onStart(ITestContext context) { + listeners.stream() + .filter(l -> l instanceof ITestListener) + .map(l -> (ITestListener) l) + .forEach(l -> l.onStart(context)); + } + + @Override + public void onTestStart(ITestResult result) { + listeners.stream() + .filter(l -> l instanceof ITestListener) + .map(l -> (ITestListener) l) + .forEach(l -> l.onTestStart(result)); + } + + @Override + public void onTestSuccess(ITestResult result) { + listeners.stream() + .filter(l -> l instanceof ITestListener) + .map(l -> (ITestListener) l) + .forEach(l -> l.onTestSuccess(result)); + } + + @Override + public void onTestFailure(ITestResult result) { + listeners.stream() + .filter(l -> l instanceof ITestListener) + .map(l -> (ITestListener) l) + .forEach(l -> l.onTestFailure(result)); + } + + @Override + public void onTestSkipped(ITestResult result) { + listeners.stream() + .filter(l -> l instanceof ITestListener) + .map(l -> (ITestListener) l) + .forEach(l -> l.onTestSkipped(result)); + } + + @Override + public void onTestFailedButWithinSuccessPercentage(ITestResult result) { + listeners.stream() + .filter(l -> l instanceof ITestListener) + .map(l -> (ITestListener) l) + .forEach(l -> l.onTestFailedButWithinSuccessPercentage(result)); + } + + @Override + public void onTestFailedWithTimeout(ITestResult result) { + listeners.stream() + .filter(l -> l instanceof ITestListener) + .map(l -> (ITestListener) l) + .forEach(l -> l.onTestFailedWithTimeout(result)); + } + + @Override + public void onFinish(ITestContext context) { + listeners.stream() + .filter(l -> l instanceof ITestListener) + .map(l -> (ITestListener) l) + .forEach(l -> l.onFinish(context)); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test_result/ResultStatusTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test_result/ResultStatusTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test_result/ResultStatusTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test_result/ResultStatusTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,66 @@ +package test_result; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.InvokedMethodNameListener; +import test.SimpleBaseTest; +import test_result.AfterListenerSample.MySkipTestListener; + +public class ResultStatusTest extends SimpleBaseTest { + + @Test + public void testGitHub1197() { + TestNG tng = create(GitHub1197Sample.class); + + // A skipped method is not supposed to be run but, here, it's the goal of the feature + InvokedMethodNameListener listener = new InvokedMethodNameListener(true, true); + tng.addListener(listener); + + tng.run(); + + assertThat(listener.getSucceedMethodNames()).containsExactly("succeedTest", "succeedTest2"); + assertThat(listener.getFailedBeforeInvocationMethodNames()).isEmpty(); + assertThat(listener.getFailedMethodNames()).containsExactly("failedTest"); // , "failedTest2"); + assertThat(listener.getSkippedMethodNames()).isEmpty(); + assertThat(listener.getSkippedAfterInvocationMethodNames()).containsExactly("skippedTest"); + } + + @Test + public void testBeforeListener() { + TestNG tng = create(BeforeListenerSample.class); + + // A skipped method is not supposed to be run but, here, it's the goal of the feature + InvokedMethodNameListener listener = new InvokedMethodNameListener(true, true); + tng.addListener(listener); + + tng.run(); + + assertThat(listener.getSucceedMethodNames()).containsExactly("succeedTest", "succeedTest2"); + assertThat(listener.getFailedBeforeInvocationMethodNames()).isEmpty(); + assertThat(listener.getFailedMethodNames()).containsExactly("failedTest"); // , "failedTest2"); + assertThat(listener.getSkippedMethodNames()).isEmpty(); + assertThat(listener.getSkippedAfterInvocationMethodNames()).containsExactly("skippedTest"); + } + + @Test + public void testAfterListener() { + TestNG tng = create(AfterListenerSample.class); + AfterListenerSample.MySkipTestListener testCaseListener = new MySkipTestListener(); + + // A skipped method is not supposed to be run but, here, it's the goal of the feature + InvokedMethodNameListener listener = new InvokedMethodNameListener(true, true); + OrderAbidingListener orderAbidingListener = + new OrderAbidingListener(testCaseListener, listener); + tng.addListener(orderAbidingListener); + + tng.run(); + + assertThat(listener.getSucceedMethodNames()).containsExactly("succeedTest", "succeedTest2"); + assertThat(listener.getFailedBeforeInvocationMethodNames()).isEmpty(); + assertThat(listener.getFailedMethodNames()).containsExactly("failedTest"); // , "failedTest2"); + assertThat(listener.getSkippedMethodNames()).isEmpty(); + assertThat(listener.getSkippedAfterInvocationMethodNames()).containsExactly("skippedTest"); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test_result/TestResultTest.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test_result/TestResultTest.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test_result/TestResultTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test_result/TestResultTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,34 @@ +package test_result; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Map; +import org.testng.ITestResult; +import org.testng.TestNG; +import org.testng.annotations.Test; +import test.SimpleBaseTest; +import test_result.issue1590.TestclassSample; +import test_result.issue2535.CalculatorTestSample; +import test_result.issue2535.CalculatorTestSample.LocalListener; + +public class TestResultTest extends SimpleBaseTest { + + @Test(description = "GITHUB-1590") + public void ensureITestResultHasValidStatusAndTimestampWhenInvokingConfigurationMethod() { + TestNG testng = create(TestclassSample.class); + testng.run(); + assertThat(TestclassSample.startTimestamp).isLessThanOrEqualTo(0); + assertThat(TestclassSample.startStatus).isEqualTo(ITestResult.STARTED); + assertThat(TestclassSample.endTimestamp).isGreaterThan(0); + assertThat(TestclassSample.endStatus).isEqualTo(ITestResult.SUCCESS); + } + + @Test(description = "GITHUB-2535") + public void ensureITestResultHasValidTimestampWhenConfigurationMethodFails() { + TestNG testng = create(CalculatorTestSample.class); + testng.run(); + Map results = LocalListener.results; + ITestResult skippedConfig = results.get("setup1"); + assertThat(skippedConfig.getEndMillis()).isEqualTo(skippedConfig.getStartMillis()); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test_result/issue1590/TestclassSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test_result/issue1590/TestclassSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test_result/issue1590/TestclassSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test_result/issue1590/TestclassSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,42 @@ +package test_result.issue1590; + +import java.util.concurrent.TimeUnit; +import org.testng.IInvokedMethod; +import org.testng.ITestContext; +import org.testng.ITestResult; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +public class TestclassSample { + public static int startStatus; + public static int endStatus; + public static long startTimestamp; + public static long endTimestamp; + + @BeforeClass + public void beforeClass(ITestContext context) throws InterruptedException { + TimeUnit.SECONDS.sleep(1); + ITestResult result = findConfigurationMethod(context).getTestResult(); + startStatus = result.getStatus(); + startTimestamp = result.getEndMillis(); + } + + @Test + public void testMethod() {} + + @AfterClass + public void afterClass(ITestContext context) { + ITestResult result = findConfigurationMethod(context).getTestResult(); + endTimestamp = result.getEndMillis(); + endStatus = ITestResult.SUCCESS; + } + + private static IInvokedMethod findConfigurationMethod(ITestContext context) { + return context.getSuite().getAllInvokedMethods().stream() + .filter( + iInvokedMethod -> iInvokedMethod.getTestMethod().getMethodName().equals("beforeClass")) + .findFirst() + .orElseThrow(IllegalStateException::new); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/test_result/issue2535/CalculatorTestSample.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test_result/issue2535/CalculatorTestSample.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/test_result/issue2535/CalculatorTestSample.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/test_result/issue2535/CalculatorTestSample.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,38 @@ +package test_result.issue2535; + +import java.util.HashMap; +import java.util.Map; +import org.testng.Assert; +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.ITestResult; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; +import test_result.issue2535.CalculatorTestSample.LocalListener; + +@Listeners(LocalListener.class) +public class CalculatorTestSample { + + @Test + public void calculatorUiTest() {} + + @BeforeClass + public void setup() { + Assert.fail(); + } + + @BeforeMethod + public void setup1() {} + + public static class LocalListener implements IInvokedMethodListener { + + public static final Map results = new HashMap<>(); + + @Override + public void beforeInvocation(IInvokedMethod method, ITestResult testResult) { + results.put(method.getTestMethod().getMethodName(), testResult); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/testhelper/CompiledCode.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/testhelper/CompiledCode.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/testhelper/CompiledCode.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/testhelper/CompiledCode.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,31 @@ +package testhelper; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import javax.tools.JavaFileObject.Kind; + +public class CompiledCode { + private final byte[] byteCode; + private final boolean skipLoading; + private final String name; + + public CompiledCode(String name, File directory, boolean skipLoading) throws IOException { + this.skipLoading = skipLoading; + this.name = name; + File classFile = new File(directory, name + Kind.CLASS.extension); + this.byteCode = Files.readAllBytes(classFile.toPath()); + } + + public byte[] getByteCode() { + return byteCode; + } + + public boolean isSkipLoading() { + return skipLoading; + } + + public String getName() { + return name; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/testhelper/OutputDirectoryPatch.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/testhelper/OutputDirectoryPatch.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/testhelper/OutputDirectoryPatch.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/testhelper/OutputDirectoryPatch.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,49 @@ +package testhelper; + +/** + * OutputDirectoryPatch is a helper class to provide an output directory for TestNG + * tests that explicitly create an instance of TestNG and do not know the output directory specified + * for the test. + * + * @author cquezel + * @since 4.8 + */ +public final class OutputDirectoryPatch { + + /** + * The default output directory name if none was specified. We should use something different than + * "test-output" to make it clear that the output directory has not been set. + */ + private static final String DEFAULT_OUTPUT_DIRECTORY = "test-output"; + + /** The name of the System property used to store the output directory. */ + private static final String OUTPUT_DIRECTORY_PROPERTY_NAME = "testng.outputDir"; + + /** + * Private constructor to disable instantiation. + * + * @since 4.8 + */ + private OutputDirectoryPatch() { + // Hide constructor + } + + /** + * Returns the output directory as specified for the current test. + * + * @return the output directory as specified for the current test. + * @since 4.8 + */ + public static String getOutputDirectory() { + String tmp = System.getProperty(OUTPUT_DIRECTORY_PROPERTY_NAME); + if (tmp != null) { + return tmp; + } + // System.err.println("System property: " + OUTPUT_DIRECTORY_PROPERTY_NAME + // + " has not been set. Using default path: " + DEFAULT_OUTPUT_DIRECTORY); + + // new Throwable("Stack is only to help locate the problem. No excpetion + // thrown.").printStackTrace(System.err); + return DEFAULT_OUTPUT_DIRECTORY; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/testhelper/SimpleCompiler.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/testhelper/SimpleCompiler.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/testhelper/SimpleCompiler.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/testhelper/SimpleCompiler.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,42 @@ +package testhelper; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.util.List; +import javax.tools.JavaCompiler; +import javax.tools.ToolProvider; +import org.testng.TestNGException; +import org.testng.collections.Lists; + +public class SimpleCompiler { + + public static List compileSourceCode(SourceCode... sources) throws IOException { + JavaCompiler javac = ToolProvider.getSystemJavaCompiler(); + String[] arguments = new String[sources.length]; + int i = 0; + for (SourceCode source : sources) { + arguments[i++] = source.getLocation().getCanonicalPath(); + } + int rc = javac.run(null, null, null, arguments); + if (rc != 0) { + throw new TestNGException("Encountered errors when compiling code"); + } + List compiledCodes = Lists.newArrayList(); + for (SourceCode source : sources) { + source.getLocation().delete(); + CompiledCode compiledCode = + new CompiledCode(source.getName(), source.getDirectory(), source.isSkipLoading()); + compiledCodes.add(compiledCode); + } + return compiledCodes; + } + + public static File createTempDir() { + try { + return Files.createTempDirectory("custom").toFile(); + } catch (IOException e) { + throw new TestNGException(e); + } + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/java/testhelper/SourceCode.java jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/testhelper/SourceCode.java --- jtreg7-7.3.1+1/testng/testng-core/src/test/java/testhelper/SourceCode.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/java/testhelper/SourceCode.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,43 @@ +package testhelper; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.StandardOpenOption; +import javax.tools.JavaFileObject.Kind; + +public class SourceCode { + + private final String name; + private final File directory; + private final boolean skipLoading; + private final File location; + + public SourceCode(String name, String src, File directory, boolean skipLoading) + throws IOException { + this.name = name; + this.directory = directory; + this.skipLoading = skipLoading; + this.location = new File(directory, name + Kind.SOURCE.extension); + if (this.location.exists()) { + this.location.delete(); + } + Files.write(location.toPath(), src.getBytes(), StandardOpenOption.CREATE_NEW); + } + + public File getDirectory() { + return directory; + } + + public String getName() { + return name; + } + + public boolean isSkipLoading() { + return skipLoading; + } + + public File getLocation() { + return location; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/kotlin/org/testng/BasicSample.kt jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/kotlin/org/testng/BasicSample.kt --- jtreg7-7.3.1+1/testng/testng-core/src/test/kotlin/org/testng/BasicSample.kt 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/kotlin/org/testng/BasicSample.kt 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package org.testng + +import org.testng.Assert.fail +import org.testng.annotations.Test + +class BasicSample { + + @Test + fun test() { + fail("BOUM") + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/kotlin/org/testng/BasicTest.kt jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/kotlin/org/testng/BasicTest.kt --- jtreg7-7.3.1+1/testng/testng-core/src/test/kotlin/org/testng/BasicTest.kt 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/kotlin/org/testng/BasicTest.kt 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ +package org.testng + +import org.assertj.core.api.Assertions.assertThat +import org.testng.annotations.Test +import test.SimpleBaseTest + +class BasicTest : SimpleBaseTest() { + + @Test + fun `basic test as sample`() { + val listener = run(BasicSample::class.java) + assertThat(listener.failedMethodNames).containsExactly("test") + assertThat(listener.succeedMethodNames).isEmpty() + assertThat(listener.skippedMethodNames).isEmpty() + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/1332.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/1332.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/1332.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/1332.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/1636.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/1636.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/1636.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/1636.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/188.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/188.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/188.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/188.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/2532.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/2532.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/2532.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/2532.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/987.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/987.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/987.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/987.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ + + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/META-INF/services/org.testng.IModule jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/META-INF/services/org.testng.IModule --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/META-INF/services/org.testng.IModule 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/META-INF/services/org.testng.IModule 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1 @@ +org.testng.SampleIModule \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/META-INF/services/org.testng.ITestNGListener jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/META-INF/services/org.testng.ITestNGListener --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/META-INF/services/org.testng.ITestNGListener 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/META-INF/services/org.testng.ITestNGListener 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,2 @@ +test.serviceloader.MyConfigurationListener +test.testng1232.TestListenerFor1232 diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/META-INF/services/org.testng.xml.ISuiteParser jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/META-INF/services/org.testng.xml.ISuiteParser --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/META-INF/services/org.testng.xml.ISuiteParser 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/META-INF/services/org.testng.xml.ISuiteParser 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1 @@ +org.testng.xml.FakeHttpXmlParser \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/a.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/a.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/a.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/a.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/b.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/b.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/b.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/b.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/checksuitesinitialization/child-suite1.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/checksuitesinitialization/child-suite1.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/checksuitesinitialization/child-suite1.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/checksuitesinitialization/child-suite1.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/checksuitesinitialization/child-suite2.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/checksuitesinitialization/child-suite2.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/checksuitesinitialization/child-suite2.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/checksuitesinitialization/child-suite2.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/checksuitesinitialization/children/child-suite-3.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/checksuitesinitialization/children/child-suite-3.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/checksuitesinitialization/children/child-suite-3.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/checksuitesinitialization/children/child-suite-3.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/checksuitesinitialization/children/child-suite-4.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/checksuitesinitialization/children/child-suite-4.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/checksuitesinitialization/children/child-suite-4.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/checksuitesinitialization/children/child-suite-4.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/checksuitesinitialization/children/morechildren/child-suite-5.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/checksuitesinitialization/children/morechildren/child-suite-5.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/checksuitesinitialization/children/morechildren/child-suite-5.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/checksuitesinitialization/children/morechildren/child-suite-5.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/checksuitesinitialization/parent-suite-with-duplicate-child.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/checksuitesinitialization/parent-suite-with-duplicate-child.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/checksuitesinitialization/parent-suite-with-duplicate-child.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/checksuitesinitialization/parent-suite-with-duplicate-child.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/checksuitesinitialization/parent-suite.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/checksuitesinitialization/parent-suite.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/checksuitesinitialization/parent-suite.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/checksuitesinitialization/parent-suite.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/create-serviceloader-jar.sh jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/create-serviceloader-jar.sh --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/create-serviceloader-jar.sh 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/create-serviceloader-jar.sh 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +# This script will update serviceloader.jar with the latest version of TmpSuiteListener.class, +# which is used by test.serviceloader.ServiceLoaderTest. +# Run this script after building TestNG and its tests with ant + +j=${PWD} +rm -rf /tmp/sl +mkdir /tmp/sl +cd /tmp/sl +jar xvf ${j}/serviceloader.jar +echo "test.serviceloader.TmpSuiteListener" >META-INF/services/org.testng.ITestNGListener +cp ${j}/../../../target/test-classes/test/serviceloader/TmpSuiteListener.class test/tmp +jar cvf ${j}/serviceloader.jar . diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/executionlistenersingletoncheck/child.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/executionlistenersingletoncheck/child.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/executionlistenersingletoncheck/child.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/executionlistenersingletoncheck/child.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/executionlistenersingletoncheck/parent.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/executionlistenersingletoncheck/parent.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/executionlistenersingletoncheck/parent.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/executionlistenersingletoncheck/parent.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/groupinvocation/parent-suiteA.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/groupinvocation/parent-suiteA.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/groupinvocation/parent-suiteA.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/groupinvocation/parent-suiteA.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/groupinvocation/parent-suiteB.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/groupinvocation/parent-suiteB.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/groupinvocation/parent-suiteB.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/groupinvocation/parent-suiteB.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/groupinvocation/suiteA.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/groupinvocation/suiteA.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/groupinvocation/suiteA.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/groupinvocation/suiteA.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/groupinvocation/suiteB.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/groupinvocation/suiteB.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/groupinvocation/suiteB.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/groupinvocation/suiteB.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/hosts.properties jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/hosts.properties --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/hosts.properties 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/hosts.properties 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,2 @@ +testng.hosts=localhost:5150 +testng.strategy=test diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/jarfileutils/child/child.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/jarfileutils/child/child.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/jarfileutils/child/child.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/jarfileutils/child/child.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/jarfileutils/child/childofchild/childofchild.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/jarfileutils/child/childofchild/childofchild.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/jarfileutils/child/childofchild/childofchild.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/jarfileutils/child/childofchild/childofchild.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/jarfileutils/child.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/jarfileutils/child.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/jarfileutils/child.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/jarfileutils/child.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/jarfileutils/childofchild/childofchild.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/jarfileutils/childofchild/childofchild.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/jarfileutils/childofchild/childofchild.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/jarfileutils/childofchild/childofchild.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/jarfileutils/testng-tests.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/jarfileutils/testng-tests.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/jarfileutils/testng-tests.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/jarfileutils/testng-tests.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/jenkins-junit.xsd jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/jenkins-junit.xsd --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/jenkins-junit.xsd 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/jenkins-junit.xsd 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/junit-suite.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/junit-suite.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/junit-suite.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/junit-suite.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ + + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/listener-in-xml.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/listener-in-xml.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/listener-in-xml.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/listener-in-xml.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/methodinterceptors/multipleinterceptors/multiple-interceptors.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/methodinterceptors/multipleinterceptors/multiple-interceptors.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/methodinterceptors/multipleinterceptors/multiple-interceptors.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/methodinterceptors/multipleinterceptors/multiple-interceptors.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/methodselector-in-xml.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/methodselector-in-xml.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/methodselector-in-xml.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/methodselector-in-xml.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/package.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/package.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/package.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/package.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/parallel-suites/inherit-thread-count-child.yaml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parallel-suites/inherit-thread-count-child.yaml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/parallel-suites/inherit-thread-count-child.yaml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parallel-suites/inherit-thread-count-child.yaml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,7 @@ +name: Child suite + +tests: + - name: Tests + classes: + - test.thread.Sample2 + - test.thread.Sample1 diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/parallel-suites/inherit-thread-count-parent.yaml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parallel-suites/inherit-thread-count-parent.yaml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/parallel-suites/inherit-thread-count-parent.yaml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parallel-suites/inherit-thread-count-parent.yaml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,5 @@ +name: Parent suite + +suiteFiles: + - ./inherit-thread-count-child.yaml + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/parallel-suites/simple-suite-parallel-0.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parallel-suites/simple-suite-parallel-0.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/parallel-suites/simple-suite-parallel-0.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parallel-suites/simple-suite-parallel-0.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/parallel-suites/simple-suite-parallel-1.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parallel-suites/simple-suite-parallel-1.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/parallel-suites/simple-suite-parallel-1.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parallel-suites/simple-suite-parallel-1.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,10 @@ + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/parallel-suites/simple-suite-parallel-2.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parallel-suites/simple-suite-parallel-2.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/parallel-suites/simple-suite-parallel-2.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parallel-suites/simple-suite-parallel-2.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,10 @@ + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/parallel-suites/suite-parallel-0.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parallel-suites/suite-parallel-0.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/parallel-suites/suite-parallel-0.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parallel-suites/suite-parallel-0.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/parallel-suites/suite-parallel-1.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parallel-suites/suite-parallel-1.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/parallel-suites/suite-parallel-1.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parallel-suites/suite-parallel-1.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,10 @@ + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/parallel-suites/suite-parallel-2-1.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parallel-suites/suite-parallel-2-1.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/parallel-suites/suite-parallel-2-1.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parallel-suites/suite-parallel-2-1.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,10 @@ + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/parallel-suites/suite-parallel-2-2-1.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parallel-suites/suite-parallel-2-2-1.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/parallel-suites/suite-parallel-2-2-1.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parallel-suites/suite-parallel-2-2-1.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,10 @@ + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/parallel-suites/suite-parallel-2-2.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parallel-suites/suite-parallel-2-2.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/parallel-suites/suite-parallel-2-2.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parallel-suites/suite-parallel-2-2.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/parallel-suites/suite-parallel-2.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parallel-suites/suite-parallel-2.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/parallel-suites/suite-parallel-2.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parallel-suites/suite-parallel-2.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/parallel-suites/suite-parallel-3.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parallel-suites/suite-parallel-3.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/parallel-suites/suite-parallel-3.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parallel-suites/suite-parallel-3.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,10 @@ + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/param-inheritance/child-suite.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/param-inheritance/child-suite.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/param-inheritance/child-suite.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/param-inheritance/child-suite.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/param-inheritance/parent-suite.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/param-inheritance/parent-suite.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/param-inheritance/parent-suite.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/param-inheritance/parent-suite.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/parametertest/1417.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parametertest/1417.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/parametertest/1417.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parametertest/1417.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/parametertest/child1-suite.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parametertest/child1-suite.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/parametertest/child1-suite.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parametertest/child1-suite.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/parametertest/child2-suite.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parametertest/child2-suite.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/parametertest/child2-suite.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parametertest/child2-suite.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/parametertest/child3-suite.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parametertest/child3-suite.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/parametertest/child3-suite.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parametertest/child3-suite.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/parametertest/parent-suite.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parametertest/parent-suite.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/parametertest/parent-suite.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parametertest/parent-suite.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/parent-module-suite.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parent-module-suite.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/parent-module-suite.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/parent-module-suite.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/sanitycheck/test-a.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/sanitycheck/test-a.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/sanitycheck/test-a.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/sanitycheck/test-a.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/sanitycheck/test-b.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/sanitycheck/test-b.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/sanitycheck/test-b.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/sanitycheck/test-b.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/sanitycheck/test-s-1.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/sanitycheck/test-s-1.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/sanitycheck/test-s-1.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/sanitycheck/test-s-1.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/sanitycheck/test-s-2.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/sanitycheck/test-s-2.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/sanitycheck/test-s-2.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/sanitycheck/test-s-2.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/sanitycheck/test-s-3.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/sanitycheck/test-s-3.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/sanitycheck/test-s-3.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/sanitycheck/test-s-3.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/sanitycheck/test-s-a.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/sanitycheck/test-s-a.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/sanitycheck/test-s-a.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/sanitycheck/test-s-a.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/sanitycheck/test-s-b.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/sanitycheck/test-s-b.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/sanitycheck/test-s-b.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/sanitycheck/test-s-b.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/sanitycheck/test1.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/sanitycheck/test1.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/sanitycheck/test1.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/sanitycheck/test1.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/sanitycheck/test2.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/sanitycheck/test2.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/sanitycheck/test2.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/sanitycheck/test2.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/sanitycheck/test3.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/sanitycheck/test3.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/sanitycheck/test3.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/sanitycheck/test3.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + Binary files /srv/release.debian.org/tmp/8eBn1h2_bd/jtreg7-7.3.1+1/testng/testng-core/src/test/resources/serviceloader.jar and /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/serviceloader.jar differ diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/suite1-1.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/suite1-1.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/suite1-1.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/suite1-1.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,13 @@ + + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/suite1-2.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/suite1-2.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/suite1-2.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/suite1-2.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/suite1.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/suite1.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/suite1.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/suite1.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/test/listeners/github1284/github1284.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/test/listeners/github1284/github1284.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/test/listeners/github1284/github1284.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/test/listeners/github1284/github1284.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/test/listeners/github1284/github1284_nolistener.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/test/listeners/github1284/github1284_nolistener.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/test/listeners/github1284/github1284_nolistener.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/test/listeners/github1284/github1284_nolistener.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/test/listeners/github1284/github1284_withchildlistener.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/test/listeners/github1284/github1284_withchildlistener.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/test/listeners/github1284/github1284_withchildlistener.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/test/listeners/github1284/github1284_withchildlistener.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/test/listeners/github1284/github1284_withlistener.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/test/listeners/github1284/github1284_withlistener.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/test/listeners/github1284/github1284_withlistener.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/test/listeners/github1284/github1284_withlistener.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/test/methodselectors/sampleTest.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/test/methodselectors/sampleTest.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/test/methodselectors/sampleTest.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/test/methodselectors/sampleTest.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/test/methodselectors/sampleTestExclusions.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/test/methodselectors/sampleTestExclusions.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/test/methodselectors/sampleTestExclusions.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/test/methodselectors/sampleTestExclusions.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/test/timeout/issue575.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/test/timeout/issue575.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/test/timeout/issue575.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/test/timeout/issue575.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/testnames/main-suite.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/testnames/main-suite.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/testnames/main-suite.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/testnames/main-suite.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/testnames/upstream-suite.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/testnames/upstream-suite.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/testnames/upstream-suite.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/testnames/upstream-suite.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/testng-all.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/testng-all.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/testng-all.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/testng-all.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/testng-annconv.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/testng-annconv.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/testng-annconv.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/testng-annconv.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/testng-ant.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/testng-ant.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/testng-ant.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/testng-ant.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,10 @@ + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/testng-configfailure.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/testng-configfailure.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/testng-configfailure.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/testng-configfailure.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/testng-methodselectors.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/testng-methodselectors.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/testng-methodselectors.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/testng-methodselectors.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/testng-override.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/testng-override.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/testng-override.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/testng-override.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/testng-package.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/testng-package.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/testng-package.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/testng-package.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/testng-single.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/testng-single.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/testng-single.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/testng-single.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/testng-single.yaml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/testng-single.yaml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/testng-single.yaml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/testng-single.yaml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +name: SingleSuite +verbose: 2 + +tests: + - name: Test1 + excludedGroups: [ excludeThisGroup ] + classes: + - name: test.dependent.xml.GroupDependencyTest +# includedMethods: [ a ] +# - test.Test2 +# - name: test.CommandLineTest +# includedMethods: [ junitParsing ] diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/testng-single2.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/testng-single2.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/testng-single2.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/testng-single2.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/testng-single2.yaml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/testng-single2.yaml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/testng-single2.yaml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/testng-single2.yaml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,48 @@ +name: SingleSuite +verbose: 2 +parallel: false +threadCount: 4 +dataProviderThreadCount: 3 + +packages: + - name: test.testng355.org.apache.tapestry5 + include: [Foo, Foo2] + exclude: [Bar] + - name: test.testng355.org.apache.tapestry5.dom + +listeners: + - test.invokedmethodlistener.MyListener + +parameters: { n: 42, p: 10, s: "a b c", t: "a,b" } + +methodSelectors: + - className: org.testng.internal.XmlMethodSelector + priority: 1 + - expression: groups.containsKey("test1") + language: beanshell + +tests: + - name: Test3 + includedGroups: [A, B] + excludedGroups: [C, D] + metaGroups: { a: [ b, d] } + packages: [ com.example1, com.example2 ] + parameters: { n: 43, z: foo } + methodSelectors: + - className: org.testng.internal.XmlMethodSelector + priority: 1 + - expression: groups.containsKey("test1") + language: beanshell + + - name: Test1 + classes: + - name: test.tmp.A + includedMethods: [test1, test2] + excludedMethods: [test3] + - test.tmp.B + + - name: Test2 + classes: + - test.tmp.B + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/testng.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/testng.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/testng.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/testng.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,997 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/testng.yaml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/testng.yaml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/testng.yaml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/testng.yaml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,352 @@ +name: TestNG +threadCount: 2 +parameters: { short: 47, parameter: out, char: c, byte: 43, first-name: Cedric, int: 42, string: Cedric, factory-param: FactoryParam, boolean: true, long: 46, double: 44.0, float: 45.0 } +tests: + - name: Nopackage + includedGroups: [ nopackage ] + classes: + - NoPackageTest + + - name: Regression1 + excludedGroups: [ excludeThisGroup ] + metaGroups: { evenodd: [ even, odd ] } + classes: + - test.parameters.ParameterSample + - test.parameters.ParameterTest + - test.Test1 + - test.Test2 + - test.CtorCalledOnce + - test.expectedexceptions.ExpectedExceptionsTest + - test.access.PrivateAccessConfigurationMethods + - test.expectedexceptions.WrappedExpectedException + - test.parameters.OptionalParameterTest + + - name: Regression2 + excludedGroups: [ broken ] + classes: + - test.Test1 + - test.MethodTest + - test.sample.AfterClassCalledAtEnd + - test.GraphTest + - org.testng.internal.DynamicGraphTest + - test.configuration.BaseGroupsTest + - test.configuration.BeforeClassThreadTest + - test.configuration.BeforeTestOrderingTest + - test.configuration.ConfigurationTest + - test.configuration.GroupsTest + - test.configuration.MultipleBeforeGroupTest + - test.configuration.ReflectMethodParametrizedConfigurationMethodTest + - test.configuration.SuiteFactoryOnceTest + - test.privatemethod.PrivateMethodTest$PrivateMethodInnerTest + - test.multiple.TestMultiple + - test.ClassConfigurations + - test.alwaysrun.AlwaysRunTest + - test.conffailure.ConfigurationFailure + - test.superclass.MainTest + - test.superclass.Test3 + - test.failures.FailuresTest + - test.mannotation.MAnnotationSampleTest + - test.mannotation.MAnnotation2SampleTest + - test.thread.ThreadPoolSizeTest + - test.thread.SequentialTest + - test.thread.ParallelTestTest + - test.thread.ParallelSuiteTest + - test.thread.FactoryTest + - test.thread.DataProviderThreadPoolSizeTest + - test.thread.MultiThreadedDependentTest + - test.simple.IncludedExcludedTest + - test.reports.ReportTest + - test.annotationtransformer.AnnotationTransformerTest + - test.jar.JarTest + - test.xml.XmlVerifyTest + - test.invokedmethodlistener.InvokedMethodListenerTest + - test.testng249.VerifyTest + - test.testng195.AfterMethodTest + - test.regression.BeforeTestFailingTest + - test.testng285.TestNG285Test + - test.failedreporter.FailedReporterTest + - test.attributes.AttributeTest + - test.verify.VerifyTest + - test.abstractconfmethod.C + - test.issue78.NonPublicClassTest + - test.listeners.ListenerTest + - test.preserveorder.PreserveOrderTest + - test.listeners.ResultEndMillisTest + + - name: Injection + classes: + - test.inject.InjectTestContextTest + - test.inject.InjectBeforeMethodTest + - test.inject.InjectTestResultTest + - test.inject.InjectDataProviderTest + - test.inject.NoInjectionTest + + - name: BeforeMethod + classes: + - test.configuration.BeforeMethodTest + + - name: Factory tests + classes: + - test.factory.classconf.XClassOrderWithFactoryTest + - test.factory.FactoryInterleavingTest + + - name: Basic + classes: + - test.sample.Basic2 + - test.sample.Basic1 + - test.Misc + + - name: Exclusion + excludedGroups: [ excludeThisGroup ] + classes: + - test.Test2 + + - name: Dependents + parameters: { foo: Cedric } + classes: + - test.dependent.MissingGroupTest + - test.dependent.MissingMethodTest + - test.dependent.OrderMethodTest + - test.dependent.DependentTest + - test.dependent.SampleDependentMethods + - test.dependent.SampleDependentMethods2 + - test.dependent.SampleDependentMethods3 + - test.dependent.SampleDependentConfigurationMethods + - test.dependent.ClassDependsOnGroups + - test.dependent.DependentAlwaysRunTest + - test.dependent.MultiGroupTest + - test.dependent.ImplicitGroupInclusionTest + - test.dependent.ClassWide1Test + - test.dependent.ClassWide2Test + - test.dependent.DepBugSampleTest + - test.dependent.DepBugVerifyTest + - test.dependent.DependsOnProtectedMethodTest + - test.dependsongroup.DependsOnGroupsTest + + - name: Inheritance + classes: + - test.SampleInheritance + - test.inheritance.ClassScopeTest + + - name: Test outer scope + includedGroups: [ outer-group ] + classes: + - test.sample.Scope + + - name: Test inner scope + parameters: { parameter: in } + includedGroups: [ inner-group ] + classes: + - test.sample.Scope + + - name: AfterClassCalledAtEnd + classes: + - test.sample.AfterClassCalledAtEnd + + - name: Triangle + classes: + - test.triangle.Child1 + - test.triangle.Child2 + + - name: CheckTrianglePost + parameters: { expected-calls: 2 } + classes: + - test.triangle.CheckCount + + - name: Test class groups 1 + classes: + - test.classgroup.Second + - test.classgroup.First + + - name: Test class groups 2 + classes: + - test.classgroup.First + - test.classgroup.Second + + - name: Factory + classes: + - test.factory.FactoryTest + - test.factory.VerifyFactoryTest + - test.factory.FactoryInSeparateClassTest + - test.factory.Factory2Test + - test.factory.FactoryWithInstanceInfoTest + - test.factory.VerifyFactoryWithInstanceInfoTest + - test.factory.TestClassAnnotationTest + - test.factory.FactoryWithDataProviderTest + - test.factory.FactoryOrderMainTest + - test.factory.FactoryFailureTest + - test.factory.FactoryInSuperClassTest + + - name: TimeOut + classes: + - test.timeout.TimeOutTest + - test.timeout.TimeOutFromXmlTest + + - name: InvocationCount + parameters: { count: 10 } + classes: + - test.InvocationAndSuccessPercentageTest + - test.invocationcount.FailedInvocationCountTest + - test.invocationcount.FirstAndLastTimeTest + + - name: Method1 + classes: + - name: test.methods.SampleMethod1 + includedMethods: + - shouldRun1 + - shouldRun2 + - test.methods.VerifyMethod1 + + - name: Method2 + classes: + - name: test.methods.SampleMethod1 + excludedMethods: + - shouldNotRun1 + - shouldNotRun2 + - test.methods.VerifyMethod1 + + - name: Method3 + classes: + - name: test.methods.SampleMethod1 + excludedMethods: + - .*Not.* + - test.methods.VerifyMethod1 + + - name: Object factory + classes: + - test.objectfactory.CustomFactoryTest + - test.objectfactory.CombinedTestAndObjectFactoryTest + + - name: Parameters for constructors + classes: + - test.ParameterConstructorTest + + - name: Excluded methods + includedGroups: [ group1, group2 ] + classes: + - name: test.Exclude + excludedMethods: + - excluded1 + - excluded2 + + - name: Parameters in init 1 + parameters: { param: value1 } + classes: + - test.configuration.ConfigurationWithParameters + + - name: Parameters in init 2 + parameters: { param: value2 } + classes: + - test.configuration.ConfigurationWithParameters + + - name: Individual method + classes: + - name: test.IndividualMethodsTest + includedMethods: + - testMethod + + - name: Method inheritance + classes: + - test.inheritance.DChild_2 + - test.inheritance.VerifyTest + + - name: Method selectors + classes: + - test.methodselectors.MethodSelectorTest + - test.methodselectors.ScriptTest + - test.methodselectors.CommandLineTest + + - name: Test order invocation + classes: + - test.interleavedorder.InterleavedInvocationTest + + - name: DataProvider + classes: + - test.dataprovider.ConfigurationAndDataProvidersTest + - test.dataprovider.MethodTest + - test.dataprovider.TestContextTest + - test.dataprovider.FailingDataProviderTest + - test.dataprovider.InstanceDataProviderTest + - test.dataprovider.FailingIterableDataProviderTest + - test.dataprovider.ClassTest + - test.dataprovider.InheritedDataProviderTest + + - name: UniqueSuite + classes: + - test.uniquesuite.TestBefore1 + - test.uniquesuite.TestBefore2 + - test.uniquesuite.TestAfter + + - name: InheritGroups + includedGroups: [ group1 ] + classes: + - test.configuration.ConfigurationInheritGroupsSampleTest + + - name: Nested + includedGroups: [ unittest ] + xmlPackages: + - name: test.nested.* + + - name: Hookable + classes: + - test.hook.HookSuccessTest + - test.hook.HookFailureTest + + - name: BeforeGroups-AfterGroups-1 + classes: + - test.configuration.ConfigurationGroups1SampleTest + - test.configuration.ConfigurationGroups2SampleTest + - test.configuration.ConfigurationGroups3SampleTest + - test.configuration.ConfigurationGroups4SampleTest + - test.configuration.ConfigurationGroups5SampleTest + - test.configuration.ConfigurationGroups6SampleTest + - test.configuration.ConfigurationGroups7SampleTest + + - name: BeforeGroups-AfterGroups-2 + includedGroups: [ A, B ] + classes: + - test.configuration.ConfigurationGroups8SampleTest + + - name: JUnit + classes: + - test.JUnitTest1 + - test.CommandLineTest + + - name: Ant-ClassFileResolution + classes: + - test.ant.TestCommandLineArgs + + - name: Class Run + classes: + - test.regression.groupsordering.A + - test.regression.groupsordering.B + + - name: Groups Run + includedGroups: [ a ] + classes: + - test.regression.groupsordering.A + - test.regression.groupsordering.B + + - name: External group invocation + includedGroups: [ a ] + classes: + - test.groupinvocation.GroupConfiguration + - test.groupinvocation.DummyTest + + - name: SkipExceptions + classes: + - test.skipex.SkippedExceptionTest + + - name: MethodInterceptor + classes: + - test.methodinterceptors.MethodInterceptorTest + + - name: Asserts + classes: + - test.asserttests.AssertTest + + - name: ConfigFailurePolicy + classes: + - test.configurationfailurepolicy.FailurePolicyTest + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/testng_convert.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/testng_convert.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/testng_convert.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/testng_convert.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,10 @@ + + + + + + + + + + Binary files /srv/release.debian.org/tmp/8eBn1h2_bd/jtreg7-7.3.1+1/testng/testng-core/src/test/resources/with-different-name-testng-xml.jar and /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/with-different-name-testng-xml.jar differ Binary files /srv/release.debian.org/tmp/8eBn1h2_bd/jtreg7-7.3.1+1/testng/testng-core/src/test/resources/withouttestngxml.jar and /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/withouttestngxml.jar differ Binary files /srv/release.debian.org/tmp/8eBn1h2_bd/jtreg7-7.3.1+1/testng/testng-core/src/test/resources/withtestngxml.jar and /srv/release.debian.org/tmp/_G9aD5rmpg/jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/withtestngxml.jar differ diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/xml/badWithDoctype.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/xml/badWithDoctype.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/xml/badWithDoctype.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/xml/badWithDoctype.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/xml/badWithoutDoctype.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/xml/badWithoutDoctype.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/xml/badWithoutDoctype.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/xml/badWithoutDoctype.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/xml/github1533/child.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/xml/github1533/child.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/xml/github1533/child.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/xml/github1533/child.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/xml/github1533/parent.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/xml/github1533/parent.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/xml/github1533/parent.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/xml/github1533/parent.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/xml/github2445/expected-failed-report.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/xml/github2445/expected-failed-report.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/xml/github2445/expected-failed-report.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/xml/github2445/expected-failed-report.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/xml/github2445/test-suite.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/xml/github2445/test-suite.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/xml/github2445/test-suite.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/xml/github2445/test-suite.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ + + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/xml/goodWithDoctype.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/xml/goodWithDoctype.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/xml/goodWithDoctype.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/xml/goodWithDoctype.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/xml/goodWithoutDoctype.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/xml/goodWithoutDoctype.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/xml/goodWithoutDoctype.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/xml/goodWithoutDoctype.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/xml/issue1668.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/xml/issue1668.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/xml/issue1668.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/xml/issue1668.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/xml/issue1674.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/xml/issue1674.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/xml/issue1674.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/xml/issue1674.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/xml/issue174.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/xml/issue174.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/xml/issue174.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/xml/issue174.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/xml/issue435.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/xml/issue435.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/xml/issue435.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/xml/issue435.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/xml/simple-suite-with-method-desc.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/xml/simple-suite-with-method-desc.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/xml/simple-suite-with-method-desc.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/xml/simple-suite-with-method-desc.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/yaml/1787.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/1787.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/yaml/1787.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/1787.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/yaml/2078.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/2078.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/yaml/2078.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/2078.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/yaml/2078.yaml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/2078.yaml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/yaml/2078.yaml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/2078.yaml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +name: My_Suite +verbose: 0 +configFailurePolicy: skip +tests: + - name: My_test + verbose: 0 + xmlDependencyGroups: + c: a b + z: c + xmlPackages: + - name: test.yaml + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/yaml/a1.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/a1.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/yaml/a1.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/a1.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/yaml/a1.yaml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/a1.yaml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/yaml/a1.yaml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/a1.yaml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,25 @@ +name: SingleSuite +verbose: 2 +threadCount: 4 +parameters: { n: 42 } +dataProviderThreadCount: 3 +parallel: false +configFailurePolicy: continue + +listeners: + - test.methodinterceptors.FastTestsFirstInterceptor + - test.invokedmethodlistener.MyListener + +packages: + - name: test.testng355.org.apache.tapestry5 + include: [Foo, Foo2] + exclude: [Bar] + - name: test.testng355.org.apache.tapestry5.dom + +tests: + - name: Regression2 + verbose: 2 + parameters: { count: 10 } + excludedGroups: [ broken ] + classes: + - test.listeners.ResultEndMillisTest diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/yaml/a2.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/a2.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/yaml/a2.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/a2.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/yaml/a2.yaml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/a2.yaml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/yaml/a2.yaml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/a2.yaml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,49 @@ +name: SingleSuite +verbose: 2 +parallel: false +threadCount: 4 +dataProviderThreadCount: 3 + +packages: + - name: test.testng355.org.apache.tapestry5 + include: [Foo, Foo2] + exclude: [Bar] + - name: test.testng355.org.apache.tapestry5.dom + +listeners: + - test.invokedmethodlistener.MyListener + +parameters: { n: 42, p: 10, s: "a b c", t: "a,b" } + +tests: + - name: Test3 + preserveOrder: false + includedGroups: [A, B] + excludedGroups: [C, D] + metaGroups: { a: [ b, d] } + packages: [ com.example1, com.example2 ] + parameters: { n: 43, z: foo } + methodSelectors: + - className: org.testng.internal.XmlMethodSelector + priority: 1 + - expression: groups.containsKey("test1") + language: beanshell + + - name: Test1 + preserveOrder: false + classes: + - name: test.tmp.A + includedMethods: [test1, test2] + excludedMethods: [test3] + - test.tmp.B + + - name: Test2 + preserveOrder: false + classes: + - test.tmp.B + +methodSelectors: + - className: org.testng.internal.XmlMethodSelector + priority: 1 + - expression: groups.containsKey("test1") + language: beanshell \ No newline at end of file diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/yaml/a3-a.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/a3-a.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/yaml/a3-a.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/a3-a.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,10 @@ + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/yaml/a3-a.yaml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/a3-a.yaml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/yaml/a3-a.yaml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/a3-a.yaml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,6 @@ +name: a3-a + +tests: + - name: Test-a3-a + classes: + - test.listeners.ResultEndMillisTest diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/yaml/a3-b.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/a3-b.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/yaml/a3-b.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/a3-b.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,10 @@ + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/yaml/a3-b.yaml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/a3-b.yaml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/yaml/a3-b.yaml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/a3-b.yaml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,6 @@ +name: a3-b + +tests: + - name: Test-a3-b + classes: + - test.listeners.ResultEndMillisTest diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/yaml/a3.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/a3.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/yaml/a3.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/a3.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,10 @@ + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/yaml/a3.yaml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/a3.yaml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/yaml/a3.yaml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/a3.yaml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,4 @@ +name: a3 +verbose: 2 + +suiteFiles: [ a3-a.xml, a3-b.xml ] diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/yaml/a4-a.yaml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/a4-a.yaml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/yaml/a4-a.yaml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/a4-a.yaml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,3 @@ +name: a4-a +verbose: 2 + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/yaml/a4-b.yaml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/a4-b.yaml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/yaml/a4-b.yaml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/a4-b.yaml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,3 @@ +name: a4-b +verbose: 2 + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/yaml/a4.xml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/a4.xml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/yaml/a4.xml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/a4.xml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,10 @@ + + + + + + + + + + diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/yaml/a4.yaml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/a4.yaml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/yaml/a4.yaml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/a4.yaml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,4 @@ +name: SingleSuite +verbose: 2 + +suiteFiles: [ a4-a.yaml, a4-b.yaml ] diff -Nru jtreg7-7.3.1+1/testng/testng-core/src/test/resources/yaml/suiteWithNonExistentTest.yaml jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/suiteWithNonExistentTest.yaml --- jtreg7-7.3.1+1/testng/testng-core/src/test/resources/yaml/suiteWithNonExistentTest.yaml 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/src/test/resources/yaml/suiteWithNonExistentTest.yaml 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,5 @@ +name: My_Suite +tests: + - name: My_test + classes: + - this.class.does.not.Exists diff -Nru jtreg7-7.3.1+1/testng/testng-core/testng-core-build.gradle.kts jtreg7-7.5.2+1+ds2/testng/testng-core/testng-core-build.gradle.kts --- jtreg7-7.3.1+1/testng/testng-core/testng-core-build.gradle.kts 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core/testng-core-build.gradle.kts 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,59 @@ +plugins { + id("testng.java-library") + id("testng.kotlin-library") + groovy + id("testng.sonarqube") +} + +java { + // use gradle feature + // in order to optionally exposed transitive dependency + + registerFeature("guice") { + usingSourceSet(sourceSets["main"]) + } + + registerFeature("junit") { + usingSourceSet(sourceSets["main"]) + } + + registerFeature("yaml") { + usingSourceSet(sourceSets["main"]) + } +} + +dependencies { + api(projects.testngCoreApi) + // Annotations have to be available on the compile classpath for the proper compilation + api("com.google.code.findbugs:jsr305:_") + api("com.beust:jcommander:_") + + "guiceApi"(platform("com.google.inject:guice-bom:_")) + "guiceApi"("com.google.inject:guice") + "junitImplementation"(projects.testngRunnerJunit4) + "yamlImplementation"("org.yaml:snakeyaml:_") + + implementation(projects.testngCollections) + implementation(projects.testngReflectionUtils) + implementation(projects.testngRunnerApi) + implementation("org.webjars:jquery:_") + + testImplementation(projects.testngAsserts) + testImplementation("org.codehaus.groovy:groovy-all:_") + testImplementation("org.spockframework:spock-core:_") + testImplementation("org.apache-extras.beanshell:bsh:_") + testImplementation("org.mockito:mockito-core:_") + testImplementation("org.jboss.shrinkwrap:shrinkwrap-api:_") + testImplementation("org.jboss.shrinkwrap:shrinkwrap-impl-base:_") + testImplementation("org.xmlunit:xmlunit-assertj:_") + testImplementation("commons-io:commons-io:_") +} + +tasks.test { + maxParallelForks = Runtime.getRuntime().availableProcessors().div(2) + (testFramework.options as TestNGOptions).apply { + suites("src/test/resources/testng.xml") + listeners.add("org.testng.reporters.FailedInformationOnConsoleReporter") + maxHeapSize = "1500m" + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IAlterSuiteListener.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IAlterSuiteListener.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IAlterSuiteListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IAlterSuiteListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,24 @@ +package org.testng; + +import java.util.List; +import org.testng.xml.XmlSuite; + +/** + * Implementations of this interface will gain access to the {@link XmlSuite} object and thus let + * users be able to alter a suite or a test based on their own needs. This listener can be added + * ONLY via the following two ways : + * + *

    + *
  1. <listeners> tag in a suite file. + *
  2. via Service loaders + *
+ * + *

Note: This listener will NOT be invoked if it is wired in via the @ + * Listeners annotation. + */ +public interface IAlterSuiteListener extends ITestNGListener { + /** @param suites - The list of {@link XmlSuite}s that are part of the current execution. */ + default void alter(List suites) { + // not implemented + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IAnnotationTransformer.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IAnnotationTransformer.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IAnnotationTransformer.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IAnnotationTransformer.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,79 @@ +package org.testng; + +import java.lang.reflect.Constructor; +import java.lang.reflect.Method; +import org.testng.annotations.IConfigurationAnnotation; +import org.testng.annotations.IDataProviderAnnotation; +import org.testng.annotations.IFactoryAnnotation; +import org.testng.annotations.IListenersAnnotation; +import org.testng.annotations.ITestAnnotation; + +public interface IAnnotationTransformer extends ITestNGListener { + + /** + * This method will be invoked by TestNG to give you a chance to modify a TestNG annotation read + * from your test classes. You can change the values you need by calling any of the setters on the + * ITest interface. + * + *

Note that only one of the three parameters testClass, testConstructor and testMethod will be + * non-null. + * + * @param annotation The annotation that was read from your test class. + * @param testClass If the annotation was found on a class, this parameter represents this class + * (null otherwise). + * @param testConstructor If the annotation was found on a constructor, this parameter represents + * this constructor (null otherwise). + * @param testMethod If the annotation was found on a method, this parameter represents this + * method (null otherwise). + */ + default void transform( + ITestAnnotation annotation, Class testClass, Constructor testConstructor, Method testMethod) { + // not implemented + } + + /** + * Transform an IConfiguration annotation. + * + *

Note that only one of the three parameters testClass, testConstructor and testMethod will be + * non-null. + * + * @param annotation The annotation that was read from your test class. + * @param testClass If the annotation was found on a class, this parameter represents this class + * (null otherwise). + * @param testConstructor If the annotation was found on a constructor, this parameter represents + * this constructor (null otherwise). + * @param testMethod If the annotation was found on a method, this parameter represents this + * method (null otherwise). + */ + default void transform( + IConfigurationAnnotation annotation, + Class testClass, + Constructor testConstructor, + Method testMethod) { + // not implemented + } + + /** + * Transform an IDataProvider annotation. + * + * @param annotation The @DataProvider annotation + * @param method The method annotated with the IDataProvider annotation. + */ + default void transform(IDataProviderAnnotation annotation, Method method) { + // not implemented + } + + /** + * Transform an IFactory annotation. + * + * @param annotation The annotation factory + * @param method The method annotated with the IFactory annotation. + */ + default void transform(IFactoryAnnotation annotation, Method method) { + // not implemented + } + + default void transform(IListenersAnnotation annotation, Class testClass) { + // not implemented + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IAttributes.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IAttributes.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IAttributes.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IAttributes.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,31 @@ +package org.testng; + +import java.util.Set; + +/** A trait that is used by all interfaces that lets the user add or remove their own attributes. */ +public interface IAttributes { + /** + * @param name The name of the attribute to return + * @return The attribute + */ + Object getAttribute(String name); + + /** + * Set a custom attribute. + * + * @param name The attribute name + * @param value The attribute value + */ + void setAttribute(String name, Object value); + + /** @return all the attributes names. */ + Set getAttributeNames(); + + /** + * Remove the attribute + * + * @param name The attribute name + * @return the attribute value if found, null otherwise + */ + Object removeAttribute(String name); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IClass.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IClass.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IClass.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IClass.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,40 @@ +package org.testng; + +import org.testng.xml.XmlClass; +import org.testng.xml.XmlTest; + +/** IClass represents a test class and a collection of its instances. */ +public interface IClass { + + /** @return this test class name. This is the name of the corresponding Java class. */ + String getName(); + + /** @return the <test> tag this class was found in. */ + XmlTest getXmlTest(); + + /** @return the *lt;class> tag this class was found in. */ + XmlClass getXmlClass(); + + /** @return its test name if this class implements org.testng.ITest, null otherwise. */ + String getTestName(); + + /** @return the Java class corresponding to this IClass. */ + Class getRealClass(); + + /** + * Returns all the instances the methods will be invoked upon. This will typically be an array of + * one object in the absence of a @Factory annotation. + * + * @param create flag if a new set of instances must be returned (if set to false) + * @return All the instances the methods will be invoked upon. + */ + Object[] getInstances(boolean create); + + default Object[] getInstances(boolean create, String errorMsgPrefix) { + return getInstances(create); + } + + long[] getInstanceHashCodes(); + + void addInstance(Object instance); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IClassListener.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IClassListener.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IClassListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IClassListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package org.testng; + +public interface IClassListener extends ITestNGListener { + + default void onBeforeClass(ITestClass testClass) { + // not implemented + } + + default void onAfterClass(ITestClass testClass) { + // not implemented + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IConfigurable.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IConfigurable.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IConfigurable.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IConfigurable.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,13 @@ +package org.testng; + +/** + * If a test class implements this interface, its run() method will be invoked instead of each + * configuration method found. The invocation of the configuration method will then be performed + * upon invocation of the callBack() method of the IConfigureCallBack parameter. + * + * @author cbeust Sep 07, 2010 + */ +public interface IConfigurable extends ITestNGListener { + + void run(IConfigureCallBack callBack, ITestResult testResult); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IConfigurationListener.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IConfigurationListener.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IConfigurationListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IConfigurationListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,81 @@ +package org.testng; + +/** Listener interface for events related to configuration methods. */ +public interface IConfigurationListener extends ITestNGListener { + + /** + * Invoked whenever a configuration method succeeded. + * + * @param tr The test result + */ + default void onConfigurationSuccess(ITestResult tr) { + // not implemented + } + + /** + * Invoked whenever a configuration method succeeded. + * + * @param tr The test result + * @param tm The test method + */ + default void onConfigurationSuccess(ITestResult tr, ITestNGMethod tm) { + // not implemented + } + + /** + * Invoked whenever a configuration method failed. + * + * @param tr The test result + */ + default void onConfigurationFailure(ITestResult tr) { + // not implemented + } + + /** + * Invoked whenever a configuration method failed. + * + * @param tr The test result + * @param tm The test method + */ + default void onConfigurationFailure(ITestResult tr, ITestNGMethod tm) { + // not implemented + } + + /** + * Invoked whenever a configuration method was skipped. + * + * @param tr The test result + */ + default void onConfigurationSkip(ITestResult tr) { + // not implemented + } + + /** + * Invoked whenever a configuration method was skipped. + * + * @param tr The test result + * @param tm The test method + */ + default void onConfigurationSkip(ITestResult tr, ITestNGMethod tm) { + // not implemented + } + + /** + * Invoked before a configuration method is invoked. + * + * @param tr The test result + */ + default void beforeConfiguration(ITestResult tr) { + // not implemented + } + + /** + * Invoked before a configuration method is invoked. + * + * @param tr The test result + * @param tm The test method + */ + default void beforeConfiguration(ITestResult tr, ITestNGMethod tm) { + // not implemented + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IConfigurationListener2.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IConfigurationListener2.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IConfigurationListener2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IConfigurationListener2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,7 @@ +package org.testng; + +// WARNING: Donot delete this interface. This is internally being referred to by Gradle here +// https://github.com/gradle/gradle/blob/f0b9d60906c7b8c42cd6c61a39ae7b74767bb012/subprojects/testing-jvm/src/main/java/org/gradle/api/internal/tasks/testing/testng/TestNGListenerAdapterFactory.java#L37-L49 +/** @deprecated As of release 7.0.0, replaced by {@link org.testng.IConfigurationListener} */ +@Deprecated +public interface IConfigurationListener2 extends IConfigurationListener {} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IConfigureCallBack.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IConfigureCallBack.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IConfigureCallBack.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IConfigureCallBack.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,24 @@ +package org.testng; + +/** + * A parameter of this type will be passed to the run() method of a IConfigurable. Invoking + * runConfigurationMethod() on that parameter will cause the test method currently being diverted to + * be invoked. + * + *

This interface is not meant to be implemented by clients, only by TestNG. + * + * @see org.testng.IConfigurable + * @author cbeust Sep 07, 2010 + */ +public interface IConfigureCallBack { + + /** + * Invoke the test method currently being hijacked. + * + * @param testResult The test result + */ + void runConfigurationMethod(ITestResult testResult); + + /** @return the parameters that will be used to invoke the configuration method. */ + Object[] getParameters(); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IDataProviderInterceptor.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IDataProviderInterceptor.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IDataProviderInterceptor.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IDataProviderInterceptor.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,29 @@ +package org.testng; + +import java.util.Iterator; + +/** + * This interface helps define an interceptor for data providers. Implementations of this TestNG + * listener can be wired in via the @Listeners annotation or via the listeners + * tag in the suite file or via a Service Provider Interface mechanism. + * + *

The implementation would be able to alter the actual set of data using which a test method + * would be iterated upon. + */ +public interface IDataProviderInterceptor extends ITestNGListener { + + /** + * @param original - The original data set as produced by a particular data provider. + * @param dataProviderMethod - The {@link IDataProviderMethod} method object which represents the + * data provider that was invoked. + * @param method - The {@link ITestNGMethod} method object which represents the test method that + * will receive the parameters. + * @param iTestContext - The {@link ITestContext} object that represents the current test context. + * @return - The altered data set that would be used by TestNG to run the test method. + */ + Iterator intercept( + Iterator original, + IDataProviderMethod dataProviderMethod, + ITestNGMethod method, + ITestContext iTestContext); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IDataProviderListener.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IDataProviderListener.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IDataProviderListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IDataProviderListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,45 @@ +package org.testng; + +/** A listener that gets invoked before and after a data provider is invoked by TestNG. */ +public interface IDataProviderListener extends ITestNGListener { + + /** + * This method gets invoked just before a data provider is invoked. + * + * @param dataProviderMethod - A {@link IDataProviderMethod} object that contains details about + * the data provider that is about to be executed. + * @param method - The {@link ITestNGMethod} method that is going to consume the data + * @param iTestContext - The current test context + */ + default void beforeDataProviderExecution( + IDataProviderMethod dataProviderMethod, ITestNGMethod method, ITestContext iTestContext) { + // not implemented + } + + /** + * This method gets invoked just after a data provider is invoked. + * + * @param dataProviderMethod - A {@link IDataProviderMethod} object that contains details about + * the data provider that got executed. + * @param method - The {@link ITestNGMethod} method that received the data + * @param iTestContext - The current test context + */ + default void afterDataProviderExecution( + IDataProviderMethod dataProviderMethod, ITestNGMethod method, ITestContext iTestContext) { + // not implemented + } + + /** + * This method gets invoked when the data provider encounters an exception + * + * @param method - The {@link ITestNGMethod} method that received the data. A reference to the + * corresponding data provider can be obtained via {@link + * ITestNGMethod#getDataProviderMethod()} + * @param ctx - The current test context + * @param t - The {@link RuntimeException} that embeds the actual exception. Use {@link + * RuntimeException#getCause()} to get to the actual exception. + */ + default void onDataProviderFailure(ITestNGMethod method, ITestContext ctx, RuntimeException t) { + // not implemented + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IDataProviderMethod.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IDataProviderMethod.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IDataProviderMethod.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IDataProviderMethod.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,28 @@ +package org.testng; + +import java.lang.reflect.Method; +import java.util.List; + +/** Represents the attributes of a {@link org.testng.annotations.DataProvider} annotated method. */ +public interface IDataProviderMethod { + /** + * @return - The instance to which the data provider belongs to. null if the data + * provider is a static one. + */ + Object getInstance(); + + /** + * @return - A {@link Method} object that represents the actual {@literal @}{@link + * org.testng.annotations.DataProvider} method. + */ + Method getMethod(); + + /** @return The name of this DataProvider. */ + String getName(); + + /** @return Whether this data provider should be run in parallel. */ + boolean isParallel(); + + /** @return Which indices to run from this data provider, default: all. */ + List getIndices(); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IDynamicGraph.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IDynamicGraph.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IDynamicGraph.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IDynamicGraph.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,43 @@ +package org.testng; + +import java.util.Collection; +import java.util.List; +import java.util.Set; + +/** + * Represents the graphical representative capabilities of an entity. The entities could be either a + * {@link ISuite} or an {@link ITestNGMethod} object which are usually the logical units of work + * that TestNG deals with. + */ +public interface IDynamicGraph { + + boolean addNode(T node); + + void addEdge(int weight, T from, T to); + + void setVisualisers(Set listener); + + void addEdges(int weight, T from, Iterable tos); + + List getFreeNodes(); + + List getDependenciesFor(T node); + + void setStatus(Collection nodes, Status status); + + void setStatus(T node, Status status); + + int getNodeCount(); + + int getNodeCountWithStatus(Status status); + + Set getNodesWithStatus(Status status); + + String toDot(); + + enum Status { + READY, + RUNNING, + FINISHED + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IExecutionListener.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IExecutionListener.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IExecutionListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IExecutionListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,25 @@ +package org.testng; + +/** + * A listener used to monitor when a TestNG run starts and ends. When implementation of this + * listener is wired into TestNG, TestNG will ensure that + * + *

    + *
  • {@link IExecutionListener#onExecutionStart()} gets invoked before TestNG proceeds with + * invoking any other listener. + *
  • {@link IExecutionListener#onExecutionFinish()} gets invoked at the very last (after report + * generation phase), before TestNG exits the JVM. + *
+ */ +public interface IExecutionListener extends ITestNGListener { + + /** Invoked before the TestNG run starts. */ + default void onExecutionStart() { + // not implemented + } + + /** Invoked once all the suites have been run. */ + default void onExecutionFinish() { + // not implemented + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IExecutionVisualiser.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IExecutionVisualiser.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IExecutionVisualiser.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IExecutionVisualiser.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,14 @@ +package org.testng; + +/** + * A TestNG listener that can be used to build graph representations of TestNG methods as and when + * they are being executed on a real-time basis. + */ +public interface IExecutionVisualiser extends ITestNGListener { + /** + * @param dotDefinition - A DOT + * representation of the Directed Acyclic Graph that TestNG builds internally to represent its + * tests. + */ + void consumeDotDefinition(String dotDefinition); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IExpectedExceptionsHolder.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IExpectedExceptionsHolder.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IExpectedExceptionsHolder.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IExpectedExceptionsHolder.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package org.testng; + +public interface IExpectedExceptionsHolder { + + /** + * Get the message in case the Throwable thrown by the test is not matching. + * + * @param ite The Throwable thrown by the test + * @return The message which will be displayed as test result + */ + String getWrongExceptionMessage(Throwable ite); + + /** + * Check if the Throwable thrown by the test is matching with the holder logic + * + * @param ite The Throwable thrown by the test + * @return true if the Throwable is matching with the holder logic, false otherwise + */ + boolean isThrowableMatching(Throwable ite); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IHookCallBack.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IHookCallBack.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IHookCallBack.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IHookCallBack.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,24 @@ +package org.testng; + +/** + * A parameter of this type will be passed to the run() method of a IHookable. Invoking + * runTestMethod() on that parameter will cause the test method currently being diverted to be + * invoked. + * + *

This interface is not meant to be implemented by clients, only by TestNG. + * + * @see org.testng.IHookable + * @author cbeust Jan 28, 2006 + */ +public interface IHookCallBack { + + /** + * Invoke the test method currently being hijacked. + * + * @param testResult The test result + */ + void runTestMethod(ITestResult testResult); + + /** @return the parameters that will be used to invoke the test method. */ + Object[] getParameters(); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IHookable.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IHookable.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IHookable.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IHookable.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,29 @@ +package org.testng; + +/** + * If a test class implements this interface, its run() method will be invoked instead of each @Test + * method found. The invocation of the test method will then be performed upon invocation of the + * callBack() method of the IHookCallBack parameter. + * + *

This is useful to test classes that require JAAS authentication, which can be implemented as + * follows: + * + *

+ * public void run(final IHookCallBack icb, ITestResult testResult) {
+ *   // Preferably initialized in a @Configuration method
+ *   mySubject = authenticateWithJAAs();
+ *
+ *   Subject.doAs(mySubject, new PrivilegedExceptionAction() {
+ *     public Object run() {
+ *       icb.callback(testResult);
+ *     }
+ *   };
+ * }
+ * 
+ * + * @author cbeust Jan 28, 2006 + */ +public interface IHookable extends ITestNGListener { + + void run(IHookCallBack callBack, ITestResult testResult); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IInjectorFactory.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IInjectorFactory.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IInjectorFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IInjectorFactory.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,36 @@ +package org.testng; + +import com.google.inject.Injector; +import com.google.inject.Module; +import com.google.inject.Stage; +import javax.annotation.Nullable; + +/** Allows customization of the {@link Injector} creation when working with dependency injection. */ +public interface IInjectorFactory { + /** + * Note that {@link #getInjector(Injector, Stage, Module...)} should be used instead. + * + * @param stage - A {@link Stage} object that defines the appropriate stage + * @param modules - An array of {@link Module} + * @return - An {@link com.google.inject.Injector} instance that can be used to perform dependency + * injection. + * @deprecated - As of TestNG 7.5.0 + */ + @Deprecated + Injector getInjector(Stage stage, Module... modules); + + /** + * Adding this method breaks existing implementations therefore for the time being (until + * deprecated method is removed) it calls the existing method. + * + * @param parent - Parent {@link com.google.inject.Injector} instance that was built with parent + * injector + * @param stage - A {@link Stage} object that defines the appropriate stage + * @param modules - An array of {@link Module} + * @return - An {@link com.google.inject.Injector} instance that can be used to perform dependency + * injection. + */ + default Injector getInjector(@Nullable Injector parent, Stage stage, Module... modules) { + return getInjector(stage, modules); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IInstanceInfo.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IInstanceInfo.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IInstanceInfo.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IInstanceInfo.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,18 @@ +package org.testng; + +/** + * This class defines a pair of instance/class. A method with @Factory can return an array of these + * objects instead of Object[] so that instances can be dynamic proxies or mock objects and still + * provide enough information to TestNG to figure out what classes the annotations should be looked + * up in. + * + * @author Cedric Beust + */ +public interface IInstanceInfo { + + /** @return The instance on which the tests will be invoked. */ + T getInstance(); + + /** @return The class on which the TestNG annotations should be looked for. */ + Class getInstanceClass(); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IInvokedMethod.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IInvokedMethod.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IInvokedMethod.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IInvokedMethod.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package org.testng; + +/** + * An interface representing a method that has been invoked by TestNG. + * + *

This interface is internal. + */ +public interface IInvokedMethod { + + /** @return true if this method is a test method */ + boolean isTestMethod(); + + /** @return true if this method is a configuration method (@BeforeXXX or @AfterXXX) */ + boolean isConfigurationMethod(); + + /** @return the test method */ + ITestNGMethod getTestMethod(); + + ITestResult getTestResult(); + + /** @return the date when this method was run */ + long getDate(); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IInvokedMethodListener.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IInvokedMethodListener.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IInvokedMethodListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IInvokedMethodListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,48 @@ +package org.testng; + +/** + * A listener that gets invoked before and after a method is invoked by TestNG. This listener will + * be invoked for configuration and test methods irrespective of whether they passe/fail or get + * skipped. This listener invocation can be disabled for SKIPPED tests through one of the below + * mechanisms: + * + *

    + *
  • Command line parameter alwaysRunListeners + *
  • Build tool + *
  • Via {@code TestNG.alwaysRunListeners(false)} + *
+ */ +public interface IInvokedMethodListener extends ITestNGListener { + + default void beforeInvocation(IInvokedMethod method, ITestResult testResult) { + // not implemented + } + + default void afterInvocation(IInvokedMethod method, ITestResult testResult) { + // not implemented + } + + /** + * To be implemented if the method needs a handle to contextual information. + * + * @param method The invoked method + * @param testResult The test result + * @param context The test context + */ + default void beforeInvocation( + IInvokedMethod method, ITestResult testResult, ITestContext context) { + // not implemented + } + + /** + * To be implemented if the method needs a handle to contextual information. + * + * @param method The invoked method + * @param testResult The test result + * @param context The test context + */ + default void afterInvocation( + IInvokedMethod method, ITestResult testResult, ITestContext context) { + // not implemented + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IMethodInstance.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IMethodInstance.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IMethodInstance.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IMethodInstance.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,9 @@ +package org.testng; + +/** This interface captures a test method along with all the instances it should be run on. */ +public interface IMethodInstance { + + ITestNGMethod getMethod(); + + Object getInstance(); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IMethodInterceptor.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IMethodInterceptor.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IMethodInterceptor.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IMethodInterceptor.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,27 @@ +package org.testng; + +import java.util.List; + +/** + * This class is used to alter the list of test methods that TestNG is about to run. + * + *

An instance of this class will be invoked right before TestNG starts invoking test methods. + * Only methods that have no dependents and that don't depend on any other test methods will be + * passed in parameter. Implementers of this interface need to return a list of {@link + * IMethodInstance} that represents the list of test methods they want run. TestNG will run these + * methods in the same order found in the returned value. + * + *

Typically, the returned list will be just the methods passed in parameter but sorted + * differently, but it can actually have any size (it can be empty, it can be of the same size as + * the original list or it can contain more methods). + * + *

The {@link ITestContext} is passed in the intercept method so that implementers + * can set user values (using {@link ITestContext#setAttribute(String, Object)}), which they can + * then look up later while generating the reports. + * + * @author cbeust + */ +public interface IMethodInterceptor extends ITestNGListener { + + List intercept(List methods, ITestContext context); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IMethodSelector.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IMethodSelector.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IMethodSelector.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IMethodSelector.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,29 @@ +package org.testng; + +import java.util.List; + +/** + * This interface is used to augment or replace TestNG's algorithm to decide whether a test method + * should be included in a test run. + */ +public interface IMethodSelector { + + /** + * @param context The selector context. The implementation of this method can invoke + * setHalted(true) to indicate that no other Method Selector should be invoked by TestNG after + * this one. Additionally, this implementation can manipulate the Map object returned by + * getUserData(). + * @param method The test method + * @param isTestMethod true if this is a @Test method, false if it's a configuration method + * @return true if this method should be included in the test run, false otherwise + */ + boolean includeMethod(IMethodSelectorContext context, ITestNGMethod method, boolean isTestMethod); + + /** + * Invoked when all the test methods are known so that the method selector can perform additional + * work, such as adding the transitive closure of all the groups being included and depended upon. + * + * @param testMethods The test methods + */ + void setTestMethods(List testMethods); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IMethodSelectorContext.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IMethodSelectorContext.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IMethodSelectorContext.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IMethodSelectorContext.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,31 @@ +package org.testng; + +import java.util.Map; + +/** + * An implementation of this interface is passed to all the Method Selectors when their + * includeMethod() is invoked. Method selectors can invoke any method of this context at that time. + * + *

Created on Jan 3, 2007 + * + * @author Cedric Beust + */ +public interface IMethodSelectorContext { + + /** @return true if no more Method Selectors should be invoked after the current one. */ + boolean isStopped(); + + /** + * Indicate that no other Method Selectors should be invoked after the current one if stopped is + * false. + * + * @param stopped The value + */ + void setStopped(boolean stopped); + + /** + * @return a Map that can be freely manipulated by the Method Selector. This can be used to share + * information among several Method Selectors. + */ + Map getUserData(); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IModule.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IModule.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IModule.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IModule.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,11 @@ +package org.testng; + +import com.google.inject.Module; + +/** + * This interface provides {@link Module} to implicitly add to the Guice context. Classes that + * implement this interface are instantiated with {@link java.util.ServiceLoader ServiceLoader}. + */ +public interface IModule { + Module getModule(); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IModuleFactory.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IModuleFactory.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IModuleFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IModuleFactory.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package org.testng; + +import com.google.inject.Module; + +/** + * This interface is used by the moduleFactory attribute of the @Guice annotation. It allows users + * to use different Guice modules based on the test class waiting to be injected. + */ +public interface IModuleFactory { + + /** + * @param context The current test context + * @param testClass The test class + * @return The Guice module that should be used to get an instance of this test class. + */ + Module createModule(ITestContext context, Class testClass); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IObjectFactory.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IObjectFactory.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IObjectFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IObjectFactory.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,12 @@ +package org.testng; + +/** + * Factory used to create all test instances. This factory is passed the constructor along with the + * parameters that TestNG calculated based on the environment (@Parameters, etc...). + * + * @see IObjectFactory2 + * @since 5.6 + * @deprecated - This interface stands deprecated as of TestNG 7.5.0 + */ +@Deprecated +public interface IObjectFactory extends ITestObjectFactory {} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IObjectFactory2.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IObjectFactory2.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IObjectFactory2.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IObjectFactory2.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,23 @@ +package org.testng; + +/** + * Factory used to create all test instances. This object factory only receives the class in + * parameter. + * + * @see org.testng.ITestObjectFactory + * @since 5.14.6 + * @deprecated - This interface stands deprecated as of TestNG 7.5.0 + */ +@Deprecated +public interface IObjectFactory2 extends ITestObjectFactory { + + /** + * @deprecated - This interface stands deprecated as of TestNG 7.5.0 + * @param cls - The class for which a new instance is to be created + * @return - The newly created object. + */ + @Deprecated + default Object newInstance(Class cls) { + return newInstance(cls, new Object[0]); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IReporter.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IReporter.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IReporter.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IReporter.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,38 @@ +package org.testng; + +import java.util.List; +import org.testng.reporters.IReporterConfig; +import org.testng.reporters.PojoReporterConfig; +import org.testng.xml.XmlSuite; + +/** + * This interface can be implemented by clients to generate a report. Its method generateReport() + * will be invoked after all the suite have run and the parameters give all the test results that + * happened during that run. + */ +public interface IReporter extends ITestNGListener { + /** + * Generate a report for the given suites into the specified output directory. + * + * @param xmlSuites The list of XmlSuite + * @param suites The list of ISuite + * @param outputDirectory The output directory + */ + default void generateReport( + List xmlSuites, List suites, String outputDirectory) { + // not implemented + } + + /** + * Get the reporter configuration object. + * + *

NOTE: Reporter configuration objects must adhere to the JavaBean object conventions, + * providing getter and setter methods that conform to standard naming rules. This enables {@link + * org.testng.internal.ReporterConfig} to serialize, deserialize, and instantiate the reporter. + * + * @return reporter configuration object + */ + default IReporterConfig getConfig() { + return new PojoReporterConfig(this); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IResultMap.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IResultMap.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IResultMap.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IResultMap.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,21 @@ +package org.testng; + +import java.util.Collection; +import java.util.Set; + +public interface IResultMap { + + void addResult(ITestResult result); + + Set getResults(ITestNGMethod method); + + Set getAllResults(); + + void removeResult(ITestNGMethod m); + + void removeResult(ITestResult r); + + Collection getAllMethods(); + + int size(); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IRetryAnalyzer.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IRetryAnalyzer.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/IRetryAnalyzer.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/IRetryAnalyzer.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package org.testng; + +/** + * Interface to implement to be able to have a chance to retry a failed test. + * + * @author tocman@gmail.com (Jeremie Lenfant-Engelmann) + */ +public interface IRetryAnalyzer { + + /** + * Returns true if the test method has to be retried, false otherwise. + * + * @param result The result of the test method that just ran. + * @return true if the test method has to be retried, false otherwise. + */ + boolean retry(ITestResult result); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/ISuite.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/ISuite.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/ISuite.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/ISuite.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,94 @@ +package org.testng; + +import com.google.inject.Injector; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import org.testng.internal.annotations.IAnnotationFinder; +import org.testng.xml.XmlSuite; + +/** + * Interface defining a Test Suite. + * + * @author Cedric Beust, Aug 6, 2004 + */ +public interface ISuite extends IAttributes { + + /** @return the name of this suite. */ + String getName(); + + /** @return The results for this suite. */ + Map getResults(); + + /** @return The object factory used to create all test instances. */ + ITestObjectFactory getObjectFactory(); + + @Deprecated + /** @deprecated - This interface stands deprecated as of TestNG 7.5.0 */ + default IObjectFactory2 getObjectFactory2() { + return null; + } + + /** @return The output directory used for the reports. */ + String getOutputDirectory(); + + /** @return true if the tests must be run in parallel. */ + String getParallel(); + + String getParentModule(); + + String getGuiceStage(); + + /** + * @param parameterName The name of the parameter + * @return The value of this parameter, or null if none was specified. + */ + String getParameter(String parameterName); + + /** + * Retrieves the map of groups and their associated test methods. + * + * @return A map where the key is the group and the value is a list of methods used by this group. + */ + Map> getMethodsByGroups(); + + /** @return a list of all the methods that were invoked in this suite. */ + List getAllInvokedMethods(); + + /** @return All the methods that were not included in this test run. */ + Collection getExcludedMethods(); + + /** Triggers the start of running tests included in the suite. */ + void run(); + + /** + * @return The host where this suite was run, or null if it was run locally. The returned string + * has the form: host:port + */ + String getHost(); + + /** + * Retrieves the shared state for a suite. + * + * @return the share state of the current suite. + */ + SuiteRunState getSuiteState(); + + /** @return the annotation finder used for the specified type (JDK5 or javadoc) */ + IAnnotationFinder getAnnotationFinder(); + + /** @return The representation of the current XML suite file. */ + XmlSuite getXmlSuite(); + + void addListener(ITestNGListener listener); + + Injector getParentInjector(); + + void setParentInjector(Injector injector); + + /** + * @return the total number of methods found in this suite. The presence of factories or data + * providers might cause the actual number of test methods run be bigger than this list. + */ + List getAllMethods(); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/ISuiteListener.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/ISuiteListener.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/ISuiteListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/ISuiteListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,26 @@ +package org.testng; + +/** + * Listener for test suites. + * + * @author Cedric Beust, Aug 6, 2004 + */ +public interface ISuiteListener extends ITestNGListener { + /** + * This method is invoked before the SuiteRunner starts. + * + * @param suite The suite + */ + default void onStart(ISuite suite) { + // not implemented + } + + /** + * This method is invoked after the SuiteRunner has run all the tests in the suite. + * + * @param suite The suite + */ + default void onFinish(ISuite suite) { + // not implemented + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/ISuiteResult.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/ISuiteResult.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/ISuiteResult.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/ISuiteResult.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ +package org.testng; + +/** This class represents the result of a suite run. */ +public interface ISuiteResult { + + /** @return The testing context for these tests. */ + ITestContext getTestContext(); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/ITest.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/ITest.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/ITest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/ITest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package org.testng; + +/** + * If a test class implements this interface, it will receive a special treatment, such as having + * the test name displayed in the HTML reports. + * + * @author cbeust Jun 6, 2006 + */ +public interface ITest { + + /** + * The name of test instance(s). + * + * @return name associated with a particular instance of a test. + */ + String getTestName(); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/ITestClass.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/ITestClass.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/ITestClass.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/ITestClass.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,100 @@ +package org.testng; + +/** + * This class represents a test class: + * + *

    + *
  • The test methods + *
  • The configuration methods (test and method) + *
  • The class file + *
+ * + * Note that the methods returned by instances of this class are expected to be correct at runtime. + * In other words, they might differ from what the ITestMethodFinder returned since ITestClass will + * take into account the groups being included and excluded. + */ +public interface ITestClass extends IClass { + + /** + * Returns all the applicable test methods. + * + * @return All the applicable test methods. + */ + ITestNGMethod[] getTestMethods(); + + /** + * Returns all the methods that should be invoked before a test method is invoked. + * + * @return All the methods that should be invoked before a test method is invoked. + */ + ITestNGMethod[] getBeforeTestMethods(); + + /** + * Returns all the methods that should be invoked after a test method completes. + * + * @return All the methods that should be invoked after a test method completes. + */ + ITestNGMethod[] getAfterTestMethods(); + + /** + * Return all the methods that should be invoked after the test class has been created and before + * any of its test methods is invoked. + * + * @return All the methods that should be invoked after the test class has been created and before + * any of its test methods is invoked. + */ + ITestNGMethod[] getBeforeClassMethods(); + + /** + * Returns all the methods that should be invoked after all the tests have been run on this class. + * + * @return All the methods that should be invoked after all the tests have been run on this class. + */ + ITestNGMethod[] getAfterClassMethods(); + + /** + * Returns All the methods that should be invoked before the suite is run. + * + * @return All the methods that should be invoked before the suite is run. + */ + ITestNGMethod[] getBeforeSuiteMethods(); + + /** + * Returns all the methods that should be invoked after the suite has run. + * + * @return All the methods that should be invoked after the suite has run. + */ + ITestNGMethod[] getAfterSuiteMethods(); + + /** + * Returns all @Configuration methods that should be invoked before any others in the current + * test. + * + * @return all @Configuration methods that should be invoked before any others in the current + * test. + */ + ITestNGMethod[] getBeforeTestConfigurationMethods(); + + /** + * Returns all @Configuration methods that should be invoked last before any others in the + * current test. + * + * @return all @Configuration methods that should be invoked last before any others in the current + * test. + */ + ITestNGMethod[] getAfterTestConfigurationMethods(); + + /** + * Returns all @Configuration methods that should be invoked before certain groups. + * + * @return all @Configuration methods that should be invoked before certain groups. + */ + ITestNGMethod[] getBeforeGroupsMethods(); + + /** + * Returns all @Configuration methods that should be invoked after certain groups. + * + * @return all @Configuration methods that should be invoked after certain groups. + */ + ITestNGMethod[] getAfterGroupsMethods(); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/ITestClassFinder.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/ITestClassFinder.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/ITestClassFinder.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/ITestClassFinder.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,24 @@ +package org.testng; + +/** + * This class is used by TestNG to locate the test classes. + * + * @author Cedric Beust + */ +public interface ITestClassFinder { + /** + * @return An array of all the classes that contain test methods. This method usually returns an + * array of one class, which is the class on which TestNG is running, except in the following + * cases. - TestNG: the class contains an @Factory method - JUnit: the class contains a + * suite() method + */ + IClass[] findTestClasses(); + + /** + * Return the IClass for a given class + * + * @param cls The class + * @return The related IClass + */ + IClass getIClass(Class cls); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/ITestContext.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/ITestContext.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/ITestContext.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/ITestContext.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,82 @@ +package org.testng; + +import java.util.Collection; +import java.util.Date; +import org.testng.xml.XmlTest; + +/** + * This class defines a test context which contains all the information for a given test run. An + * instance of this context is passed to the test listeners so they can query information about + * their environment. + * + * @author Cedric Beust, Aug 6, 2004 + */ +public interface ITestContext extends IAttributes { + + /** @return The name of this test. */ + String getName(); + + /** @return When this test started running. */ + Date getStartDate(); + + /** @return When this test stopped running. */ + Date getEndDate(); + + /** @return A list of all the tests that run successfully. */ + IResultMap getPassedTests(); + + /** @return A list of all the tests that were skipped */ + IResultMap getSkippedTests(); + + /** + * @return A list of all the tests that failed but are being ignored because annotated with a + * successPercentage. + */ + IResultMap getFailedButWithinSuccessPercentageTests(); + + /** + * @return A map of all the tests that failed, indexed by their ITestNGMethod. + * @see org.testng.ITestNGMethod + */ + IResultMap getFailedTests(); + + /** @return All the groups that are included for this test run. */ + String[] getIncludedGroups(); + + /** @return All the groups that are excluded for this test run. */ + String[] getExcludedGroups(); + + /** @return Where the reports will be generated. */ + String getOutputDirectory(); + + /** @return The Suite object that was passed to the runner at start-up. */ + ISuite getSuite(); + + /** @return All the test methods that were run. */ + ITestNGMethod[] getAllTestMethods(); + + /** + * @return The host where this test was run, or null if it was run locally. The returned string + * has the form: host:port + */ + String getHost(); + + /** @return All the methods that were not included in this test run. */ + Collection getExcludedMethods(); + + /** @return The information about the successful configuration method invocations. */ + IResultMap getPassedConfigurations(); + + /** @return The information about the skipped configuration method invocations. */ + IResultMap getSkippedConfigurations(); + + /** @return The information about the failed configuration method invocations. */ + IResultMap getFailedConfigurations(); + + /** @return the current XmlTest. */ + XmlTest getCurrentXmlTest(); + + default IInjectorFactory getInjectorFactory() { + return null; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/ITestListener.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/ITestListener.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/ITestListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/ITestListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,91 @@ +package org.testng; + +/** + * A listener for test running. + * + * @author Cedric Beust + * @author Alexandru Popescu + * @author Hani Suleiman + */ +public interface ITestListener extends ITestNGListener { + /** + * Invoked each time before a test will be invoked. The ITestResult is only partially + * filled with the references to class, method, start millis and status. + * + * @param result the partially filled ITestResult + * @see ITestResult#STARTED + */ + default void onTestStart(ITestResult result) { + // not implemented + } + + /** + * Invoked each time a test succeeds. + * + * @param result ITestResult containing information about the run test + * @see ITestResult#SUCCESS + */ + default void onTestSuccess(ITestResult result) { + // not implemented + } + + /** + * Invoked each time a test fails. + * + * @param result ITestResult containing information about the run test + * @see ITestResult#FAILURE + */ + default void onTestFailure(ITestResult result) { + // not implemented + } + + /** + * Invoked each time a test is skipped. + * + * @param result ITestResult containing information about the run test + * @see ITestResult#SKIP + */ + default void onTestSkipped(ITestResult result) { + // not implemented + } + + /** + * Invoked each time a method fails but has been annotated with successPercentage and this failure + * still keeps it within the success percentage requested. + * + * @param result ITestResult containing information about the run test + * @see ITestResult#SUCCESS_PERCENTAGE_FAILURE + */ + default void onTestFailedButWithinSuccessPercentage(ITestResult result) { + // not implemented + } + + /** + * Invoked each time a test fails due to a timeout. + * + * @param result ITestResult containing information about the run test + */ + default void onTestFailedWithTimeout(ITestResult result) { + onTestFailure(result); + } + + /** + * Invoked before running all the test methods belonging to the classes inside the <test> + * tag and calling all their Configuration methods. + * + * @param context The test context + */ + default void onStart(ITestContext context) { + // not implemented + } + + /** + * Invoked after all the test methods belonging to the classes inside the <test> tag have + * run and all their Configuration methods have been called. + * + * @param context The test context + */ + default void onFinish(ITestContext context) { + // not implemented + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/ITestMethodFinder.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/ITestMethodFinder.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/ITestMethodFinder.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/ITestMethodFinder.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,67 @@ +package org.testng; + +import org.testng.xml.XmlTest; + +/** + * This interface allows to modify the strategy used by TestRunner to find its test methods. At the + * time of this writing, TestNG supports two different strategies: TestNG (using annotations to + * locate these methods) and JUnit (setUp()/tearDown() and all methods that start with "test" or + * have a suite() method). + * + * @author Cedric Beust, May 3, 2004 + */ +public interface ITestMethodFinder { + + /** + * @param cls The test class + * @param xmlTest The test node of xml + * @return All the applicable test methods. + */ + ITestNGMethod[] getTestMethods(Class cls, XmlTest xmlTest); + + /** + * @param cls The test class + * @return All the methods that should be invoked before a test method is invoked. + */ + ITestNGMethod[] getBeforeTestMethods(Class cls); + + /** + * @param cls The test class + * @return All the methods that should be invoked after a test method completes. + */ + ITestNGMethod[] getAfterTestMethods(Class cls); + + /** + * @param cls The test class + * @return All the methods that should be invoked after the test class has been created and before + * any of its test methods is invoked. + */ + ITestNGMethod[] getBeforeClassMethods(Class cls); + + /** + * @param cls The test class + * @return All the methods that should be invoked after the test class has been created and after + * all its test methods have completed. + */ + ITestNGMethod[] getAfterClassMethods(Class cls); + + /** + * @param cls The test class + * @return All the methods that should be invoked before the suite starts running. + */ + ITestNGMethod[] getBeforeSuiteMethods(Class cls); + + /** + * @param cls The test class + * @return All the methods that should be invoked after the suite has run all its tests. + */ + ITestNGMethod[] getAfterSuiteMethods(Class cls); + + ITestNGMethod[] getBeforeTestConfigurationMethods(Class testClass); + + ITestNGMethod[] getAfterTestConfigurationMethods(Class testClass); + + ITestNGMethod[] getBeforeGroupsConfigurationMethods(Class testClass); + + ITestNGMethod[] getAfterGroupsConfigurationMethods(Class testClass); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/ITestNGListener.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/ITestNGListener.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/ITestNGListener.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/ITestNGListener.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,8 @@ +package org.testng; + +/** + * This is a marker interface for all objects that can be passed as a -listener argument. + * + * @author cbeust + */ +public interface ITestNGListener {} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/ITestNGListenerFactory.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/ITestNGListenerFactory.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/ITestNGListenerFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/ITestNGListenerFactory.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,17 @@ +package org.testng; + +/** + * A factory used to create instances of ITestNGListener. Users can implement this interface in any + * of their test classes but there can be only one such instance. + */ +public interface ITestNGListenerFactory { + + /** + * Create and return an instance of the listener class passed in parameter. Return null if you + * want to use the default factory. + * + * @param listenerClass The class of listener to create + * @return The created listener + */ + ITestNGListener createListener(Class listenerClass); +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/ITestNGMethod.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/ITestNGMethod.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/ITestNGMethod.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/ITestNGMethod.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,272 @@ +package org.testng; + +import java.util.List; +import java.util.Map; +import java.util.concurrent.Callable; +import org.testng.annotations.CustomAttribute; +import org.testng.internal.ConstructorOrMethod; +import org.testng.internal.IParameterInfo; +import org.testng.xml.XmlTest; + +/** + * Describes a TestNG annotated method and the instance on which it will be invoked. + * + *

This interface is not meant to be implemented by users. + */ +public interface ITestNGMethod extends Cloneable { + + /** + * @return The real class on which this method was declared (can be different from + * getMethod().getDeclaringClass() if the test method was defined in a superclass). + */ + Class getRealClass(); + + ITestClass getTestClass(); + + /** + * Sets the test class having this method. This is not necessarily the declaring class. + * + * @param cls The test class having this method. + */ + void setTestClass(ITestClass cls); + + /** + * Returns the method name. This is needed for serialization because methods are not Serializable. + * + * @return the method name. + */ + String getMethodName(); + + Object getInstance(); + + /** + * Needed for serialization. + * + * @return The hashcode of instances + */ + long[] getInstanceHashCodes(); + + /** + * @return The groups this method belongs to, possibly added to the groups declared on the class. + */ + String[] getGroups(); + + /** + * @return The groups this method depends on, possibly added to the groups declared on the class. + */ + String[] getGroupsDependedUpon(); + + /** @return If a group was not found. */ + String getMissingGroup(); + + void setMissingGroup(String group); + + String[] getBeforeGroups(); + + String[] getAfterGroups(); + + /** + * @return The methods this method depends on, possibly added to the methods declared on the + * class. + */ + String[] getMethodsDependedUpon(); + + void addMethodDependedUpon(String methodName); + + /** @return true if this method was annotated with @Test */ + boolean isTest(); + + /** @return true if this method was annotated with @Configuration and beforeTestMethod = true */ + boolean isBeforeMethodConfiguration(); + + /** @return true if this method was annotated with @Configuration and beforeTestMethod = false */ + boolean isAfterMethodConfiguration(); + + /** @return true if this method was annotated with @Configuration and beforeClassMethod = true */ + boolean isBeforeClassConfiguration(); + + /** @return true if this method was annotated with @Configuration and beforeClassMethod = false */ + boolean isAfterClassConfiguration(); + + /** @return true if this method was annotated with @Configuration and beforeSuite = true */ + boolean isBeforeSuiteConfiguration(); + + /** @return true if this method was annotated with @Configuration and afterSuite = true */ + boolean isAfterSuiteConfiguration(); + + /** @return true if this method is a @BeforeTest (@Configuration beforeTest=true) */ + boolean isBeforeTestConfiguration(); + + /** @return true if this method is an @AfterTest (@Configuration afterTest=true) */ + boolean isAfterTestConfiguration(); + + boolean isBeforeGroupsConfiguration(); + + boolean isAfterGroupsConfiguration(); + + default boolean hasBeforeGroupsConfiguration() { + return false; + } + + default boolean hasAfterGroupsConfiguration() { + return false; + } + + /** @return The timeout in milliseconds. */ + long getTimeOut(); + + void setTimeOut(long timeOut); + + /** @return the number of times this method needs to be invoked. */ + int getInvocationCount(); + + void setInvocationCount(int count); + + /** @return the success percentage for this method (between 0 and 100). */ + int getSuccessPercentage(); + + /** @return The id of the thread this method was run in. */ + String getId(); + + void setId(String id); + + long getDate(); + + void setDate(long date); + + /** + * @param testClass The test class + * @return true if this ITestNGMethod can be invoked from within IClass. + */ + boolean canRunFromClass(IClass testClass); + + /** @return true if this method is alwaysRun=true */ + boolean isAlwaysRun(); + + /** @return the number of threads to be used when invoking the method on parallel */ + int getThreadPoolSize(); + + void setThreadPoolSize(int threadPoolSize); + + boolean getEnabled(); + + String getDescription(); + + void setDescription(String description); + + void incrementCurrentInvocationCount(); + + int getCurrentInvocationCount(); + + void setParameterInvocationCount(int n); + + int getParameterInvocationCount(); + + void setMoreInvocationChecker(Callable moreInvocationChecker); + + boolean hasMoreInvocation(); + + ITestNGMethod clone(); + + IRetryAnalyzer getRetryAnalyzer(ITestResult result); + + void setRetryAnalyzerClass(Class clazz); + + Class getRetryAnalyzerClass(); + + boolean skipFailedInvocations(); + + void setSkipFailedInvocations(boolean skip); + + /** @return The time under which all invocationCount methods need to complete by. */ + long getInvocationTimeOut(); + + boolean ignoreMissingDependencies(); + + void setIgnoreMissingDependencies(boolean ignore); + + /** + * Which invocation numbers of this method should be used (only applicable if it uses a data + * provider). If this value is an empty list, use all the values returned from the data provider. + * These values are read from the XML file in the <include invocationNumbers="..."> + * tag. + * + * @return The list of invocation numbers + */ + List getInvocationNumbers(); + + void setInvocationNumbers(List numbers); + + /** + * The list of invocation numbers that failed, which is only applicable for methods that have a + * data provider. + * + * @param number The invocation number that failed + */ + void addFailedInvocationNumber(int number); + + List getFailedInvocationNumbers(); + + /** + * The scheduling priority. Lower priorities get scheduled first. + * + * @return The priority value + */ + int getPriority(); + + void setPriority(int priority); + + int getInterceptedPriority(); + + void setInterceptedPriority(int priority); + + /** @return the XmlTest this method belongs to. */ + XmlTest getXmlTest(); + + ConstructorOrMethod getConstructorOrMethod(); + + /** + * @param test - The {@link XmlTest} object. + * @return the parameters found in the include tag, if any + */ + Map findMethodParameters(XmlTest test); + + /** + * getRealClass().getName() + "." + getMethodName() + * + * @return qualified name for this method + */ + String getQualifiedName(); + + default boolean isDataDriven() { + return false; + } + + /** + * @return - A {@link IParameterInfo} object that represents details about the parameters + * associated with the factory method. + */ + default IParameterInfo getFactoryMethodParamsInfo() { + return null; + } + + /** + * @return - An array of {@link CustomAttribute} that represents the custom attributes associated + * with a test. + */ + default CustomAttribute[] getAttributes() { + return new CustomAttribute[] {}; + } + + /** + * @return - An {@link IDataProviderMethod} for a data provider powered test method and null + * otherwise. + */ + default IDataProviderMethod getDataProviderMethod() { + return null; + } + + default Class[] getParameterTypes() { + return new Class[] {}; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/ITestObjectFactory.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/ITestObjectFactory.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/ITestObjectFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/ITestObjectFactory.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package org.testng; + +import java.lang.reflect.Constructor; +import org.testng.internal.objects.InstanceCreator; + +/** Parent interface of all the object factories. */ +public interface ITestObjectFactory { + + default T newInstance(Class cls, Object... parameters) { + return InstanceCreator.newInstance(cls, parameters); + } + + default T newInstance(String clsName, Object... parameters) { + return InstanceCreator.newInstance(clsName, parameters); + } + + default T newInstance(Constructor constructor, Object... parameters) { + return InstanceCreator.newInstance(constructor, parameters); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/ITestResult.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/ITestResult.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/ITestResult.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/ITestResult.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,131 @@ +package org.testng; + +import java.util.Collections; +import java.util.List; +import org.testng.internal.thread.ThreadTimeoutException; + +/** + * This class describes the result of a test. + * + * @author Cedric Beust, May 2, 2004 + * @version $Revision: 721 $, $Date: 2009-05-23 09:55:46 -0700 (Sat, 23 May 2009) $ + * @since May 2, 2004 + */ +public interface ITestResult extends IAttributes, Comparable { + + // Test status + int CREATED = -1; + int SUCCESS = 1; + int FAILURE = 2; + int SKIP = 3; + int SUCCESS_PERCENTAGE_FAILURE = 4; + int STARTED = 16; + + /** @return The status of this result, using one of the constants above. */ + int getStatus(); + + void setStatus(int status); + + /** @return The test method this result represents. */ + ITestNGMethod getMethod(); + + /** @return The parameters this method was invoked with. */ + Object[] getParameters(); + + void setParameters(Object[] parameters); + + /** @return The test class used this object is a result for. */ + IClass getTestClass(); + + /** + * @return The throwable that was thrown while running the method, or null if no exception was + * thrown. + */ + Throwable getThrowable(); + + void setThrowable(Throwable throwable); + + /** @return the start date for this test, in milliseconds. */ + long getStartMillis(); + + /** @return the end date for this test, in milliseconds. */ + long getEndMillis(); + + void setEndMillis(long millis); + + /** @return The name of this TestResult, typically identical to the name of the method. */ + String getName(); + + /** @return true if if this test run is a SUCCESS */ + boolean isSuccess(); + + /** + * @return The host where this suite was run, or null if it was run locally. The returned string + * has the form: host:port + */ + String getHost(); + + /** @return The instance on which this method was run. */ + Object getInstance(); + + /** + * @return - A parameter array that was passed to a factory method (or) an empty object array + * otherwise. + */ + Object[] getFactoryParameters(); + + /** + * @return The test name if this result's related instance implements ITest or + * use @Test(testName=...), null otherwise. + */ + String getTestName(); + + String getInstanceName(); + + /** @return the {@link ITestContext} for this test result. */ + ITestContext getTestContext(); + + /** @param name - The new name to be used as a test name */ + void setTestName(String name); + + /** + * @return - true if the test was retried again by an implementation of {@link + * IRetryAnalyzer} + */ + boolean wasRetried(); + + /** + * @param wasRetried - true if the test was retried and false otherwise. + */ + void setWasRetried(boolean wasRetried); + + /** + * @return - The list of either upstream method(s) or configuration method(s) whose failure led to + * the current method being skipped. An empty list is returned when the current method is not + * a skipped method. + */ + default List getSkipCausedBy() { + return Collections.emptyList(); + } + + /** + * @return - A unique id for the current JVM that represents a unique way of identifying a + * specific test method's result. + */ + String id(); + + /** + * @param result - The test result of a method + * @return - true if the test failure was due to a timeout. + */ + static boolean wasFailureDueToTimeout(ITestResult result) { + Throwable cause = result.getThrowable(); + while (cause != null && !cause.getClass().equals(Throwable.class)) { + if (cause instanceof ThreadTimeoutException) { + return true; + } + cause = cause.getCause(); + } + return false; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/Reporter.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/Reporter.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/Reporter.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/Reporter.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,177 @@ +package org.testng; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Vector; +import org.testng.collections.Lists; +import org.testng.collections.Maps; +import org.testng.internal.Utils; +import org.testng.util.Strings; + +/** + * This class is used for test methods to log messages that will be included in the HTML reports + * generated by TestNG.
+ *
+ * Implementation details
+ *
+ * The reporter keeps a combined output of strings (in m_output) and also a record of which method + * output which line. In order to do this, callers specify what the current method is with + * setCurrentTestResult() and the Reporter maintains a mapping of each test result with a list of + * integers. These integers are indices in the combined output (avoids duplicating the output). + * + *

Created on Nov 2, 2005 + * + * @author cbeust + */ +public class Reporter { + // When tests are run in parallel, each thread may be working with different + // 'current test result'. Also, this value should be inherited if the test code + // spawns its own thread. + private static final ThreadLocal m_currentTestResult = + new InheritableThreadLocal<>(); + + /** All output logged in a sequential order. */ + private static final List m_output = new Vector<>(); + + private static final Map> m_methodOutputMap = Maps.newHashMap(); + + private static boolean m_escapeHtml = false; + // This variable is responsible for persisting all output that is yet to be associated with any + // valid TestResult objects. + private static final ThreadLocal> m_orphanedOutput = new InheritableThreadLocal<>(); + + public static void setCurrentTestResult(ITestResult m) { + m_currentTestResult.set(m); + } + + public static List getOutput() { + return m_output; + } + + /** Erase the content of all the output generated so far. */ + public static void clear() { + m_methodOutputMap.clear(); + m_output.clear(); + } + + /** @return If true, use HTML entities for special HTML characters (<, >, &, ...). */ + public static boolean getEscapeHtml() { + return m_escapeHtml; + } + + /** + * @param escapeHtml If true, use HTML entities for special HTML characters (<, >, &, + * ...). + */ + public static void setEscapeHtml(boolean escapeHtml) { + m_escapeHtml = escapeHtml; + } + + private static synchronized void log(String s, ITestResult m) { + // Escape for the HTML reports. + if (m_escapeHtml) { + s = Strings.escapeHtml(s); + } + + if (m == null) { + // Persist the output temporarily into a Threadlocal String list. + if (m_orphanedOutput.get() == null) { + m_orphanedOutput.set(new ArrayList<>()); + } + m_orphanedOutput.get().add(s); + return; + } + + // Synchronization needed to ensure the line number and m_output are updated atomically. + int n = getOutput().size(); + + List lines = m_methodOutputMap.computeIfAbsent(m.id(), k -> Lists.newArrayList()); + + // Check if there was already some orphaned output for the current thread. + if (m_orphanedOutput.get() != null) { + n = n + m_orphanedOutput.get().size(); + getOutput().addAll(m_orphanedOutput.get()); + // Since we have already added all of the orphaned output to the current + // TestResult, let's clear it off. + m_orphanedOutput.remove(); + } + lines.add(n); + getOutput().add(s); + } + + /** + * Log the passed string to the HTML reports. + * + * @param s The message to log + */ + public static void log(String s) { + log(s, getCurrentTestResult()); + } + + /** + * Log the passed string to the HTML reports if the current verbosity is equal to or greater than + * the one passed as a parameter. If logToStandardOut is true, the string will also be printed on + * standard out. + * + * @param s The message to log + * @param level The verbosity of this message + * @param logToStandardOut Whether to print this string on standard out too + */ + public static void log(String s, int level, boolean logToStandardOut) { + if (Utils.getVerbose() >= level) { + log(s, getCurrentTestResult()); + if (logToStandardOut) { + System.out.println(s); + } + } + } + + /** + * Log the passed string to the HTML reports. If logToStandardOut is true, the string will also be + * printed on standard out. + * + * @param s The message to log + * @param logToStandardOut Whether to print this string on standard out too + */ + public static void log(String s, boolean logToStandardOut) { + log(s, getCurrentTestResult()); + if (logToStandardOut) { + System.out.println(s); + } + } + /** + * Log the passed string to the HTML reports if the current verbosity is equal to or greater than + * the one passed as a parameter. + * + * @param s The message to log + * @param level The verbosity of this message + */ + public static void log(String s, int level) { + if (Utils.getVerbose() >= level) { + log(s, getCurrentTestResult()); + } + } + + /** @return the current test result. */ + public static ITestResult getCurrentTestResult() { + return m_currentTestResult.get(); + } + + public static synchronized List getOutput(ITestResult tr) { + List result = Lists.newArrayList(); + if (tr == null) { + // Guard against a possible NPE in scenarios wherein the test result object itself could be a + // null value. + return result; + } + List lines = m_methodOutputMap.get(tr.id()); + if (lines != null) { + for (Integer n : lines) { + result.add(getOutput().get(n)); + } + } + + return result; + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/SuiteRunState.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/SuiteRunState.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/SuiteRunState.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/SuiteRunState.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,20 @@ +package org.testng; + +import java.util.concurrent.atomic.AtomicBoolean; + +/** + * A state object that records the status of the suite run. Mainly used to figure out if there are + * any @BeforeSuite failures. + */ +public class SuiteRunState { + + private final AtomicBoolean m_hasFailures = new AtomicBoolean(); + + public void failed() { + m_hasFailures.set(true); + } + + public boolean isFailed() { + return m_hasFailures.get(); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/TestNGException.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/TestNGException.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/TestNGException.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/TestNGException.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package org.testng; + +/** The base class for all exceptions thrown by TestNG. */ +public class TestNGException extends RuntimeException { + + private static final long serialVersionUID = -422675971506425913L; + + public TestNGException(Throwable t) { + super(t); + } + + public TestNGException(String string) { + super("\n" + string); + } + + public TestNGException(String string, Throwable t) { + super("\n" + string, t); + } +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/annotations/AfterClass.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/AfterClass.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/annotations/AfterClass.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/AfterClass.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,80 @@ +package org.testng.annotations; + +import java.lang.annotation.Documented; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +@Retention(java.lang.annotation.RetentionPolicy.RUNTIME) +@Target(java.lang.annotation.ElementType.METHOD) +@Documented +public @interface AfterClass { + /** + * Whether methods on this class/method are enabled. + * + * @return true if enabled (true by default) + */ + boolean enabled() default true; + + /** + * The list of groups this class/method belongs to. + * + * @return the value + */ + String[] groups() default {}; + + /** + * The list of groups this method depends on. Every method member of one of these groups is + * guaranteed to have been invoked before this method. Furthermore, if any of these methods was + * not a SUCCESS, this test method will not be run and will be flagged as a SKIP. + * + * @return the value + */ + String[] dependsOnGroups() default {}; + + /** + * The list of methods this method depends on. There is no guarantee of the order in which the + * methods depended upon will be run, but you are guaranteed that all these methods will be run + * before the test method that contains this annotation is run. Furthermore, if any of these + * methods was not a SUCCESS, this test method will not be run and will be flagged as a SKIP. + * + *

If some of these methods have been overloaded, all the overloaded versions will be run. + * + * @return the value + */ + String[] dependsOnMethods() default {}; + + /** + * For before methods (beforeSuite, beforeTest, beforeTestClass and beforeTestMethod, but not + * beforeGroups): if set to true, this configuration method will be run regardless of what groups + * it belongs to.
+ * For after methods (afterSuite, afterClass, ...): if set to true, this configuration method will + * be run even if one or more methods invoked previously failed or was skipped. + * + * @return the value (default false) + */ + boolean alwaysRun() default false; + + /** + * If true, this @Configuration method will belong to groups specified in the @Test + * annotation on the class (if any). + * + * @return the value (default true) + */ + boolean inheritGroups() default true; + + /** + * The description for this method. The string used will appear in the HTML report and also on + * standard output if verbose >= 2. + * + * @return the value (default empty) + */ + String description() default ""; + + /** + * The maximum number of milliseconds this method should take. If it hasn't returned after this + * time, this method will fail and it will cause test methods depending on it to be skipped. + * + * @return the value (default 0) + */ + long timeOut() default 0; +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/annotations/AfterGroups.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/AfterGroups.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/annotations/AfterGroups.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/AfterGroups.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,90 @@ +package org.testng.annotations; + +import java.lang.annotation.Documented; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +@Retention(java.lang.annotation.RetentionPolicy.RUNTIME) +@Target(java.lang.annotation.ElementType.METHOD) +@Documented +public @interface AfterGroups { + /** + * The list of groups that this configuration method will run after. If specified, it overrides + * the list of groups provided through {@link #groups()} attribute. This method is guaranteed to + * run shortly after the last test method that belongs to any of these groups is invoked. + * + * @return the value + */ + String[] value() default {}; + + /** + * Whether methods on this class/method are enabled. + * + * @return the value (default true) + */ + boolean enabled() default true; + + /** + * The list of groups this class/method belongs to. The list also describes the groups that this + * configuration method will be run after (if no {@link #value()} attribute is defined). + * + * @return the value + */ + String[] groups() default {}; + + /** + * The list of groups this method depends on. Every method member of one of these groups is + * guaranteed to have been invoked before this method. Furthermore, if any of these methods was + * not a SUCCESS, this test method will not be run and will be flagged as a SKIP. + * + * @return the value + */ + String[] dependsOnGroups() default {}; + + /** + * The list of methods this method depends on. There is no guarantee of the order on which the + * methods depended upon will be run, but you are guaranteed that all these methods will be run + * before the test method that contains this annotation is run. Furthermore, if any of these + * methods was not a SUCCESS, this test method will not be run and will be flagged as a SKIP. + * + *

If some of these methods have been overloaded, all the overloaded versions will be run. + * + * @return the value + */ + String[] dependsOnMethods() default {}; + + /** + * For before methods (beforeSuite, beforeTest, beforeTestClass and beforeTestMethod, but not + * beforeGroups): if set to true, this configuration method will be run regardless of what groups + * it belongs to.
+ * For after methods (afterSuite, afterClass, ...): if set to true, this configuration method will + * be run even if one or more methods invoked previously failed or was skipped. + * + * @return the value (default false) + */ + boolean alwaysRun() default false; + + /** + * If true, this @Configuration method will belong to groups specified in the @Test + * annotation on the class (if any). + * + * @return the value (default false) + */ + boolean inheritGroups() default false; + + /** + * The description for this method. The string used will appear in the HTML report and also on + * standard output if verbose > 2. + * + * @return the value (default empty) + */ + String description() default ""; + + /** + * The maximum number of milliseconds this method should take. If it hasn't returned after this + * time, this method will fail and it will cause test methods depending on it to be skipped. + * + * @return the value (default 0) + */ + long timeOut() default 0; +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/annotations/AfterMethod.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/AfterMethod.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/annotations/AfterMethod.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/AfterMethod.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,102 @@ +package org.testng.annotations; + +import java.lang.annotation.Documented; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +@Retention(java.lang.annotation.RetentionPolicy.RUNTIME) +@Target(java.lang.annotation.ElementType.METHOD) +@Documented +public @interface AfterMethod { + /** + * Whether methods on this class/method are enabled. + * + * @return the value (default true) + */ + boolean enabled() default true; + + /** + * The list of groups this class/method belongs to. Note that even if the test method that was + * invoked belongs to a different group, all @AfterMethod methods will be invoked after it as long + * as they belong to groups that were selected to run at all. See {@link #onlyForGroups()} to + * select test method groups which this method will be invoked after. + * + * @return the value + */ + String[] groups() default {}; + + /** + * The list of groups this method depends on. Every method member of one of these groups is + * guaranteed to have been invoked before this method. Furthermore, if any of these methods was + * not a SUCCESS, this test method will not be run and will be flagged as a SKIP. + * + * @return the value + */ + String[] dependsOnGroups() default {}; + + /** + * The list of methods this method depends on. There is no guarantee of the order in which the + * methods depended upon will be run, but you are guaranteed that all these methods will be run + * before the test method that contains this annotation is run. Furthermore, if any of these + * methods was not a SUCCESS, this test method will not be run and will be flagged as a SKIP. + * + *

If some of these methods have been overloaded, all the overloaded versions will be run. + * + * @return the value + */ + String[] dependsOnMethods() default {}; + + /** + * Causes this method to be invoked only if the test method belongs to a listed group. It can be + * used if different cleanups are needed for different groups. Omitting this or setting it to an + * empty list will cause this method to run after every test method, regardless of which group it + * belongs to. Otherwise, this method is only invoked if the test method that was invoked belongs + * to one of the groups listed here. + * + * @return the value + */ + String[] onlyForGroups() default {}; + + /** + * For before methods (beforeSuite, beforeTest, beforeTestClass and beforeTestMethod, but not + * beforeGroups): if set to true, this configuration method will be run regardless of what groups + * it belongs to.
+ * For after methods (afterSuite, afterClass, ...): if set to true, this configuration method will + * be run even if one or more test methods invoked previously failed or was skipped. + * + * @return the value (default false) + */ + boolean alwaysRun() default false; + + /** + * If true, this @Configuration method will belong to groups specified in the @Test + * annotation on the class (if any). + * + * @return the value (default true) + */ + boolean inheritGroups() default true; + + /** + * The description for this method. The string used will appear in the HTML report and also on + * standard output if verbose > 2. + * + * @return the value (default empty) + */ + String description() default ""; + + /** + * If true and the @Test method that was just run has an invocationCount > 1, this AfterMethod + * will only be invoked once (after the last test invocation). + * + * @return the value (default false) + */ + boolean lastTimeOnly() default false; + + /** + * The maximum number of milliseconds this method should take. If it hasn't returned after this + * time, this method will fail and it will cause test methods depending on it to be skipped. + * + * @return the value (default 0) + */ + long timeOut() default 0; +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/annotations/AfterSuite.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/AfterSuite.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/annotations/AfterSuite.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/AfterSuite.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,80 @@ +package org.testng.annotations; + +import java.lang.annotation.Documented; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +@Retention(java.lang.annotation.RetentionPolicy.RUNTIME) +@Target(java.lang.annotation.ElementType.METHOD) +@Documented +public @interface AfterSuite { + /** + * Whether methods on this class/method are enabled. + * + * @return the value (default true) + */ + boolean enabled() default true; + + /** + * The list of groups this class/method belongs to. + * + * @return the value + */ + String[] groups() default {}; + + /** + * The list of groups this method depends on. Every method member of one of these groups is + * guaranteed to have been invoked before this method. Furthermore, if any of these methods was + * not a SUCCESS, this test method will not be run and will be flagged as a SKIP. + * + * @return the value + */ + String[] dependsOnGroups() default {}; + + /** + * The list of methods this method depends on. There is no guarantee of the order in which the + * methods depended upon will be run, but you are guaranteed that all these methods will be run + * before the test method that contains this annotation is run. Furthermore, if any of these + * methods was not a SUCCESS, this test method will not be run and will be flagged as a SKIP. + * + *

If some of these methods have been overloaded, all the overloaded versions will be run. + * + * @return the value + */ + String[] dependsOnMethods() default {}; + + /** + * For before methods (beforeSuite, beforeTest, beforeTestClass and beforeTestMethod, but not + * beforeGroups): if set to true, this configuration method will be run regardless of what groups + * it belongs to.
+ * For after methods (afterSuite, afterClass, ...): if set to true, this configuration method will + * be run even if one or more methods invoked previously failed or was skipped. + * + * @return the value (default false) + */ + boolean alwaysRun() default false; + + /** + * If true, this @Configuration method will belong to groups specified in the @Test + * annotation on the class (if any). + * + * @return the value (default true) + */ + boolean inheritGroups() default true; + + /** + * The description for this method. The string used will appear in the HTML report and also on + * standard output if verbose > 2. + * + * @return the value (default empty) + */ + String description() default ""; + + /** + * The maximum number of milliseconds this method should take. If it hasn't returned after this + * time, this method will fail and it will cause test methods depending on it to be skipped. + * + * @return the valude (default 0) + */ + long timeOut() default 0; +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/annotations/AfterTest.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/AfterTest.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/annotations/AfterTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/AfterTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,80 @@ +package org.testng.annotations; + +import java.lang.annotation.Documented; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +@Retention(java.lang.annotation.RetentionPolicy.RUNTIME) +@Target(java.lang.annotation.ElementType.METHOD) +@Documented +public @interface AfterTest { + /** + * Whether methods on this class/method are enabled. + * + * @return the value (default true) + */ + boolean enabled() default true; + + /** + * The list of groups this class/method belongs to. + * + * @return the value + */ + String[] groups() default {}; + + /** + * The list of groups this method depends on. Every method member of one of these groups is + * guaranteed to have been invoked before this method. Furthermore, if any of these methods was + * not a SUCCESS, this test method will not be run and will be flagged as a SKIP. + * + * @return the value + */ + String[] dependsOnGroups() default {}; + + /** + * The list of methods this method depends on. There is no guarantee of the order in which the + * methods depended upon will be run, but you are guaranteed that all these methods will be run + * before the test method that contains this annotation is run. Furthermore, if any of these + * methods was not a SUCCESS, this test method will not be run and will be flagged as a SKIP. + * + *

If some of these methods have been overloaded, all the overloaded versions will be run. + * + * @return the value + */ + String[] dependsOnMethods() default {}; + + /** + * For before methods (beforeSuite, beforeTest, beforeTestClass and beforeTestMethod, but not + * beforeGroups): if set to true, this configuration method will be run regardless of what groups + * it belongs to.
+ * For after methods (afterSuite, afterClass, ...): if set to true, this configuration method will + * be run even if one or more methods invoked previously failed or was skipped. + * + * @return the value (default false) + */ + boolean alwaysRun() default false; + + /** + * If true, this @Configuration method will belong to groups specified in the @Test + * annotation on the class (if any). + * + * @return the value (default true) + */ + boolean inheritGroups() default true; + + /** + * The description for this method. The string used will appear in the HTML report and also on + * standard output if verbose > 2. + * + * @return the value (default empty) + */ + String description() default ""; + + /** + * The maximum number of milliseconds this method should take. If it hasn't returned after this + * time, this method will fail and it will cause test methods depending on it to be skipped. + * + * @return the value (default 0) + */ + long timeOut() default 0; +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/annotations/BeforeClass.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/BeforeClass.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/annotations/BeforeClass.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/BeforeClass.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,80 @@ +package org.testng.annotations; + +import java.lang.annotation.Documented; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +@Retention(java.lang.annotation.RetentionPolicy.RUNTIME) +@Target(java.lang.annotation.ElementType.METHOD) +@Documented +public @interface BeforeClass { + /** + * Whether methods on this class/method are enabled. + * + * @return the value (default true) + */ + boolean enabled() default true; + + /** + * The list of groups this class/method belongs to. + * + * @return the value + */ + String[] groups() default {}; + + /** + * The list of groups this method depends on. Every method member of one of these groups is + * guaranteed to have been invoked before this method. Furthermore, if any of these methods was + * not a SUCCESS, this test method will not be run and will be flagged as a SKIP. + * + * @return the value + */ + String[] dependsOnGroups() default {}; + + /** + * The list of methods this method depends on. There is no guarantee on the order on which the + * methods depended upon will be run, but you are guaranteed that all these methods will be run + * before the test method that contains this annotation is run. Furthermore, if any of these + * methods was not a SUCCESS, this test method will not be run and will be flagged as a SKIP. + * + *

If some of these methods have been overloaded, all the overloaded versions will be run. + * + * @return the value + */ + String[] dependsOnMethods() default {}; + + /** + * For before methods (beforeSuite, beforeTest, beforeTestClass and beforeTestMethod, but not + * beforeGroups): If set to true, this configuration method will be run regardless of what groups + * it belongs to.
+ * For after methods (afterSuite, afterClass, ...): If set to true, this configuration method will + * be run even if one or more methods invoked previously failed or was skipped. + * + * @return the value (default false) + */ + boolean alwaysRun() default false; + + /** + * If true, this @Configuration method will belong to groups specified in the @Test + * annotation on the class (if any). + * + * @return the value (default true) + */ + boolean inheritGroups() default true; + + /** + * The description for this method. The string used will appear in the HTML report and also on + * standard output if verbose > 2. + * + * @return the value (default empty) + */ + String description() default ""; + + /** + * The maximum number of milliseconds this method should take. If it hasn't returned after this + * time, this method will fail and it will cause test methods depending on it to be skipped. + * + * @return the value (default 0) + */ + long timeOut() default 0; +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/annotations/BeforeGroups.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/BeforeGroups.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/annotations/BeforeGroups.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/BeforeGroups.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,90 @@ +package org.testng.annotations; + +import java.lang.annotation.Documented; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +@Retention(java.lang.annotation.RetentionPolicy.RUNTIME) +@Target(java.lang.annotation.ElementType.METHOD) +@Documented +public @interface BeforeGroups { + /** + * The list of groups that this configuration method will run before. If specified it overrides + * the list of groups provided through {@link #groups()} attribute. This method is guaranteed to + * run shortly before the first test method that belongs to any of these groups is invoked. + * + * @return the value + */ + String[] value() default {}; + + /** + * Whether methods on this class/method are enabled. + * + * @return the value (default true) + */ + boolean enabled() default true; + + /** + * The list of groups this class/method belongs to. This list also describes the groups that this + * configuration method will run before (if no {@link #value()} attribute is defined). + * + * @return the value + */ + String[] groups() default {}; + + /** + * The list of groups this method depends on. Every method member of one of these groups is + * guaranteed to have been invoked before this method. Furthermore, if any of these methods was + * not a SUCCESS, this test method will not be run and will be flagged as a SKIP. + * + * @return the value + */ + String[] dependsOnGroups() default {}; + + /** + * The list of methods this method depends on. There is no guarantee on the order on which the + * methods depended upon will be run, but you are guaranteed that all these methods will be run + * before the test method that contains this annotation is run. Furthermore, if any of these + * methods was not a SUCCESS, this test method will not be run and will be flagged as a SKIP. + * + *

If some of these methods have been overloaded, all the overloaded versions will be run. + * + * @return the value + */ + String[] dependsOnMethods() default {}; + + /** + * For before methods (beforeSuite, beforeTest, beforeTestClass and beforeTestMethod, but not + * beforeGroups): If set to true, this configuration method will be run regardless of what groups + * it belongs to.
+ * For after methods (afterSuite, afterClass, ...): If set to true, this configuration method will + * be run even if one or more methods invoked previously failed or was skipped. + * + * @return the value (default false) + */ + boolean alwaysRun() default false; + + /** + * If true, this @Configuration method will belong to groups specified in the @Test + * annotation on the class (if any). + * + * @return the value (default false) + */ + boolean inheritGroups() default false; + + /** + * The description for this method. The string used will appear in the HTML report and also on + * standard output if verbose > 2. + * + * @return the value (default empty) + */ + String description() default ""; + + /** + * The maximum number of milliseconds this method should take. If it hasn't returned after this + * time, this method will fail and it will cause test methods depending on it to be skipped. + * + * @return the value (default 0) + */ + long timeOut() default 0; +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/annotations/BeforeMethod.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/BeforeMethod.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/annotations/BeforeMethod.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/BeforeMethod.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,102 @@ +package org.testng.annotations; + +import java.lang.annotation.Documented; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +@Retention(java.lang.annotation.RetentionPolicy.RUNTIME) +@Target(java.lang.annotation.ElementType.METHOD) +@Documented +public @interface BeforeMethod { + /** + * Whether methods on this class/method are enabled. + * + * @return the value (default true) + */ + boolean enabled() default true; + + /** + * The list of groups this class/method belongs to. Note that even if the test method being + * invoked belongs to a different group, all @BeforeMethod methods will be invoked before it as + * long as they belong to groups that were selected to run at all. See {@link #onlyForGroups()} to + * select test method groups which this method will be invoked before. + * + * @return the value + */ + String[] groups() default {}; + + /** + * The list of groups this method depends on. Every method member of one of these groups is + * guaranteed to have been invoked before this method. Furthermore, if any of these methods was + * not a SUCCESS, this test method will not be run and will be flagged as a SKIP. + * + * @return the value + */ + String[] dependsOnGroups() default {}; + + /** + * The list of methods this method depends on. There is no guarantee on the order on which the + * methods depended upon will be run, but you are guaranteed that all these methods will be run + * before the test method that contains this annotation is run. Furthermore, if any of these + * methods was not a SUCCESS, this test method will not be run and will be flagged as a SKIP. + * + *

If some of these methods have been overloaded, all the overloaded versions will be run. + * + * @return the value + */ + String[] dependsOnMethods() default {}; + + /** + * Causes this method to be invoked only if the test method belongs to a listed group. It can be + * used if different setups are needed for different groups. Omitting this or setting it to an + * empty list will cause this method to run before every test method, regardless of which group it + * belongs to. Otherwise, this method is only invoked if the test method being invoked belongs to + * one of the groups listed here. + * + * @return the value + */ + String[] onlyForGroups() default {}; + + /** + * For before methods (beforeSuite, beforeTest, beforeTestClass and beforeTestMethod, but not + * beforeGroups): If set to true, this configuration method will be run regardless of what groups + * it belongs to.
+ * For after methods (afterSuite, afterClass, ...): If set to true, this configuration method will + * be run even if one or more methods invoked previously failed or was skipped. + * + * @return the value (default false) + */ + boolean alwaysRun() default false; + + /** + * If true, this @Configuration method will belong to groups specified in the @Test + * annotation on the class (if any). + * + * @return the value (default true) + */ + boolean inheritGroups() default true; + + /** + * The description for this method. The string used will appear in the HTML report and also on + * standard output if verbose >= 2. + * + * @return the value (default empty) + */ + String description() default ""; + + /** + * If true and the @Test method about to be run has an invocationCount > 1, this BeforeMethod + * will only be invoked once (before the first test invocation). + * + * @return the value (default false) + */ + boolean firstTimeOnly() default false; + + /** + * The maximum number of milliseconds this method should take. If it hasn't returned after this + * time, this method will fail and it will cause test methods depending on it to be skipped. + * + * @return the value (default 0) + */ + long timeOut() default 0; +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/annotations/BeforeSuite.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/BeforeSuite.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/annotations/BeforeSuite.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/BeforeSuite.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,80 @@ +package org.testng.annotations; + +import java.lang.annotation.Documented; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +@Retention(java.lang.annotation.RetentionPolicy.RUNTIME) +@Target(java.lang.annotation.ElementType.METHOD) +@Documented +public @interface BeforeSuite { + /** + * Whether methods on this class/method are enabled. + * + * @return the value (default true) + */ + boolean enabled() default true; + + /** + * The list of groups this class/method belongs to. + * + * @return the value + */ + String[] groups() default {}; + + /** + * The list of groups this method depends on. Every method member of one of these groups is + * guaranteed to have been invoked before this method. Furthermore, if any of these methods was + * not a SUCCESS, this test method will not be run and will be flagged as a SKIP. + * + * @return the value + */ + String[] dependsOnGroups() default {}; + + /** + * The list of methods this method depends on. There is no guarantee on the order on which the + * methods depended upon will be run, but you are guaranteed that all these methods will be run + * before the test method that contains this annotation is run. Furthermore, if any of these + * methods was not a SUCCESS, this test method will not be run and will be flagged as a SKIP. + * + *

If some of these methods have been overloaded, all the overloaded versions will be run. + * + * @return the value + */ + String[] dependsOnMethods() default {}; + + /** + * For before methods (beforeSuite, beforeTest, beforeTestClass and beforeTestMethod, but not + * beforeGroups): If set to true, this configuration method will be run regardless of what groups + * it belongs to.
+ * For after methods (afterSuite, afterClass, ...): If set to true, this configuration method will + * be run even if one or more methods invoked previously failed or was skipped. + * + * @return the value (default false) + */ + boolean alwaysRun() default false; + + /** + * If true, this @Configuration method will belong to groups specified in the @Test + * annotation on the class (if any). + * + * @return the value (default true) + */ + boolean inheritGroups() default true; + + /** + * The description for this method. The string used will appear in the HTML report and also on + * standard output if verbose >= 2. + * + * @return the value (default empty) + */ + String description() default ""; + + /** + * The maximum number of milliseconds this method should take. If it hasn't returned after this + * time, this method will fail and it will cause test methods depending on it to be skipped. + * + * @return the value (default 0) + */ + long timeOut() default 0; +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/annotations/BeforeTest.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/BeforeTest.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/annotations/BeforeTest.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/BeforeTest.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,80 @@ +package org.testng.annotations; + +import java.lang.annotation.Documented; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +@Retention(java.lang.annotation.RetentionPolicy.RUNTIME) +@Target(java.lang.annotation.ElementType.METHOD) +@Documented +public @interface BeforeTest { + /** + * Whether methods on this class/method are enabled. + * + * @return the value (default true) + */ + boolean enabled() default true; + + /** + * The list of groups this class/method belongs to. + * + * @return the value + */ + String[] groups() default {}; + + /** + * The list of groups this method depends on. Every method member of one of these groups is + * guaranteed to have been invoked before this method. Furthermore, if any of these methods was + * not a SUCCESS, this test method will not be run and will be flagged as a SKIP. + * + * @return the value + */ + String[] dependsOnGroups() default {}; + + /** + * The list of methods this method depends on. There is no guarantee on the order on which the + * methods depended upon will be run, but you are guaranteed that all these methods will be run + * before the test method that contains this annotation is run. Furthermore, if any of these + * methods was not a SUCCESS, this test method will not be run and will be flagged as a SKIP. + * + *

If some of these methods have been overloaded, all the overloaded versions will be run. + * + * @return the value + */ + String[] dependsOnMethods() default {}; + + /** + * For before methods (beforeSuite, beforeTest, beforeTestClass and beforeTestMethod, but not + * beforeGroups): If set to true, this configuration method will be run regardless of what groups + * it belongs to.
+ * For after methods (afterSuite, afterClass, ...): If set to true, this configuration method will + * be run even if one or more methods invoked previously failed or was skipped. + * + * @return the value (default false) + */ + boolean alwaysRun() default false; + + /** + * If true, this @Configuration method will belong to groups specified in the @Test + * annotation on the class (if any). + * + * @return the value (default true) + */ + boolean inheritGroups() default true; + + /** + * The description for this method. The string used will appear in the HTML report and also on + * standard output if verbose > 2. + * + * @return the value (default empty) + */ + String description() default ""; + + /** + * The maximum number of milliseconds this method should take. If it hasn't returned after this + * time, this method will fail and it will cause test methods depending on it to be skipped. + * + * @return the value (default 0) + */ + long timeOut() default 0; +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/annotations/CustomAttribute.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/CustomAttribute.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/annotations/CustomAttribute.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/CustomAttribute.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,19 @@ +package org.testng.annotations; + +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.ElementType.TYPE; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +/** Represents a means to add in custom attributes to @{@link Test} annotated tests. */ +@Retention(java.lang.annotation.RetentionPolicy.RUNTIME) +@Target({METHOD, TYPE}) +public @interface CustomAttribute { + + /** @return - The name for the custom attribute */ + String name(); + + /** @return - The custom attribute values as an array. */ + String[] values() default {}; +} diff -Nru jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/annotations/DataProvider.java jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/DataProvider.java --- jtreg7-7.3.1+1/testng/testng-core-api/src/main/java/org/testng/annotations/DataProvider.java 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/testng/testng-core-api/src/main/java/org/testng/annotations/DataProvider.java 2025-10-28 19:26:35.000000000 +0000 @@ -0,0 +1,51 @@ +package org.testng.annotations; + +import static java.lang.annotation.ElementType.METHOD; + +import java.lang.annotation.Documented; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +/** + * Mark a method as supplying data for a test method. + * + *

The {@link #name() name} defaults to the name of the annotated method. + * + *

The annotated method must return any of the following: + * + *