diff -Nru junit4-4.13.1/.classpath junit4-4.13.2/.classpath --- junit4-4.13.1/.classpath 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/.classpath 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ - - - - - - - - - - diff -Nru junit4-4.13.1/debian/changelog junit4-4.13.2/debian/changelog --- junit4-4.13.1/debian/changelog 2021-02-05 12:48:11.000000000 +0000 +++ junit4-4.13.2/debian/changelog 2021-11-21 22:28:37.000000000 +0000 @@ -1,3 +1,11 @@ +junit4 (4.13.2-1) unstable; urgency=medium + + * New upstream release + - Refreshed the patches + * Standards-Version updated to 4.6.0.1 + + -- Emmanuel Bourg Sun, 21 Nov 2021 23:28:37 +0100 + junit4 (4.13.1-2) unstable; urgency=medium * Fixed the build failure with OpenJDK 17 (Closes: #981830) diff -Nru junit4-4.13.1/debian/control junit4-4.13.2/debian/control --- junit4-4.13.1/debian/control 2021-02-05 12:15:28.000000000 +0000 +++ junit4-4.13.2/debian/control 2021-11-21 22:28:32.000000000 +0000 @@ -17,7 +17,7 @@ libhamcrest-java-doc, libmaven-javadoc-plugin-java, maven-debian-helper (>= 2.2) -Standards-Version: 4.5.1 +Standards-Version: 4.6.0.1 Vcs-Git: https://salsa.debian.org/java-team/junit4.git Vcs-Browser: https://salsa.debian.org/java-team/junit4 Homepage: http://www.junit.org diff -Nru junit4-4.13.1/debian/patches/exclude-dependency-sources.patch junit4-4.13.2/debian/patches/exclude-dependency-sources.patch --- junit4-4.13.1/debian/patches/exclude-dependency-sources.patch 2021-02-04 10:09:13.000000000 +0000 +++ junit4-4.13.2/debian/patches/exclude-dependency-sources.patch 2021-11-21 22:28:14.000000000 +0000 @@ -8,11 +8,9 @@ pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -diff --git a/pom.xml b/pom.xml -index 4287158..9dbc55c 100644 --- a/pom.xml +++ b/pom.xml -@@ -311,7 +311,7 @@ +@@ -314,7 +314,7 @@ 32m 128m true @@ -21,7 +19,7 @@ org.hamcrest:hamcrest-core:* -@@ -434,7 +434,7 @@ +@@ -437,7 +437,7 @@ 32m 128m true diff -Nru junit4-4.13.1/debian/patches/java17-compatibility.patch junit4-4.13.2/debian/patches/java17-compatibility.patch --- junit4-4.13.1/debian/patches/java17-compatibility.patch 2021-02-05 12:43:53.000000000 +0000 +++ junit4-4.13.2/debian/patches/java17-compatibility.patch 2021-11-21 22:28:14.000000000 +0000 @@ -4,7 +4,7 @@ Bug-Debian: https://bugs.debian.org/981830 --- a/pom.xml +++ b/pom.xml -@@ -530,14 +530,14 @@ +@@ -533,14 +533,14 @@ -Xlint:unchecked @@ -21,7 +21,7 @@ -@@ -547,7 +547,7 @@ +@@ -550,7 +550,7 @@ maven-javadoc-plugin @@ -30,7 +30,7 @@ -@@ -567,7 +567,7 @@ +@@ -570,7 +570,7 @@ maven-javadoc-plugin @@ -39,7 +39,7 @@ -@@ -577,7 +577,7 @@ +@@ -580,7 +580,7 @@ maven-javadoc-plugin diff -Nru junit4-4.13.1/debian/patches/Version.patch junit4-4.13.2/debian/patches/Version.patch --- junit4-4.13.1/debian/patches/Version.patch 2021-02-04 10:09:13.000000000 +0000 +++ junit4-4.13.2/debian/patches/Version.patch 2021-11-21 22:28:14.000000000 +0000 @@ -3,10 +3,6 @@ Subject: Version Forwarded: no ---- - src/main/java/junit/runner/Version.java | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - diff --git a/src/main/java/junit/runner/Version.java b/src/main/java/junit/runner/Version.java index 9f26384..81e07de 100644 --- a/src/main/java/junit/runner/Version.java @@ -15,8 +11,8 @@ } public static String id() { -- return "4.13.1-SNAPSHOT"; -+ return "4.13.1"; +- return "4.13.2-SNAPSHOT"; ++ return "4.13.2"; } public static void main(String[] args) { diff -Nru junit4-4.13.1/doc/ReleaseNotes4.13.1.md junit4-4.13.2/doc/ReleaseNotes4.13.1.md --- junit4-4.13.1/doc/ReleaseNotes4.13.1.md 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/doc/ReleaseNotes4.13.1.md 2021-02-13 16:30:49.000000000 +0000 @@ -1,5 +1,11 @@ ## Summary of changes in version 4.13.1 +# Rules + +### Security fix: `TemporaryFolder` now limits access to temporary folders on Java 1.7 or later + +A local information disclosure vulnerability in `TemporaryFolder` has been fixed. See the published [security advisory](https://github.com/junit-team/junit4/security/advisories/GHSA-269g-pwp5-87pp) for details. + # Test Runners ### [Pull request #1669:](https://github.com/junit-team/junit/pull/1669) Make `FrameworkField` constructor public diff -Nru junit4-4.13.1/doc/ReleaseNotes4.13.2.md junit4-4.13.2/doc/ReleaseNotes4.13.2.md --- junit4-4.13.1/doc/ReleaseNotes4.13.2.md 1970-01-01 00:00:00.000000000 +0000 +++ junit4-4.13.2/doc/ReleaseNotes4.13.2.md 2021-02-13 16:30:49.000000000 +0000 @@ -0,0 +1,38 @@ +## Summary of changes in version 4.13.2 + +# Rules + +### [Pull request #1687:](https://github.com/junit-team/junit/pull/1687) Mark ThreadGroups created by FailOnTimeout as daemon groups + +In JUnit 4.13 ([pull request #1517](https://github.com/junit-team/junit4/pull/1517)) an attempt was +made to fix leakage of the `ThreadGroup` instances created when a test is run with a timeout. That +change explicitly destroyed the `ThreadGroup` that was created for the time-limited test. Numerous +people reported problems that were caused by explicitly destroying the `ThreadGroup`. + +In this change, the code was updated to call `ThreadGroup.setDaemon(true)` instead of destroying the +ThreadGroup. + +### [Pull request $1691:](https://github.com/junit-team/junit/pull/1691) Only create ThreadGroups if FailOnTimeout.lookForStuckThread is true. + +In JUnit 4.12 ([pull request #742](https://github.com/junit-team/junit4/pull/742)) the `Timeout` +Rule was updated to optionally display the stacktrace of the thread that appears to be stuck +(enabled on an opt-in basis by passing `true` to `Timeout.Builder.lookForStuckThread(boolean)`). +When that change was made, time-limited tests were changed to start the new thread in a new +`ThreadGroup`, even if the test did not call `lookForStuckThread()`. This subtle change in +behavior resulted in visible behavior changes to some tests (for example, tests of code that uses +`java.beans.ThreadGroupContext`). + +In this change, the code is updated to only create a new `ThreadGroup` if the caller calls +`Timeout.Builder.lookForStuckThread(true)`. Tests with timeouts that do not make this call will +behave as they did in JUnit 4.11 (and more similar to tests that do not have a timeout). This +unfortunately could result in visible changes of tests written or updated since the 4.12 +release. If this change adversely affects your tests, you can create the `Timeout` rule via the +builder and call `Timeout.Builder.lookForStuckThread(true)`. + +# Exceptions + +### [Pull request #1654:](https://github.com/junit-team/junit/pull/1654) Fix for issue #1192: NotSerializableException with AssumptionViolatedException + +This change fixes an issue where `AssumptionViolatedException` instances could not be serialized +if they were created with a constructor that takes in an `org.hamcrest.Matcher` instance (these +constructors are used if you use one of the `assumeThat()` methods in `org.junit.Assume`). diff -Nru junit4-4.13.1/.github/workflows/main.yml junit4-4.13.2/.github/workflows/main.yml --- junit4-4.13.1/.github/workflows/main.yml 1970-01-01 00:00:00.000000000 +0000 +++ junit4-4.13.2/.github/workflows/main.yml 2021-02-13 16:30:49.000000000 +0000 @@ -0,0 +1,48 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + branches: + - '*' + +jobs: + + build-and-verify: + name: Build and verify (JDK ${{ matrix.java }}) + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + java: [6, 8, 11, 15, 17-ea] + steps: + - uses: actions/checkout@v2 + - name: Download Maven # Download with default JDK because OpenJDK 6 does not support TLS 1.2 + run: ./mvnw --version + - name: Set up JDK + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Build and verify + run: ./mvnw verify javadoc:javadoc site:site --batch-mode --errors --settings .github/workflows/settings.xml + + publish-snapshots: + name: Publish snapshot artifacts + if: github.event_name == 'push' && github.repository == 'junit-team/junit4' && github.ref == 'refs/heads/main' + needs: build-and-verify + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Download Maven # Download with default JDK because OpenJDK 6 does not support TLS 1.2 + run: ./mvnw --version + - name: Set up JDK + uses: actions/setup-java@v1 + with: + java-version: 6 + - name: Publish snapshot artifacts + env: + OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} + OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} + run: ./mvnw deploy --batch-mode --errors --activate-profiles generate-docs --settings .github/workflows/settings.xml diff -Nru junit4-4.13.1/.github/workflows/settings.xml junit4-4.13.2/.github/workflows/settings.xml --- junit4-4.13.1/.github/workflows/settings.xml 1970-01-01 00:00:00.000000000 +0000 +++ junit4-4.13.2/.github/workflows/settings.xml 2021-02-13 16:30:49.000000000 +0000 @@ -0,0 +1,22 @@ + + + + central + GCS Maven Central mirror + https://maven-central.storage-download.googleapis.com/maven2/ + google-maven-central + + + + + junit-snapshot-repo + ${env.OSSRH_USERNAME} + ${env.OSSRH_PASSWORD} + + + junit-releases-repo + ${env.OSSRH_USERNAME} + ${env.OSSRH_PASSWORD} + + + diff -Nru junit4-4.13.1/pom.xml junit4-4.13.2/pom.xml --- junit4-4.13.1/pom.xml 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/pom.xml 2021-02-13 16:30:49.000000000 +0000 @@ -4,7 +4,7 @@ junit junit - 4.13.1 + 4.13.2 JUnit JUnit is a unit testing framework for Java, created by Erich Gamma and Kent Beck. @@ -64,15 +64,15 @@ scm:git:git://github.com/junit-team/junit4.git scm:git:git@github.com:junit-team/junit4.git https://github.com/junit-team/junit4 - r4.13.1 + r4.13.2 github https://github.com/junit-team/junit4/issues - travis - https://travis-ci.org/junit-team/junit4 + github + https://github.com/junit-team/junit4/actions https://github.com/junit-team/junit4/wiki/Download-and-Install @@ -96,6 +96,9 @@ 1.5 2.19.1 1.3 + 1.4 + 2.6 + 2.10.3 ISO-8859-1 67893CC4 @@ -147,7 +150,7 @@ the project, requires only release versions of dependencies of other artifacts. --> maven-enforcer-plugin - 1.4 + ${enforcerPluginVersion} enforce-versions @@ -286,7 +289,7 @@ in jar archive target/junit-*-javadoc.jar. --> maven-javadoc-plugin - 2.10.3 + ${javadocPluginVersion} ${basedir}/src/main/javadoc/stylesheet.css protected @@ -345,7 +348,7 @@ maven-jar-plugin - 2.6 + ${jarPluginVersion} false @@ -408,7 +411,7 @@ maven-javadoc-plugin - 2.10.3 + ${javadocPluginVersion} javadoc/latest ${basedir}/src/main/javadoc/stylesheet.css @@ -556,7 +559,7 @@ java9 - [1.9,) + [1.9,12) @@ -581,6 +584,49 @@ + + + + java12 + + [12,) + + + + 1.7 + 3.0.0-M3 + 3.2.0 + 3.2.0 + + + + + maven-javadoc-plugin + + 1.7 + false + + + + maven-compiler-plugin + + + -Xdoclint:none + + + + + + + + + maven-javadoc-plugin + + 1.7 + false + + + diff -Nru junit4-4.13.1/.project junit4-4.13.2/.project --- junit4-4.13.1/.project 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/.project 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ - - - junit - - - - - - org.eclipse.jdt.core.javabuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.team.cvs.core.cvsnature - - diff -Nru junit4-4.13.1/README.md junit4-4.13.2/README.md --- junit4-4.13.1/README.md 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/README.md 2021-02-13 16:30:49.000000000 +0000 @@ -6,4 +6,4 @@ * [Download and Install guide](https://github.com/junit-team/junit4/wiki/Download-and-Install) * [Getting Started](https://github.com/junit-team/junit4/wiki/Getting-started) -[![Build Status](https://travis-ci.org/junit-team/junit4.svg?branch=main)](https://travis-ci.org/junit-team/junit4) +[![CI Status](https://github.com/junit-team/junit4/workflows/CI/badge.svg)](https://github.com/junit-team/junit4/actions) diff -Nru junit4-4.13.1/.settings/org.eclipse.jdt.core.prefs junit4-4.13.2/.settings/org.eclipse.jdt.core.prefs --- junit4-4.13.1/.settings/org.eclipse.jdt.core.prefs 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/.settings/org.eclipse.jdt.core.prefs 1970-01-01 00:00:00.000000000 +0000 @@ -1,357 +0,0 @@ -#Mon Oct 12 21:57:10 EDT 2009 -eclipse.preferences.version=1 -org.eclipse.jdt.core.codeComplete.argumentPrefixes= -org.eclipse.jdt.core.codeComplete.argumentSuffixes= -org.eclipse.jdt.core.codeComplete.fieldPrefixes=f -org.eclipse.jdt.core.codeComplete.fieldSuffixes= -org.eclipse.jdt.core.codeComplete.localPrefixes= -org.eclipse.jdt.core.codeComplete.localSuffixes= -org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= -org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.5 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.doc.comment.support=enabled -org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.autoboxing=ignore -org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning -org.eclipse.jdt.core.compiler.problem.deadCode=warning -org.eclipse.jdt.core.compiler.problem.deprecation=warning -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled -org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore -org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore -org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled -org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore -org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.forbiddenReference=error -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore -org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning -org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=disabled -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=disabled -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected -org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning -org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore -org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore -org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled -org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected -org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=no_tag -org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore -org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled -org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=protected -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning -org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore -org.eclipse.jdt.core.compiler.problem.nullReference=warning -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning -org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore -org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore -org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning -org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore -org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore -org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore -org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled -org.eclipse.jdt.core.compiler.problem.unusedImport=warning -org.eclipse.jdt.core.compiler.problem.unusedLabel=warning -org.eclipse.jdt.core.compiler.problem.unusedLocal=warning -org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning -org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.5 -org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled -org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,NORMAL,HIGH,NORMAL -org.eclipse.jdt.core.compiler.taskTags=TODO,REVISIT,HACK,QUESTION -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=0 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=1 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=false -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=true -org.eclipse.jdt.core.formatter.comment.format_source_code=true -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert -org.eclipse.jdt.core.formatter.comment.line_length=80 -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=80 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true -org.eclipse.jdt.core.formatter.tabulation.char=space -org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true diff -Nru junit4-4.13.1/.settings/org.eclipse.jdt.ui.prefs junit4-4.13.2/.settings/org.eclipse.jdt.ui.prefs --- junit4-4.13.1/.settings/org.eclipse.jdt.ui.prefs 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/.settings/org.eclipse.jdt.ui.prefs 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -#Tue Jul 22 09:31:38 PDT 2008 -eclipse.preferences.version=1 -formatter_profile=_junit -formatter_settings_version=11 -internal.default.compliance=default -org.eclipse.jdt.ui.exception.name=e -org.eclipse.jdt.ui.gettersetter.use.is=true -org.eclipse.jdt.ui.ignorelowercasenames=true -org.eclipse.jdt.ui.importorder=java;javax;com; -org.eclipse.jdt.ui.keywordthis=false -org.eclipse.jdt.ui.ondemandthreshold=99 -org.eclipse.jdt.ui.overrideannotation=true -org.eclipse.jdt.ui.text.custom_code_templates= diff -Nru junit4-4.13.1/src/main/java/junit/extensions/ActiveTestSuite.java junit4-4.13.2/src/main/java/junit/extensions/ActiveTestSuite.java --- junit4-4.13.1/src/main/java/junit/extensions/ActiveTestSuite.java 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/src/main/java/junit/extensions/ActiveTestSuite.java 2021-02-13 16:30:49.000000000 +0000 @@ -63,7 +63,7 @@ } } - synchronized public void runFinished() { + public synchronized void runFinished() { fActiveTestDeathCount++; notifyAll(); } diff -Nru junit4-4.13.1/src/main/java/junit/framework/Assert.java junit4-4.13.2/src/main/java/junit/framework/Assert.java --- junit4-4.13.1/src/main/java/junit/framework/Assert.java 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/src/main/java/junit/framework/Assert.java 2021-02-13 16:30:49.000000000 +0000 @@ -17,7 +17,7 @@ * Asserts that a condition is true. If it isn't it throws * an AssertionFailedError with the given message. */ - static public void assertTrue(String message, boolean condition) { + public static void assertTrue(String message, boolean condition) { if (!condition) { fail(message); } @@ -27,7 +27,7 @@ * Asserts that a condition is true. If it isn't it throws * an AssertionFailedError. */ - static public void assertTrue(boolean condition) { + public static void assertTrue(boolean condition) { assertTrue(null, condition); } @@ -35,7 +35,7 @@ * Asserts that a condition is false. If it isn't it throws * an AssertionFailedError with the given message. */ - static public void assertFalse(String message, boolean condition) { + public static void assertFalse(String message, boolean condition) { assertTrue(message, !condition); } @@ -43,14 +43,14 @@ * Asserts that a condition is false. If it isn't it throws * an AssertionFailedError. */ - static public void assertFalse(boolean condition) { + public static void assertFalse(boolean condition) { assertFalse(null, condition); } /** * Fails a test with the given message. */ - static public void fail(String message) { + public static void fail(String message) { if (message == null) { throw new AssertionFailedError(); } @@ -60,7 +60,7 @@ /** * Fails a test with no message. */ - static public void fail() { + public static void fail() { fail(null); } @@ -68,7 +68,7 @@ * Asserts that two objects are equal. If they are not * an AssertionFailedError is thrown with the given message. */ - static public void assertEquals(String message, Object expected, Object actual) { + public static void assertEquals(String message, Object expected, Object actual) { if (expected == null && actual == null) { return; } @@ -82,14 +82,14 @@ * Asserts that two objects are equal. If they are not * an AssertionFailedError is thrown. */ - static public void assertEquals(Object expected, Object actual) { + public static void assertEquals(Object expected, Object actual) { assertEquals(null, expected, actual); } /** * Asserts that two Strings are equal. */ - static public void assertEquals(String message, String expected, String actual) { + public static void assertEquals(String message, String expected, String actual) { if (expected == null && actual == null) { return; } @@ -103,7 +103,7 @@ /** * Asserts that two Strings are equal. */ - static public void assertEquals(String expected, String actual) { + public static void assertEquals(String expected, String actual) { assertEquals(null, expected, actual); } @@ -112,7 +112,7 @@ * an AssertionFailedError is thrown with the given message. If the expected * value is infinity then the delta value is ignored. */ - static public void assertEquals(String message, double expected, double actual, double delta) { + public static void assertEquals(String message, double expected, double actual, double delta) { if (Double.compare(expected, actual) == 0) { return; } @@ -125,7 +125,7 @@ * Asserts that two doubles are equal concerning a delta. If the expected * value is infinity then the delta value is ignored. */ - static public void assertEquals(double expected, double actual, double delta) { + public static void assertEquals(double expected, double actual, double delta) { assertEquals(null, expected, actual, delta); } @@ -134,7 +134,7 @@ * are not an AssertionFailedError is thrown with the given message. If the * expected value is infinity then the delta value is ignored. */ - static public void assertEquals(String message, float expected, float actual, float delta) { + public static void assertEquals(String message, float expected, float actual, float delta) { if (Float.compare(expected, actual) == 0) { return; } @@ -147,7 +147,7 @@ * Asserts that two floats are equal concerning a delta. If the expected * value is infinity then the delta value is ignored. */ - static public void assertEquals(float expected, float actual, float delta) { + public static void assertEquals(float expected, float actual, float delta) { assertEquals(null, expected, actual, delta); } @@ -155,14 +155,14 @@ * Asserts that two longs are equal. If they are not * an AssertionFailedError is thrown with the given message. */ - static public void assertEquals(String message, long expected, long actual) { + public static void assertEquals(String message, long expected, long actual) { assertEquals(message, Long.valueOf(expected), Long.valueOf(actual)); } /** * Asserts that two longs are equal. */ - static public void assertEquals(long expected, long actual) { + public static void assertEquals(long expected, long actual) { assertEquals(null, expected, actual); } @@ -170,14 +170,14 @@ * Asserts that two booleans are equal. If they are not * an AssertionFailedError is thrown with the given message. */ - static public void assertEquals(String message, boolean expected, boolean actual) { + public static void assertEquals(String message, boolean expected, boolean actual) { assertEquals(message, Boolean.valueOf(expected), Boolean.valueOf(actual)); } /** * Asserts that two booleans are equal. */ - static public void assertEquals(boolean expected, boolean actual) { + public static void assertEquals(boolean expected, boolean actual) { assertEquals(null, expected, actual); } @@ -185,14 +185,14 @@ * Asserts that two bytes are equal. If they are not * an AssertionFailedError is thrown with the given message. */ - static public void assertEquals(String message, byte expected, byte actual) { + public static void assertEquals(String message, byte expected, byte actual) { assertEquals(message, Byte.valueOf(expected), Byte.valueOf(actual)); } /** * Asserts that two bytes are equal. */ - static public void assertEquals(byte expected, byte actual) { + public static void assertEquals(byte expected, byte actual) { assertEquals(null, expected, actual); } @@ -200,14 +200,14 @@ * Asserts that two chars are equal. If they are not * an AssertionFailedError is thrown with the given message. */ - static public void assertEquals(String message, char expected, char actual) { + public static void assertEquals(String message, char expected, char actual) { assertEquals(message, Character.valueOf(expected), Character.valueOf(actual)); } /** * Asserts that two chars are equal. */ - static public void assertEquals(char expected, char actual) { + public static void assertEquals(char expected, char actual) { assertEquals(null, expected, actual); } @@ -215,14 +215,14 @@ * Asserts that two shorts are equal. If they are not * an AssertionFailedError is thrown with the given message. */ - static public void assertEquals(String message, short expected, short actual) { + public static void assertEquals(String message, short expected, short actual) { assertEquals(message, Short.valueOf(expected), Short.valueOf(actual)); } /** * Asserts that two shorts are equal. */ - static public void assertEquals(short expected, short actual) { + public static void assertEquals(short expected, short actual) { assertEquals(null, expected, actual); } @@ -230,21 +230,21 @@ * Asserts that two ints are equal. If they are not * an AssertionFailedError is thrown with the given message. */ - static public void assertEquals(String message, int expected, int actual) { + public static void assertEquals(String message, int expected, int actual) { assertEquals(message, Integer.valueOf(expected), Integer.valueOf(actual)); } /** * Asserts that two ints are equal. */ - static public void assertEquals(int expected, int actual) { + public static void assertEquals(int expected, int actual) { assertEquals(null, expected, actual); } /** * Asserts that an object isn't null. */ - static public void assertNotNull(Object object) { + public static void assertNotNull(Object object) { assertNotNull(null, object); } @@ -252,7 +252,7 @@ * Asserts that an object isn't null. If it is * an AssertionFailedError is thrown with the given message. */ - static public void assertNotNull(String message, Object object) { + public static void assertNotNull(String message, Object object) { assertTrue(message, object != null); } @@ -263,7 +263,7 @@ * * @param object Object to check or null */ - static public void assertNull(Object object) { + public static void assertNull(Object object) { if (object != null) { assertNull("Expected: but was: " + object.toString(), object); } @@ -273,7 +273,7 @@ * Asserts that an object is null. If it is not * an AssertionFailedError is thrown with the given message. */ - static public void assertNull(String message, Object object) { + public static void assertNull(String message, Object object) { assertTrue(message, object == null); } @@ -281,7 +281,7 @@ * Asserts that two objects refer to the same object. If they are not * an AssertionFailedError is thrown with the given message. */ - static public void assertSame(String message, Object expected, Object actual) { + public static void assertSame(String message, Object expected, Object actual) { if (expected == actual) { return; } @@ -292,7 +292,7 @@ * Asserts that two objects refer to the same object. If they are not * the same an AssertionFailedError is thrown. */ - static public void assertSame(Object expected, Object actual) { + public static void assertSame(Object expected, Object actual) { assertSame(null, expected, actual); } @@ -301,7 +301,7 @@ * refer to the same object an AssertionFailedError is thrown with the * given message. */ - static public void assertNotSame(String message, Object expected, Object actual) { + public static void assertNotSame(String message, Object expected, Object actual) { if (expected == actual) { failSame(message); } @@ -311,21 +311,21 @@ * Asserts that two objects do not refer to the same object. If they do * refer to the same object an AssertionFailedError is thrown. */ - static public void assertNotSame(Object expected, Object actual) { + public static void assertNotSame(Object expected, Object actual) { assertNotSame(null, expected, actual); } - static public void failSame(String message) { + public static void failSame(String message) { String formatted = (message != null) ? message + " " : ""; fail(formatted + "expected not same"); } - static public void failNotSame(String message, Object expected, Object actual) { + public static void failNotSame(String message, Object expected, Object actual) { String formatted = (message != null) ? message + " " : ""; fail(formatted + "expected same:<" + expected + "> was not:<" + actual + ">"); } - static public void failNotEquals(String message, Object expected, Object actual) { + public static void failNotEquals(String message, Object expected, Object actual) { fail(format(message, expected, actual)); } diff -Nru junit4-4.13.1/src/main/java/junit/runner/Version.java junit4-4.13.2/src/main/java/junit/runner/Version.java --- junit4-4.13.1/src/main/java/junit/runner/Version.java 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/src/main/java/junit/runner/Version.java 2021-02-13 16:30:49.000000000 +0000 @@ -9,7 +9,7 @@ } public static String id() { - return "4.13.1-SNAPSHOT"; + return "4.13.2-SNAPSHOT"; } public static void main(String[] args) { diff -Nru junit4-4.13.1/src/main/java/org/junit/experimental/results/ResultMatchers.java junit4-4.13.2/src/main/java/org/junit/experimental/results/ResultMatchers.java --- junit4-4.13.1/src/main/java/org/junit/experimental/results/ResultMatchers.java 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/src/main/java/org/junit/experimental/results/ResultMatchers.java 2021-02-13 16:30:49.000000000 +0000 @@ -4,7 +4,6 @@ import org.hamcrest.Description; import org.hamcrest.Matcher; import org.hamcrest.TypeSafeMatcher; -import org.junit.runner.notification.Failure; /** * Matchers on a PrintableResult, to enable JUnit self-tests. diff -Nru junit4-4.13.1/src/main/java/org/junit/internal/AssumptionViolatedException.java junit4-4.13.2/src/main/java/org/junit/internal/AssumptionViolatedException.java --- junit4-4.13.1/src/main/java/org/junit/internal/AssumptionViolatedException.java 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/src/main/java/org/junit/internal/AssumptionViolatedException.java 2021-02-13 16:30:49.000000000 +0000 @@ -1,5 +1,8 @@ package org.junit.internal; +import java.io.IOException; +import java.io.ObjectOutputStream; + import org.hamcrest.Description; import org.hamcrest.Matcher; import org.hamcrest.SelfDescribing; @@ -108,4 +111,29 @@ } } } + + /** + * Override default Java object serialization to correctly deal with potentially unserializable matchers or values. + * By not implementing readObject, we assure ourselves of backwards compatibility and compatibility with the + * standard way of Java serialization. + * + * @param objectOutputStream The outputStream to write our representation to + * @throws IOException When serialization fails + */ + private void writeObject(ObjectOutputStream objectOutputStream) throws IOException { + ObjectOutputStream.PutField putField = objectOutputStream.putFields(); + putField.put("fAssumption", fAssumption); + putField.put("fValueMatcher", fValueMatcher); + + // We have to wrap the matcher into a serializable form. + putField.put("fMatcher", SerializableMatcherDescription.asSerializableMatcher(fMatcher)); + + // We have to wrap the value inside a non-String class (instead of serializing the String value directly) as + // A Description will handle a String and non-String object differently (1st is surrounded by '"' while the + // latter will be surrounded by '<' '>'. Wrapping it makes sure that the description of a serialized and + // non-serialized instance produce the exact same description + putField.put("fValue", SerializableValueDescription.asSerializableValue(fValue)); + + objectOutputStream.writeFields(); + } } diff -Nru junit4-4.13.1/src/main/java/org/junit/internal/runners/statements/FailOnTimeout.java junit4-4.13.2/src/main/java/org/junit/internal/runners/statements/FailOnTimeout.java --- junit4-4.13.1/src/main/java/org/junit/internal/runners/statements/FailOnTimeout.java 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/src/main/java/org/junit/internal/runners/statements/FailOnTimeout.java 2021-02-13 16:30:49.000000000 +0000 @@ -120,29 +120,40 @@ public void evaluate() throws Throwable { CallableStatement callable = new CallableStatement(); FutureTask task = new FutureTask(callable); - ThreadGroup threadGroup = new ThreadGroup("FailOnTimeoutGroup"); + ThreadGroup threadGroup = threadGroupForNewThread(); Thread thread = new Thread(threadGroup, task, "Time-limited test"); - try { - thread.setDaemon(true); - thread.start(); - callable.awaitStarted(); - Throwable throwable = getResult(task, thread); - if (throwable != null) { - throw throwable; - } - } finally { - try { - thread.join(1); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - } + thread.setDaemon(true); + thread.start(); + callable.awaitStarted(); + Throwable throwable = getResult(task, thread); + if (throwable != null) { + throw throwable; + } + } + + private ThreadGroup threadGroupForNewThread() { + if (!lookForStuckThread) { + // Use the default ThreadGroup (usually the one from the current + // thread). + return null; + } + + // Create the thread in a new ThreadGroup, so if the time-limited thread + // becomes stuck, getStuckThread() can find the thread likely to be the + // culprit. + ThreadGroup threadGroup = new ThreadGroup("FailOnTimeoutGroup"); + if (!threadGroup.isDaemon()) { + // Mark the new ThreadGroup as a daemon thread group, so it will be + // destroyed after the time-limited thread completes. By ensuring the + // ThreadGroup is destroyed, any data associated with the ThreadGroup + // (ex: via java.beans.ThreadGroupContext) is destroyed. try { - threadGroup.destroy(); - } catch (IllegalThreadStateException e) { - // If a thread from the group is still alive, the ThreadGroup cannot be destroyed. - // Swallow the exception to keep the same behavior prior to this change. + threadGroup.setDaemon(true); + } catch (SecurityException e) { + // Swallow the exception to keep the same behavior as in JUnit 4.12. } } + return threadGroup; } /** diff -Nru junit4-4.13.1/src/main/java/org/junit/internal/SerializableMatcherDescription.java junit4-4.13.2/src/main/java/org/junit/internal/SerializableMatcherDescription.java --- junit4-4.13.1/src/main/java/org/junit/internal/SerializableMatcherDescription.java 1970-01-01 00:00:00.000000000 +0000 +++ junit4-4.13.2/src/main/java/org/junit/internal/SerializableMatcherDescription.java 2021-02-13 16:30:49.000000000 +0000 @@ -0,0 +1,47 @@ +package org.junit.internal; + +import java.io.Serializable; + +import org.hamcrest.BaseMatcher; +import org.hamcrest.Description; +import org.hamcrest.Matcher; +import org.hamcrest.StringDescription; + +/** + * This class exists solely to provide a serializable description of a matcher to be serialized as a field in + * {@link AssumptionViolatedException}. Being a {@link Throwable}, it is required to be {@link Serializable}, but most + * implementations of {@link Matcher} are not. This class works around that limitation as + * {@link AssumptionViolatedException} only every uses the description of the {@link Matcher}, while still retaining + * backwards compatibility with classes compiled against its class signature before 4.14 and/or deserialization of + * previously serialized instances. + */ +class SerializableMatcherDescription extends BaseMatcher implements Serializable { + + private final String matcherDescription; + + private SerializableMatcherDescription(Matcher matcher) { + matcherDescription = StringDescription.asString(matcher); + } + + public boolean matches(Object o) { + throw new UnsupportedOperationException("This Matcher implementation only captures the description"); + } + + public void describeTo(Description description) { + description.appendText(matcherDescription); + } + + /** + * Factory method that checks to see if the matcher is already serializable. + * @param matcher the matcher to make serializable + * @return The provided matcher if it is null or already serializable, + * the SerializableMatcherDescription representation of it if it is not. + */ + static Matcher asSerializableMatcher(Matcher matcher) { + if (matcher == null || matcher instanceof Serializable) { + return matcher; + } else { + return new SerializableMatcherDescription(matcher); + } + } +} diff -Nru junit4-4.13.1/src/main/java/org/junit/internal/SerializableValueDescription.java junit4-4.13.2/src/main/java/org/junit/internal/SerializableValueDescription.java --- junit4-4.13.1/src/main/java/org/junit/internal/SerializableValueDescription.java 1970-01-01 00:00:00.000000000 +0000 +++ junit4-4.13.2/src/main/java/org/junit/internal/SerializableValueDescription.java 2021-02-13 16:30:49.000000000 +0000 @@ -0,0 +1,38 @@ +package org.junit.internal; + +import java.io.Serializable; + +/** + * This class exists solely to provide a serializable description of a value to be serialized as a field in + * {@link AssumptionViolatedException}. Being a {@link Throwable}, it is required to be {@link Serializable}, but a + * value of type Object provides no guarantee to be serializable. This class works around that limitation as + * {@link AssumptionViolatedException} only every uses the string representation of the value, while still retaining + * backwards compatibility with classes compiled against its class signature before 4.14 and/or deserialization of + * previously serialized instances. + */ +class SerializableValueDescription implements Serializable { + private final String value; + + private SerializableValueDescription(Object value) { + this.value = String.valueOf(value); + } + + /** + * Factory method that checks to see if the value is already serializable. + * @param value the value to make serializable + * @return The provided value if it is null or already serializable, + * the SerializableValueDescription representation of it if it is not. + */ + static Object asSerializableValue(Object value) { + if (value == null || value instanceof Serializable) { + return value; + } else { + return new SerializableValueDescription(value); + } + } + + @Override + public String toString() { + return value; + } +} diff -Nru junit4-4.13.1/src/main/java/org/junit/internal/Throwables.java junit4-4.13.2/src/main/java/org/junit/internal/Throwables.java --- junit4-4.13.1/src/main/java/org/junit/internal/Throwables.java 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/src/main/java/org/junit/internal/Throwables.java 2021-02-13 16:30:49.000000000 +0000 @@ -232,7 +232,10 @@ "org.junit.runners.", "org.junit.experimental.runners.", "org.junit.internal.", - "junit.", + "junit.extensions", + "junit.framework", + "junit.runner", + "junit.textui", }; private static final String[] TEST_FRAMEWORK_TEST_METHOD_NAME_PREFIXES = { diff -Nru junit4-4.13.1/src/main/java/org/junit/runner/notification/RunNotifier.java junit4-4.13.2/src/main/java/org/junit/runner/notification/RunNotifier.java --- junit4-4.13.1/src/main/java/org/junit/runner/notification/RunNotifier.java 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/src/main/java/org/junit/runner/notification/RunNotifier.java 2021-02-13 16:30:49.000000000 +0000 @@ -78,7 +78,7 @@ fireTestFailures(safeListeners, failures); } - abstract protected void notifyListener(RunListener each) throws Exception; + protected abstract void notifyListener(RunListener each) throws Exception; } /** diff -Nru junit4-4.13.1/src/main/java/org/junit/runners/model/FrameworkField.java junit4-4.13.2/src/main/java/org/junit/runners/model/FrameworkField.java --- junit4-4.13.1/src/main/java/org/junit/runners/model/FrameworkField.java 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/src/main/java/org/junit/runners/model/FrameworkField.java 2021-02-13 16:30:49.000000000 +0000 @@ -2,7 +2,6 @@ import java.lang.annotation.Annotation; import java.lang.reflect.Field; -import java.util.List; import org.junit.runners.BlockJUnit4ClassRunner; diff -Nru junit4-4.13.1/src/main/java/org/junit/validator/AnnotationsValidator.java junit4-4.13.2/src/main/java/org/junit/validator/AnnotationsValidator.java --- junit4-4.13.1/src/main/java/org/junit/validator/AnnotationsValidator.java 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/src/main/java/org/junit/validator/AnnotationsValidator.java 2021-02-13 16:30:49.000000000 +0000 @@ -40,7 +40,7 @@ return validationErrors; } - private static abstract class AnnotatableValidator { + private abstract static class AnnotatableValidator { private static final AnnotationValidatorFactory ANNOTATION_VALIDATOR_FACTORY = new AnnotationValidatorFactory(); abstract Iterable getAnnotatablesForTestClass(TestClass testClass); diff -Nru junit4-4.13.1/src/test/java/junit/tests/framework/DoublePrecisionAssertTest.java junit4-4.13.2/src/test/java/junit/tests/framework/DoublePrecisionAssertTest.java --- junit4-4.13.1/src/test/java/junit/tests/framework/DoublePrecisionAssertTest.java 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/src/test/java/junit/tests/framework/DoublePrecisionAssertTest.java 2021-02-13 16:30:49.000000000 +0000 @@ -11,17 +11,19 @@ public void testAssertEqualsNaNFails() { try { assertEquals(1.234, Double.NaN, 0.0); - fail(); } catch (AssertionFailedError e) { + return; } + fail(); } public void testAssertNaNEqualsFails() { try { assertEquals(Double.NaN, 1.234, 0.0); - fail(); } catch (AssertionFailedError e) { + return; } + fail(); } public void testAssertNaNEqualsNaN() { @@ -31,17 +33,19 @@ public void testAssertPosInfinityNotEqualsNegInfinity() { try { assertEquals(Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY, 0.0); - fail(); } catch (AssertionFailedError e) { + return; } + fail(); } public void testAssertPosInfinityNotEquals() { try { assertEquals(Double.POSITIVE_INFINITY, 1.23, 0.0); - fail(); } catch (AssertionFailedError e) { + return; } + fail(); } public void testAssertPosInfinityEqualsInfinity() { diff -Nru junit4-4.13.1/src/test/java/junit/tests/framework/FloatAssertTest.java junit4-4.13.2/src/test/java/junit/tests/framework/FloatAssertTest.java --- junit4-4.13.1/src/test/java/junit/tests/framework/FloatAssertTest.java 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/src/test/java/junit/tests/framework/FloatAssertTest.java 2021-02-13 16:30:49.000000000 +0000 @@ -11,17 +11,19 @@ public void testAssertEqualsNaNFails() { try { assertEquals(1.234f, Float.NaN, 0.0); - fail(); } catch (AssertionFailedError e) { + return; } + fail(); } public void testAssertNaNEqualsFails() { try { assertEquals(Float.NaN, 1.234f, 0.0); - fail(); } catch (AssertionFailedError e) { + return; } + fail(); } public void testAssertNaNEqualsNaN() { @@ -31,17 +33,19 @@ public void testAssertPosInfinityNotEqualsNegInfinity() { try { assertEquals(Float.POSITIVE_INFINITY, Float.NEGATIVE_INFINITY, 0.0); - fail(); } catch (AssertionFailedError e) { + return; } + fail(); } public void testAssertPosInfinityNotEquals() { try { assertEquals(Float.POSITIVE_INFINITY, 1.23f, 0.0); - fail(); } catch (AssertionFailedError e) { + return; } + fail(); } public void testAssertPosInfinityEqualsInfinity() { @@ -53,11 +57,7 @@ } public void testAllInfinities() { - try { - assertEquals(Float.POSITIVE_INFINITY, Float.NEGATIVE_INFINITY, Float.POSITIVE_INFINITY); - fail(); - } catch (AssertionFailedError e) { - } + assertEquals(Float.POSITIVE_INFINITY, Float.NEGATIVE_INFINITY, Float.POSITIVE_INFINITY); } } diff -Nru junit4-4.13.1/src/test/java/junit/tests/runner/ResultTest.java junit4-4.13.2/src/test/java/junit/tests/runner/ResultTest.java --- junit4-4.13.1/src/test/java/junit/tests/runner/ResultTest.java 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/src/test/java/junit/tests/runner/ResultTest.java 2021-02-13 16:30:49.000000000 +0000 @@ -2,8 +2,6 @@ import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.ObjectInputStream; @@ -98,7 +96,7 @@ fromStream, resourceSerializationFormat); } - static public class AssumptionFailedTest { + public static class AssumptionFailedTest { @Test public void assumptionFailed() throws Exception { org.junit.Assume.assumeTrue(false); diff -Nru junit4-4.13.1/src/test/java/junit/tests/runner/TextRunnerTest.java junit4-4.13.2/src/test/java/junit/tests/runner/TextRunnerTest.java --- junit4-4.13.1/src/test/java/junit/tests/runner/TextRunnerTest.java 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/src/test/java/junit/tests/runner/TextRunnerTest.java 2021-02-13 16:30:49.000000000 +0000 @@ -32,7 +32,7 @@ Process p = Runtime.getRuntime().exec(cmd); InputStream i = p.getInputStream(); while ((i.read()) != -1) - ; //System.out.write(b); + ; assertTrue((p.waitFor() == 0) == success); if (success) { assertTrue(p.exitValue() == 0); diff -Nru junit4-4.13.1/src/test/java/junit/tests/SampleJUnit3Tests.java junit4-4.13.2/src/test/java/junit/tests/SampleJUnit3Tests.java --- junit4-4.13.1/src/test/java/junit/tests/SampleJUnit3Tests.java 1970-01-01 00:00:00.000000000 +0000 +++ junit4-4.13.2/src/test/java/junit/tests/SampleJUnit3Tests.java 2021-02-13 16:30:49.000000000 +0000 @@ -0,0 +1,51 @@ +package junit.tests; + +import junit.framework.TestCase; + +/** + * Container for sample JUnit3-style tests used in integration tests. + */ +public class SampleJUnit3Tests { + + public static class TestWithOneThrowingTestMethod extends TestCase { + + public void testAlwaysThrows() { + new FakeClassUnderTest().throwsExceptionWithoutCause(); + } + } + + public static class TestWithThrowingSetUpMethod extends TestCase { + + @Override + protected void setUp() throws Exception { + super.setUp(); + new FakeClassUnderTest().throwsExceptionWithoutCause(); + } + + public void testAlwaysPasses() { + } + } + + private static class FakeClassUnderTest { + + public void throwsExceptionWithCause() { + doThrowExceptionWithCause(); + } + + public void throwsExceptionWithoutCause() { + doThrowExceptionWithoutCause(); + } + + private void doThrowExceptionWithCause() { + try { + throwsExceptionWithoutCause(); + } catch (Exception e) { + throw new RuntimeException("outer", e); + } + } + + private void doThrowExceptionWithoutCause() { + throw new RuntimeException("cause"); + } + } +} diff -Nru junit4-4.13.1/src/test/java/org/junit/AssumptionViolatedExceptionTest.java junit4-4.13.2/src/test/java/org/junit/AssumptionViolatedExceptionTest.java --- junit4-4.13.1/src/test/java/org/junit/AssumptionViolatedExceptionTest.java 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/src/test/java/org/junit/AssumptionViolatedExceptionTest.java 2021-02-13 16:30:49.000000000 +0000 @@ -4,12 +4,27 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.notNullValue; import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.IsNot.not; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; import static org.junit.Assume.assumeThat; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.Serializable; + +import org.hamcrest.BaseMatcher; +import org.hamcrest.Description; import org.hamcrest.Matcher; import org.hamcrest.StringDescription; import org.junit.experimental.theories.DataPoint; import org.junit.experimental.theories.Theories; import org.junit.experimental.theories.Theory; +import org.junit.rules.TestName; import org.junit.runner.RunWith; @RunWith(Theories.class) @@ -23,6 +38,14 @@ @DataPoint public static Matcher NULL = null; + @Rule + public TestName name = new TestName(); + + private static final String MESSAGE = "Assumption message"; + private static Matcher SERIALIZABLE_IS_THREE = new SerializableIsThreeMatcher(); + private static final UnserializableClass UNSERIALIZABLE_VALUE = new UnserializableClass(); + private static final Matcher UNSERIALIZABLE_MATCHER = not(is(UNSERIALIZABLE_VALUE)); + @Theory public void toStringReportsMatcher(Integer actual, Matcher matcher) { assumeThat(matcher, notNullValue()); @@ -92,4 +115,93 @@ AssumptionViolatedException e = new AssumptionViolatedException("invalid number", cause); assertThat(e.getCause(), is(cause)); } + + @Test + public void assumptionViolatedExceptionWithoutValueAndMatcherCanBeReserialized_v4_13() + throws IOException, ClassNotFoundException { + assertReserializable(new AssumptionViolatedException(MESSAGE)); + } + + @Test + public void assumptionViolatedExceptionWithValueAndMatcherCanBeReserialized_v4_13() + throws IOException, ClassNotFoundException { + assertReserializable(new AssumptionViolatedException(MESSAGE, TWO, SERIALIZABLE_IS_THREE)); + } + + @Test + public void unserializableValueAndMatcherCanBeSerialized() throws IOException, ClassNotFoundException { + AssumptionViolatedException exception = new AssumptionViolatedException(MESSAGE, + UNSERIALIZABLE_VALUE, UNSERIALIZABLE_MATCHER); + + assertCanBeSerialized(exception); + } + + @Test + public void nullValueAndMatcherCanBeSerialized() throws IOException, ClassNotFoundException { + AssumptionViolatedException exception = new AssumptionViolatedException(MESSAGE); + + assertCanBeSerialized(exception); + } + + @Test + public void serializableValueAndMatcherCanBeSerialized() throws IOException, ClassNotFoundException { + AssumptionViolatedException exception = new AssumptionViolatedException(MESSAGE, + TWO, SERIALIZABLE_IS_THREE); + + assertCanBeSerialized(exception); + } + + private void assertCanBeSerialized(AssumptionViolatedException exception) + throws IOException, ClassNotFoundException { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + ObjectOutputStream oos = new ObjectOutputStream(baos); + oos.writeObject(exception); + + ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); + ObjectInputStream ois = new ObjectInputStream(bais); + AssumptionViolatedException fromStream = (AssumptionViolatedException) ois.readObject(); + + assertSerializedCorrectly(exception, fromStream); + } + + private void assertReserializable(AssumptionViolatedException expected) + throws IOException, ClassNotFoundException { + String resourceName = name.getMethodName(); + InputStream resource = getClass().getResourceAsStream(resourceName); + assertNotNull("Could not read resource " + resourceName, resource); + ObjectInputStream objectInputStream = new ObjectInputStream(resource); + AssumptionViolatedException fromStream = (AssumptionViolatedException) objectInputStream.readObject(); + + assertSerializedCorrectly(expected, fromStream); + } + + private void assertSerializedCorrectly( + AssumptionViolatedException expected, AssumptionViolatedException fromStream) { + assertNotNull(fromStream); + + // Exceptions don't implement equals() so we need to compare field by field + assertEquals("message", expected.getMessage(), fromStream.getMessage()); + assertEquals("description", StringDescription.asString(expected), StringDescription.asString(fromStream)); + // We don't check the stackTrace as that will be influenced by how the test was started + // (e.g. by maven or directly from IDE) + // We also don't check the cause as that should already be serialized correctly by the superclass + } + + private static class SerializableIsThreeMatcher extends BaseMatcher implements Serializable { + + public boolean matches(Object item) { + return IS_THREE.matches(item); + } + + public void describeTo(Description description) { + IS_THREE.describeTo(description); + } + } + + private static class UnserializableClass { + @Override + public String toString() { + return "I'm not serializable"; + } + } } diff -Nru junit4-4.13.1/src/test/java/org/junit/experimental/categories/CategoriesAndParameterizedTest.java junit4-4.13.2/src/test/java/org/junit/experimental/categories/CategoriesAndParameterizedTest.java --- junit4-4.13.1/src/test/java/org/junit/experimental/categories/CategoriesAndParameterizedTest.java 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/src/test/java/org/junit/experimental/categories/CategoriesAndParameterizedTest.java 2021-02-13 16:30:49.000000000 +0000 @@ -6,9 +6,7 @@ import org.junit.Assert; import org.junit.Test; -import org.junit.experimental.categories.Categories; import org.junit.experimental.categories.Categories.IncludeCategory; -import org.junit.experimental.categories.Category; import org.junit.runner.JUnitCore; import org.junit.runner.Result; import org.junit.runner.RunWith; diff -Nru junit4-4.13.1/src/test/java/org/junit/experimental/categories/CategoryTest.java junit4-4.13.2/src/test/java/org/junit/experimental/categories/CategoryTest.java --- junit4-4.13.1/src/test/java/org/junit/experimental/categories/CategoryTest.java 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/src/test/java/org/junit/experimental/categories/CategoryTest.java 2021-02-13 16:30:49.000000000 +0000 @@ -1,28 +1,27 @@ package org.junit.experimental.categories; +import static java.lang.String.format; import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.AnyOf.anyOf; +import static org.hamcrest.core.Is.is; +import static org.hamcrest.core.IsEqual.equalTo; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import static org.junit.experimental.results.PrintableResult.testResult; -import static org.junit.experimental.results.ResultMatchers.isSuccessful; import static org.junit.experimental.results.ResultMatchers.failureCountIs; -import static org.hamcrest.core.AnyOf.anyOf; -import static org.hamcrest.core.Is.is; -import static org.hamcrest.core.IsEqual.equalTo; -import static java.lang.String.format; +import static org.junit.experimental.results.ResultMatchers.isSuccessful; import java.util.Collections; import java.util.HashSet; import java.util.Set; + import org.junit.Ignore; import org.junit.Test; -import org.junit.experimental.categories.Categories; import org.junit.experimental.categories.Categories.CategoryFilter; import org.junit.experimental.categories.Categories.ExcludeCategory; import org.junit.experimental.categories.Categories.IncludeCategory; -import org.junit.experimental.categories.Category; import org.junit.runner.JUnitCore; import org.junit.runner.Request; import org.junit.runner.Result; @@ -412,7 +411,7 @@ } @Category(SlowTests.class) - public static abstract class Ancestor{} + public abstract static class Ancestor{} public static class Inherited extends Ancestor { @Test diff -Nru junit4-4.13.1/src/test/java/org/junit/experimental/categories/CategoryValidatorTest.java junit4-4.13.2/src/test/java/org/junit/experimental/categories/CategoryValidatorTest.java --- junit4-4.13.1/src/test/java/org/junit/experimental/categories/CategoryValidatorTest.java 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/src/test/java/org/junit/experimental/categories/CategoryValidatorTest.java 2021-02-13 16:30:49.000000000 +0000 @@ -10,8 +10,6 @@ import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; -import org.junit.experimental.categories.Category; -import org.junit.experimental.categories.CategoryValidator; import org.junit.runners.model.FrameworkMethod; import org.junit.runners.model.TestClass; diff -Nru junit4-4.13.1/src/test/java/org/junit/experimental/categories/JavadocTest.java junit4-4.13.2/src/test/java/org/junit/experimental/categories/JavadocTest.java --- junit4-4.13.1/src/test/java/org/junit/experimental/categories/JavadocTest.java 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/src/test/java/org/junit/experimental/categories/JavadocTest.java 2021-02-13 16:30:49.000000000 +0000 @@ -1,18 +1,16 @@ package org.junit.experimental.categories; +import static org.hamcrest.core.Is.is; +import static org.junit.Assert.assertThat; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + import org.junit.Test; -import org.junit.experimental.categories.Categories; -import org.junit.experimental.categories.Category; import org.junit.runner.JUnitCore; import org.junit.runner.Result; import org.junit.runner.RunWith; import org.junit.runners.Suite; -import static org.hamcrest.core.Is.is; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - /** * @author tibor17 * @version 4.12 diff -Nru junit4-4.13.1/src/test/java/org/junit/experimental/categories/MultiCategoryTest.java junit4-4.13.2/src/test/java/org/junit/experimental/categories/MultiCategoryTest.java --- junit4-4.13.1/src/test/java/org/junit/experimental/categories/MultiCategoryTest.java 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/src/test/java/org/junit/experimental/categories/MultiCategoryTest.java 2021-02-13 16:30:49.000000000 +0000 @@ -1,19 +1,17 @@ package org.junit.experimental.categories; -import org.junit.Test; -import org.junit.experimental.categories.Categories; -import org.junit.experimental.categories.Category; -import org.junit.runner.JUnitCore; -import org.junit.runner.Result; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; - import static org.hamcrest.core.Is.is; import static org.hamcrest.core.IsEqual.equalTo; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertThat; import static org.junit.Assert.fail; +import org.junit.Test; +import org.junit.runner.JUnitCore; +import org.junit.runner.Result; +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + /** * @author tibor17 * @version 4.12 diff -Nru junit4-4.13.1/src/test/java/org/junit/internal/runners/statements/FailOnTimeoutTest.java junit4-4.13.2/src/test/java/org/junit/internal/runners/statements/FailOnTimeoutTest.java --- junit4-4.13.1/src/test/java/org/junit/internal/runners/statements/FailOnTimeoutTest.java 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/src/test/java/org/junit/internal/runners/statements/FailOnTimeoutTest.java 2021-02-13 16:30:49.000000000 +0000 @@ -4,182 +4,155 @@ import static java.lang.Math.atan; import static java.lang.System.currentTimeMillis; import static java.lang.Thread.currentThread; +import static java.lang.Thread.interrupted; import static java.lang.Thread.sleep; import static java.util.concurrent.TimeUnit.MILLISECONDS; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNotSame; import static org.junit.Assert.assertSame; import static org.junit.Assert.assertThrows; import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; -import static org.junit.internal.runners.statements.FailOnTimeout.builder; +import static org.junit.Assume.assumeFalse; +import static org.junit.Assume.assumeTrue; import java.util.Arrays; -import java.util.Collection; -import java.util.HashSet; -import java.util.Set; -import java.util.concurrent.TimeUnit; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicReference; import org.junit.Test; import org.junit.function.ThrowingRunnable; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.junit.runners.Parameterized.Parameter; +import org.junit.runners.Parameterized.Parameters; import org.junit.runners.model.Statement; import org.junit.runners.model.TestTimedOutException; + /** * @author Asaf Ary, Stefan Birkner */ +@RunWith(Parameterized.class) public class FailOnTimeoutTest { - private static final long TIMEOUT = 100; - private static final long DURATION_THAT_EXCEEDS_TIMEOUT = 60 * 60 * 1000; //1 hour - private final TestStatement statement = new TestStatement(); + @Parameters(name = "lookingForStuckThread = {0}") + public static Iterable getParameters() { + return Arrays.asList(Boolean.TRUE, Boolean.FALSE); + } - private final FailOnTimeout failOnTimeout = builder().withTimeout(TIMEOUT, MILLISECONDS).build(statement); + @Parameter + public boolean lookingForStuckThread; @Test - public void throwsTestTimedOutException() { - assertThrows( - TestTimedOutException.class, - evaluateWithWaitDuration(DURATION_THAT_EXCEEDS_TIMEOUT)); + public void noExceptionIsThrownWhenWrappedStatementFinishesBeforeTimeoutWithoutThrowingException() + throws Throwable { + FailOnTimeout failOnTimeout = failAfter50Ms(new FastStatement()); + + failOnTimeout.evaluate(); + + // test is successful when no exception is thrown } @Test - public void throwExceptionWithNiceMessageOnTimeout() { - TestTimedOutException e = assertThrows( + public void throwsTestTimedOutExceptionWithMeaningfulMessage() { + Exception e = assertThrows( TestTimedOutException.class, - evaluateWithWaitDuration(DURATION_THAT_EXCEEDS_TIMEOUT)); - assertEquals("test timed out after 100 milliseconds", e.getMessage()); + run(failAfter50Ms(new RunForASecond()))); + assertEquals("test timed out after 50 milliseconds", e.getMessage()); } @Test public void sendUpExceptionThrownByStatement() { - RuntimeException exception = new RuntimeException(); - RuntimeException e = assertThrows( - RuntimeException.class, - evaluateWithException(exception)); + Exception exception = new RuntimeException(); + Exception e = assertThrows( + Exception.class, + run(failAfter50Ms(new Fail(exception)))); assertSame(exception, e); } @Test public void throwExceptionIfTheSecondCallToEvaluateNeedsTooMuchTime() throws Throwable { - evaluateWithWaitDuration(0).run(); + DelegatingStatement statement = new DelegatingStatement(); + FailOnTimeout failOnTimeout = failAfter50Ms(statement); + + statement.delegate = new FastStatement(); + failOnTimeout.evaluate(); + + statement.delegate = new RunForASecond(); assertThrows( TestTimedOutException.class, - evaluateWithWaitDuration(DURATION_THAT_EXCEEDS_TIMEOUT)); + run(failOnTimeout)); } @Test public void throwTimeoutExceptionOnSecondCallAlthoughFirstCallThrowsException() { - try { - evaluateWithException(new RuntimeException()).run(); - } catch (Throwable expected) { - } + DelegatingStatement statement = new DelegatingStatement(); + FailOnTimeout failOnTimeout = failAfter50Ms(statement); - TestTimedOutException e = assertThrows( + statement.delegate = new Fail(new AssertionError("first execution failed")); + assertThrows( + AssertionError.class, + run(failOnTimeout) + ); + + statement.delegate = new RunForASecond(); + assertThrows( TestTimedOutException.class, - evaluateWithWaitDuration(DURATION_THAT_EXCEEDS_TIMEOUT)); - assertEquals("test timed out after 100 milliseconds", e.getMessage()); + run(failOnTimeout)); } @Test public void throwsExceptionWithTimeoutValueAndTimeUnitSet() { TestTimedOutException e = assertThrows( TestTimedOutException.class, - evaluateWithWaitDuration(DURATION_THAT_EXCEEDS_TIMEOUT)); - assertEquals(TIMEOUT, e.getTimeout()); - assertEquals(TimeUnit.MILLISECONDS, e.getTimeUnit()); + run(failAfter50Ms(new RunForASecond()))); + assertEquals(50, e.getTimeout()); + assertEquals(MILLISECONDS, e.getTimeUnit()); } - private ThrowingRunnable evaluateWithException(final Exception exception) { - return new ThrowingRunnable() { - public void run() throws Throwable { - statement.nextException = exception; - statement.waitDuration = 0; - failOnTimeout.evaluate(); - } - }; - } - - private ThrowingRunnable evaluateWithWaitDuration(final long waitDuration) { - return new ThrowingRunnable() { - public void run() throws Throwable { - statement.nextException = null; - statement.waitDuration = waitDuration; - failOnTimeout.evaluate(); - } - }; - } - - private static final class TestStatement extends Statement { - long waitDuration; - - Exception nextException; + @Test + public void statementThatCanBeInterruptedIsStoppedAfterTimeout() throws Throwable { + // RunForASecond can be interrupted because it checks the Thread's + // interrupted flag. + RunForASecond runForASecond = new RunForASecond(); + assertThrows( + TestTimedOutException.class, + run(failAfter50Ms(runForASecond))); - @Override - public void evaluate() throws Throwable { - sleep(waitDuration); - if (nextException != null) { - throw nextException; - } - } + // Thread is explicitly stopped if it finishes faster than its + // pre-defined execution time of one second. + boolean stopped = runForASecond.finished.await(50, MILLISECONDS); + assertTrue("Thread has not been stopped.", stopped); } @Test - public void stopEndlessStatement() throws Throwable { - InfiniteLoopStatement infiniteLoop = new InfiniteLoopStatement(); - FailOnTimeout infiniteLoopTimeout = builder().withTimeout(TIMEOUT, MILLISECONDS).build(infiniteLoop); - try { - infiniteLoopTimeout.evaluate(); - } catch (Exception timeoutException) { - sleep(20); // time to interrupt the thread - int firstCount = InfiniteLoopStatement.COUNT; - sleep(20); // time to increment the count - assertTrue("Thread has not been stopped.", - firstCount == InfiniteLoopStatement.COUNT); - } - } - - private static final class InfiniteLoopStatement extends Statement { - private static int COUNT = 0; + public void stackTraceContainsRealCauseOfTimeout() { + TestTimedOutException timedOutException = assertThrows( + TestTimedOutException.class, + run(failAfter50Ms(new StuckStatement()))); - @Override - public void evaluate() throws Throwable { - while (true) { - sleep(10); // sleep in order to enable interrupting thread - ++COUNT; + StackTraceElement[] stackTrace = timedOutException.getStackTrace(); + boolean stackTraceContainsTheRealCauseOfTheTimeout = false; + boolean stackTraceContainsOtherThanTheRealCauseOfTheTimeout = false; + for (StackTraceElement element : stackTrace) { + String methodName = element.getMethodName(); + if ("theRealCauseOfTheTimeout".equals(methodName)) { + stackTraceContainsTheRealCauseOfTheTimeout = true; + } + if ("notTheRealCauseOfTheTimeout".equals(methodName)) { + stackTraceContainsOtherThanTheRealCauseOfTheTimeout = true; } } - } - - @Test - public void stackTraceContainsRealCauseOfTimeout() throws Throwable { - StuckStatement stuck = new StuckStatement(); - FailOnTimeout stuckTimeout = builder().withTimeout(TIMEOUT, MILLISECONDS).build(stuck); - try { - stuckTimeout.evaluate(); - // We must not get here, we expect a timeout exception - fail("Expected timeout exception"); - } catch (Exception timeoutException) { - StackTraceElement[] stackTrace = timeoutException.getStackTrace(); - boolean stackTraceContainsTheRealCauseOfTheTimeout = false; - boolean stackTraceContainsOtherThanTheRealCauseOfTheTimeout = false; - for (StackTraceElement element : stackTrace) { - String methodName = element.getMethodName(); - if ("theRealCauseOfTheTimeout".equals(methodName)) { - stackTraceContainsTheRealCauseOfTheTimeout = true; - } - if ("notTheRealCauseOfTheTimeout".equals(methodName)) { - stackTraceContainsOtherThanTheRealCauseOfTheTimeout = true; - } - } - assertTrue( - "Stack trace does not contain the real cause of the timeout", - stackTraceContainsTheRealCauseOfTheTimeout); - assertFalse( - "Stack trace contains other than the real cause of the timeout, which can be very misleading", - stackTraceContainsOtherThanTheRealCauseOfTheTimeout); - } + assertTrue( + "Stack trace does not contain the real cause of the timeout", + stackTraceContainsTheRealCauseOfTheTimeout); + assertFalse( + "Stack trace contains other than the real cause of the timeout, which can be very misleading", + stackTraceContainsOtherThanTheRealCauseOfTheTimeout); } private static final class StuckStatement extends Statement { @@ -209,21 +182,90 @@ } @Test - public void threadGroupNotLeaked() throws Throwable { - Collection groupsBeforeSet = subGroupsOfCurrentThread(); - - evaluateWithWaitDuration(0); - - for (ThreadGroup group: subGroupsOfCurrentThread()) { - if (!groupsBeforeSet.contains(group) && "FailOnTimeoutGroup".equals(group.getName())) { - fail("A 'FailOnTimeoutGroup' thread group remains referenced after the test execution."); + public void lookingForStuckThread_threadGroupNotLeaked() throws Throwable { + assumeTrue(lookingForStuckThread); + final AtomicReference innerThreadGroup = new AtomicReference(); + final AtomicReference innerThread = new AtomicReference(); + final ThreadGroup outerThreadGroup = currentThread().getThreadGroup(); + FailOnTimeout failOnTimeout = failAfter50Ms(new Statement() { + @Override + public void evaluate() { + innerThread.set(currentThread()); + ThreadGroup group = currentThread().getThreadGroup(); + assertNotSame("inner thread should use a different thread group", + outerThreadGroup, group); + innerThreadGroup.set(group); + assertTrue("the 'FailOnTimeoutGroup' thread group should be a daemon thread group", + group.isDaemon()); + } + }); + + failOnTimeout.evaluate(); + + assertNotNull("the Statement was never run", innerThread.get()); + innerThread.get().join(); + assertTrue("the 'FailOnTimeoutGroup' thread group should be destroyed after running the test", + innerThreadGroup.get().isDestroyed()); + } + + @Test + public void notLookingForStuckThread_usesSameThreadGroup() throws Throwable { + assumeFalse(lookingForStuckThread); + final AtomicBoolean statementWasExecuted = new AtomicBoolean(); + final ThreadGroup outerThreadGroup = currentThread().getThreadGroup(); + FailOnTimeout failOnTimeout = failAfter50Ms(new Statement() { + @Override + public void evaluate() { + statementWasExecuted.set(true); + ThreadGroup group = currentThread().getThreadGroup(); + assertSame("inner thread should use the same thread group", outerThreadGroup, group); + } + }); + + failOnTimeout.evaluate(); + + assertTrue("the Statement was never run", statementWasExecuted.get()); + } + + private FailOnTimeout failAfter50Ms(Statement statement) { + return FailOnTimeout.builder() + .withTimeout(50, MILLISECONDS) + .withLookingForStuckThread(lookingForStuckThread) + .build(statement); + } + + private ThrowingRunnable run(final FailOnTimeout failOnTimeout) { + return new ThrowingRunnable() { + public void run() throws Throwable { + failOnTimeout.evaluate(); } + }; + } + + private static class DelegatingStatement extends Statement { + volatile Statement delegate; + + @Override + public void evaluate() throws Throwable { + delegate.evaluate(); + } + } + + private static class FastStatement extends Statement { + @Override + public void evaluate() throws Throwable { } } - - private Collection subGroupsOfCurrentThread() { - ThreadGroup[] subGroups = new ThreadGroup[256]; - int numGroups = currentThread().getThreadGroup().enumerate(subGroups); - return Arrays.asList(subGroups).subList(0, numGroups); + + private static final class RunForASecond extends Statement { + final CountDownLatch finished = new CountDownLatch(1); + + @Override + public void evaluate() throws Throwable { + long timeout = currentTimeMillis() + 1000L; + while (!interrupted() && currentTimeMillis() < timeout) { + } + finished.countDown(); + } } } diff -Nru junit4-4.13.1/src/test/java/org/junit/internal/StackTracesTest.java junit4-4.13.2/src/test/java/org/junit/internal/StackTracesTest.java --- junit4-4.13.1/src/test/java/org/junit/internal/StackTracesTest.java 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/src/test/java/org/junit/internal/StackTracesTest.java 2021-02-13 16:30:49.000000000 +0000 @@ -6,7 +6,6 @@ import static org.junit.Assert.fail; import static org.junit.Assume.assumeTrue; -import java.lang.reflect.Method; import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; @@ -14,25 +13,19 @@ import java.util.concurrent.Future; import java.util.regex.Pattern; -import junit.framework.TestCase; +import junit.tests.SampleJUnit3Tests; import org.hamcrest.CoreMatchers; import org.hamcrest.Description; import org.hamcrest.Matcher; import org.hamcrest.StringDescription; import org.hamcrest.TypeSafeMatcher; import org.junit.AfterClass; -import org.junit.Before; import org.junit.BeforeClass; -import org.junit.ClassRule; -import org.junit.Rule; import org.junit.Test; -import org.junit.rules.MethodRule; -import org.junit.rules.TestRule; import org.junit.runner.JUnitCore; import org.junit.runner.Result; import org.junit.runner.notification.Failure; -import org.junit.runners.model.FrameworkMethod; -import org.junit.runners.model.Statement; +import org.junit.tests.SampleJUnit4Tests.*; public class StackTracesTest { private static final String EOL = System.getProperty("line.separator", "\n"); @@ -58,9 +51,9 @@ assertHasTrimmedTrace(failure, message("java.lang.RuntimeException: cause"), - at("org.junit.internal.StackTracesTest$FakeClassUnderTest.doThrowExceptionWithoutCause"), - at("org.junit.internal.StackTracesTest$FakeClassUnderTest.throwsExceptionWithoutCause"), - at("org.junit.internal.StackTracesTest$TestWithOneThrowingTestMethod.alwaysThrows")); + at("org.junit.tests.SampleJUnit4Tests$FakeClassUnderTest.doThrowExceptionWithoutCause"), + at("org.junit.tests.SampleJUnit4Tests$FakeClassUnderTest.throwsExceptionWithoutCause"), + at("org.junit.tests.SampleJUnit4Tests$TestWithOneThrowingTestMethod.alwaysThrows")); assertNotEquals(failure.getTrace(), failure.getTrimmedTrace()); } @@ -73,14 +66,14 @@ assertHasTrimmedTrace(failure, message("java.lang.RuntimeException: outer"), - at("org.junit.internal.StackTracesTest$FakeClassUnderTest.doThrowExceptionWithCause"), - at("org.junit.internal.StackTracesTest$FakeClassUnderTest.throwsExceptionWithCause"), - at("org.junit.internal.StackTracesTest$TestWithOneThrowingTestMethodWithCause.alwaysThrows"), + at("org.junit.tests.SampleJUnit4Tests$FakeClassUnderTest.doThrowExceptionWithCause"), + at("org.junit.tests.SampleJUnit4Tests$FakeClassUnderTest.throwsExceptionWithCause"), + at("org.junit.tests.SampleJUnit4Tests$TestWithOneThrowingTestMethodWithCause.alwaysThrows"), framesTrimmed(), message("Caused by: java.lang.RuntimeException: cause"), - at("org.junit.internal.StackTracesTest$FakeClassUnderTest.doThrowExceptionWithoutCause"), - at("org.junit.internal.StackTracesTest$FakeClassUnderTest.throwsExceptionWithoutCause"), - at("org.junit.internal.StackTracesTest$FakeClassUnderTest.doThrowExceptionWithCause"), + at("org.junit.tests.SampleJUnit4Tests$FakeClassUnderTest.doThrowExceptionWithoutCause"), + at("org.junit.tests.SampleJUnit4Tests$FakeClassUnderTest.throwsExceptionWithoutCause"), + at("org.junit.tests.SampleJUnit4Tests$FakeClassUnderTest.doThrowExceptionWithCause"), framesInCommon()); assertNotEquals(failure.getTrace(), failure.getTrimmedTrace()); } @@ -94,39 +87,39 @@ assertHasTrimmedTrace(failure, message("java.lang.RuntimeException: cause"), - at("org.junit.internal.StackTracesTest$FakeClassUnderTest.doThrowExceptionWithoutCause"), - at("org.junit.internal.StackTracesTest$FakeClassUnderTest.throwsExceptionWithoutCause"), - at("org.junit.internal.StackTracesTest$TestWithThrowingBeforeMethod.alwaysThrows")); + at("org.junit.tests.SampleJUnit4Tests$FakeClassUnderTest.doThrowExceptionWithoutCause"), + at("org.junit.tests.SampleJUnit4Tests$FakeClassUnderTest.throwsExceptionWithoutCause"), + at("org.junit.tests.SampleJUnit4Tests$TestWithThrowingBeforeMethod.alwaysThrows")); assertNotEquals(failure.getTrace(), failure.getTrimmedTrace()); } @Test public void getTrimmedStackForJUnit3TestFailingInTestMethod() { - Result result = runTest(JUnit3TestWithOneThrowingTestMethod.class); + Result result = runTest(SampleJUnit3Tests.TestWithOneThrowingTestMethod.class); assertEquals("Should run the test", 1, result.getRunCount()); assertEquals("One test should fail", 1, result.getFailureCount()); Failure failure = result.getFailures().get(0); assertHasTrimmedTrace(failure, message("java.lang.RuntimeException: cause"), - at("org.junit.internal.StackTracesTest$FakeClassUnderTest.doThrowExceptionWithoutCause"), - at("org.junit.internal.StackTracesTest$FakeClassUnderTest.throwsExceptionWithoutCause"), - at("org.junit.internal.StackTracesTest$JUnit3TestWithOneThrowingTestMethod.testAlwaysThrows")); + at("junit.tests.SampleJUnit3Tests$FakeClassUnderTest.doThrowExceptionWithoutCause"), + at("junit.tests.SampleJUnit3Tests$FakeClassUnderTest.throwsExceptionWithoutCause"), + at("junit.tests.SampleJUnit3Tests$TestWithOneThrowingTestMethod.testAlwaysThrows")); assertNotEquals(failure.getTrace(), failure.getTrimmedTrace()); } @Test public void getTrimmedStackForJUnit3TestFailingInSetupMethod() { - Result result = runTest(JUnit3TestWithThrowingSetUpMethod.class); + Result result = runTest(SampleJUnit3Tests.TestWithThrowingSetUpMethod.class); assertEquals("Should run the test", 1, result.getRunCount()); assertEquals("One test should fail", 1, result.getFailureCount()); Failure failure = result.getFailures().get(0); assertHasTrimmedTrace(failure, message("java.lang.RuntimeException: cause"), - at("org.junit.internal.StackTracesTest$FakeClassUnderTest.doThrowExceptionWithoutCause"), - at("org.junit.internal.StackTracesTest$FakeClassUnderTest.throwsExceptionWithoutCause"), - at("org.junit.internal.StackTracesTest$JUnit3TestWithThrowingSetUpMethod.setUp")); + at("junit.tests.SampleJUnit3Tests$FakeClassUnderTest.doThrowExceptionWithoutCause"), + at("junit.tests.SampleJUnit3Tests$FakeClassUnderTest.throwsExceptionWithoutCause"), + at("junit.tests.SampleJUnit3Tests$TestWithThrowingSetUpMethod.setUp")); assertNotEquals(failure.getTrace(), failure.getTrimmedTrace()); } @@ -139,9 +132,9 @@ assertHasTrimmedTrace(failure, message("java.lang.RuntimeException: cause"), - at("org.junit.internal.StackTracesTest$FakeClassUnderTest.doThrowExceptionWithoutCause"), - at("org.junit.internal.StackTracesTest$FakeClassUnderTest.throwsExceptionWithoutCause"), - at("org.junit.internal.StackTracesTest$ThrowingTestRule.apply")); + at("org.junit.tests.SampleJUnit4Tests$FakeClassUnderTest.doThrowExceptionWithoutCause"), + at("org.junit.tests.SampleJUnit4Tests$FakeClassUnderTest.throwsExceptionWithoutCause"), + at("org.junit.tests.SampleJUnit4Tests$ThrowingTestRule.apply")); assertNotEquals(failure.getTrace(), failure.getTrimmedTrace()); } @@ -154,9 +147,9 @@ assertHasTrimmedTrace(failure, message("java.lang.RuntimeException: cause"), - at("org.junit.internal.StackTracesTest$FakeClassUnderTest.doThrowExceptionWithoutCause"), - at("org.junit.internal.StackTracesTest$FakeClassUnderTest.throwsExceptionWithoutCause"), - at("org.junit.internal.StackTracesTest$ThrowingTestRule.apply")); + at("org.junit.tests.SampleJUnit4Tests$FakeClassUnderTest.doThrowExceptionWithoutCause"), + at("org.junit.tests.SampleJUnit4Tests$FakeClassUnderTest.throwsExceptionWithoutCause"), + at("org.junit.tests.SampleJUnit4Tests$ThrowingTestRule.apply")); assertNotEquals(failure.getTrace(), failure.getTrimmedTrace()); } @@ -169,9 +162,9 @@ assertHasTrimmedTrace(failure, message("java.lang.RuntimeException: cause"), - at("org.junit.internal.StackTracesTest$FakeClassUnderTest.doThrowExceptionWithoutCause"), - at("org.junit.internal.StackTracesTest$FakeClassUnderTest.throwsExceptionWithoutCause"), - at("org.junit.internal.StackTracesTest$ThrowingMethodRule.apply")); + at("org.junit.tests.SampleJUnit4Tests$FakeClassUnderTest.doThrowExceptionWithoutCause"), + at("org.junit.tests.SampleJUnit4Tests$FakeClassUnderTest.throwsExceptionWithoutCause"), + at("org.junit.tests.SampleJUnit4Tests$ThrowingMethodRule.apply")); assertNotEquals(failure.getTrace(), failure.getTrimmedTrace()); } @@ -185,9 +178,9 @@ assertHasTrimmedTrace(failure, message("java.lang.RuntimeException: error"), - at("org.junit.internal.StackTracesTest$TestWithSuppressedException.alwaysThrows"), + at("org.junit.tests.SampleJUnit4Tests$TestWithSuppressedException.alwaysThrows"), message("\tSuppressed: java.lang.RuntimeException: suppressed"), - at("org.junit.internal.StackTracesTest$TestWithSuppressedException.alwaysThrows"), + at("org.junit.tests.SampleJUnit4Tests$TestWithSuppressedException.alwaysThrows"), framesInCommon()); assertNotEquals(failure.getTrace(), failure.getTrimmedTrace()); } @@ -336,141 +329,4 @@ fail("Missing line in trimmed trace: " + description.toString()); } } - - public static class TestWithOneThrowingTestMethod { - - @Test - public void alwaysThrows() { - new FakeClassUnderTest().throwsExceptionWithoutCause(); - } - } - - public static class JUnit3TestWithOneThrowingTestMethod extends TestCase { - - public void testAlwaysThrows() { - new FakeClassUnderTest().throwsExceptionWithoutCause(); - } - } - - public static class TestWithOneThrowingTestMethodWithCause { - - @Test - public void alwaysThrows() { - new FakeClassUnderTest().throwsExceptionWithCause(); - } - } - - public static class TestWithThrowingBeforeMethod { - - @Before - public void alwaysThrows() { - new FakeClassUnderTest().throwsExceptionWithoutCause(); - } - - @Test - public void alwaysPasses() { - } - } - - public static class JUnit3TestWithThrowingSetUpMethod extends TestCase { - - @Override - protected void setUp() throws Exception { - super.setUp(); - new FakeClassUnderTest().throwsExceptionWithoutCause(); - } - - public void testAlwaysPasses() { - } - } - - public static class ThrowingTestRule implements TestRule { - - public Statement apply( - Statement base, org.junit.runner.Description description) { - new FakeClassUnderTest().throwsExceptionWithoutCause(); - return base; - } - } - - public static class TestWithThrowingTestRule { - - @Rule - public final TestRule rule = new ThrowingTestRule(); - - @Test - public void alwaysPasses() { - } - } - - public static class TestWithThrowingClassRule { - - @ClassRule - public static final TestRule rule = new ThrowingTestRule(); - - @Test - public void alwaysPasses() { - } - } - - public static class ThrowingMethodRule implements MethodRule { - - public Statement apply( - Statement base, FrameworkMethod method, Object target) { - new FakeClassUnderTest().throwsExceptionWithoutCause(); - return base; - } - } - - public static class TestWithThrowingMethodRule { - - @Rule - public final ThrowingMethodRule rule = new ThrowingMethodRule(); - - @Test - public void alwaysPasses() { - } - } - - private static class FakeClassUnderTest { - - public void throwsExceptionWithCause() { - doThrowExceptionWithCause(); - } - - public void throwsExceptionWithoutCause() { - doThrowExceptionWithoutCause(); - } - - private void doThrowExceptionWithCause() { - try { - throwsExceptionWithoutCause(); - } catch (Exception e) { - throw new RuntimeException("outer", e); - } - } - - private void doThrowExceptionWithoutCause() { - throw new RuntimeException("cause"); - } - } - - public static class TestWithSuppressedException { - static final Method addSuppressed = initAddSuppressed(); - - static Method initAddSuppressed() { - try { - return Throwable.class.getMethod("addSuppressed", Throwable.class); - } catch (Throwable e) { - return null; - } - } - - @Test - public void alwaysThrows() throws Exception { - final RuntimeException exception = new RuntimeException("error"); - addSuppressed.invoke(exception, new RuntimeException("suppressed")); - throw exception; - } - } } diff -Nru junit4-4.13.1/src/test/java/org/junit/rules/DisableOnDebugTest.java junit4-4.13.2/src/test/java/org/junit/rules/DisableOnDebugTest.java --- junit4-4.13.1/src/test/java/org/junit/rules/DisableOnDebugTest.java 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/src/test/java/org/junit/rules/DisableOnDebugTest.java 2021-02-13 16:30:49.000000000 +0000 @@ -48,7 +48,7 @@ } - public static abstract class AbstractDisableOnDebugTest { + public abstract static class AbstractDisableOnDebugTest { @Rule public TestRule failOnExecution; diff -Nru junit4-4.13.1/src/test/java/org/junit/rules/MethodRulesTest.java junit4-4.13.2/src/test/java/org/junit/rules/MethodRulesTest.java --- junit4-4.13.1/src/test/java/org/junit/rules/MethodRulesTest.java 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/src/test/java/org/junit/rules/MethodRulesTest.java 2021-02-13 16:30:49.000000000 +0000 @@ -44,7 +44,7 @@ } } - static abstract class NonPublicExampleTest { + abstract static class NonPublicExampleTest { @Rule public MethodRule example = new TestMethodRule(); diff -Nru junit4-4.13.1/src/test/java/org/junit/rules/RuleChainTest.java junit4-4.13.2/src/test/java/org/junit/rules/RuleChainTest.java --- junit4-4.13.1/src/test/java/org/junit/rules/RuleChainTest.java 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/src/test/java/org/junit/rules/RuleChainTest.java 2021-02-13 16:30:49.000000000 +0000 @@ -10,8 +10,6 @@ import static org.junit.experimental.results.PrintableResult.testResult; import static org.junit.rules.RuleChain.outerRule; -import java.io.PrintWriter; -import java.io.StringWriter; import java.util.ArrayList; import java.util.List; diff -Nru junit4-4.13.1/src/test/java/org/junit/rules/StopwatchTest.java junit4-4.13.2/src/test/java/org/junit/rules/StopwatchTest.java --- junit4-4.13.1/src/test/java/org/junit/rules/StopwatchTest.java 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/src/test/java/org/junit/rules/StopwatchTest.java 2021-02-13 16:30:49.000000000 +0000 @@ -49,7 +49,7 @@ } } - public static abstract class AbstractStopwatchTest { + public abstract static class AbstractStopwatchTest { /** * Fake implementation of {@link Stopwatch.Clock} that increments the time diff -Nru junit4-4.13.1/src/test/java/org/junit/rules/TestRuleTest.java junit4-4.13.2/src/test/java/org/junit/rules/TestRuleTest.java --- junit4-4.13.1/src/test/java/org/junit/rules/TestRuleTest.java 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/src/test/java/org/junit/rules/TestRuleTest.java 2021-02-13 16:30:49.000000000 +0000 @@ -1,11 +1,9 @@ package org.junit.rules; -import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; import static org.junit.experimental.results.PrintableResult.testResult; import static org.junit.experimental.results.ResultMatchers.hasSingleFailureContaining; import static org.junit.experimental.results.ResultMatchers.isSuccessful; @@ -14,11 +12,9 @@ import java.util.List; import org.junit.After; -import org.junit.Assume; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.internal.AssumptionViolatedException; import org.junit.runner.Description; import org.junit.runner.JUnitCore; import org.junit.runner.Result; diff -Nru junit4-4.13.1/src/test/java/org/junit/runners/AllRunnersTests.java junit4-4.13.2/src/test/java/org/junit/runners/AllRunnersTests.java --- junit4-4.13.1/src/test/java/org/junit/runners/AllRunnersTests.java 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/src/test/java/org/junit/runners/AllRunnersTests.java 2021-02-13 16:30:49.000000000 +0000 @@ -1,7 +1,6 @@ package org.junit.runners; import org.junit.runner.RunWith; -import org.junit.runners.Suite; import org.junit.runners.Suite.SuiteClasses; import org.junit.runners.model.AllModelTests; import org.junit.runners.parameterized.AllParameterizedTests; diff -Nru junit4-4.13.1/src/test/java/org/junit/runners/RuleContainerTest.java junit4-4.13.2/src/test/java/org/junit/runners/RuleContainerTest.java --- junit4-4.13.1/src/test/java/org/junit/runners/RuleContainerTest.java 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/src/test/java/org/junit/runners/RuleContainerTest.java 2021-02-13 16:30:49.000000000 +0000 @@ -2,8 +2,6 @@ import static org.junit.Assert.assertEquals; -import java.util.Arrays; - import org.junit.Test; import org.junit.rules.MethodRule; import org.junit.rules.TestRule; diff -Nru junit4-4.13.1/src/test/java/org/junit/tests/experimental/AssumptionTest.java junit4-4.13.2/src/test/java/org/junit/tests/experimental/AssumptionTest.java --- junit4-4.13.1/src/test/java/org/junit/tests/experimental/AssumptionTest.java 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/src/test/java/org/junit/tests/experimental/AssumptionTest.java 2021-02-13 16:30:49.000000000 +0000 @@ -237,8 +237,8 @@ assertThat(result.getAssumptionFailureCount(), is(1)); } - final static String message = "Some random message string."; - final static Throwable e = new Throwable(); + static final String message = "Some random message string."; + static final Throwable e = new Throwable(); /** * @see AssumptionTest#assumptionsWithMessage() diff -Nru junit4-4.13.1/src/test/java/org/junit/tests/experimental/theories/AssumingInTheoriesTest.java junit4-4.13.2/src/test/java/org/junit/tests/experimental/theories/AssumingInTheoriesTest.java --- junit4-4.13.1/src/test/java/org/junit/tests/experimental/theories/AssumingInTheoriesTest.java 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/src/test/java/org/junit/tests/experimental/theories/AssumingInTheoriesTest.java 2021-02-13 16:30:49.000000000 +0000 @@ -31,7 +31,7 @@ public static class TheoryWithNoUnassumedParameters { @DataPoint - public final static boolean FALSE = false; + public static final boolean FALSE = false; @Theory public void theoryWithNoUnassumedParameters(boolean value) { diff -Nru junit4-4.13.1/src/test/java/org/junit/tests/experimental/theories/runner/SuccessfulWithDataPointFields.java junit4-4.13.2/src/test/java/org/junit/tests/experimental/theories/runner/SuccessfulWithDataPointFields.java --- junit4-4.13.1/src/test/java/org/junit/tests/experimental/theories/runner/SuccessfulWithDataPointFields.java 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/src/test/java/org/junit/tests/experimental/theories/runner/SuccessfulWithDataPointFields.java 2021-02-13 16:30:49.000000000 +0000 @@ -195,7 +195,7 @@ } @RunWith(Theories.class) - static public class StaticPublicNonDataPoints { + public static class StaticPublicNonDataPoints { // DataPoint which passes the test @DataPoint public static int ZERO = 0; diff -Nru junit4-4.13.1/src/test/java/org/junit/tests/junit3compatibility/AllTestsTest.java junit4-4.13.2/src/test/java/org/junit/tests/junit3compatibility/AllTestsTest.java --- junit4-4.13.1/src/test/java/org/junit/tests/junit3compatibility/AllTestsTest.java 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/src/test/java/org/junit/tests/junit3compatibility/AllTestsTest.java 2021-02-13 16:30:49.000000000 +0000 @@ -24,7 +24,7 @@ @RunWith(AllTests.class) public static class All { - static public junit.framework.Test suite() { + public static junit.framework.Test suite() { TestSuite suite = new TestSuite(); suite.addTestSuite(OneTest.class); return suite; @@ -60,7 +60,7 @@ @RunWith(AllTests.class) public static class AllJUnit4 { - static public junit.framework.Test suite() { + public static junit.framework.Test suite() { TestSuite suite = new TestSuite(); suite.addTest(new JUnit4TestAdapter(JUnit4Test.class)); return suite; diff -Nru junit4-4.13.1/src/test/java/org/junit/tests/junit3compatibility/ForwardCompatibilityTest.java junit4-4.13.2/src/test/java/org/junit/tests/junit3compatibility/ForwardCompatibilityTest.java --- junit4-4.13.1/src/test/java/org/junit/tests/junit3compatibility/ForwardCompatibilityTest.java 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/src/test/java/org/junit/tests/junit3compatibility/ForwardCompatibilityTest.java 2021-02-13 16:30:49.000000000 +0000 @@ -19,7 +19,7 @@ public class ForwardCompatibilityTest extends TestCase { static String fLog; - static public class NewTest { + public static class NewTest { @Before public void before() { fLog += "before "; diff -Nru junit4-4.13.1/src/test/java/org/junit/tests/junit3compatibility/JUnit38ClassRunnerTest.java junit4-4.13.2/src/test/java/org/junit/tests/junit3compatibility/JUnit38ClassRunnerTest.java --- junit4-4.13.1/src/test/java/org/junit/tests/junit3compatibility/JUnit38ClassRunnerTest.java 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/src/test/java/org/junit/tests/junit3compatibility/JUnit38ClassRunnerTest.java 2021-02-13 16:30:49.000000000 +0000 @@ -53,7 +53,7 @@ static int count; - static public class OneTest extends TestCase { + public static class OneTest extends TestCase { public void testOne() { } } diff -Nru junit4-4.13.1/src/test/java/org/junit/tests/junit3compatibility/OldTests.java junit4-4.13.2/src/test/java/org/junit/tests/junit3compatibility/OldTests.java --- junit4-4.13.1/src/test/java/org/junit/tests/junit3compatibility/OldTests.java 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/src/test/java/org/junit/tests/junit3compatibility/OldTests.java 2021-02-13 16:30:49.000000000 +0000 @@ -6,7 +6,7 @@ @RunWith(AllTests.class) public class OldTests { - static public Test suite() { + public static Test suite() { return junit.tests.AllTests.suite(); } } diff -Nru junit4-4.13.1/src/test/java/org/junit/tests/junit3compatibility/SuiteMethodTest.java junit4-4.13.2/src/test/java/org/junit/tests/junit3compatibility/SuiteMethodTest.java --- junit4-4.13.1/src/test/java/org/junit/tests/junit3compatibility/SuiteMethodTest.java 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/src/test/java/org/junit/tests/junit3compatibility/SuiteMethodTest.java 2021-02-13 16:30:49.000000000 +0000 @@ -18,7 +18,7 @@ public class SuiteMethodTest { public static boolean wasRun; - static public class OldTest extends TestCase { + public static class OldTest extends TestCase { public OldTest(String name) { super(name); } @@ -41,7 +41,7 @@ assertTrue(wasRun); } - static public class NewTest { + public static class NewTest { @Test public void sample() { wasRun = true; @@ -81,7 +81,7 @@ assertEquals(0, description.getChildren().size()); } - static public class NewTestSuiteFails { + public static class NewTestSuiteFails { @Test public void sample() { wasRun = true; @@ -101,7 +101,7 @@ assertFalse(wasRun); } - static public class NewTestSuiteNotUsed { + public static class NewTestSuiteNotUsed { private static boolean wasIgnoredRun; @Test diff -Nru junit4-4.13.1/src/test/java/org/junit/tests/listening/ListenerTest.java junit4-4.13.2/src/test/java/org/junit/tests/listening/ListenerTest.java --- junit4-4.13.1/src/test/java/org/junit/tests/listening/ListenerTest.java 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/src/test/java/org/junit/tests/listening/ListenerTest.java 2021-02-13 16:30:49.000000000 +0000 @@ -8,7 +8,7 @@ import org.junit.runner.notification.RunListener; public class ListenerTest { - static private String log; + private static String log; public static class OneTest { @Test diff -Nru junit4-4.13.1/src/test/java/org/junit/tests/manipulation/SingleMethodTest.java junit4-4.13.2/src/test/java/org/junit/tests/manipulation/SingleMethodTest.java --- junit4-4.13.1/src/test/java/org/junit/tests/manipulation/SingleMethodTest.java 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/src/test/java/org/junit/tests/manipulation/SingleMethodTest.java 2021-02-13 16:30:49.000000000 +0000 @@ -27,7 +27,7 @@ public class SingleMethodTest { public static int count; - static public class OneTimeSetup { + public static class OneTimeSetup { @BeforeClass public static void once() { count++; @@ -53,7 +53,7 @@ } @RunWith(Parameterized.class) - static public class ParameterizedOneTimeSetup { + public static class ParameterizedOneTimeSetup { @Parameters public static List params() { return Arrays.asList(new Object[]{1}, new Object[]{2}); @@ -78,7 +78,7 @@ } @RunWith(Parameterized.class) - static public class ParameterizedOneTimeBeforeClass { + public static class ParameterizedOneTimeBeforeClass { @Parameters public static List params() { return Arrays.asList(new Object[]{1}, new Object[]{2}); diff -Nru junit4-4.13.1/src/test/java/org/junit/tests/running/classes/EnclosedTest.java junit4-4.13.2/src/test/java/org/junit/tests/running/classes/EnclosedTest.java --- junit4-4.13.1/src/test/java/org/junit/tests/running/classes/EnclosedTest.java 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/src/test/java/org/junit/tests/running/classes/EnclosedTest.java 2021-02-13 16:30:49.000000000 +0000 @@ -30,7 +30,7 @@ @Test public void c() {} } - abstract public static class C { + public abstract static class C { @Test public void a() {} } } diff -Nru junit4-4.13.1/src/test/java/org/junit/tests/running/classes/ParameterizedTestTest.java junit4-4.13.2/src/test/java/org/junit/tests/running/classes/ParameterizedTestTest.java --- junit4-4.13.1/src/test/java/org/junit/tests/running/classes/ParameterizedTestTest.java 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/src/test/java/org/junit/tests/running/classes/ParameterizedTestTest.java 2021-02-13 16:30:49.000000000 +0000 @@ -168,7 +168,7 @@ } @RunWith(Parameterized.class) - static public class BadIndexForAnnotatedFieldTest { + public static class BadIndexForAnnotatedFieldTest { @Parameters public static Collection data() { return Arrays.asList(new Object[][]{{0}}); @@ -200,7 +200,7 @@ } @RunWith(Parameterized.class) - static public class BadNumberOfAnnotatedFieldTest { + public static class BadNumberOfAnnotatedFieldTest { @Parameters public static Collection data() { return Arrays.asList(new Object[][]{{0, 0}}); @@ -232,7 +232,7 @@ private static String fLog; @RunWith(Parameterized.class) - static public class BeforeAndAfter { + public static class BeforeAndAfter { @BeforeClass public static void before() { fLog += "before "; @@ -487,7 +487,7 @@ } @RunWith(Parameterized.class) - static public class EmptyTest { + public static class EmptyTest { @BeforeClass public static void before() { fLog += "before "; @@ -506,7 +506,7 @@ } @RunWith(Parameterized.class) - static public class IncorrectTest { + public static class IncorrectTest { @Test public int test() { return 0; @@ -525,7 +525,7 @@ } @RunWith(Parameterized.class) - static public class ProtectedParametersTest { + public static class ProtectedParametersTest { @Parameters protected static Collection data() { return Collections.emptyList(); @@ -544,7 +544,7 @@ } @RunWith(Parameterized.class) - static public class ParametersNotIterable { + public static class ParametersNotIterable { @Parameters public static String data() { return "foo"; @@ -563,7 +563,7 @@ } @RunWith(Parameterized.class) - static public class PrivateConstructor { + public static class PrivateConstructor { private PrivateConstructor(int x) { } @@ -613,7 +613,7 @@ } @RunWith(Parameterized.class) - static public class SingleArgumentTestWithArray { + public static class SingleArgumentTestWithArray { @Parameters public static Object[] data() { return new Object[] { "first test", "second test" }; @@ -634,7 +634,7 @@ } @RunWith(Parameterized.class) - static public class SingleArgumentTestWithIterable { + public static class SingleArgumentTestWithIterable { private static final AtomicBoolean dataCalled = new AtomicBoolean(false); @Parameters @@ -677,7 +677,7 @@ } @RunWith(Parameterized.class) - static public class SingleArgumentTestWithCollection { + public static class SingleArgumentTestWithCollection { @Parameters public static Iterable data() { return Collections.unmodifiableCollection(asList("first test", "second test")); @@ -699,7 +699,7 @@ } - static public class ExceptionThrowingRunnerFactory implements + public static class ExceptionThrowingRunnerFactory implements ParametersRunnerFactory { public Runner createRunnerForTestWithParameters(TestWithParameters test) throws InitializationError { @@ -710,7 +710,7 @@ @RunWith(Parameterized.class) @UseParametersRunnerFactory(ExceptionThrowingRunnerFactory.class) - static public class TestWithUseParametersRunnerFactoryAnnotation { + public static class TestWithUseParametersRunnerFactoryAnnotation { @Parameters public static Iterable data() { return asList("single test"); @@ -739,7 +739,7 @@ @RunWith(Parameterized.class) @UseParametersRunnerFactory(ExceptionThrowingRunnerFactory.class) - public static abstract class UseParameterizedFactoryAbstractTest { + public abstract static class UseParameterizedFactoryAbstractTest { @Parameters public static Iterable data() { return asList("single test"); diff -Nru junit4-4.13.1/src/test/java/org/junit/tests/running/classes/parent/ParentRunnerClassLoaderTest.java junit4-4.13.2/src/test/java/org/junit/tests/running/classes/parent/ParentRunnerClassLoaderTest.java --- junit4-4.13.1/src/test/java/org/junit/tests/running/classes/parent/ParentRunnerClassLoaderTest.java 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/src/test/java/org/junit/tests/running/classes/parent/ParentRunnerClassLoaderTest.java 2021-02-13 16:30:49.000000000 +0000 @@ -1,5 +1,10 @@ package org.junit.tests.running.classes.parent; +import static org.junit.Assert.assertEquals; + +import java.lang.reflect.Field; +import java.net.URL; +import java.net.URLClassLoader; import org.junit.Test; import org.junit.runner.Description; @@ -9,13 +14,6 @@ import org.junit.runners.model.FrameworkMethod; import org.junit.runners.model.InitializationError; -import java.lang.reflect.Field; -import java.net.URL; -import java.net.URLClassLoader; -import java.util.List; - -import static org.junit.Assert.assertEquals; - public class ParentRunnerClassLoaderTest { @Test public void testClassRuleAccessToClassInAnotherClassLoader() throws Exception { diff -Nru junit4-4.13.1/src/test/java/org/junit/tests/running/core/CommandLineTest.java junit4-4.13.2/src/test/java/org/junit/tests/running/core/CommandLineTest.java --- junit4-4.13.1/src/test/java/org/junit/tests/running/core/CommandLineTest.java 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/src/test/java/org/junit/tests/running/core/CommandLineTest.java 2021-02-13 16:30:49.000000000 +0000 @@ -28,7 +28,7 @@ System.setOut(oldOut); } - static public class Example { + public static class Example { @Test public void test() { testWasRun = true; @@ -55,7 +55,7 @@ private static int fCount; - static public class Count { + public static class Count { @Test public void increment() { fCount++; diff -Nru junit4-4.13.1/src/test/java/org/junit/tests/running/core/JUnitCoreReturnsCorrectExitCodeTest.java junit4-4.13.2/src/test/java/org/junit/tests/running/core/JUnitCoreReturnsCorrectExitCodeTest.java --- junit4-4.13.1/src/test/java/org/junit/tests/running/core/JUnitCoreReturnsCorrectExitCodeTest.java 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/src/test/java/org/junit/tests/running/core/JUnitCoreReturnsCorrectExitCodeTest.java 2021-02-13 16:30:49.000000000 +0000 @@ -8,7 +8,7 @@ public class JUnitCoreReturnsCorrectExitCodeTest { - static public class Fail { + public static class Fail { @Test public void kaboom() { fail(); @@ -25,7 +25,7 @@ runClass("Foo", 1); } - static public class Succeed { + public static class Succeed { @Test public void peacefulSilence() { } diff -Nru junit4-4.13.1/src/test/java/org/junit/tests/running/methods/AnnotationTest.java junit4-4.13.2/src/test/java/org/junit/tests/running/methods/AnnotationTest.java --- junit4-4.13.1/src/test/java/org/junit/tests/running/methods/AnnotationTest.java 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/src/test/java/org/junit/tests/running/methods/AnnotationTest.java 2021-02-13 16:30:49.000000000 +0000 @@ -34,7 +34,7 @@ run = false; } - static public class SimpleTest { + public static class SimpleTest { @Test public void success() { run = true; @@ -48,7 +48,7 @@ } @RunWith(JUnit4.class) - static public class SimpleTestWithFutureProofExplicitRunner { + public static class SimpleTestWithFutureProofExplicitRunner { @Test public void success() { run = true; @@ -61,7 +61,7 @@ assertTrue(run); } - static public class SetupTest { + public static class SetupTest { @Before public void before() { run = true; @@ -78,7 +78,7 @@ assertTrue(run); } - static public class TeardownTest { + public static class TeardownTest { @After public void after() { run = true; @@ -95,7 +95,7 @@ assertTrue(run); } - static public class FailureTest { + public static class FailureTest { @Test public void error() throws Exception { org.junit.Assert.fail(); @@ -110,7 +110,7 @@ assertEquals(AssertionError.class, result.getFailures().get(0).getException().getClass()); } - static public class SetupFailureTest { + public static class SetupFailureTest { @Before public void before() { throw new Error(); @@ -131,7 +131,7 @@ assertFalse(run); } - static public class TeardownFailureTest { + public static class TeardownFailureTest { @After public void after() { throw new Error(); @@ -150,7 +150,7 @@ assertEquals(Error.class, runner.getFailures().get(0).getException().getClass()); } - static public class TestAndTeardownFailureTest { + public static class TestAndTeardownFailureTest { @After public void after() { throw new Error("hereAfter"); @@ -170,7 +170,7 @@ assertThat(runner.getFailures().toString(), allOf(containsString("hereAfter"), containsString("inTest"))); } - static public class TeardownAfterFailureTest { + public static class TeardownAfterFailureTest { @After public void after() { run = true; @@ -191,7 +191,7 @@ static int count; static Collection tests; - static public class TwoTests { + public static class TwoTests { @Test public void one() { count++; @@ -214,7 +214,7 @@ assertEquals(2, tests.size()); } - static public class OldTest extends TestCase { + public static class OldTest extends TestCase { public void test() { run = true; } @@ -226,7 +226,7 @@ assertTrue(run); } - static public class OldSuiteTest extends TestCase { + public static class OldSuiteTest extends TestCase { public void testOne() { run = true; } @@ -239,7 +239,7 @@ assertTrue(run); } - static public class ExceptionTest { + public static class ExceptionTest { @Test(expected = Error.class) public void expectedException() { throw new Error(); @@ -252,7 +252,7 @@ assertEquals(0, result.getFailureCount()); } - static public class NoExceptionTest { + public static class NoExceptionTest { @Test(expected = Error.class) public void expectedException() { } @@ -265,7 +265,7 @@ assertEquals("Expected exception: java.lang.Error", result.getFailures().get(0).getMessage()); } - static public class OneTimeSetup { + public static class OneTimeSetup { @BeforeClass public static void once() { count++; @@ -287,7 +287,7 @@ assertEquals(1, count); } - static public class OneTimeTeardown { + public static class OneTimeTeardown { @AfterClass public static void once() { count++; @@ -345,7 +345,7 @@ assertEquals("beforeClass before test after afterClass ", log); } - static public class NonStaticOneTimeSetup { + public static class NonStaticOneTimeSetup { @BeforeClass public void once() { } @@ -361,7 +361,7 @@ assertEquals(1, result.getFailureCount()); } - static public class ErrorInBeforeClass { + public static class ErrorInBeforeClass { @BeforeClass public static void before() throws Exception { throw new Exception(); @@ -383,7 +383,7 @@ assertEquals(ErrorInBeforeClass.class.getName(), description.getDisplayName()); } - static public class ErrorInAfterClass { + public static class ErrorInAfterClass { @Test public void test() { run = true; @@ -405,12 +405,12 @@ static class SuperInheritance { @BeforeClass - static public void beforeClassSuper() { + public static void beforeClassSuper() { log += "Before class super "; } @AfterClass - static public void afterClassSuper() { + public static void afterClassSuper() { log += "After class super "; } @@ -425,14 +425,14 @@ } } - static public class SubInheritance extends SuperInheritance { + public static class SubInheritance extends SuperInheritance { @BeforeClass - static public void beforeClassSub() { + public static void beforeClassSub() { log += "Before class sub "; } @AfterClass - static public void afterClassSub() { + public static void afterClassSub() { log += "After class sub "; } @@ -459,7 +459,7 @@ assertEquals("Before class super Before class sub Before super Before sub Test After sub After super After class sub After class super ", log); } - static public abstract class SuperShadowing { + public abstract static class SuperShadowing { @Rule public TestRule rule() { @@ -487,7 +487,7 @@ } } - static public class SubShadowing extends SuperShadowing { + public static class SubShadowing extends SuperShadowing { @Override @Rule @@ -545,7 +545,7 @@ log); } - static public abstract class SuperStaticMethodShadowing { + public abstract static class SuperStaticMethodShadowing { @ClassRule public static TestRule rule() { @@ -563,7 +563,7 @@ } } - static public class SubStaticMethodShadowing extends SuperStaticMethodShadowing { + public static class SubStaticMethodShadowing extends SuperStaticMethodShadowing { @ClassRule public static TestRule rule() { @@ -596,7 +596,7 @@ log); } - static public abstract class SuperFieldShadowing { + public abstract static class SuperFieldShadowing { @Rule public final TestRule rule = new ExternalResource() { @@ -612,7 +612,7 @@ }; } - static public class SubFieldShadowing extends SuperFieldShadowing { + public static class SubFieldShadowing extends SuperFieldShadowing { @Rule public final TestRule rule = new ExternalResource() { @@ -643,7 +643,7 @@ log); } - static public abstract class SuperStaticFieldShadowing { + public abstract static class SuperStaticFieldShadowing { @ClassRule public static TestRule rule = new ExternalResource() { @@ -659,7 +659,7 @@ }; } - static public class SubStaticFieldShadowing extends SuperStaticFieldShadowing { + public static class SubStaticFieldShadowing extends SuperStaticFieldShadowing { @ClassRule public static TestRule rule = new ExternalResource() { @@ -690,7 +690,7 @@ log); } - static public class SuperTest { + public static class SuperTest { @Test public void one() { log += "Super"; @@ -702,7 +702,7 @@ } } - static public class SubTest extends SuperTest { + public static class SubTest extends SuperTest { @Override @Test public void one() { @@ -720,7 +720,7 @@ assertFalse(log.contains("Super")); } - static public class RunAllAfters { + public static class RunAllAfters { @Before public void good() { } @@ -753,7 +753,7 @@ assertTrue(log.contains("two")); } - static public class RunAllAftersRegardless { + public static class RunAllAftersRegardless { @Test public void empty() { } @@ -780,7 +780,7 @@ assertEquals(2, result.getFailureCount()); } - static public class RunAllAfterClasses { + public static class RunAllAfterClasses { @Before public void good() { } @@ -813,19 +813,19 @@ assertTrue(log.contains("two")); } - static public class RunAllAfterClassesRegardless { + public static class RunAllAfterClassesRegardless { @Test public void empty() { } @AfterClass - static public void one() { + public static void one() { log += "one"; throw new Error(); } @AfterClass - static public void two() { + public static void two() { log += "two"; throw new Error(); } diff -Nru junit4-4.13.1/src/test/java/org/junit/tests/running/methods/ParameterizedTestMethodTest.java junit4-4.13.2/src/test/java/org/junit/tests/running/methods/ParameterizedTestMethodTest.java --- junit4-4.13.1/src/test/java/org/junit/tests/running/methods/ParameterizedTestMethodTest.java 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/src/test/java/org/junit/tests/running/methods/ParameterizedTestMethodTest.java 2021-02-13 16:30:49.000000000 +0000 @@ -136,19 +136,19 @@ private Class fClass; private int fErrorCount; - static public class SuperWrong { + public static class SuperWrong { @Test void notPublic() { } } - static public class SubWrong extends SuperWrong { + public static class SubWrong extends SuperWrong { @Test public void justFine() { } } - static public class SubShadows extends SuperWrong { + public static class SubShadows extends SuperWrong { @Override @Test public void notPublic() { diff -Nru junit4-4.13.1/src/test/java/org/junit/tests/SampleJUnit4Tests.java junit4-4.13.2/src/test/java/org/junit/tests/SampleJUnit4Tests.java --- junit4-4.13.1/src/test/java/org/junit/tests/SampleJUnit4Tests.java 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/src/test/java/org/junit/tests/SampleJUnit4Tests.java 2021-02-13 16:30:49.000000000 +0000 @@ -1,6 +1,15 @@ package org.junit.tests; +import org.junit.Before; +import org.junit.ClassRule; +import org.junit.Rule; import org.junit.Test; +import org.junit.rules.MethodRule; +import org.junit.rules.TestRule; +import org.junit.runners.model.FrameworkMethod; +import org.junit.runners.model.Statement; + +import java.lang.reflect.Method; /** * Container for sample JUnit4-style tests used in integration tests. @@ -23,6 +32,85 @@ } } + public static class TestWithThrowingBeforeMethod { + + @Before + public void alwaysThrows() { + new FakeClassUnderTest().throwsExceptionWithoutCause(); + } + + @Test + public void alwaysPasses() { + } + } + + public static class ThrowingTestRule implements TestRule { + + public Statement apply( + Statement base, org.junit.runner.Description description) { + new FakeClassUnderTest().throwsExceptionWithoutCause(); + return base; + } + } + + public static class TestWithThrowingTestRule { + + @Rule + public final TestRule rule = new ThrowingTestRule(); + + @Test + public void alwaysPasses() { + } + } + + public static class TestWithThrowingClassRule { + + @ClassRule + public static final TestRule rule = new ThrowingTestRule(); + + @Test + public void alwaysPasses() { + } + } + + public static class ThrowingMethodRule implements MethodRule { + + public Statement apply( + Statement base, FrameworkMethod method, Object target) { + new FakeClassUnderTest().throwsExceptionWithoutCause(); + return base; + } + } + + public static class TestWithThrowingMethodRule { + + @Rule + public final ThrowingMethodRule rule = new ThrowingMethodRule(); + + @Test + public void alwaysPasses() { + } + } + + public static class TestWithSuppressedException { + public static final Method addSuppressed = initAddSuppressed(); + + static Method initAddSuppressed() { + try { + return Throwable.class.getMethod("addSuppressed", Throwable.class); + } catch (Throwable e) { + return null; + } + } + + @Test + public void alwaysThrows() throws Exception { + final RuntimeException exception = new RuntimeException("error"); + addSuppressed.invoke(exception, new RuntimeException("suppressed")); + throw exception; + } + } + private static class FakeClassUnderTest { public void throwsExceptionWithCause() { Binary files /tmp/tmpk8x32zbj/3rIB_7Xu8S/junit4-4.13.1/src/test/resources/org/junit/assumptionViolatedExceptionWithoutValueAndMatcherCanBeReserialized_v4_13 and /tmp/tmpk8x32zbj/hq9QpZvViI/junit4-4.13.2/src/test/resources/org/junit/assumptionViolatedExceptionWithoutValueAndMatcherCanBeReserialized_v4_13 differ Binary files /tmp/tmpk8x32zbj/3rIB_7Xu8S/junit4-4.13.1/src/test/resources/org/junit/assumptionViolatedExceptionWithValueAndMatcherCanBeReserialized_v4_13 and /tmp/tmpk8x32zbj/hq9QpZvViI/junit4-4.13.2/src/test/resources/org/junit/assumptionViolatedExceptionWithValueAndMatcherCanBeReserialized_v4_13 differ diff -Nru junit4-4.13.1/.travis.settings.xml junit4-4.13.2/.travis.settings.xml --- junit4-4.13.1/.travis.settings.xml 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/.travis.settings.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,22 +0,0 @@ - - - - central - GCS Maven Central mirror - https://maven-central.storage-download.googleapis.com/maven2/ - google-maven-central - - - - - junit-snapshot-repo - ${env.OSSRH_USERNAME} - ${env.OSSRH_PASSWORD} - - - junit-releases-repo - ${env.OSSRH_USERNAME} - ${env.OSSRH_PASSWORD} - - - diff -Nru junit4-4.13.1/.travis.yml junit4-4.13.2/.travis.yml --- junit4-4.13.1/.travis.yml 2020-10-11 15:18:49.000000000 +0000 +++ junit4-4.13.2/.travis.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,69 +0,0 @@ -dist: trusty - -language: java - -script: ./mvnw verify javadoc:javadoc site:site - -install: -- ./mvnw --version - -stages: - - test - - name: deploy - if: (branch = main) AND (NOT type IN (pull_request)) - -jobs: - include: - - name: Java 6 - env: JDK=openjdk6 - addons: - apt: - packages: - - openjdk-6-jdk - install: - # Download dependencies with JDK 8 because Mave Central supports - # TLS 1.2 only but OpenJDK 6 does not. - - export ORIGINAL_JAVA_HOME=$JAVA_HOME - - jdk_switcher use oraclejdk8 - - ./mvnw test -DskipTests - # Delete all files created with JDK 8 - - ./mvnw clean - # Restore desired JDK - - export JAVA_HOME=$ORIGINAL_JAVA_HOME - - jdk_switcher use openjdk6 - - ./mvnw --version - - name: Java 7 - jdk: openjdk7 - - name: Java 8 - jdk: oraclejdk8 - - name: Java 9 - jdk: oraclejdk9 - - name: Java 10 - jdk: openjdk10 - - name: Java 11 - jdk: openjdk11 - - stage: deploy - name: "Publish snapshot artifacts" - addons: - apt: - packages: - - openjdk-6-jdk - install: - # Download dependencies with JDK 8 because Mave Central supports - # TLS 1.2 only but OpenJDK 6 does not. - - export ORIGINAL_JAVA_HOME=$JAVA_HOME - - jdk_switcher use oraclejdk8 - - ./mvnw test -DskipTests - # Delete all files created with JDK 8 - - ./mvnw clean - # Restore desired JDK - - export JAVA_HOME=$ORIGINAL_JAVA_HOME - - jdk_switcher use openjdk6 - - ./mvnw --version - env: - - JDK=openjdk6 - # OSSRH_USERNAME - - secure: griGZYDtqDMRUaYex/uAnpkWIQ/yodM6IOn4G8izWKpyGLeCxyXBG0FDcVo81xRq/9mMevj2idyW/xNP/HAQ45G4pyJUk/vTSMkNslzVjr7OBEtQQCN8XahSaOO0l0CJ5lzA6LdwWg7uDaf9znqZ0slt81u0S1NJmUZyYeUEim0= - # OSSRH_PASSWORD - - secure: EM7Z2M09HvLJXYJaeD/YmeF5A6tqavG2tBBeDcFZ7C6k0AI/wApe882pEMMoUG06xufKfSlt7WFJxoyU3M+fPOpeK5qZpJQxsHWnNJwbcbKzqMpM9mDsgIL9rtAvm9MuIIbIY2spiT0Cx3sHdh5qofaJHPL/u8Or5L9tE8FV1ew= - script: ./mvnw deploy --batch-mode --activate-profiles generate-docs --settings .travis.settings.xml