Rob Tompkins [Tue, 9 Apr 2019 18:08:56 +0000 (14:08 -0400)]
(update) a few more version upgrades 3.8.1 -> 3.9
Tompkins [Tue, 9 Apr 2019 17:18:18 +0000 (13:18 -0400)]
Merge branch 'master' of https://github.com/apache/commons-lang into 3.9
Rob Tompkins [Tue, 9 Apr 2019 17:16:59 +0000 (13:16 -0400)]
LANG-1446: switch from cobertura to jacoco
Tompkins [Tue, 9 Apr 2019 17:12:01 +0000 (13:12 -0400)]
Preparing the codebase for 3.9
Rob Tompkins [Mon, 8 Apr 2019 18:35:57 +0000 (14:35 -0400)]
(docs) more specificity
Gilles Sadowski [Mon, 8 Apr 2019 13:22:17 +0000 (15:22 +0200)]
LANG-1442: Javadoc.
https://markmail.org/message/mbp35qav34ifjm4t
Tompkins [Mon, 8 Apr 2019 12:13:39 +0000 (08:13 -0400)]
(docs) update user use -> user explore
Rob Tompkins [Sat, 6 Apr 2019 13:02:56 +0000 (09:02 -0400)]
LANG-1442: Commons-RNG citation
Benedikt Ritter [Fri, 5 Apr 2019 16:33:35 +0000 (18:33 +0200)]
LANG-1443: Add more SystemUtils.IS_JAVA_XX variants (#415)
Tompkins [Thu, 4 Apr 2019 12:17:22 +0000 (08:17 -0400)]
(docs) add "</p>" to end of crypto statement
Tompkins [Thu, 4 Apr 2019 12:13:48 +0000 (08:13 -0400)]
(fix) unused imports
Tompkins [Thu, 4 Apr 2019 12:11:56 +0000 (08:11 -0400)]
(docs) remove SecureRandom
Rob Tompkins [Thu, 4 Apr 2019 00:43:17 +0000 (20:43 -0400)]
(docs) updates to documentation about SecureRandom
Gary Gregory [Wed, 27 Mar 2019 00:24:32 +0000 (20:24 -0400)]
Oops, remove dup property.
Gary Gregory [Wed, 27 Mar 2019 00:22:19 +0000 (20:22 -0400)]
Update Apache Commons Parent from 47 to 48.
Benedikt Ritter [Sat, 23 Mar 2019 12:50:53 +0000 (13:50 +0100)]
Add proposal for Jenkins Pipeline (#410)
Introduces a Jenkins pipeline with a build stage and an
optional deploy stage that is only executed when master
branch is build.
Post actions send mails in case of build failures.
Gary Gregory [Fri, 22 Mar 2019 19:34:27 +0000 (15:34 -0400)]
Update Travis build with current JDKs.
Bruno P. Kinoshita [Tue, 12 Mar 2019 21:11:39 +0000 (10:11 +1300)]
Merge pull request #413 from machaval/patch-1
Fix javadoc in wrapIfMissing
Mariano de Achaval [Tue, 12 Mar 2019 12:40:44 +0000 (09:40 -0300)]
Fix javadoc in wrapIfMissing
wrapIfMissing function was referencing warp function in the javadoc
Gary Gregory [Mon, 4 Mar 2019 22:44:26 +0000 (17:44 -0500)]
[LANG-1436] (doc) Fix javadoc for 'startIndex' parameter of
StringUtils.join() methods. GitHub PR #412.
Andrei Troie [Mon, 4 Mar 2019 22:41:38 +0000 (22:41 +0000)]
(doc) Fix javadoc for 'startIndex' parameter of StringUtils.join() methods (#412)
Alex Herbert [Sun, 3 Mar 2019 13:43:23 +0000 (13:43 +0000)]
Consolidate the StringUtils.equals and equalsIgnoreCase methods. (#409)
* Consolidate the StringUtils.equals and equalsIgnoreCase methods.
Implement the same edge case logic for null. Use the same parameter
names. Use the same Javadoc wording. Change the equals method to use a
step-wise charAt comparison.
* LANG-1436: Added Jira to changes.xml.
Rob Tompkins [Mon, 18 Feb 2019 23:34:22 +0000 (18:34 -0500)]
Merge pull request #391 from RahulNagekar/JsonToStringStyle_Junits
Adding junits for JsonToStringStyle
Benedikt Ritter [Sat, 9 Feb 2019 15:56:09 +0000 (16:56 +0100)]
Simplify test code by using lambda expressions
pascalschumacher [Sat, 9 Feb 2019 12:54:01 +0000 (13:54 +0100)]
Update checkstyle to version 8.17
pascalschumacher [Sat, 9 Feb 2019 12:46:58 +0000 (13:46 +0100)]
Update EasyMock to version 4.0.2
pascalschumacher [Sat, 9 Feb 2019 12:43:15 +0000 (13:43 +0100)]
Update Hamcrest to version 2.1
pascalschumacher [Sat, 9 Feb 2019 12:31:34 +0000 (13:31 +0100)]
Remove dependency management for JUnit (since the update to JUnit 5.4.0 we only have a single JUnit test dependency).
Allon Mureinik [Fri, 8 Feb 2019 19:41:33 +0000 (21:41 +0200)]
Simplify assertions (closes #404)
Use JUnit methods to clean up the test and simplify the assertions:
- assertArraysEqual(x, y) replaces assertTrue(Arrays.equals(x, y))
- assertEquals(x, y) replaces assertTrue(x == y)
- assertNotEquals(x, y) replaces assertFalse(x == y)
Allon Mureinik [Fri, 8 Feb 2019 19:36:33 +0000 (21:36 +0200)]
Use assertThrows in FunctionsTest (closes #404)
Use JUnit Jupiter's elegant assertThrows method instead of the
boilerplate pattern of try-fail-catch to assert an exception was
thrown.
Eitan Adler [Sat, 9 Feb 2019 10:08:32 +0000 (02:08 -0800)]
[ToStringBuilderTest] clean up after some old issues
- Remove code to handle old JDK 6 bugs
- Fix a mis-ordered assertEquals
- Remove a deprecated call to Character's constructor
Allon Mureinik [Fri, 8 Feb 2019 14:21:11 +0000 (16:21 +0200)]
Clean up floating point assertions (closes #402)
JUnit Jupiter 5.4.0 supports deltas of 0 when asserting double and
float equalities.
This patch utilizes these new assertEquals methods and removes the
hack of using assertTrue with an == statement that was needed in older
JUnit versions.
Allon Mureinik [Fri, 8 Feb 2019 13:28:02 +0000 (15:28 +0200)]
Upgrade JUnit depedency to 5.4.0 (closes #402)
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.
pascalschumacher [Fri, 8 Feb 2019 18:50:44 +0000 (19:50 +0100)]
Skip javadoc on Java 11 to workaround https://bugs.openjdk.java.net/browse/JDK-
8212233 which causes javadoc to fail with "Exit code: 1 - javadoc: error - The code being documented uses modules but the packages defined in https://docs.oracle.com/javase/7/docs/api/ are in the unnamed module."
pascalschumacher [Fri, 8 Feb 2019 18:41:40 +0000 (19:41 +0100)]
Merge remote-tracking branch 'origin/pr/403'
Allon Mureinik [Fri, 8 Feb 2019 18:05:43 +0000 (20:05 +0200)]
Fix javadoc errors in Functions.java
Allon Mureinik [Fri, 8 Feb 2019 17:39:01 +0000 (19:39 +0200)]
FunctionsTest whitespaces
Use four spaces instead of a tab as per the projcet's Checkstyle
rules.
Allon Mureinik [Fri, 8 Feb 2019 17:37:38 +0000 (19:37 +0200)]
FunctionsTest whitespace after comma
Add a space after the comma as per the project's Checkstyle rules
Allon Mureinik [Fri, 8 Feb 2019 17:36:29 +0000 (19:36 +0200)]
FunctionsTest method references
Use method references instead of lambda expression to clean up the
code and comply to the project's Checkstyle rules.
Allon Mureinik [Fri, 8 Feb 2019 17:34:40 +0000 (19:34 +0200)]
FunctionTest redundant constructor modifier
Remove redundant public modifiers from inner classes constructors as
per the project's Checkstyle rules.
Allon Mureinik [Fri, 8 Feb 2019 17:32:39 +0000 (19:32 +0200)]
FunctionsTest imports
Clean up FunctionsTest's imports as per the project's Checkstyle
rules.
Allon Mureinik [Fri, 8 Feb 2019 17:30:35 +0000 (19:30 +0200)]
Functions.java whitspaces
Replace tabs with four spaces, as per the project's Checkstyle rules.
Allon Mureinik [Fri, 8 Feb 2019 17:29:06 +0000 (19:29 +0200)]
Add spaces after commas in Functions.java
Add spaces after commas as per the project's Checkstyle rules.
Allon Mureinik [Fri, 8 Feb 2019 17:24:03 +0000 (19:24 +0200)]
Remove unused generic argument from Functions#tryWithResources
Allon Mureinik [Fri, 8 Feb 2019 17:21:27 +0000 (19:21 +0200)]
Fix Javadoc issues in Functions
Allon Mureinik [Fri, 8 Feb 2019 16:18:40 +0000 (18:18 +0200)]
Functions' interfaces modifiers
Remove the redundant public modifier from the inner interfaces in
Functions, as per the Checkstyle policy of the project.
Allon Mureinik [Fri, 8 Feb 2019 15:47:29 +0000 (17:47 +0200)]
Add license to FunctionsTest.java
Add a license header to FunctionsTest.java to make the rat maven task
pass.
Benedikt Ritter [Fri, 8 Feb 2019 15:42:31 +0000 (16:42 +0100)]
Add missing Apache license header
Jochen Wiedmann (jwi) [Tue, 29 Jan 2019 10:42:07 +0000 (11:42 +0100)]
Added Functions.tryWithResources.
Jochen Wiedmann (jwi) [Wed, 23 Jan 2019 13:59:25 +0000 (14:59 +0100)]
Adding the Functions class as a helper for dealing with Java 8 Lambdas.
Bruno P. Kinoshita [Tue, 8 Jan 2019 07:01:56 +0000 (20:01 +1300)]
Fix checkstyle issues in new test code
Bruno P. Kinoshita [Tue, 8 Jan 2019 06:48:34 +0000 (19:48 +1300)]
Merge branch 'pr-379'
This closes pr #379
Thanks to @apirom9
Apirom Na Nakorn [Tue, 30 Oct 2018 15:28:31 +0000 (22:28 +0700)]
add test use ImmutablePair class with java.util.HashMap and java.util.TreeMap
pascalschumacher [Sat, 5 Jan 2019 21:51:18 +0000 (22:51 +0100)]
Update spotbugs-maven-plugin to version 3.1.10
pascalschumacher [Sat, 5 Jan 2019 20:29:45 +0000 (21:29 +0100)]
Travis: "openjdk-ea" now means Java 13, so add Java 12 to JDKs to build on. (closes #396)
RahulNagekar [Thu, 20 Dec 2018 19:35:50 +0000 (01:05 +0530)]
Refactoring junits of JsonToStringStyle
RahulNagekar [Sun, 2 Dec 2018 20:15:54 +0000 (01:45 +0530)]
Adding junits for JsonToStringStyle
Signed-off-by: RahulNagekar <rahul.nagekar1@gmail.com>
pascalschumacher [Thu, 20 Dec 2018 13:48:34 +0000 (14:48 +0100)]
Update to JaCoCo 0.8.2 with works Java 11+.
pascalschumacher [Thu, 20 Dec 2018 13:26:28 +0000 (14:26 +0100)]
LANG-1427: Add SystemUtils.isJavaVersionAtMost(JavaVersion)
Fix checkstyle violations.
Gary Gregory [Tue, 11 Dec 2018 00:48:30 +0000 (17:48 -0700)]
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/commons-lang.git
Gary Gregory [Tue, 11 Dec 2018 00:48:06 +0000 (17:48 -0700)]
[LANG-1427] Add API
org.apache.commons.lang3.SystemUtils.isJavaVersionAtMost(JavaVersion)
RahulNagekar [Wed, 28 Nov 2018 19:54:43 +0000 (01:24 +0530)]
Add additional tests for StandardToStringStyle (closes #390)
pascalschumacher [Sun, 2 Dec 2018 13:11:09 +0000 (14:11 +0100)]
Update to JUnit version 5.3.2
pascalschumacher [Tue, 20 Nov 2018 17:42:57 +0000 (18:42 +0100)]
Travis: Stop building with Java 9 and 10, as these are superseded by Java 11 and not supported anymore.
pascalschumacher [Tue, 20 Nov 2018 20:38:15 +0000 (21:38 +0100)]
Update Spotbugs Maven Plugin to version 3.1.8
pascalschumacher [Mon, 19 Nov 2018 21:03:58 +0000 (22:03 +0100)]
Make whitespace use around generic tokens consistent and add a checkstyle rule to enforce it.
pascalschumacher [Mon, 19 Nov 2018 21:04:43 +0000 (22:04 +0100)]
Make whitespace use before tokens consistent and add a checkstyle rule to enforce it.
pascalschumacher [Sun, 18 Nov 2018 10:59:34 +0000 (11:59 +0100)]
Make whitespace use after tokens consistent and add a checkstyle rule to enforce it.
Bruno P. Kinoshita [Sat, 3 Nov 2018 00:50:48 +0000 (13:50 +1300)]
Merge branch 'pr-380'
This closes #380 thanks to @oorijsonar
Uri [Fri, 2 Nov 2018 23:48:04 +0000 (16:48 -0700)]
fix javadoc typo
pascalschumacher [Fri, 2 Nov 2018 20:05:14 +0000 (21:05 +0100)]
Update JUnit Pioneer to version 0.3.0
pascalschumacher [Fri, 2 Nov 2018 20:01:51 +0000 (21:01 +0100)]
Update maven-spotbugs-plugin to version 3.1.7
Gary Gregory [Sun, 28 Oct 2018 15:11:14 +0000 (09:11 -0600)]
Update EasyMock from 3.6 to 4.0 to fix testing on Java 11.
pascalschumacher [Fri, 26 Oct 2018 17:51:07 +0000 (19:51 +0200)]
Use surefire plugin version from parent POM.
pascalschumacher [Fri, 26 Oct 2018 17:49:58 +0000 (19:49 +0200)]
Remove unused test code
pascalschumacher [Fri, 26 Oct 2018 17:48:28 +0000 (19:48 +0200)]
LANG-1422: Add null-safe StringUtils.valueOf(char[]) to delegate to String.valueOf(char[])
Fix checkstyle violations
Gary Gregory [Thu, 25 Oct 2018 14:52:48 +0000 (08:52 -0600)]
[LANG-1422] Add null-safe StringUtils.valueOf(char[]) to delegate to
String.valueOf(char[])
pascalschumacher [Wed, 17 Oct 2018 06:55:05 +0000 (08:55 +0200)]
Travis: Remove Oracle JDK 10 because it is no longer available
Allon Mureinik [Sat, 13 Oct 2018 17:05:40 +0000 (20:05 +0300)]
Clean up assertions (closes #376)
Use built-in assertion methods provides by
org.junit.jupiter.api.Assertions instead of reimplementing the same
logic with assertTrue and assertFalse.
Note that JUnit Jupiter 5.3.1 does not support deltas of 0 for
assertEquals(double, double, double) and
assertEquals(float, float, float), so these usages of assertTrue were
left untouched, and will be addressed when JUnit Jupiter 5.4, that
addresses this isssue, will be available (see
https://github.com/junit-team/junit5/pull/1613 for details).
Allon Mureinik [Sat, 13 Oct 2018 16:49:52 +0000 (19:49 +0300)]
Clean up redundant throws clauses
Allon Mureinik [Sat, 13 Oct 2018 16:38:01 +0000 (19:38 +0300)]
Use assertTrue/assertFalse instead of reimplementing them
Use assertTrue and assertFalse instead of reimplemeting their logic by
having an if statement conditionalling call fail.
Allon Mureinik [Sat, 13 Oct 2018 14:08:48 +0000 (17:08 +0300)]
Clean up testing of exceptions
Now that the entire project is ported to JUnit Jupiter, there are more
elegant ways to test for exceptions, which this patch applies
throughtout the code base.
If throwing an exception is supposed to fail a test, just throwing it
outside of the method cleans up the code and makes it more elegant,
instead of catching it and calling Assertions#fail.
If an exception is supposed to be thrown, calling
Assertions#assertThrows is a more elegant option than calling
Assertions#fail in the try block and then catching and ignoring the
expected exception.
Note that assertThrows uses a lambda block, so the variables inside it
should be final or effectively final. Reusing variables is a common
practice in the tests, so where needed new final variables were
introduced, or the variables used were inlined.
Allon Mureinik [Sat, 13 Oct 2018 14:16:54 +0000 (17:16 +0300)]
Remove double stop() test in StopWatchTest
StopWatchTest#testBadStates has the same block of code testing
StopWatch#stop copy-pasted.
This patch cleans it up by removing one of those blocks.
Allon Mureinik [Fri, 12 Oct 2018 16:14:01 +0000 (19:14 +0300)]
Make LocaleUtilsTest#parseAllLocales parameterized
This patch converts testParseAllLocales to a @ParameterizedTest instead
of iterating over the locales inside the method's body.
This changes allows using standard asserts for each case individually
instead of having to count failures and print the problematic locales
to System.out.
Allon Mureinik [Fri, 12 Oct 2018 15:12:34 +0000 (18:12 +0300)]
Remove ConversionTest#assertBinaryEquals
JUnit Jupiter's Assertions has an
assertArraysEuqals(boolean[], boolean[]) method, so there's no longer a
need for the assertBinaryEquals method.
pascalschumacher [Sat, 13 Oct 2018 18:22:23 +0000 (20:22 +0200)]
Update checkstyle to version 8.13
Allon Mureinik [Thu, 11 Oct 2018 13:21:52 +0000 (16:21 +0300)]
Update tests to JUnit Jupiter (closes #375)
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.
Allon Mureinik [Tue, 2 Oct 2018 03:41:37 +0000 (06:41 +0300)]
Update time tests to JUnit Jupiter
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.
Allon Mureinik [Tue, 2 Oct 2018 03:41:37 +0000 (06:41 +0300)]
Update mutable tests to JUnit Jupiter
Upgrade the tests in the mutable 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.
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.
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.
Allon Mureinik [Tue, 2 Oct 2018 03:41:37 +0000 (06:41 +0300)]
Update math tests to JUnit Jupiter
Upgrade the tests in the math 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.
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.
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.
Allon Mureinik [Tue, 2 Oct 2018 03:41:37 +0000 (06:41 +0300)]
Update tuple tests to JUnit Jupiter
Upgrade the tests in the text package to use JUnit Jupiter as
part of the effort to remove the dependency on the Vintage Engine.
Allon Mureinik [Tue, 2 Oct 2018 03:41:37 +0000 (06:41 +0300)]
Update text tests to JUnit Jupiter
Upgrade the tests in the text 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.
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.
Allon Mureinik [Tue, 2 Oct 2018 03:41:37 +0000 (06:41 +0300)]
Update reflect tests to JUnit Jupiter
Upgrade the tests in the reflect 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.
Unlike org.junit.Assume, org.junit.jupiter.api.Assumptions does not have
an assumtNotNull method. Instead, assumeTrue was used with an explicit
condition of a variable being different than null.
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.
Allon Mureinik [Tue, 2 Oct 2018 03:41:37 +0000 (06:41 +0300)]
Update exception tests to JUnit Jupiter
Upgrade the tests in the exception 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.
Another non-obvious change was performed in
ContextedRuntimeExceptionTest. Unlike JUnit Vintages's @Before, JUnit
Jupiter's @BeforeEach does not apply if a parent's method is annotated
with it and the overriding method is not, so an explicit @BeforeEach
annotation had to be added to ContexedTuntimeExceptionTest#setUp().
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
made more elegant with Jupiter's new features, but that work is left
for subsequent patches.
Allon Mureinik [Tue, 2 Oct 2018 03:41:37 +0000 (06:41 +0300)]
Update event tests to JUnit Jupiter
Upgrade the tests in the event 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, it is worth noting the tests that test thrown excetpions.
Prior to this patch, this package tested for exceptions in two ways,
neither of which are supported in JUnit Jupiter:
1. With the "expected" argument of the org.junit.Test annotation.
2. With the org.junit.rules.ExpectedException @Rule
Both of these usages were replaced with calls to
org.junit.jupiter.api.Assertions#assertThrows.
Allon Mureinik [Tue, 2 Oct 2018 03:41:37 +0000 (06:41 +0300)]
Update concurrent tests to JUnit Jupiter
Upgrade the tests in the concurrent 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. This call allows
the test to pinpoint the exact statement that is expected to throw the
exception and allows making the tests a bit stricter by preventing
false-positives that could occur if the setup code would throw the
expected exception instead of the statement that was supposed to throw
it.
Another notable change was performed in MemoizerTest.
JUnit Jupiter does not support JUnit 4's runners, and EasyMock has no
equivalent @Extension, so a setup method was added and the mock was
explicitly initialized.
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
made more elegant with Jupiter's new features, but that work is left
for subsequent patches.
pascalschumacher [Sat, 6 Oct 2018 08:30:32 +0000 (10:30 +0200)]
Travis: Also build with openjdk-ea, but allow openjdk-ea builds to fail.
pascalschumacher [Sat, 6 Oct 2018 08:22:57 +0000 (10:22 +0200)]
Use JDKs provided by travis
pascalschumacher [Sat, 6 Oct 2018 08:10:06 +0000 (10:10 +0200)]
Replace FindBugs with SpotBugs: Fix source assembly
Allon Mureinik [Tue, 2 Oct 2018 03:41:37 +0000 (06:41 +0300)]
Update builder tests to JUnit Jupiter
Upgrade the tests in the builder 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, it is worth mentioning the change to how expected exceptions
are tested.
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. This call allows
the test to pinpoint the exact statement that is expected to throw the
expcetion and allows making the tests a bit stricter by preventing
false-positives that could occur if the setup code would throw the
expected exception instead of the statement that was supposed to throw
it.