Skip to content

Update math tests to JUnit Jupiter#372

Merged
asfgit merged 1 commit intoapache:masterfrom
mureinik:junit-jupiter-math
Oct 9, 2018
Merged

Update math tests to JUnit Jupiter#372
asfgit merged 1 commit intoapache:masterfrom
mureinik:junit-jupiter-math

Conversation

@mureinik
Copy link
Copy Markdown
Contributor

@mureinik mureinik commented Oct 9, 2018

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 junit-team/junit-framework#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.

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
junit-team/junit-framework#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.
@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 95.253% when pulling 47a9ea7 on mureinik:junit-jupiter-math into f110da9 on apache:master.

@PascalSchumacher
Copy link
Copy Markdown
Contributor

Thanks! 👍

@asfgit asfgit merged commit 47a9ea7 into apache:master Oct 9, 2018
@mureinik mureinik deleted the junit-jupiter-math branch October 9, 2018 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants