Commit Graph

5430 Commits

Author SHA1 Message Date
Allon Mureinik fde19e79d5 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.
2018-10-13 21:09:35 +02:00
Allon Mureinik 369d0616ce Remove ConversionTest#assertBinaryEquals
JUnit Jupiter's Assertions has an
assertArraysEuqals(boolean[], boolean[]) method, so there's no longer a
need for the assertBinaryEquals method.
2018-10-13 21:09:35 +02:00
pascalschumacher 46ea7e5e96 Update checkstyle to version 8.13 2018-10-13 20:22:23 +02:00
Allon Mureinik e99b0dde8e 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.
2018-10-11 22:28:38 +02:00
Allon Mureinik ca2e59c513 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.
2018-10-10 19:09:33 +03:00
Allon Mureinik 94beded839 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.
2018-10-09 19:39:13 +03:00
Allon Mureinik 47a9ea7c82 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.
2018-10-09 09:41:10 +03:00
Allon Mureinik f110da945a 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.
2018-10-08 22:23:34 +03:00
Allon Mureinik 182e335432 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.
2018-10-08 19:47:57 +03:00
Allon Mureinik cbc8e0b295 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.
2018-10-08 01:38:55 +03:00
Allon Mureinik 884d273f42 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.
2018-10-07 18:28:09 +03:00
Allon Mureinik 762641dcdb 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.
2018-10-06 15:05:16 +03:00
Allon Mureinik dd761382d3 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.
2018-10-06 13:08:06 +03:00
pascalschumacher 6191dedf35 Travis: Also build with openjdk-ea, but allow openjdk-ea builds to fail. 2018-10-06 11:36:04 +02:00
pascalschumacher 8e507bd0b1 Use JDKs provided by travis 2018-10-06 10:22:57 +02:00
pascalschumacher 4d5c5a8afd Replace FindBugs with SpotBugs: Fix source assembly 2018-10-06 10:10:06 +02:00
Allon Mureinik 729adb624d 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.
2018-10-06 10:02:58 +02:00
靳阳 90d8b93efd Fix dead links in README.md (closes #359) 2018-10-06 09:59:44 +02:00
Eitan Adler ba7ca7998f StringUtils: trivial formatting change.
This replaces <code> with {@code} primarily as a way to test
INFRA-17094.
2018-10-05 19:47:58 -07:00
Rob Tompkins 69e843890c (fix) download page pointed to lang3 in uri 2018-09-23 12:17:28 -04:00
Rob Tompkins ec6a15696f Adding TODO to index.xml for 3.9 release 2018-09-23 12:04:37 -04:00
Rob Tompkins 9e79655f67 RELEASE-NOTES: fix template 3.9+ targets java 8 2018-09-22 17:48:13 -04:00
Rob Tompkins 83329ef669 (fix) RELEASE-NOTES.txt on master to look like 3.8.1 dist 2018-09-22 17:45:29 -04:00
Rob Tompkins 77f875110a Tagging commons-lang3-3.8.1 from RC1
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEtuc9hOpPzEcWYIclP6rSzV7LsxQFAlumrW8ACgkQP6rSzV7L
 sxQgcA//dWX1C1n526Z34UgI5OSGxE+pT3L6Imny33gDRbEdUuBAtX7nsU04OEpB
 YGZuwAvaZ6CVgcEha43T0t6qD5mMb+btNTauqY116PRhEqSIDLJBgapZNcKLj1gA
 sR1SXY87VCQHcWO/tjUtL2yC+Js++KwowFX1If9MpByV46PqTr7e/FKrzYB2ocsD
 BaDCgQTcJWoLb6XHXlsSUrGO92AeDS8O2oa+6eIDstH0qzC4vKKFhpGGGRhI0SrP
 99rwzpBfNljxe3oVDIU+JIjAuNvepb1+WrtOTbwu2GEz0PMS4KkvB9cvBeyGJeM+
 cQXccZ34VU2Ony9TNDUfJEwdeoWbZWw8ib4ijThhufIPmiOU2QpHhhcQ2K8iK8CJ
 lCnDLQDtjZHpo5308nEW4EuGi31uzRZePDNubrQcHpqjdmVcrs93jOJuK8K8zIpn
 DG3ly1E6fItVILFIhUzXyFJ20qPtSmhQmjNPuX3/4b3Pmx1MDc/b0u3mxDjc/ADq
 OWFcT5f2N//StnR58ZSDqw4vdOo0l5EyhSr70nMnMfk3p1XsbU1IOb3lNZouXjWr
 T6Ckwyz2CWo+wAS9U72EvRzaim/SQz+2E8sscu1gLwE067YFmY9lPGGFpFliJO6Y
 NwAkKq2uR+aemvWok5GmwDPastv7U59gJDJCLZ7SrTlHNpIyh6E=
 =Hha5
 -----END PGP SIGNATURE-----

Updates for 3.8.1 release
2018-09-22 17:31:24 -04:00
Rob Tompkins eb5b11a25c Prepare 3.8.1 release 2018-09-19 11:09:49 -04:00
Rob Tompkins ae9b31285e LANG-1419: Restore BundleSymbolicName for OSGi 2018-09-19 10:51:19 -04:00
Benedikt Ritter 910f5427b3
Update to latest JUnit version 2018-09-11 21:06:39 +02:00
Benedikt Ritter 6dc3a6db11
Merge branch 'spotbugs' 2018-09-06 22:05:54 +02:00
Benedikt Ritter c3b38a3ba1
Merge branch 'nested-validate-test' 2018-09-06 22:02:03 +02:00
Benedikt Ritter 89f3d989e0
Convert util class convention tests to @Nested test 2018-09-06 20:21:18 +02:00
Benedikt Ritter 0b14928ee4
Convert tests for Validate.isAssignable overloads to @Nested test 2018-09-06 20:19:14 +02:00
Benedikt Ritter 3e58ab33b9
Convert tests for Validate.isInstanceOf overloads to @Nested test 2018-09-06 20:16:47 +02:00
Benedikt Ritter 5445f22747
Convert tests for Validate.exclusiveBetween overloads to @Nested test 2018-09-06 20:08:24 +02:00
Benedikt Ritter eabf1aaa25
Convert tests for Validate.inclusiveBetween overloads to @Nested test 2018-09-06 19:50:59 +02:00
Benedikt Ritter 6e9f406aac
Convert tests for Validate.finite overloads to @Nested test 2018-09-06 19:38:45 +02:00
Benedikt Ritter 4077b57f6d
Convert tests for Validate.notNaN overloads to @Nested test 2018-09-06 19:29:01 +02:00
Benedikt Ritter 8912be8a88
Convert tests for Validate.matchesPattern overloads to @Nested test 2018-09-06 18:14:59 +02:00
Benedikt Ritter f6f8e5dbed
Convert tests for Validate.validIndex overloads to @Nested test 2018-09-06 15:41:44 +02:00
Benedikt Ritter 74c24ad194
Move constructor test to top 2018-09-06 15:18:34 +02:00
Benedikt Ritter ad97f20202
Convert tests for Validate.noNullElements overloads to @Nested test 2018-09-06 15:17:13 +02:00
Benedikt Ritter c0779f42c7
Convert tests for Validate.notBlank overloads to @Nested test 2018-09-06 14:59:59 +02:00
Benedikt Ritter d784612d0d
Convert tests for Validate.notEmpty overloads to @Nested test 2018-09-06 14:30:29 +02:00
Benedikt Ritter d3f2a89ba2
Convert tests for Validate.notNull overloads to @Nested test 2018-09-06 10:16:26 +02:00
Benedikt Ritter 3178494ca1
Merge branch 'parameterized-FastDateParser_TimeZoneStrategyTest' 2018-09-06 09:55:45 +02:00
Benedikt Ritter 7e440785d9
Use @ParameterizedTest to iterate over available locales 2018-09-05 15:58:27 +02:00
Benedikt Ritter aad2db8b12
Convert tests for Validate.isTrue overloads to @Nested test 2018-09-05 14:26:25 +02:00
Benedikt Ritter bce28f99f3
JUnit 5 tests do not need to be public 2018-09-05 13:50:12 +02:00
Benedikt Ritter 6ec01a633c
Merge branch 'LANG-1416' 2018-09-04 16:15:34 +02:00
Benedikt Ritter 65a7b5d3b9
LANG-1416: Add changes.xml entry 2018-09-04 16:15:27 +02:00
Benedikt Ritter 2bcf86d8af
LANG-1416: Update ValidateTest to JUnit 5 API 2018-09-04 15:08:37 +02:00