Hello community, here is the log from the commit of package opentest4j for openSUSE:Factory checked in at 2020-04-02 17:43:50 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/opentest4j (Old) and /work/SRC/openSUSE:Factory/.opentest4j.new.3248 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "opentest4j" Thu Apr 2 17:43:50 2020 rev:2 rq:790793 version:1.2.0 Changes: -------- --- /work/SRC/openSUSE:Factory/opentest4j/opentest4j.changes 2019-03-06 15:49:35.896428626 +0100 +++ /work/SRC/openSUSE:Factory/.opentest4j.new.3248/opentest4j.changes 2020-04-02 17:43:56.269426588 +0200 @@ -1,0 +2,5 @@ +Thu Apr 2 07:06:55 UTC 2020 - Fridrich Štrba <fridrich.st...@bluewin.ch> + +- Update to upstream version 1.2.0 + +------------------------------------------------------------------- Old: ---- opentest4j-1.0.0.pom r1.0.0.tar.gz New: ---- opentest4j-1.2.0.pom r1.2.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ opentest4j.spec ++++++ --- /var/tmp/diff_new_pack.OehTEO/_old 2020-04-02 17:43:56.749427168 +0200 +++ /var/tmp/diff_new_pack.OehTEO/_new 2020-04-02 17:43:56.753427173 +0200 @@ -1,7 +1,7 @@ # # spec file for package opentest4j # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 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.0.0 +Version: 1.2.0 Release: 0 Summary: Open Test Alliance for the JVM License: Apache-2.0 @@ -57,9 +57,41 @@ find -name \*.jar -delete cp %{SOURCE1} build.xml +cp %{SOURCE100} pom.xml + +%pom_add_dep junit:junit::test + +%pom_xpath_inject pom:project " + <build> + <pluginManagement> + <plugins> + <plugin> + <artifactId>maven-jar-plugin</artifactId> + <configuration> + <archive> + <manifestEntries> + <Automatic-Module-Name>org.opentest4j</Automatic-Module-Name> + <Implementation-Title>opentest4j</Implementation-Title> + <Implementation-Vendor>opentest4j.org</Implementation-Vendor> + <Implementation-Version>%{version}</Implementation-Version> + <Specification-Title>opentest4j</Specification-Title> + <Specification-Vendor>opentest4j.org</Specification-Vendor> + <Specification-Version>%{version}</Specification-Version> + <!-- OSGi metadata required by Eclipse --> + <Bundle-ManifestVersion>2</Bundle-ManifestVersion> + <Bundle-SymbolicName>org.opentest4j</Bundle-SymbolicName> + <Bundle-Version>%{version}</Bundle-Version> + <Export-Package>org.opentest4j;version=\"%{version}\"</Export-Package> + </manifestEntries> + </archive> + </configuration> + </plugin> + </plugins> + </pluginManagement> + </build>" %build -%ant \ +%{ant} \ %if %{without tests} -Dtest.skip=true \ %endif ++++++ opentest4j-1.0.0.pom -> opentest4j-1.2.0.pom ++++++ --- /work/SRC/openSUSE:Factory/opentest4j/opentest4j-1.0.0.pom 2019-03-06 15:49:35.200428531 +0100 +++ /work/SRC/openSUSE:Factory/.opentest4j.new.3248/opentest4j-1.2.0.pom 2020-04-02 17:43:56.205426511 +0200 @@ -4,7 +4,7 @@ <modelVersion>4.0.0</modelVersion> <groupId>org.opentest4j</groupId> <artifactId>opentest4j</artifactId> - <version>1.0.0</version> + <version>1.2.0</version> <name>org.opentest4j:opentest4j</name> <description>Open Test Alliance for the JVM</description> <url>https://github.com/ota4j-team/opentest4j</url> ++++++ opentest4j-build.xml ++++++ --- /var/tmp/diff_new_pack.OehTEO/_old 2020-04-02 17:43:56.797427226 +0200 +++ /var/tmp/diff_new_pack.OehTEO/_new 2020-04-02 17:43:56.797427226 +0200 @@ -10,7 +10,7 @@ <property name="project.groupId" value="org.opentest4j"/> <property name="project.artifactId" value="opentest4j"/> - <property name="project.version" value="1.0.0"/> + <property name="project.version" value="1.2.0"/> <property name="compiler.source" value="1.6"/> <property name="compiler.target" value="${compiler.source}"/> ++++++ r1.0.0.tar.gz -> r1.2.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentest4j-r1.0.0/.gitattributes new/opentest4j-r1.2.0/.gitattributes --- old/opentest4j-r1.0.0/.gitattributes 1970-01-01 01:00:00.000000000 +0100 +++ new/opentest4j-r1.2.0/.gitattributes 2019-06-06 21:23:33.000000000 +0200 @@ -0,0 +1,2 @@ +* text eol=lf +*.bat eol=crlf diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentest4j-r1.0.0/.gitignore new/opentest4j-r1.2.0/.gitignore --- old/opentest4j-r1.0.0/.gitignore 2017-09-10 13:25:29.000000000 +0200 +++ new/opentest4j-r1.2.0/.gitignore 2019-06-06 21:23:33.000000000 +0200 @@ -17,6 +17,7 @@ *.iws *.uml .idea/ +out/ # Misc *.log diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentest4j-r1.0.0/.travis.yml new/opentest4j-r1.2.0/.travis.yml --- old/opentest4j-r1.0.0/.travis.yml 2017-09-10 13:25:29.000000000 +0200 +++ new/opentest4j-r1.2.0/.travis.yml 2019-06-06 21:23:33.000000000 +0200 @@ -1,5 +1,37 @@ language: java + +# Specify which branches/tags that we do not want to be built: r5.0.0-M5 +branches: + except: + - /^r\d.*$/ + +before_install: + - unset _JAVA_OPTIONS # https://github.com/travis-ci/travis-ci/issues/8408 + +install: + - ./gradlew --version # Display Gradle, Groovy, JVM and other versions + jdk: - - oraclejdk8 -script: - - ./gradlew check + - openjdk11 + +stages: + - test + - name: deploy + if: (branch = master) AND (NOT type IN (pull_request)) + +jobs: + include: + - script: ./gradlew --stacktrace build + - stage: deploy + name: "Publish snapshot artifacts" + env: + # ORG_GRADLE_PROJECT_ossrhUsername + - secure: K3oEnLQ2ai8lmTHrfQsktkb8vc/W5ghP6NurUmb4E+SHWw/zqv2naxupbpVZqovhhTqYm1/I0rqHKrGrBIUDSFMhyTKYmqw4+Nck3BAnjXovotGuKyMrg6yqoBjaWhT8rJe/fR2hZgUi96vSjEKC/UDSGRRHhoEyX73qAwbA7CGJ3SMVRZpkBvs2GUubKZgXuJCpGSk2FWOtJpWK4sC87/yV8Arg1DgrCHUm7uc1we+CedjierPxfo6QX9Laohyn60D3BtojYw1xxsiX9Rv0KCxCqmZn5Qd6PLV4+0PzFXjO0xvrHecQ+NhyWfmMkfV5dO/zaF0OoxrHj/cFmvoGSHN4r1SIV2TwbtIuUCxypWqUTVrfejQyJ2Dhk2GbOa941EtXXX8i2zEDTBq56Tby4d44QvhK1v8QNmmev/o6j1YCBMKN+X59bSqUHF4PX8ap9m2iWYNCbvwET5YJAKnWLEj2QGBXn34GWZksyU/Fe+mvVJ0eRwZjUWKfOcS5xzrvRrNayyMIzUSUGKuTDeS+KR9eF7215hBDu6t8z+s+jSyoLD8+tttnHrgBkkUvwzctT8MeQP0JdpYhYyITuWYJ1OB9w2GKHE5ch9JYYOKUliJga42P6Hbx4NwTeCSNJ96mzQAKcDwwJZujzN2PDSr86uBlHwLdn+9cy0vndYUSYtY= + # ORG_GRADLE_PROJECT_ossrhPassword + - secure: NewZka3bmiDgrSP8+yfPQNf85K/sT4CQiIbrf9SWOTgI7Z6kq6kKXU94cEQue6Ugli0USreMZYhl5b6XvcCUzRF9kOh/mRk9VIaOOaOIloatmaF581mGiYNBn8AoBoQ/JURQ59dBxHxyyf4Wm5o63FW0RdZoBOb8FA+esLGdY8ZlpsSc3WdYmguJf6Ga2auT1FIGujDLjBYCaPBqx1xM8JckFWBU0QHhDGFo6CjGUUd62KTf72RVtsLmcMnEvoJ18s7txmWYY4H/BwONekTnmXw80+y6EVXP3K7kkD/9KL9xq/fDibcmP9UfbpCnEysu7hygMhPfMPB3KmPhFSP7GGlEZsLeGNhLBLXidpJmyNvcSHOdS+vaF8xbW/+DBJ3stNntS1TaPGPcIjAyKN67q4yayZBdJKzkIWzVkJy3akRwO7D0Lj1irs7mcLL0DSkP3YrgShIhcq34D+Iknblz4AykG1/ehv4eAipljrh66SGB41QlN6U0AZVpqi869sPfu55q8Piucnrps+3jo26q25mtPpurEIIQIX6SCwUyK4A+4Jvk4r8KUykkBS7HildiflKGwiLTRHgskGkAslm0ARZo4B50FQgqcJbytkSqe76y4WeVLZ648zNNTlX7oysKeizGjj6CxnXN3KLKmmXqKaht5UX6gCSbw2+O9/OlAgw= + script: ./gradlew --stacktrace uploadArchives -x check + - name: "Update snapshot documentation" + env: + # ORG_GRADLE_PROJECT_githubToken + - secure: AW4jpuuv5MTIxUw1dlfIKyRgp5G9aj9/wsJx+XBVdZ6/+0Tj8BzBldUe9b4JeNEnDGIRIL83lPHMR0a/DbfF5Cg0Cpi0oLQE+JkKh/ucRZucrXXMjIg+3IEtpdUG/I4vqjwd1xUAYZ/URPP75NVr7b3RVY9+MTaSaZ2b+VtG/aMNJ5kih4PHfJ2wR0OobHrTSxOkyGwZTdG6ZvFplHcPtuZ/v6KJGaUrCFYRnXOZIE73dPDQjxqy90FQrNlscvkZ3cerqVeeQ1nK7eU60neNBrSP9PJsN6zqSyPfMfyfzGBiS7v2dlVktSjeOmdEn+NCSmR59a0wbVObhzisOgODqBMk3KLWOWwWHfA2M5URuQaNr/AsKQTr2FlVkwY/cHO52q58tKNE1m/3nPs5ZMEhlh6jtbBafUe8NA9JQ0LKppA/kMqd1vT97hCeMGR0B5rTZEYXK9pCKWmWg98YEAR9RA9gnNuRod07uI/T9dSvHVvg3T7K1jdFtnSs8TOYamxn3wo1I8jud34mUTv7v4Wdk7ujXZJIcIkHFWKon/OpRwiBHNh9w5w0d7qZVvH7dYFhxRYjbUP4d+QzYlUQUVcy1QvixHBr4eYRZ1q7v40OWBKb9lOXdD1I6x7XLtcNcZ08c3xKpiBFjwTPIMot87vw90PTPFigBAfRj1wDocdd9Sg= + script: ./gradlew --stacktrace publishGhPages diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentest4j-r1.0.0/README.md new/opentest4j-r1.2.0/README.md --- old/opentest4j-r1.0.0/README.md 2017-09-10 13:25:29.000000000 +0200 +++ new/opentest4j-r1.2.0/README.md 2019-06-06 21:23:33.000000000 +0200 @@ -1,5 +1,7 @@ # Open Test Alliance for the JVM +[![Travis Build Status](https://travis-ci.org/ota4j-team/opentest4j.svg?branch=master)](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). @@ -18,11 +20,9 @@ Based on discussions with IDE and build tool developers from Eclipse, Gradle, and IntelliJ, the JUnit 5 team is working on a proposal for an open source project to provide a minimal common foundation for testing libraries on the JVM. The primary goal of the project is to enable testing frameworks like JUnit, TestNG, Spock, etc. and third-party assertion libraries like Hamcrest, AssertJ, etc. to use a common set of exceptions that IDEs and build tools can support in a consistent manner across all testing scenarios -- for example, for consistent handling of failed assertions and failed assumptions as well as visualization of test execution in IDEs and reports. -## Draft Implementation - -We have begun with a small set of errors and exceptions that we consider to be common for all testing and assertion frameworks. In fact, early drafts of these errors and exceptions are already used in [JUnit 5]. +## Initial Implementation -Please take a look at our current draft in this project and let us know what you think. +We have begun with a small set of errors and exceptions that we consider to be common for all testing and assertion frameworks. In fact, these errors and exceptions are already used in [JUnit 5]. Please take a look at the project and let us know what you think. ## Javadocs @@ -73,7 +73,7 @@ - **Group ID**: `org.opentest4j` - **Artifact ID**: `opentest4j` -- **Version**: `1.0.0` +- **Version**: `1.2.0` See also: <http://search.maven.org/#search|ga|1|opentest4j/> @@ -81,19 +81,10 @@ - **Group ID**: `org.opentest4j` - **Artifact ID**: `opentest4j` -- **Version**: `1.0.0-SNAPSHOT` +- **Version**: `1.3.0-SNAPSHOT` See also: <https://oss.sonatype.org/content/repositories/snapshots/org/opentest4j/opentest4j/> -# Continuous Integration Builds - -[![Travis Build Status](https://travis-ci.org/ota4j-team/opentest4j.svg)](https://travis-ci.org/ota4j-team/opentest4j) [![Jenkins Build Status](https://junit.ci.cloudbees.com/buildStatus/icon?job=OpenTest4J)](https://junit.ci.cloudbees.com/job/OpenTest4J) - ---- - -[![built on DEV@cloud](https://www.cloudbees.com/sites/default/files/styles/large/public/Button-Built-on-CB-1.png?itok=3Tnkun-C)](https://junit.ci.cloudbees.com/job/OpenTest4J/) - - [CONTRIBUTING.md]: https://github.com/ota4j-team/opentest4j/blob/master/CONTRIBUTING.md [JUnit 5]: https://github.com/junit-team/junit5 [Maven Central]: http://search.maven.org/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentest4j-r1.0.0/build.gradle new/opentest4j-r1.2.0/build.gradle --- old/opentest4j-r1.0.0/build.gradle 2017-09-10 13:25:29.000000000 +0200 +++ new/opentest4j-r1.2.0/build.gradle 2019-06-06 21:23:33.000000000 +0200 @@ -1,17 +1,15 @@ import java.text.SimpleDateFormat -buildscript { - repositories { - maven { - url 'https://plugins.gradle.org/m2/' - } - } - dependencies { - classpath 'com.diffplug.gradle.spotless:spotless:1.3.2' - classpath 'org.ajoberstar:gradle-git:1.5.1' - classpath "be.insaneprogramming.gradle:animalsniffer-gradle-plugin:+" - classpath 'net.nemerosa:versioning:1.7.1' - } +plugins { + id 'java' + id 'osgi' + id 'eclipse' + id 'idea' + id 'maven' + id 'signing' + id 'com.diffplug.gradle.spotless' version '3.23.0' + id 'net.nemerosa.versioning' version '2.8.2' + id 'org.ajoberstar.github-pages' version '1.7.2' } Date buildTimeAndDate = new Date() @@ -21,31 +19,31 @@ builtByValue = project.hasProperty('builtBy') ? project.builtBy : project.defaultBuiltBy } -apply plugin: 'java' -apply plugin: 'eclipse' -apply plugin: 'idea' -apply plugin: 'maven' -apply plugin: 'signing' -apply plugin: 'com.diffplug.gradle.spotless' -apply plugin: 'be.insaneprogramming.gradle.animalsniffer' -apply plugin: 'net.nemerosa.versioning' -apply plugin: "org.ajoberstar.github-pages" - description = 'Open Test Alliance for the JVM' +def moduleName = 'org.opentest4j' repositories { mavenCentral() } compileJava { - // please also update accordingly the animalsniffer config down below when changing the compatibility settings - sourceCompatibility = 1.6 - targetCompatibility = 1.6 + options.compilerArgs = ['--release', '6'] } -compileTestJava { - sourceCompatibility = 1.6 - targetCompatibility = 1.6 +task compileModule(type: JavaCompile) { + def moduleSrcDir = file('src/module/java') + source(moduleSrcDir) + destinationDir = file("$buildDir/classes/java/modules") + classpath = compileJava.classpath + inputs.property("moduleName", moduleName) + inputs.property("moduleVersion", project.version) + options.compilerArgs = [ + '--release', '9', + '--module-version', project.version as String, + '--module-source-path', moduleSrcDir.toString(), + '--patch-module', "$moduleName=${sourceSets.main.allJava.srcDirs.join(':')}", + '--module', moduleName + ] } dependencies { @@ -61,8 +59,8 @@ def normalizeVersion = { versionLiteral -> try { (versionLiteral =~ /(\d+)\.(\d+)\.(\d+).*/)[0][1..3].join('.') - } catch(x) { - throw new GradleException("Version '$versionLiteral' does not match version pattern, e.g. 1.0.0-QUALIFIER") + } catch (e) { + throw new GradleException("Version '$versionLiteral' does not match version pattern, e.g. 1.0.0-QUALIFIER", e) } } @@ -79,9 +77,13 @@ 'Specification-Vendor': 'opentest4j.org', 'Implementation-Title': project.name, 'Implementation-Version': project.version, - 'Implementation-Vendor': 'opentest4j.org', - 'Automatic-Module-Name': 'org.opentest4j' + 'Implementation-Vendor': 'opentest4j.org' ) + license = 'The Apache License, Version 2.0' + vendor = 'opentest4j.org' + } + from(files("${compileModule.destinationDir}/$moduleName").builtBy(compileModule)) { + include('module-info.class') } } @@ -90,7 +92,7 @@ options.author = true options.header = 'Open Test Alliance for the JVM' options.addStringOption('Xdoclint:html,syntax,reference', '-quiet') - options.links 'https://docs.oracle.com/javase/8/docs/api/' + options.links 'https://docs.oracle.com/en/java/javase/11/docs/api/' } task sourcesJar(type: Jar, dependsOn: classes) { @@ -111,20 +113,14 @@ spotless { java { licenseHeaderFile rootProject.file('etc/spotless/apache-license-2.0.java') - importOrder(['java', 'javax', 'com', 'org']) - eclipseFormatFile rootProject.file('etc/eclipse/eclipse-formatter-settings.xml') + importOrder('java', 'javax', 'com', 'org') + eclipse().configFile(rootProject.file('etc/eclipse/eclipse-formatter-settings.xml')) trimTrailingWhitespace() endWithNewline() - - custom 'Lambda fix', { it.replace('} )', '})').replace('} ,', '},') } } } -animalsniffer { - signature = "org.codehaus.mojo.signature:java16:+@signature" -} - def signArtifacts = !project.version.contains('SNAPSHOT') if (signArtifacts) { @@ -265,7 +261,3 @@ prepareGhPages.dependsOn(prepareDocsForUploadToGhPages) prepareGhPages.dependsOn(createCurrentDocsFolder) - -task wrapper(type: Wrapper) { - distributionUrl = 'https://services.gradle.org/distributions/gradle-2.14.1-bin.zip' -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentest4j-r1.0.0/etc/eclipse/eclipse-formatter-settings.xml new/opentest4j-r1.2.0/etc/eclipse/eclipse-formatter-settings.xml --- old/opentest4j-r1.0.0/etc/eclipse/eclipse-formatter-settings.xml 2017-09-10 13:25:29.000000000 +0200 +++ new/opentest4j-r1.2.0/etc/eclipse/eclipse-formatter-settings.xml 2019-06-06 21:23:33.000000000 +0200 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?> <profiles version="12"> -<profile kind="CodeFormatterProfile" name="JUnit Lambda" version="12"> +<profile kind="CodeFormatterProfile" name="JUnit 5" version="12"> <setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="insert"/> @@ -16,7 +16,7 @@ <setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="false"/> <setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/> @@ -64,7 +64,7 @@ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="120"/> +<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="80"/> <setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="true"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/> @@ -107,7 +107,7 @@ <setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="true"/> <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="true"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/> @@ -232,7 +232,7 @@ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="false"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentest4j-r1.0.0/etc/spotless/apache-license-2.0.java new/opentest4j-r1.2.0/etc/spotless/apache-license-2.0.java --- old/opentest4j-r1.0.0/etc/spotless/apache-license-2.0.java 2017-09-10 13:25:29.000000000 +0200 +++ new/opentest4j-r1.2.0/etc/spotless/apache-license-2.0.java 2019-06-06 21:23:33.000000000 +0200 @@ -1,5 +1,5 @@ /* - * Copyright 2015-2016 the original author or authors. + * Copyright 2015-2018 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.0.0/gradle/wrapper/gradle-wrapper.jar and new/opentest4j-r1.2.0/gradle/wrapper/gradle-wrapper.jar differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentest4j-r1.0.0/gradle/wrapper/gradle-wrapper.properties new/opentest4j-r1.2.0/gradle/wrapper/gradle-wrapper.properties --- old/opentest4j-r1.0.0/gradle/wrapper/gradle-wrapper.properties 2017-09-10 13:25:29.000000000 +0200 +++ new/opentest4j-r1.2.0/gradle/wrapper/gradle-wrapper.properties 2019-06-06 21:23:33.000000000 +0200 @@ -1,6 +1,5 @@ -#Mon Jul 18 11:55:30 CEST 2016 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-bin.zip diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentest4j-r1.0.0/gradle.properties new/opentest4j-r1.2.0/gradle.properties --- old/opentest4j-r1.0.0/gradle.properties 2017-09-10 13:25:29.000000000 +0200 +++ new/opentest4j-r1.2.0/gradle.properties 2019-06-06 21:23:33.000000000 +0200 @@ -1,5 +1,5 @@ group = org.opentest4j -version = 1.0.0 +version = 1.2.0 junit4Version = 4.12 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentest4j-r1.0.0/gradlew new/opentest4j-r1.2.0/gradlew --- old/opentest4j-r1.0.0/gradlew 2017-09-10 13:25:29.000000000 +0200 +++ new/opentest4j-r1.2.0/gradlew 2019-06-06 21:23:33.000000000 +0200 @@ -1,4 +1,20 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ############################################################################## ## @@ -28,16 +44,16 @@ APP_BASE_NAME=`basename "$0"` # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" -warn ( ) { +warn () { echo "$*" } -die ( ) { +die () { echo echo "$*" echo @@ -154,11 +170,19 @@ esac fi -# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("$@") +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " } -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" +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")" +fi -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" +exec "$JAVACMD" "$@" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentest4j-r1.0.0/gradlew.bat new/opentest4j-r1.2.0/gradlew.bat --- old/opentest4j-r1.0.0/gradlew.bat 2017-09-10 13:25:29.000000000 +0200 +++ new/opentest4j-r1.2.0/gradlew.bat 2019-06-06 21:23:33.000000000 +0200 @@ -1,90 +1,100 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem 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= - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_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=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -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% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem http://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +: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% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentest4j-r1.0.0/settings.gradle new/opentest4j-r1.2.0/settings.gradle --- old/opentest4j-r1.0.0/settings.gradle 2017-09-10 13:25:29.000000000 +0200 +++ new/opentest4j-r1.2.0/settings.gradle 2019-06-06 21:23:33.000000000 +0200 @@ -1 +1,7 @@ rootProject.name = 'opentest4j' + +// Require Java 11 +if (!JavaVersion.current().java11) { + throw new GradleException('The OpenTest4J build requires Java 11. ' + + "Currently executing with Java ${JavaVersion.current()}.") +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentest4j-r1.0.0/src/main/java/org/opentest4j/AssertionFailedError.java new/opentest4j-r1.2.0/src/main/java/org/opentest4j/AssertionFailedError.java --- old/opentest4j-r1.0.0/src/main/java/org/opentest4j/AssertionFailedError.java 2017-09-10 13:25:29.000000000 +0200 +++ new/opentest4j-r1.2.0/src/main/java/org/opentest4j/AssertionFailedError.java 2019-06-06 21:23:33.000000000 +0200 @@ -1,5 +1,5 @@ /* - * Copyright 2015-2016 the original author or authors. + * Copyright 2015-2018 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. @@ -17,16 +17,12 @@ package org.opentest4j; /** - * {@code AssertionFailedError} is an <em>initial draft</em> for a common - * base class for test-related {@link AssertionError AssertionErrors}. + * {@code AssertionFailedError} is a common base class for test-related + * {@link AssertionError AssertionErrors}. * - * <p>In addition to a message and a cause this class stores the expected + * <p>In addition to a message and a cause, this class stores the expected * and actual values of an assertion using the {@link ValueWrapper} type. * - * <p><strong>WARNING</strong>: this is a <em>work in progress</em> and - * is therefore guaranteed to undergo heavy revisions in the near future - * based on community feedback. - * * @author Sam Brannen * @author Marc Philipp * @since 1.0 @@ -39,8 +35,8 @@ private final ValueWrapper actual; /** - * Constructs an {@code AssertionFailedError} with no message, no cause, - * and no expected/actual values. + * Constructs an {@code AssertionFailedError} with an empty message, no + * cause, and no expected/actual values. */ public AssertionFailedError() { this(null); @@ -49,6 +45,9 @@ /** * Constructs an {@code AssertionFailedError} with a message, no cause, * and no expected/actual values. + * + * @param message the detail message; {@code null} or blank will be + * converted to the empty {@code String} */ public AssertionFailedError(String message) { this(message, null); @@ -57,6 +56,11 @@ /** * Constructs an {@code AssertionFailedError} with a message and * expected/actual values but without a cause. + * + * @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); @@ -65,6 +69,10 @@ /** * Constructs an {@code AssertionFailedError} with a message and a cause * but without expected/actual values. + * + * @param message the detail message; {@code null} or blank will be + * converted to the empty {@code String} + * @param cause the cause of the failure */ public AssertionFailedError(String message, Throwable cause) { this(message, null, null, cause); @@ -73,6 +81,12 @@ /** * Constructs an {@code AssertionFailedError} with a message, * expected/actual values, and a cause. + * + * @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} + * @param cause the cause of the failure */ public AssertionFailedError(String message, Object expected, Object actual, Throwable cause) { this(message, ValueWrapper.create(expected), ValueWrapper.create(actual), cause); @@ -80,14 +94,14 @@ private AssertionFailedError(String message, ValueWrapper expected, ValueWrapper actual, Throwable cause) { super((message == null || message.trim().length() == 0) ? "" : message); - initCause(cause); this.expected = expected; this.actual = actual; + initCause(cause); } /** - * Returns {@code true} if the expected value is defined, i.e. was passed - * to the constructor. + * Returns {@code true} if an <em>expected value</em> was supplied via an + * appropriate constructor. * * @see #getExpected() */ @@ -96,8 +110,8 @@ } /** - * Returns {@code true} if the actual value is defined, i.e. was passed - * to the constructor. + * Returns {@code true} if an <em>actual value</em> was supplied via an + * appropriate constructor. * * @see #getActual() */ @@ -123,4 +137,22 @@ return this.actual; } + /** + * Returns a short description of this assertion error using the same format + * as {@link Throwable#toString()}. + * + * <p>Since the constructors of this class convert supplied {@code null} or + * blank messages to the empty {@code String}, this method only includes + * non-empty messages in its return value. + * + * @return a string representation of this {@code AssertionFailedError} + * @since 1.1.1 + */ + @Override + public String toString() { + String className = getClass().getName(); + String message = getLocalizedMessage(); + return ("".equals(message) ? className : (className + ": " + message)); + } + } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentest4j-r1.0.0/src/main/java/org/opentest4j/IncompleteExecutionException.java new/opentest4j-r1.2.0/src/main/java/org/opentest4j/IncompleteExecutionException.java --- old/opentest4j-r1.0.0/src/main/java/org/opentest4j/IncompleteExecutionException.java 2017-09-10 13:25:29.000000000 +0200 +++ new/opentest4j-r1.2.0/src/main/java/org/opentest4j/IncompleteExecutionException.java 2019-06-06 21:23:33.000000000 +0200 @@ -1,5 +1,5 @@ /* - * Copyright 2015-2016 the original author or authors. + * Copyright 2015-2018 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.0.0/src/main/java/org/opentest4j/MultipleFailuresError.java new/opentest4j-r1.2.0/src/main/java/org/opentest4j/MultipleFailuresError.java --- old/opentest4j-r1.0.0/src/main/java/org/opentest4j/MultipleFailuresError.java 2017-09-10 13:25:29.000000000 +0200 +++ new/opentest4j-r1.2.0/src/main/java/org/opentest4j/MultipleFailuresError.java 2019-06-06 21:23:33.000000000 +0200 @@ -1,5 +1,5 @@ /* - * Copyright 2015-2016 the original author or authors. + * Copyright 2015-2018 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. @@ -21,9 +21,9 @@ import java.util.List; /** - * {@link MultipleFailuresError} is an {@link AssertionError} which - * aggregates multiple {@code AssertionErrors} thrown in a given context - * (i.e., typically within the invocation of a single test). + * {@link MultipleFailuresError} is an {@link AssertionError} that aggregates + * multiple failures thrown in a given context (i.e., typically within the + * invocation of a single test). * * @author Johannes Link * @author Sam Brannen @@ -34,10 +34,24 @@ private static final long serialVersionUID = 1L; + private static final String EOL = System.getProperty("line.separator"); + private final String heading; private final List<Throwable> failures; + /** + * Constructs an {@code MultipleFailuresError} with the supplied heading and + * failures. + * + * @param heading the message heading; a default value will be used if + * {@code null} or blank + * @param failures the list of failures; must not be {@code null} or contain + * {@code null} elements + */ public MultipleFailuresError(String heading, List<? extends Throwable> failures) { + if (failures == null) { + throw new NullPointerException("failures must not be null"); + } this.heading = isBlank(heading) ? "Multiple Failures" : heading.trim(); this.failures = new ArrayList<Throwable>(); @@ -57,30 +71,34 @@ return this.heading; } - String lineSeparator = System.getProperty("line.separator"); - // @formatter:off StringBuilder builder = new StringBuilder(this.heading) .append(" (") .append(failureCount).append(" ") .append(pluralize(failureCount, "failure", "failures")) .append(")") - .append(lineSeparator); + .append(EOL); // @formatter:on int lastIndex = failureCount - 1; for (Throwable failure : this.failures.subList(0, lastIndex)) { - builder.append("\t").append(nullSafeMessage(failure)).append(lineSeparator); + builder.append("\t").append(nullSafeMessage(failure)).append(EOL); } builder.append('\t').append(nullSafeMessage(this.failures.get(lastIndex))); return builder.toString(); } + /** + * Returns the list of failures contained in this error. + */ public List<Throwable> getFailures() { return Collections.unmodifiableList(this.failures); } + /** + * Returns whether this error contains any failures. + */ public boolean hasFailures() { return !this.failures.isEmpty(); } @@ -95,9 +113,9 @@ private static String nullSafeMessage(Throwable failure) { if (isBlank(failure.getMessage())) { - return "<no message> in " + failure.getClass().getName(); + return failure.getClass().getName() + ": <no message>"; } - return failure.getMessage(); + return failure.getClass().getName() + ": " + failure.getMessage(); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentest4j-r1.0.0/src/main/java/org/opentest4j/TestAbortedException.java new/opentest4j-r1.2.0/src/main/java/org/opentest4j/TestAbortedException.java --- old/opentest4j-r1.0.0/src/main/java/org/opentest4j/TestAbortedException.java 2017-09-10 13:25:29.000000000 +0200 +++ new/opentest4j-r1.2.0/src/main/java/org/opentest4j/TestAbortedException.java 2019-06-06 21:23:33.000000000 +0200 @@ -1,5 +1,5 @@ /* - * Copyright 2015-2016 the original author or authors. + * Copyright 2015-2018 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.0.0/src/main/java/org/opentest4j/TestSkippedException.java new/opentest4j-r1.2.0/src/main/java/org/opentest4j/TestSkippedException.java --- old/opentest4j-r1.0.0/src/main/java/org/opentest4j/TestSkippedException.java 2017-09-10 13:25:29.000000000 +0200 +++ new/opentest4j-r1.2.0/src/main/java/org/opentest4j/TestSkippedException.java 2019-06-06 21:23:33.000000000 +0200 @@ -1,5 +1,5 @@ /* - * Copyright 2015-2016 the original author or authors. + * Copyright 2015-2018 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.0.0/src/main/java/org/opentest4j/ValueWrapper.java new/opentest4j-r1.2.0/src/main/java/org/opentest4j/ValueWrapper.java --- old/opentest4j-r1.0.0/src/main/java/org/opentest4j/ValueWrapper.java 2017-09-10 13:25:29.000000000 +0200 +++ new/opentest4j-r1.2.0/src/main/java/org/opentest4j/ValueWrapper.java 2019-06-06 21:23:33.000000000 +0200 @@ -1,5 +1,5 @@ /* - * Copyright 2015-2016 the original author or authors. + * Copyright 2015-2018 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. @@ -22,10 +22,15 @@ * Serializable representation of a value that was used in an assertion. * * <p>This class only stores the value if it implements {@link Serializable}. - * In any case, it stores its runtime type, identity hash code and string - * representation, i.e. the result of invoking {@link Object#toString}. + * In any case, it stores its {@linkplain #getType() runtime type}, {@linkplain + * #getIdentityHashCode() identity hash code}, and {@linkplain + * #getStringRepresentation() string representation} determined via {@link + * String#valueOf(Object)}. If the invocation of {@code String.valueOf(Object)} + * throws an {@link Exception}, the string representation will take the form of + * {@code "<Exception in toString(): " + e + ">"}, where "e" is the caught + * exception. * - * <p>The {@link #toString} method returns the string representation of the + * <p>The {@link #toString()} method returns the string representation of the * value along with its type and identity hash code. * * @author Marc Philipp @@ -43,66 +48,137 @@ * Factory for creating a new {@code ValueWrapper} for the supplied {@code value}. * * <p>If the supplied {@code value} is {@code null}, this method will return a - * cached {@code ValueWrapper} suitable for all null values. + * cached {@code ValueWrapper} suitable for all {@code null} values. + * If the supplied {@code value} is already an instance of {@link ValueWrapper}, + * it will be returned as is. * - * @param value the value to wrap - * @return a wrapper for the supplied value + * @param value the value to wrap; may be {@code null} + * @return a wrapper for the supplied value; never {@code null} */ public static ValueWrapper create(Object value) { - return (value == null ? nullValueWrapper : new ValueWrapper(value)); + if (value instanceof ValueWrapper) + return (ValueWrapper) value; + return (value == null) ? nullValueWrapper : new ValueWrapper(value); + } + + /** + * Factory for creating a new {@code ValueWrapper} for the supplied {@code value} + * using the supplied custom {@code stringRepresentation}. + * + * <p>You should use this method when you don't want to rely on the result of the + * value's {@link Object#toString() toString()} method. + * + * <p>If the supplied {@code value} is {@code null}, this method will return a + * cached {@code ValueWrapper} suitable for all {@code null} values. + * If the supplied {@code value} is already an instance of {@link ValueWrapper}, + * it will be returned as is if the {@code stringRepresentation} match, otherwise + * the original value will be unwrapped and a new {@code ValueWrapper} with the + * new {@code stringRepresentation} will be created. + * + * @param value the value to wrap; may be {@code null} + * @param stringRepresentation a custom rendering of the value; will fallback to + * the default behavior if {@code null} + * @return a wrapper for the supplied value; never {@code null} + * @since 1.2 + */ + public static ValueWrapper create(Object value, String stringRepresentation) { + if (value instanceof ValueWrapper) { + ValueWrapper wrapper = (ValueWrapper) value; + return wrapper.stringRepresentation.equals(stringRepresentation) ? wrapper + : create(wrapper.value, stringRepresentation); + } + return (value == null ? nullValueWrapper : new ValueWrapper(value, stringRepresentation)); } private final Serializable value; private final Class<?> type; private final String stringRepresentation; private final int identityHashCode; + private final transient Object ephemeralValue; /** * Reads and stores the supplied value's runtime type, string representation, and * identity hash code. */ - private ValueWrapper(Object value) { + private ValueWrapper(Object value, String stringRepresentation) { this.value = value instanceof Serializable ? (Serializable) value : null; this.type = value != null ? value.getClass() : null; - this.stringRepresentation = String.valueOf(value); + this.stringRepresentation = stringRepresentation == null ? safeValueToString(value) : stringRepresentation; this.identityHashCode = System.identityHashCode(value); + this.ephemeralValue = value; + } + + private ValueWrapper(Object value) { + this(value, safeValueToString(value)); + } + + private static String safeValueToString(Object value) { + try { + return String.valueOf(value); + } + catch (Exception e) { + return "<Exception in toString(): " + e + ">"; + } } /** - * Returns the value as passed to the constructor in case it implemented - * {@link Serializable}; otherwise, {@code null}. + * Returns the value supplied to {@link #create(Object)} if the value + * implements {@link Serializable}; otherwise, {@code null}. + * + * @see #getEphemeralValue() */ public Serializable getValue() { return this.value; } /** - * Returns the value's runtime type in case it wasn't {@code null}; - * otherwise, {@code null}. + * Returns the value's runtime type or {@code null} if the value is + * {@code null}. */ public Class<?> getType() { return this.type; } /** - * Returns the value's string representation, i.e. the result of invoking - * {@link Object#toString} at the time this object's constructor was - * called. Returns {@code "null"} if the value was {@code null}. + * Returns the value's string representation. + * + * <p>The string representation is generated by invoking + * {@link String#valueOf(Object) String.valueOf(value)} for the value + * supplied to {@link #create(Object)}. + * + * @see #getValue() */ public String getStringRepresentation() { return this.stringRepresentation; } /** - * Returns the value's identity hash code, i.e. the result of invoking - * {@link System#identityHashCode} at the time this object's constructor - * was called. Returns {@code 0} if the value was {@code null}. + * Returns the value's identity hash code. + * + * <p>The identity hash code is generated by invoking + * {@link System#identityHashCode(Object) System.identityHashCode(value)} + * for the value supplied to {@link #create(Object)}. + * + * @see #getValue() */ public int getIdentityHashCode() { return this.identityHashCode; } /** + * Returns the original value supplied to {@link #create(Object) create()}. + * + * <p>If this {@code ValueWrapper} was created by deserialization this method + * returns {@code null}. + * + * @see #getValue() + * @since 1.2 + */ + public Object getEphemeralValue() { + return this.ephemeralValue; + } + + /** * Returns the value's string representation along with its type and * identity hash code. */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentest4j-r1.0.0/src/module/java/org.opentest4j/module-info.java new/opentest4j-r1.2.0/src/module/java/org.opentest4j/module-info.java --- old/opentest4j-r1.0.0/src/module/java/org.opentest4j/module-info.java 1970-01-01 01:00:00.000000000 +0100 +++ new/opentest4j-r1.2.0/src/module/java/org.opentest4j/module-info.java 2019-06-06 21:23:33.000000000 +0200 @@ -0,0 +1,3 @@ +module org.opentest4j { + exports org.opentest4j; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentest4j-r1.0.0/src/test/java/org/opentest4j/AssertionFailedErrorTests.java new/opentest4j-r1.2.0/src/test/java/org/opentest4j/AssertionFailedErrorTests.java --- old/opentest4j-r1.0.0/src/test/java/org/opentest4j/AssertionFailedErrorTests.java 2017-09-10 13:25:29.000000000 +0200 +++ new/opentest4j-r1.2.0/src/test/java/org/opentest4j/AssertionFailedErrorTests.java 2019-06-06 21:23:33.000000000 +0200 @@ -1,5 +1,5 @@ /* - * Copyright 2015-2016 the original author or authors. + * Copyright 2015-2018 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. @@ -23,8 +23,10 @@ import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; +import java.io.InputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; +import java.io.OutputStream; import org.junit.Test; @@ -37,21 +39,54 @@ */ public class AssertionFailedErrorTests { + private static final String EMPTY = ""; + private static final String BLANK = " "; + + @Test + public void defaultConstructorUsesEmptyMessage() { + assertEquals(EMPTY, new AssertionFailedError().getMessage()); + } + @Test - public void nullMessageIsConvertedToEmptyString() { - assertEquals("", new AssertionFailedError().getMessage()); - assertEquals("", new AssertionFailedError(null).getMessage()); - assertEquals("", new AssertionFailedError(null, null).getMessage()); - assertEquals("", new AssertionFailedError(null, "foo", "bar").getMessage()); - assertEquals("", new AssertionFailedError(null, "foo", "bar", null).getMessage()); + public void nullMessageIsConvertedToEmptyMessage() { + assertEquals(EMPTY, new AssertionFailedError(null).getMessage()); + assertEquals(EMPTY, new AssertionFailedError(null, null).getMessage()); + assertEquals(EMPTY, new AssertionFailedError(null, "foo", "bar").getMessage()); + assertEquals(EMPTY, new AssertionFailedError(null, "foo", "bar", null).getMessage()); } @Test - public void blankMessageIsConvertedToEmptyString() { - assertEquals("", new AssertionFailedError(" ").getMessage()); - assertEquals("", new AssertionFailedError(" ", null).getMessage()); - assertEquals("", new AssertionFailedError(" ", "foo", "bar").getMessage()); - assertEquals("", new AssertionFailedError(" ", "foo", "bar", null).getMessage()); + public void blankMessageIsConvertedToEmptyMessage() { + assertEquals(EMPTY, new AssertionFailedError(BLANK).getMessage()); + assertEquals(EMPTY, new AssertionFailedError(BLANK, null).getMessage()); + assertEquals(EMPTY, new AssertionFailedError(BLANK, "foo", "bar").getMessage()); + assertEquals(EMPTY, new AssertionFailedError(BLANK, "foo", "bar", null).getMessage()); + } + + @Test + public void toStringChecks() { + String className = AssertionFailedError.class.getName(); + assertEquals(className, new AssertionFailedError().toString()); + assertEquals(className, new AssertionFailedError(null).toString()); + assertEquals(className, new AssertionFailedError(null, "foo", "bar").toString()); + assertEquals(className, new AssertionFailedError(null, new RuntimeException()).toString()); + assertEquals(className, new AssertionFailedError(null, "foo", "bar", new RuntimeException()).toString()); + + assertEquals(className, new AssertionFailedError(EMPTY).toString()); + assertEquals(className, new AssertionFailedError(EMPTY, "foo", "bar").toString()); + assertEquals(className, new AssertionFailedError(EMPTY, new RuntimeException()).toString()); + assertEquals(className, new AssertionFailedError(EMPTY, "foo", "bar", new RuntimeException()).toString()); + + assertEquals(className, new AssertionFailedError(BLANK).toString()); + assertEquals(className, new AssertionFailedError(BLANK, "foo", "bar").toString()); + assertEquals(className, new AssertionFailedError(BLANK, new RuntimeException()).toString()); + assertEquals(className, new AssertionFailedError(BLANK, "foo", "bar", new RuntimeException()).toString()); + + assertEquals(className + ": message", new AssertionFailedError("message").toString()); + assertEquals(className + ": message", new AssertionFailedError("message", "foo", "bar").toString()); + assertEquals(className + ": message", new AssertionFailedError("message", new RuntimeException()).toString()); + assertEquals(className + ": message", + new AssertionFailedError("message", "foo", "bar", new RuntimeException()).toString()); } @Test @@ -99,31 +134,79 @@ public void serializationWorksForAssertionFailedErrorWithoutAnyValues() throws Exception { AssertionFailedError error = serializeAndDeserialize(new AssertionFailedError()); - assertEquals("", error.getMessage()); + assertEquals(EMPTY, error.getMessage()); assertFalse(error.isExpectedDefined()); assertNull(error.getExpected()); assertFalse(error.isActualDefined()); assertNull(error.getActual()); } + @Test + public void deserializationOfAssertionFailedErrorWorksForVersion_1_0_0() throws Exception { + // Generated using: + // FileOutputStream outputStream = new FileOutputStream("src/test/resources/AssertionFailedError_serializedVersion_1_0_0.out"); + // serialize(new AssertionFailedError("message", "foo", "bar"), outputStream); + // outputStream.close(); + + AssertionFailedError error = (AssertionFailedError) deserializeClasspathResource( + "/AssertionFailedError_serializedVersion_1_0_0.out"); + + assertEquals("message", error.getMessage()); + assertTrue(error.isExpectedDefined()); + assertEquals("foo", error.getExpected().getValue()); + assertTrue(error.isActualDefined()); + assertEquals("bar", error.getActual().getValue()); + } + + @Test + public void ephemeralValueIsOmittedFromSerialization() throws Exception { + class NonSerializable { + public final String guid = "8675309"; + } + + AssertionFailedError error = serializeAndDeserialize( + new AssertionFailedError("a message", new NonSerializable(), new NonSerializable())); + assertEquals("a message", error.getMessage()); + assertTrue(error.isExpectedDefined()); + assertNull(error.getExpected().getValue()); + assertNull(error.getExpected().getEphemeralValue()); + assertTrue(error.isActualDefined()); + assertNull(error.getActual().getValue()); + assertNull(error.getActual().getEphemeralValue()); + } + + private Object deserializeClasspathResource(String name) throws Exception { + InputStream inputStream = getClass().getResourceAsStream(name); + try { + return deserialize(inputStream); + } + finally { + inputStream.close(); + } + } + private AssertionFailedError serializeAndDeserialize(AssertionFailedError originalError) throws Exception { byte[] bytes = serialize(originalError); - Object deserializedObject = deserialize(bytes); + Object deserializedObject = deserialize(new ByteArrayInputStream(bytes)); assertEquals(AssertionFailedError.class, deserializedObject.getClass()); return (AssertionFailedError) deserializedObject; } - private Object deserialize(byte[] bytes) throws Exception { - ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(bytes)); + private Object deserialize(InputStream inputStream) throws Exception { + ObjectInputStream in = new ObjectInputStream(inputStream); return in.readObject(); } private byte[] serialize(Object object) throws Exception { ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); - ObjectOutputStream out = new ObjectOutputStream(byteArrayOutputStream); + serialize(object, byteArrayOutputStream); + return byteArrayOutputStream.toByteArray(); + } + + private void serialize(Object object, OutputStream outputStream) throws Exception { + ObjectOutputStream out = new ObjectOutputStream(outputStream); out.writeObject(object); out.flush(); - return byteArrayOutputStream.toByteArray(); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentest4j-r1.0.0/src/test/java/org/opentest4j/MultipleFailuresErrorTests.java new/opentest4j-r1.2.0/src/test/java/org/opentest4j/MultipleFailuresErrorTests.java --- old/opentest4j-r1.0.0/src/test/java/org/opentest4j/MultipleFailuresErrorTests.java 2017-09-10 13:25:29.000000000 +0200 +++ new/opentest4j-r1.2.0/src/test/java/org/opentest4j/MultipleFailuresErrorTests.java 2019-06-06 21:23:33.000000000 +0200 @@ -1,5 +1,5 @@ /* - * Copyright 2015-2016 the original author or authors. + * Copyright 2015-2018 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. @@ -90,10 +90,9 @@ MultipleFailuresError mfe = new MultipleFailuresError(HEADING, failures); - assertEquals( - String.format("%s %s%n\t%s%n\t%s", HEADING, "(2 failures)", // - "<no message> in java.lang.AssertionError", // - "<no message> in org.opentest4j.AssertionFailedError"), // + assertEquals(String.format("%s %s%n\t%s%n\t%s", HEADING, "(2 failures)", // + "java.lang.AssertionError: <no message>", // + "org.opentest4j.AssertionFailedError: <no message>"), // mfe.getMessage()); } @@ -122,20 +121,23 @@ assertEquals(1, mfe.getFailures().size()); assertTrue(mfe.hasFailures()); - assertEquals(String.format("%s %s%n\t%s", outputHeading, "(1 failure)", "failure 1"), mfe.getMessage()); + assertEquals( + String.format("%s %s%n\t%s: %s", outputHeading, "(1 failure)", AssertionError.class.getName(), "failure 1"), + mfe.getMessage()); } private void assertExceptionWithFailures(String inputHeading, String outputHeading) { List<Throwable> failures = new ArrayList<Throwable>(); failures.add(new AssertionError("failure 1")); failures.add(new AssertionError("failure 2")); + String assertErrorClassName = AssertionError.class.getName(); MultipleFailuresError mfe = new MultipleFailuresError(inputHeading, failures); assertEquals(2, mfe.getFailures().size()); assertTrue(mfe.hasFailures()); - assertEquals(String.format("%s %s%n\t%s%n\t%s", outputHeading, "(2 failures)", "failure 1", "failure 2"), - mfe.getMessage()); + assertEquals(String.format("%s %s%n\t%s: %s%n\t%s: %s", outputHeading, "(2 failures)", assertErrorClassName, + "failure 1", assertErrorClassName, "failure 2"), mfe.getMessage()); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentest4j-r1.0.0/src/test/java/org/opentest4j/ValueWrapperTests.java new/opentest4j-r1.2.0/src/test/java/org/opentest4j/ValueWrapperTests.java --- old/opentest4j-r1.0.0/src/test/java/org/opentest4j/ValueWrapperTests.java 2017-09-10 13:25:29.000000000 +0200 +++ new/opentest4j-r1.2.0/src/test/java/org/opentest4j/ValueWrapperTests.java 2019-06-06 21:23:33.000000000 +0200 @@ -1,5 +1,5 @@ /* - * Copyright 2015-2016 the original author or authors. + * Copyright 2015-2018 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. @@ -16,10 +16,9 @@ package org.opentest4j; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; +import static org.junit.Assert.*; + +import java.io.Serializable; import org.junit.Test; @@ -41,6 +40,7 @@ assertEquals("null", wrapper.getStringRepresentation()); assertEquals(0, wrapper.getIdentityHashCode()); assertEquals("null", wrapper.toString()); + assertNull(wrapper.getEphemeralValue()); } @Test @@ -53,6 +53,59 @@ assertNotEquals(0, wrapper.getIdentityHashCode()); assertTrue(wrapper.toString().startsWith("1.2 (java.lang.Double@")); assertTrue(wrapper.toString().endsWith(")")); + assertEquals(1.2D, wrapper.getEphemeralValue()); + assertSame(wrapper.getValue(), wrapper.getEphemeralValue()); + } + + @Test + public void acceptsCustomStringRepresentation() { + ValueWrapper wrapper = ValueWrapper.create(1.2d, "1,20"); + + assertEquals(Double.class, wrapper.getType()); + assertEquals(1.2d, wrapper.getValue()); + assertEquals("1,20", wrapper.getStringRepresentation()); + assertNotEquals(0, wrapper.getIdentityHashCode()); + assertTrue(wrapper.toString().startsWith("1,20 (java.lang.Double@")); + assertTrue(wrapper.toString().endsWith(")")); + } + + @Test + public void doesNotWrapAnotherValueWrapper() { + ValueWrapper wrapper = ValueWrapper.create(1.2d); + + ValueWrapper same = ValueWrapper.create(wrapper); + + assertSame(wrapper, same); + } + + @Test + public void doesNotWrapAnotherValueWrapperWithSameCustomRepresentation() { + ValueWrapper wrapper = ValueWrapper.create(1.2d, "1,20"); + + ValueWrapper same = ValueWrapper.create(wrapper, "1,20"); + + assertSame(wrapper, same); + } + + @Test + public void doesRepackageValueWrapperWithDifferentStringRepresentation() { + ValueWrapper wrapper = ValueWrapper.create(1.2d); + + ValueWrapper same = ValueWrapper.create(wrapper, "1,20"); + + assertNotSame(wrapper, same); + } + + @Test + public void nullForCustomStringRepresentationFallsBackToDefaultToString() { + ValueWrapper wrapper = ValueWrapper.create(1.2d, null); + + assertEquals(Double.class, wrapper.getType()); + assertEquals(1.2d, wrapper.getValue()); + assertEquals("1.2", wrapper.getStringRepresentation()); + assertNotEquals(0, wrapper.getIdentityHashCode()); + assertTrue(wrapper.toString().startsWith("1.2 (java.lang.Double@")); + assertTrue(wrapper.toString().endsWith(")")); } @Test @@ -72,10 +125,38 @@ assertNull(wrapper.getValue()); assertEquals("someString", wrapper.getStringRepresentation()); assertNotEquals(0, wrapper.getIdentityHashCode()); + assertEquals(value, wrapper.getEphemeralValue()); String toString = wrapper.toString(); assertTrue(toString, toString.startsWith("someString (" + NonSerializable.class.getName() + "@")); assertTrue(toString, toString.endsWith(")")); } + @Test + public void wrapsWithBrokenToString() { + class BrokenToString implements Serializable { + private static final long serialVersionUID = -3072024134414066195L; + + @Override + public String toString() { + throw new RuntimeException("toStringFailure"); + } + } + + BrokenToString value = new BrokenToString(); + ValueWrapper wrapper = ValueWrapper.create(value); + + assertEquals(BrokenToString.class, wrapper.getType()); + assertEquals(value, wrapper.getValue()); + assertEquals(value, wrapper.getEphemeralValue()); + String representation = wrapper.getStringRepresentation(); + assertTrue(representation, representation.contains(RuntimeException.class.getName())); + assertTrue(representation, representation.contains("toStringFailure")); + assertNotEquals(0, wrapper.getIdentityHashCode()); + + String toString = wrapper.toString(); + assertTrue(toString, toString.contains(RuntimeException.class.getName())); + assertTrue(toString, toString.contains("toStringFailure")); + } + } Binary files old/opentest4j-r1.0.0/src/test/resources/AssertionFailedError_serializedVersion_1_0_0.out and new/opentest4j-r1.2.0/src/test/resources/AssertionFailedError_serializedVersion_1_0_0.out differ