commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mureinik <...@git.apache.org>
Subject [GitHub] commons-lang pull request #368: Update exception tests to JUnit Jupiter
Date Sun, 07 Oct 2018 15:33:47 GMT
GitHub user mureinik opened a pull request:

    https://github.com/apache/commons-lang/pull/368

    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
Vintage'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 more elegant with Jupiter's new features, but that
work is left for subsequent patches.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/mureinik/commons-lang junit-jupiter-exception

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/commons-lang/pull/368.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #368
    
----
commit 884d273f4207095f881167b3398fc2a55617ee9a
Author: Allon Mureinik <mureinik@...>
Date:   2018-10-02T03:41:37Z

    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.

----


---

Mime
View raw message