Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package opentest4j for openSUSE:Factory checked in at 2023-10-17 20:25:18 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/opentest4j (Old) and /work/SRC/openSUSE:Factory/.opentest4j.new.20540 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "opentest4j" Tue Oct 17 20:25:18 2023 rev:5 rq:1118285 version:1.3.0 Changes: -------- --- /work/SRC/openSUSE:Factory/opentest4j/opentest4j.changes 2022-05-25 20:35:23.532297133 +0200 +++ /work/SRC/openSUSE:Factory/.opentest4j.new.20540/opentest4j.changes 2023-10-17 20:25:36.256554721 +0200 @@ -1,0 +2,9 @@ +Tue Oct 17 03:49:22 UTC 2023 - ming li <m...@suse.com> + +- Update to version 1.3.0: + * Introduce FileInfo + * Add copyright and license to jar + * Enable Java-behavior for late cause initialisation + * Adjust OSGi manifest to match previously published ones + +------------------------------------------------------------------- Old: ---- opentest4j-1.2.0.pom r1.2.0.tar.gz New: ---- opentest4j-1.3.0.pom r1.3.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ opentest4j.spec ++++++ --- /var/tmp/diff_new_pack.EDx5EA/_old 2023-10-17 20:25:38.064618016 +0200 +++ /var/tmp/diff_new_pack.EDx5EA/_new 2023-10-17 20:25:38.068618156 +0200 @@ -1,7 +1,7 @@ # # spec file for package opentest4j # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,7 +18,7 @@ %bcond_with tests Name: opentest4j -Version: 1.2.0 +Version: 1.3.0 Release: 0 Summary: Open Test Alliance for the JVM License: Apache-2.0 ++++++ opentest4j-1.2.0.pom -> opentest4j-1.3.0.pom ++++++ --- /work/SRC/openSUSE:Factory/opentest4j/opentest4j-1.2.0.pom 2020-04-02 17:43:56.205426511 +0200 +++ /work/SRC/openSUSE:Factory/.opentest4j.new.20540/opentest4j-1.3.0.pom 2023-10-17 20:25:36.224553601 +0200 @@ -1,17 +1,22 @@ <?xml version="1.0" encoding="UTF-8"?> -<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" +<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <!-- This module was also published with a richer model, Gradle metadata, --> + <!-- which should be used instead. Do not delete the following line which --> + <!-- is to indicate to Gradle or any Gradle module metadata file consumer --> + <!-- that they should prefer consuming it instead. --> + <!-- do_not_remove: published-with-gradle-metadata --> <modelVersion>4.0.0</modelVersion> <groupId>org.opentest4j</groupId> <artifactId>opentest4j</artifactId> - <version>1.2.0</version> + <version>1.3.0</version> <name>org.opentest4j:opentest4j</name> <description>Open Test Alliance for the JVM</description> <url>https://github.com/ota4j-team/opentest4j</url> <licenses> <license> <name>The Apache License, Version 2.0</name> - <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> + <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url> </license> </licenses> <developers> @@ -33,7 +38,7 @@ <developer> <id>mmerdes</id> <name>Matthias Merdes</name> - <email>matthias.mer...@heidelberg-mobil.com</email> + <email>matthias.mer...@heidelpay.com</email> </developer> <developer> <id>sbrannen</id> ++++++ opentest4j-build.xml ++++++ --- /var/tmp/diff_new_pack.EDx5EA/_old 2023-10-17 20:25:38.112619697 +0200 +++ /var/tmp/diff_new_pack.EDx5EA/_new 2023-10-17 20:25:38.112619697 +0200 @@ -10,7 +10,7 @@ <property name="project.groupId" value="org.opentest4j"/> <property name="project.artifactId" value="opentest4j"/> - <property name="project.version" value="1.2.0"/> + <property name="project.version" value="1.3.0"/> <property name="compiler.source" value="1.8"/> <property name="compiler.target" value="${compiler.source}"/> ++++++ r1.2.0.tar.gz -> r1.3.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentest4j-r1.2.0/.gitattributes new/opentest4j-r1.3.0/.gitattributes --- old/opentest4j-r1.2.0/.gitattributes 2019-06-06 21:23:33.000000000 +0200 +++ new/opentest4j-r1.3.0/.gitattributes 2023-07-06 14:24:53.000000000 +0200 @@ -1,2 +1,3 @@ * text eol=lf -*.bat eol=crlf +*.bat text eol=crlf +*.jar binary diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentest4j-r1.2.0/.github/actions/run-gradle/action.yml new/opentest4j-r1.3.0/.github/actions/run-gradle/action.yml --- old/opentest4j-r1.2.0/.github/actions/run-gradle/action.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/opentest4j-r1.3.0/.github/actions/run-gradle/action.yml 2023-07-06 14:24:53.000000000 +0200 @@ -0,0 +1,29 @@ +name: Run Gradle +description: Sets up Gradle JDKs and runs Gradle +inputs: + arguments: + required: true + description: Gradle arguments + default: build +runs: + using: "composite" + steps: + - uses: actions/setup-java@v3 + id: setup-toolchain-jdk + with: + distribution: temurin + java-version: 11 + - uses: actions/setup-java@v3 + id: setup-gradle-jdk + with: + distribution: temurin + java-version: 17 + - uses: gradle/gradle-build-action@v2 + env: + JDK11: ${{ steps.setup-toolchain-jdk.outputs.path }} + JAVA_HOME: ${{ steps.setup-gradle-jdk.outputs.path }} + with: + arguments: | + -Porg.gradle.java.installations.auto-download=false + javaToolchains + ${{ inputs.arguments }} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentest4j-r1.2.0/.github/dependabot.yml new/opentest4j-r1.3.0/.github/dependabot.yml --- old/opentest4j-r1.2.0/.github/dependabot.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/opentest4j-r1.3.0/.github/dependabot.yml 2023-07-06 14:24:53.000000000 +0200 @@ -0,0 +1,25 @@ +version: 2 +registries: + gradle-plugin-portal: + type: maven-repository + url: https://plugins.gradle.org/m2 + username: dummy # Required by dependabot + password: dummy # Required by dependabot +updates: + - package-ecosystem: "gradle" + directory: "/" + registries: + - gradle-plugin-portal + schedule: + interval: "weekly" + labels: [ ] + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + labels: [ ] + - package-ecosystem: "github-actions" + directory: "/.github/actions/run-gradle" + schedule: + interval: "weekly" + labels: [ ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentest4j-r1.2.0/.github/workflows/combine-prs.yml new/opentest4j-r1.3.0/.github/workflows/combine-prs.yml --- old/opentest4j-r1.2.0/.github/workflows/combine-prs.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/opentest4j-r1.3.0/.github/workflows/combine-prs.yml 2023-07-06 14:24:53.000000000 +0200 @@ -0,0 +1,16 @@ +name: Combine PRs + +on: + schedule: + - cron: '0 0 * * *' # Every day at 00:00 UTC + workflow_dispatch: + +jobs: + combine-prs: + if: github.repository == 'ota4j-team/opentest4j' + runs-on: ubuntu-latest + steps: + - name: combine-prs + uses: github/combine-prs@v3.1.1 + with: + github_token: ${{ secrets.GH_TOKEN }} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentest4j-r1.2.0/.github/workflows/gradle-wrapper-validation.yml new/opentest4j-r1.3.0/.github/workflows/gradle-wrapper-validation.yml --- old/opentest4j-r1.2.0/.github/workflows/gradle-wrapper-validation.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/opentest4j-r1.3.0/.github/workflows/gradle-wrapper-validation.yml 2023-07-06 14:24:53.000000000 +0200 @@ -0,0 +1,14 @@ +name: "Validate Gradle Wrapper" +on: [push, pull_request] + +jobs: + validation: + name: "Validation" + runs-on: ubuntu-latest + steps: + - name: Check out repository + uses: actions/checkout@v3 + with: + fetch-depth: 1 + - name: Validate Gradle wrapper + uses: gradle/wrapper-validation-action@v1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentest4j-r1.2.0/.github/workflows/main.yml new/opentest4j-r1.3.0/.github/workflows/main.yml --- old/opentest4j-r1.2.0/.github/workflows/main.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/opentest4j-r1.3.0/.github/workflows/main.yml 2023-07-06 14:24:53.000000000 +0200 @@ -0,0 +1,76 @@ +name: CI + +on: + push: + branches: + - main + - 'releases/*' + pull_request: + branches: + - '*' + +jobs: + Linux: + runs-on: ubuntu-latest + steps: + - name: Check out repository + uses: actions/checkout@v3 + with: + fetch-depth: 1 + - name: Build + uses: ./.github/actions/run-gradle + + Windows: + runs-on: windows-latest + steps: + - name: Check out repository + uses: actions/checkout@v3 + with: + fetch-depth: 1 + - name: Build + uses: ./.github/actions/run-gradle + + macOS: + runs-on: macos-latest + steps: + - name: Check out repository + uses: actions/checkout@v3 + with: + fetch-depth: 1 + - name: Build + uses: ./.github/actions/run-gradle + + publish_artifacts: + name: Publish Snapshot Artifacts + needs: linux + runs-on: ubuntu-latest + if: github.event_name == 'push' && github.repository == 'ota4j-team/opentest4j' && (startsWith(github.ref, 'refs/heads/releases/') || github.ref == 'refs/heads/main') + steps: + - name: Check out repository + uses: actions/checkout@v3 + with: + fetch-depth: 1 + - name: Publish + uses: ./.github/actions/run-gradle + env: + ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }} + ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }} + with: + arguments: publish -x check + + update_documentation: + name: Update documentation + needs: linux + runs-on: ubuntu-latest + if: github.event_name == 'push' && github.repository == 'ota4j-team/opentest4j' && github.ref == 'refs/heads/main' + steps: + - name: Check out repository + uses: actions/checkout@v3 + with: + fetch-depth: 1 + - name: Publish + uses: ./.github/actions/run-gradle + env: + GRGIT_USER: ${{ secrets.GH_TOKEN }} + with: + arguments: gitPublishPush diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentest4j-r1.2.0/COPYRIGHT new/opentest4j-r1.3.0/COPYRIGHT --- old/opentest4j-r1.2.0/COPYRIGHT 1970-01-01 01:00:00.000000000 +0100 +++ new/opentest4j-r1.3.0/COPYRIGHT 2023-07-06 14:24:53.000000000 +0200 @@ -0,0 +1,13 @@ +Copyright 2015-2023 the original author or authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentest4j-r1.2.0/README.md new/opentest4j-r1.3.0/README.md --- old/opentest4j-r1.2.0/README.md 2019-06-06 21:23:33.000000000 +0200 +++ new/opentest4j-r1.3.0/README.md 2023-07-06 14:24:53.000000000 +0200 @@ -1,7 +1,5 @@ # Open Test Alliance for the JVM -[](https://travis-ci.org/ota4j-team/opentest4j) - ## History This project is the result of an initiative by the [JUnit 5 team](https://github.com/junit-team/junit5/issues/12). @@ -73,7 +71,7 @@ - **Group ID**: `org.opentest4j` - **Artifact ID**: `opentest4j` -- **Version**: `1.2.0` +- **Version**: `1.3.0` See also: <http://search.maven.org/#search|ga|1|opentest4j/> @@ -81,7 +79,7 @@ - **Group ID**: `org.opentest4j` - **Artifact ID**: `opentest4j` -- **Version**: `1.3.0-SNAPSHOT` +- **Version**: `1.4.0-SNAPSHOT` See also: <https://oss.sonatype.org/content/repositories/snapshots/org/opentest4j/opentest4j/> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentest4j-r1.2.0/build.gradle new/opentest4j-r1.3.0/build.gradle --- old/opentest4j-r1.2.0/build.gradle 2019-06-06 21:23:33.000000000 +0200 +++ new/opentest4j-r1.3.0/build.gradle 2023-07-06 14:24:53.000000000 +0200 @@ -1,21 +1,23 @@ -import java.text.SimpleDateFormat +import java.time.OffsetDateTime +import java.time.format.DateTimeFormatter plugins { - id 'java' - id 'osgi' + id 'java-library' id 'eclipse' id 'idea' - id 'maven' + id 'maven-publish' id 'signing' - id 'com.diffplug.gradle.spotless' version '3.23.0' - id 'net.nemerosa.versioning' version '2.8.2' - id 'org.ajoberstar.github-pages' version '1.7.2' + id 'com.diffplug.spotless' version '6.19.0' + id 'net.nemerosa.versioning' version '3.0.0' + id 'org.ajoberstar.git-publish' version '4.2.0' + id 'biz.aQute.bnd.builder' version '6.4.0' + id 'io.github.gradle-nexus.publish-plugin' version '1.3.0' } -Date buildTimeAndDate = new Date() +def buildTimeAndDate = OffsetDateTime.now() ext { - buildDate = new SimpleDateFormat('yyyy-MM-dd').format(buildTimeAndDate) - buildTime = new SimpleDateFormat('HH:mm:ss.SSSZ').format(buildTimeAndDate) + buildDate = DateTimeFormatter.ISO_LOCAL_DATE.format(buildTimeAndDate) + buildTime = DateTimeFormatter.ofPattern("HH:mm:ss.SSSZ").format(buildTimeAndDate) builtByValue = project.hasProperty('builtBy') ? project.builtBy : project.defaultBuiltBy } @@ -26,14 +28,22 @@ mavenCentral() } +java { + withJavadocJar() + withSourcesJar() +} + compileJava { - options.compilerArgs = ['--release', '6'] + javaCompiler.set(javaToolchains.compilerFor { + languageVersion = JavaLanguageVersion.of(11) + }) + options.compilerArgs = ['--release', '6', '-Xlint:-options'] } -task compileModule(type: JavaCompile) { +tasks.register('compileModule', JavaCompile) { def moduleSrcDir = file('src/module/java') source(moduleSrcDir) - destinationDir = file("$buildDir/classes/java/modules") + destinationDirectory.set(layout.buildDirectory.dir("classes/java/modules")) classpath = compileJava.classpath inputs.property("moduleName", moduleName) inputs.property("moduleVersion", project.version) @@ -47,7 +57,7 @@ } dependencies { - testCompile("junit:junit:${junit4Version}") + testImplementation("junit:junit:${junit4Version}") } test { @@ -77,14 +87,27 @@ 'Specification-Vendor': 'opentest4j.org', 'Implementation-Title': project.name, 'Implementation-Version': project.version, - 'Implementation-Vendor': 'opentest4j.org' + 'Implementation-Vendor': 'opentest4j.org', ) - license = 'The Apache License, Version 2.0' - vendor = 'opentest4j.org' } - from(files("${compileModule.destinationDir}/$moduleName").builtBy(compileModule)) { + bundle { + bnd( + 'Bundle-Name': 'opentest4j', + 'Bundle-SymbolicName': moduleName, + 'Bundle-License': 'The Apache License, Version 2.0', + 'Bundle-Vendor': 'opentest4j.org', + '-exportcontents': 'org.opentest4j.*' + ) + } + from(files(compileModule.destinationDirectory.dir(moduleName)).builtBy(compileModule)) { include('module-info.class') } + + from(".") { + include("LICENSE") + include("COPYRIGHT") + into("META-INF") + } } javadoc { @@ -95,21 +118,6 @@ options.links 'https://docs.oracle.com/en/java/javase/11/docs/api/' } -task sourcesJar(type: Jar, dependsOn: classes) { - classifier = 'sources' - from sourceSets.main.allSource -} - -task javadocJar(type: Jar) { - classifier = 'javadoc' - from javadoc -} - -artifacts { - archives sourcesJar - archives javadocJar -} - spotless { java { licenseHeaderFile rootProject.file('etc/spotless/apache-license-2.0.java') @@ -125,92 +133,76 @@ if (signArtifacts) { signing { - sign configurations.archives + useGpgCmd() + sign(publishing.publications) } } -uploadArchives { - - dependsOn check - +nexusPublishing { repositories { - mavenDeployer { - - if (signArtifacts) { - beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } - } - - def ossrhUsername = rootProject.hasProperty('ossrhUsername') ? rootProject.ossrhUsername : '' - def ossrhPassword = rootProject.hasProperty('ossrhPassword') ? rootProject.ossrhPassword : '' - - repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { - authentication(userName: ossrhUsername, password: ossrhPassword) - } - - snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { - authentication(userName: ossrhUsername, password: ossrhPassword) - } - - pom.project { - name "${project.group}:${project.name}" - packaging 'jar' - description "Open Test Alliance for the JVM" - url 'https://github.com/ota4j-team/opentest4j' + sonatype() + } +} +publishing { + publications { + maven(MavenPublication) { + from(components.java) + pom { + name = "${project.group}:${project.name}" + description = project.description + url = 'https://github.com/ota4j-team/opentest4j' scm { - connection 'scm:git:git://github.com/ota4j-team/opentest4j.git' - developerConnection 'scm:git:git://github.com/ota4j-team/opentest4j.git' - url 'https://github.com/ota4j-team/opentest4j' + connection = 'scm:git:git://github.com/ota4j-team/opentest4j.git' + developerConnection = 'scm:git:git://github.com/ota4j-team/opentest4j.git' + url = 'https://github.com/ota4j-team/opentest4j' } - licenses { license { - name 'The Apache License, Version 2.0' - url 'http://www.apache.org/licenses/LICENSE-2.0.txt' + name = 'The Apache License, Version 2.0' + url = 'https://www.apache.org/licenses/LICENSE-2.0.txt' } } - developers { developer { - id 'bechte' - name 'Stefan Bechtold' - email 'stefan.becht...@me.com' + id = 'bechte' + name = 'Stefan Bechtold' + email = 'stefan.becht...@me.com' } developer { - id 'jlink' - name 'Johannes Link' - email 'busin...@johanneslink.net' + id = 'jlink' + name = 'Johannes Link' + email = 'busin...@johanneslink.net' } developer { - id 'marcphilipp' - name 'Marc Philipp' - email 'm...@marcphilipp.de' + id = 'marcphilipp' + name = 'Marc Philipp' + email = 'm...@marcphilipp.de' } developer { - id 'mmerdes' - name 'Matthias Merdes' - email 'matthias.mer...@heidelberg-mobil.com' + id = 'mmerdes' + name = 'Matthias Merdes' + email = 'matthias.mer...@heidelpay.com' } developer { - id 'sbrannen' - name 'Sam Brannen' - email 's...@sambrannen.com' + id = 'sbrannen' + name = 'Sam Brannen' + email = 's...@sambrannen.com' } } } - - pom.whenConfigured { p -> - p.dependencies = p.dependencies.findAll { dep -> dep.scope != 'test' } - } } } } +tasks.withType(PublishToMavenRepository).configureEach { + dependsOn(check) +} + spotless { format 'misc', { - target project.fileTree(project.rootDir) { - include '**/*.gradle', '**/*.md', '**/*.gitignore' - exclude '.gradle/**/*.*' + target fileTree(rootDir) { + include '*.gradle', '*.md', '.gitignore' } indentWithTabs() trimTrailingWhitespace() @@ -221,7 +213,8 @@ def docsVersion = project.version.contains('SNAPSHOT') ? 'snapshot' : project.version def docsDir = new File(buildDir, 'ghpages-docs') -task prepareDocsForUploadToGhPages(dependsOn: [javadoc], type: Copy) { +tasks.register('prepareDocsForUploadToGhPages', Copy) { + dependsOn(javadoc) outputs.dir docsDir from("$buildDir/docs") { @@ -234,30 +227,39 @@ includeEmptyDirs = false } -task createCurrentDocsFolder(dependsOn: prepareDocsForUploadToGhPages, type: Copy) { +def replaceCurrentDocs = project.hasProperty('replaceCurrentDocs') + +tasks.register('createCurrentDocsFolder', Copy) { + dependsOn prepareDocsForUploadToGhPages outputs.dir "${docsDir}/current" from "${docsDir}/${docsVersion}" into "${docsDir}/current" -} -createCurrentDocsFolder.onlyIf { project.hasProperty('replaceCurrentDocs') } + enabled = replaceCurrentDocs +} -githubPages { - repoUri = 'https://github.com/ota4j-team/opentest4j.git' +gitPublish { + repoUri.set("https://github.com/ota4j-team/opentest4j.git") + branch.set("gh-pages") + sign.set(false) + fetchDepth.set(1) - credentials { - username = project.hasProperty('githubToken') ? project.githubToken : '' - password = '' + contents { + from(docsDir) + into("docs") } - pages { - from docsDir - into "docs" + preserve { + include("**/*") + exclude("docs/$docsVersion/**") + if (replaceCurrentDocs) { + exclude("docs/current/**") + } } - - deleteExistingFiles = false } -prepareGhPages.dependsOn(prepareDocsForUploadToGhPages) -prepareGhPages.dependsOn(createCurrentDocsFolder) +tasks.named("gitPublishCopy") { + dependsOn(prepareDocsForUploadToGhPages) + dependsOn(createCurrentDocsFolder) +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentest4j-r1.2.0/etc/spotless/apache-license-2.0.java new/opentest4j-r1.3.0/etc/spotless/apache-license-2.0.java --- old/opentest4j-r1.2.0/etc/spotless/apache-license-2.0.java 2019-06-06 21:23:33.000000000 +0200 +++ new/opentest4j-r1.3.0/etc/spotless/apache-license-2.0.java 2023-07-06 14:24:53.000000000 +0200 @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 the original author or authors. + * Copyright 2015-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Binary files old/opentest4j-r1.2.0/gradle/wrapper/gradle-wrapper.jar and new/opentest4j-r1.3.0/gradle/wrapper/gradle-wrapper.jar differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentest4j-r1.2.0/gradle/wrapper/gradle-wrapper.properties new/opentest4j-r1.3.0/gradle/wrapper/gradle-wrapper.properties --- old/opentest4j-r1.2.0/gradle/wrapper/gradle-wrapper.properties 2019-06-06 21:23:33.000000000 +0200 +++ new/opentest4j-r1.3.0/gradle/wrapper/gradle-wrapper.properties 2023-07-06 14:24:53.000000000 +0200 @@ -1,5 +1,8 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip +distributionSha256Sum=38f66cd6eef217b4c35855bb11ea4e9fbc53594ccccb5fb82dfd317ef8c2c5a3 +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentest4j-r1.2.0/gradle.properties new/opentest4j-r1.3.0/gradle.properties --- old/opentest4j-r1.2.0/gradle.properties 2019-06-06 21:23:33.000000000 +0200 +++ new/opentest4j-r1.3.0/gradle.properties 2023-07-06 14:24:53.000000000 +0200 @@ -1,6 +1,8 @@ group = org.opentest4j -version = 1.2.0 +version = 1.3.0 junit4Version = 4.12 defaultBuiltBy = OTA4J Team + +org.gradle.java.installations.fromEnv=JDK11 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentest4j-r1.2.0/gradlew new/opentest4j-r1.3.0/gradlew --- old/opentest4j-r1.2.0/gradlew 2019-06-06 21:23:33.000000000 +0200 +++ new/opentest4j-r1.3.0/gradlew 2023-07-06 14:24:53.000000000 +0200 @@ -1,13 +1,13 @@ -#!/usr/bin/env sh +#!/bin/sh # -# Copyright 2015 the original author or authors. +# Copyright © 2015-2021 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, @@ -17,78 +17,110 @@ # ############################################################################## -## -## Gradle start up script for UN*X -## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# ############################################################################## # Attempt to set APP_HOME + # Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null +app_path=$0 -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" +MAX_FD=maximum warn () { echo "$*" -} +} >&2 die () { echo echo "$*" echo exit 1 -} +} >&2 # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD="$JAVA_HOME/bin/java" + JAVACMD=$JAVA_HOME/bin/java fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME @@ -97,92 +129,120 @@ location of your Java installation." fi else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac fi -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) fi - i=$((i+1)) + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac fi -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=$(save "$@") - -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" - -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong -if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then - cd "$(dirname "$0")" + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" fi +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + exec "$JAVACMD" "$@" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentest4j-r1.2.0/gradlew.bat new/opentest4j-r1.3.0/gradlew.bat --- old/opentest4j-r1.2.0/gradlew.bat 2019-06-06 21:23:33.000000000 +0200 +++ new/opentest4j-r1.3.0/gradlew.bat 2023-07-06 14:24:53.000000000 +0200 @@ -5,7 +5,7 @@ @rem you may not use this file except in compliance with the License. @rem You may obtain a copy of the License at @rem -@rem http://www.apache.org/licenses/LICENSE-2.0 +@rem https://www.apache.org/licenses/LICENSE-2.0 @rem @rem Unless required by applicable law or agreed to in writing, software @rem distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,10 +25,14 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @@ -37,7 +41,7 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init +if %ERRORLEVEL% equ 0 goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -51,7 +55,7 @@ set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe -if exist "%JAVA_EXE%" goto init +if exist "%JAVA_EXE%" goto execute echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% @@ -61,38 +65,26 @@ goto fail -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - :execute @rem Setup the command line set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentest4j-r1.2.0/settings.gradle new/opentest4j-r1.3.0/settings.gradle --- old/opentest4j-r1.2.0/settings.gradle 2019-06-06 21:23:33.000000000 +0200 +++ new/opentest4j-r1.3.0/settings.gradle 2023-07-06 14:24:53.000000000 +0200 @@ -1,7 +1,6 @@ rootProject.name = 'opentest4j' -// Require Java 11 -if (!JavaVersion.current().java11) { - throw new GradleException('The OpenTest4J build requires Java 11. ' + +if (JavaVersion.current() != JavaVersion.VERSION_17) { + throw new GradleException('The OpenTest4J build requires Java 17. ' + "Currently executing with Java ${JavaVersion.current()}.") } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentest4j-r1.2.0/src/main/java/org/opentest4j/AssertionFailedError.java new/opentest4j-r1.3.0/src/main/java/org/opentest4j/AssertionFailedError.java --- old/opentest4j-r1.2.0/src/main/java/org/opentest4j/AssertionFailedError.java 2019-06-06 21:23:33.000000000 +0200 +++ new/opentest4j-r1.3.0/src/main/java/org/opentest4j/AssertionFailedError.java 2023-07-06 14:24:53.000000000 +0200 @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 the original author or authors. + * Copyright 2015-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,6 +31,14 @@ private static final long serialVersionUID = 1L; + private static final Throwable NO_CAUSE = new RuntimeException("no cause indicator") { + @Override + public Throwable fillInStackTrace() { + // Avoid the overhead of filling in the stack trace for this + return this; + } + }; + private final ValueWrapper expected; private final ValueWrapper actual; @@ -50,20 +58,22 @@ * converted to the empty {@code String} */ public AssertionFailedError(String message) { - this(message, null); + this(message, NO_CAUSE); } /** * Constructs an {@code AssertionFailedError} with a message and * expected/actual values but without a cause. * + * <p>Actual and expected values may be {@link FileInfo} instances. + * * @param message the detail message; {@code null} or blank will be * converted to the empty {@code String} * @param expected the expected value; may be {@code null} * @param actual the actual value; may be {@code null} */ public AssertionFailedError(String message, Object expected, Object actual) { - this(message, expected, actual, null); + this(message, expected, actual, NO_CAUSE); } /** @@ -96,7 +106,9 @@ super((message == null || message.trim().length() == 0) ? "" : message); this.expected = expected; this.actual = actual; - initCause(cause); + if (cause != NO_CAUSE) { + initCause(cause); + } } /** diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentest4j-r1.2.0/src/main/java/org/opentest4j/FileInfo.java new/opentest4j-r1.3.0/src/main/java/org/opentest4j/FileInfo.java --- old/opentest4j-r1.2.0/src/main/java/org/opentest4j/FileInfo.java 1970-01-01 01:00:00.000000000 +0100 +++ new/opentest4j-r1.3.0/src/main/java/org/opentest4j/FileInfo.java 2023-07-06 14:24:53.000000000 +0200 @@ -0,0 +1,137 @@ +/* + * Copyright 2015-2023 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.opentest4j; + +import java.io.Serializable; +import java.nio.charset.Charset; +import java.util.Arrays; + +/** + * {@code FileInfo} is a pair of a file path and the contents of the file. + * + * <p>Its main use case is for {@code actual} and {@code expected} values in + * {@code AssertionFailedError}. + * + * <p>The semantics of the {@code path} can be defined by the users of this + * class. + * + * @author Marc Philipp + * @author Reinhold Degenfellner + * @since 1.3 + */ +public class FileInfo implements Serializable { + + private static final long serialVersionUID = 1L; + + private final String path; + private final byte[] contents; + + /** + * Constructs a {@code FileInfo} with a path to a file and the contents of + * the file. + * + * <p>Be cautious with large files (limiting the size may be a good idea). + * + * <p>The supplied byte array is not copied to avoid unnecessary memory + * allocations. However, callers of this constructors should not modify the + * byte array after calling this constructor. This behavior may change + * in a future release without prior notice. + * + * @param path the path to the file; must not be {@code null} + * @param contents the contents of the file; must not be {@code null}; + */ + public FileInfo(String path, byte[] contents) { + if (contents == null) { + throw new NullPointerException("contents must not be null"); + } + validatePath(path); + this.contents = contents; + this.path = path; + } + + private static void validatePath(String path) { + if (path == null || path.trim().isEmpty()) { + throw new NullPointerException("path must not be null or blank"); + } + } + + /** + * Returns the path to the file. + * + * @return the path to the file; never {@code null} + */ + public String getPath() { + return path; + } + + /** + * Returns the contents of the file. + * + * <p>This method does currently not return a defensive copy of the + * contained byte array to avoid unnecessary memory allocations. However, + * callers of this method should not modify the returned byte array. This + * behavior may change in a future release without prior notice. + * + * @return the contents of the file; never {@code null} + */ + public byte[] getContents() { + return contents; + } + + /** + * Returns the contents of the file as a {@code String}. + * + * @return the contents of the file as a {@code String}; never {@code null} + */ + public String getContentsAsString(Charset charset) { + return new String(contents, charset); + } + + /** + * Determines if the supplied object is an instance of {@code FileInfo} + * with the same path and contents as this {@code FileInfo}. + */ + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null || getClass() != obj.getClass()) { + return false; + } + FileInfo that = (FileInfo) obj; + return this.path.equals(that.path) && Arrays.equals(this.contents, that.contents); + } + + /** + * Generates a unique hash code for this {@code FileInfo} based + * on its {@link #getPath() path}. + */ + @Override + public int hashCode() { + return path.hashCode(); + } + + /** + * Generates a string representation of this {@code FileInfo} based + * on the {@link #getPath() path} and {@link #getContents() contents}. + */ + @Override + public String toString() { + return "FileInfo[path='" + this.path + "', contents containing " + this.contents.length + " bytes]"; + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentest4j-r1.2.0/src/main/java/org/opentest4j/IncompleteExecutionException.java new/opentest4j-r1.3.0/src/main/java/org/opentest4j/IncompleteExecutionException.java --- old/opentest4j-r1.2.0/src/main/java/org/opentest4j/IncompleteExecutionException.java 2019-06-06 21:23:33.000000000 +0200 +++ new/opentest4j-r1.3.0/src/main/java/org/opentest4j/IncompleteExecutionException.java 2023-07-06 14:24:53.000000000 +0200 @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 the original author or authors. + * Copyright 2015-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentest4j-r1.2.0/src/main/java/org/opentest4j/MultipleFailuresError.java new/opentest4j-r1.3.0/src/main/java/org/opentest4j/MultipleFailuresError.java --- old/opentest4j-r1.2.0/src/main/java/org/opentest4j/MultipleFailuresError.java 2019-06-06 21:23:33.000000000 +0200 +++ new/opentest4j-r1.3.0/src/main/java/org/opentest4j/MultipleFailuresError.java 2023-07-06 14:24:53.000000000 +0200 @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 the original author or authors. + * Copyright 2015-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentest4j-r1.2.0/src/main/java/org/opentest4j/TestAbortedException.java new/opentest4j-r1.3.0/src/main/java/org/opentest4j/TestAbortedException.java --- old/opentest4j-r1.2.0/src/main/java/org/opentest4j/TestAbortedException.java 2019-06-06 21:23:33.000000000 +0200 +++ new/opentest4j-r1.3.0/src/main/java/org/opentest4j/TestAbortedException.java 2023-07-06 14:24:53.000000000 +0200 @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 the original author or authors. + * Copyright 2015-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentest4j-r1.2.0/src/main/java/org/opentest4j/TestSkippedException.java new/opentest4j-r1.3.0/src/main/java/org/opentest4j/TestSkippedException.java --- old/opentest4j-r1.2.0/src/main/java/org/opentest4j/TestSkippedException.java 2019-06-06 21:23:33.000000000 +0200 +++ new/opentest4j-r1.3.0/src/main/java/org/opentest4j/TestSkippedException.java 2023-07-06 14:24:53.000000000 +0200 @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 the original author or authors. + * Copyright 2015-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentest4j-r1.2.0/src/main/java/org/opentest4j/ValueWrapper.java new/opentest4j-r1.3.0/src/main/java/org/opentest4j/ValueWrapper.java --- old/opentest4j-r1.2.0/src/main/java/org/opentest4j/ValueWrapper.java 2019-06-06 21:23:33.000000000 +0200 +++ new/opentest4j-r1.3.0/src/main/java/org/opentest4j/ValueWrapper.java 2023-07-06 14:24:53.000000000 +0200 @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 the original author or authors. + * Copyright 2015-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentest4j-r1.2.0/src/test/java/org/opentest4j/AssertionFailedErrorTests.java new/opentest4j-r1.3.0/src/test/java/org/opentest4j/AssertionFailedErrorTests.java --- old/opentest4j-r1.2.0/src/test/java/org/opentest4j/AssertionFailedErrorTests.java 2019-06-06 21:23:33.000000000 +0200 +++ new/opentest4j-r1.3.0/src/test/java/org/opentest4j/AssertionFailedErrorTests.java 2023-07-06 14:24:53.000000000 +0200 @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 the original author or authors. + * Copyright 2015-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,7 +28,9 @@ import java.io.ObjectOutputStream; import java.io.OutputStream; +import org.junit.Rule; import org.junit.Test; +import org.junit.rules.ExpectedException; /** * Unit tests for {@link AssertionFailedError}. @@ -42,6 +44,33 @@ private static final String EMPTY = ""; private static final String BLANK = " "; + @Rule + public ExpectedException expectedException = ExpectedException.none(); + + @Test + public void undefinedCauseDoesNotInitializeCause() { + RuntimeException lateCause = new RuntimeException("lateCause"); + new AssertionFailedError().initCause(lateCause); + new AssertionFailedError("my message").initCause(lateCause); + new AssertionFailedError(null, "foo", "bar").initCause(lateCause); + } + + @Test + public void cannotReinitializeNullCauseForMessageCauseArgs() { + RuntimeException lazyCause = new RuntimeException("cause"); + + expectedException.expect(IllegalStateException.class); + new AssertionFailedError(null, null).initCause(lazyCause); + } + + @Test + public void cannotReinitializeNullCauseForExpectedActualCauseArgs() { + RuntimeException lazyCause = new RuntimeException("cause"); + + expectedException.expect(IllegalStateException.class); + new AssertionFailedError(null, "foo", "bar", null).initCause(lazyCause); + } + @Test public void defaultConstructorUsesEmptyMessage() { assertEquals(EMPTY, new AssertionFailedError().getMessage()); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentest4j-r1.2.0/src/test/java/org/opentest4j/FileInfoTests.java new/opentest4j-r1.3.0/src/test/java/org/opentest4j/FileInfoTests.java --- old/opentest4j-r1.2.0/src/test/java/org/opentest4j/FileInfoTests.java 1970-01-01 01:00:00.000000000 +0100 +++ new/opentest4j-r1.3.0/src/test/java/org/opentest4j/FileInfoTests.java 2023-07-06 14:24:53.000000000 +0200 @@ -0,0 +1,78 @@ +/* + * Copyright 2015-2023 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.opentest4j; + +import static java.nio.charset.Charset.defaultCharset; +import static java.nio.charset.StandardCharsets.UTF_8; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; + +import org.junit.Test; + +/** + * Unit tests for {@link FileInfo}. + * + * @author Marc Philipp + * @author Reinhold Degenfellner + * @since 1.3 + */ +public class FileInfoTests { + + FileInfo actual = new FileInfo("actual path", "actual contents".getBytes(UTF_8)); + FileInfo expected = new FileInfo("expected path", "expected contents".getBytes(UTF_8)); + AssertionFailedError assertionFailedError = new AssertionFailedError("message", expected, actual); + + @Test + public void actualAndExpectedFileInfoAreAccessible() { + assertSame(actual, assertionFailedError.getActual().getValue()); + assertSame(expected, assertionFailedError.getExpected().getValue()); + } + + @Test + public void isSerializable() throws Exception { + var out = new ByteArrayOutputStream(); + + new ObjectOutputStream(out).writeObject(assertionFailedError); + var deserialized = (AssertionFailedError) new ObjectInputStream( + new ByteArrayInputStream(out.toByteArray())).readObject(); + + assertEquals(actual, deserialized.getActual().getValue()); + assertEquals(expected, deserialized.getExpected().getValue()); + } + + @Test + public void constructors() { + var contents = "contents".getBytes(UTF_8); + var fileInfo = new FileInfo("path", contents); + + assertSame(fileInfo.getContents(), contents); + assertEquals(fileInfo.getContentsAsString(defaultCharset()), "contents"); + assertEquals(fileInfo.getPath(), "path"); + + contents = "contents".getBytes(); + fileInfo = new FileInfo("path", contents); + + assertSame(fileInfo.getContents(), contents); + assertEquals(fileInfo.getContentsAsString(defaultCharset()), "contents"); + assertEquals(fileInfo.getPath(), "path"); + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentest4j-r1.2.0/src/test/java/org/opentest4j/MultipleFailuresErrorTests.java new/opentest4j-r1.3.0/src/test/java/org/opentest4j/MultipleFailuresErrorTests.java --- old/opentest4j-r1.2.0/src/test/java/org/opentest4j/MultipleFailuresErrorTests.java 2019-06-06 21:23:33.000000000 +0200 +++ new/opentest4j-r1.3.0/src/test/java/org/opentest4j/MultipleFailuresErrorTests.java 2023-07-06 14:24:53.000000000 +0200 @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 the original author or authors. + * Copyright 2015-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentest4j-r1.2.0/src/test/java/org/opentest4j/ValueWrapperTests.java new/opentest4j-r1.3.0/src/test/java/org/opentest4j/ValueWrapperTests.java --- old/opentest4j-r1.2.0/src/test/java/org/opentest4j/ValueWrapperTests.java 2019-06-06 21:23:33.000000000 +0200 +++ new/opentest4j-r1.3.0/src/test/java/org/opentest4j/ValueWrapperTests.java 2023-07-06 14:24:53.000000000 +0200 @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 the original author or authors. + * Copyright 2015-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.