Upgrade the JUnit dependency to the latest available 5.4.0.
Note that JUnit simplified its artifacts, and now it contains a
single, simple org.junit:junit-jupiter artifact.
This patch finalizes the upgrade of commons-lang's tests to use JUnit
Jupiter and remove the Vintage Engine dependency entirely.
While most of these changes are drop-in replacements with no functional
benefit, there are some non-obvious changes worth mentioning.
Unlike org.junit.Assert.assertEquals(double, double, double),
org.junit.jupiter.api.Assertions.assertEquals(double, double, double)
does not support deltas of zero, only strictly positive deltas.
This issue will be addressed in JUnit Jupiter 5.4 (see
https://github.com/junit-team/junit5/pull/1613 for details). In the
meanwhile, assertTrue(expected==actual) was used, and TODO comments were
placed in the code to refactor it to assertEquals once JUnit 5.4 is
available.
Unlike org.junit.Test, org.junit.jupiter.api.Test does not have an
"expected" argument. Instead, an explicit call to
org.junit.jupiter.api.Assertions.assertThrows is used.
Unlike org.junit.Test, org.junit.jupiter.api.Test does not have a
"timeout" argument either. Instead, an explicit call to
org.junit.jupiter.api.Assertions.assertTimeoutPreemptively is used.
JUnit Jupiter also no longer has the concept of Rules. Usages of the
SystemDefaultsSwitch rule and its accompanying annotates were replaced
with the @DefaultLocale annotation that Benedikt Ritter contributed to
JUnit Pioneer, the semi-official JUnit extension project.
Following the removal of their usages, the SystemDefaults annotation,
the SystemDefaultsSwitch rule and the SystemDefaultsSwitchTest class
that tests them had no more use, and they were removed entirely.
It's also worth noting this is a minimal patch for migrating the
package's tests to Jupiter. There are several tests that can be made
more elegant with Jupiter's new features, but that work is left for
subsequent patches.
Upgrade the tests in the time package to use JUnit Jupiter as
part of the effort to remove the dependency on the Vintage Engine.
While most of these changes are drop-in replacements with no functional
benefit, there are some non-obvious changes worth mentioning.
Unlike org.junit.Test, org.junit.jupiter.api.Test does not have an
"expected" argument. Instead, an explicit call to
org.junit.jupiter.api.Assertions.assertThrows is used.
JUnit Jupiter no longer has a concept of runners. Tests previously run
with the org.junit.runners.Parameterized runner were rewritten to use
@ParameterizedTest and a @MethodSource.
JUnit Jupiter also no longer has the concept of Rules. Usages of the
SystemDefaultsSwitch rule and its accompanying annotates were replaced
with the @DefaultLocale and @DefaultTimezone annotations that
Benedikt Ritter contributed to JUnit Pioneer, the semi-official JUnit
extension project.
It's also worth noting this is a minimal patch for migrating the
package's tests to Jupiter. There are several tests that can be made
more elegant with Jupiter's new features, but that work is left for
subsequent patches.
maven java9 profile:
- use maven-javadoc-plugin version 3.0.0-M1, because versions below 3.0.0 do not work on java 9
- skip maven-coveralls-plugin, because version 4.3.0 does not work on java 9, see https://github.com/trautonen/coveralls-maven-plugin/issues/112
compatibility.
This change duplicates adds some maven-jar-plugin configuration pom.
After we have implemented a solution for this in parent pom, this
confgiruation should be removed.
In order to provide patch for LANG-1110, required dependency on JMH lib.
Current commit add benchmark profile and ability to run JMH based benchmark by
executing "mvn test -P benchmark" command, moreover it's also possible to
specify exact benchmark name by running "mvn test -P benchmark
-Dbenchmark=benchmark.full.class.name".
This patch copies the FindBugs configuration in pom.xml from the
reporting section to the build section so findbugs can be used as part
of the build process (by using the maven goal findbugs:check).
It then adds this goal to the Travis CI build so that FindBugs
becomes part of the CI, and new patches would be prevented from
introducing new FindBugs errors.
This patch enforces the code style defined by the checkstyle checks
to the test files too.
In the cases where it would just add robustness and not improve the
code's readability and maintainability (specifically - the javadoc
checks), those checks are explicitly suppressed.
Currently, checkstyle is only run as part of the reporting phase, and
it's up to the developer to check the report manually.
This patch adds the checkstyle configuration to the build plugins so
it can be used to check the code (as opposed to just generate a
report of the failures) and adds it to Travis CI's configuration so
every new patch will be automatically checked against it.
This patch upgrades maven-checkstyle-plugin to the latest available
version, 2.17.
This is done in order to consume a fix for checkstyle wrongfully
reporting an error if the @return javadoc tag was used in an
annotation type, as it is in Guarded (line 36).
Note that checkstyle has removed the RedundantThrows check (see
discussion at https://github.com/checkstyle/checkstyle/issues/473),
so it was removed from the project's checkstyle.xml configuration.
Fix build on Java 9 Build 157 by adding a java-9 maven profile. This is activated by default on Java 9 and opens up java.base classes for reflection, which makes all unit tests pass.