You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by mureinik <gi...@git.apache.org> on 2018/10/09 21:11:17 UTC

[GitHub] commons-lang pull request #374: Update time tests to JUnit Jupiter

GitHub user mureinik opened a pull request:

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

    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 @britter contributed to [JUnit Pioneer](https://github.com/junit-pioneer/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.

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

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

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

    https://github.com/apache/commons-lang/pull/374.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 #374
    
----
commit 74a18ce4c6ff7e7f5db9ed788d5f4999f7213cfe
Author: Allon Mureinik <mu...@...>
Date:   2018-10-02T03:41:37Z

    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.

----


---

[GitHub] commons-lang issue #374: Update time tests to JUnit Jupiter

Posted by PascalSchumacher <gi...@git.apache.org>.
Github user PascalSchumacher commented on the issue:

    https://github.com/apache/commons-lang/pull/374
  
    Thanks! 👍 


---

[GitHub] commons-lang pull request #374: Update time tests to JUnit Jupiter

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

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


---

[GitHub] commons-lang issue #374: Update time tests to JUnit Jupiter

Posted by mureinik <gi...@git.apache.org>.
Github user mureinik commented on the issue:

    https://github.com/apache/commons-lang/pull/374
  
    @britter I was half way through rewriting the `SystemDefaultsSwitch` as a JUnit Jupiter extension when I remembered your tweet from earlier this month and figured out that you already did this work in JUnit Pioneer. I hope I'm not stepping on any toes here, but if this conflicts with anything you had planned, I'd gladly abandon this PR.


---

[GitHub] commons-lang pull request #374: Update time tests to JUnit Jupiter

Posted by PascalSchumacher <gi...@git.apache.org>.
Github user PascalSchumacher commented on a diff in the pull request:

    https://github.com/apache/commons-lang/pull/374#discussion_r224137193
  
    --- Diff: pom.xml ---
    @@ -543,6 +543,11 @@
           <artifactId>junit-vintage-engine</artifactId>
           <scope>test</scope>
         </dependency>
    +    <dependency>
    +      <groupId>org.junit-pioneer</groupId>
    +      <artifactId>junit-pioneer</artifactId>
    +      <version>0.2.0</version>
    --- End diff --
    
    This dependency should have `test` scope.


---

[GitHub] commons-lang pull request #374: Update time tests to JUnit Jupiter

Posted by mureinik <gi...@git.apache.org>.
Github user mureinik commented on a diff in the pull request:

    https://github.com/apache/commons-lang/pull/374#discussion_r224144394
  
    --- Diff: pom.xml ---
    @@ -543,6 +543,11 @@
           <artifactId>junit-vintage-engine</artifactId>
           <scope>test</scope>
         </dependency>
    +    <dependency>
    +      <groupId>org.junit-pioneer</groupId>
    +      <artifactId>junit-pioneer</artifactId>
    +      <version>0.2.0</version>
    --- End diff --
    
    Good catch, thanks.


---

[GitHub] commons-lang issue #374: Update time tests to JUnit Jupiter

Posted by mureinik <gi...@git.apache.org>.
Github user mureinik commented on the issue:

    https://github.com/apache/commons-lang/pull/374
  
    Updated the patch to fix the scoping issue in `pom.xml` @PascalSchumacher commented about.


---

[GitHub] commons-lang issue #374: Update time tests to JUnit Jupiter

Posted by coveralls <gi...@git.apache.org>.
Github user coveralls commented on the issue:

    https://github.com/apache/commons-lang/pull/374
  
    
    [![Coverage Status](https://coveralls.io/builds/19434867/badge)](https://coveralls.io/builds/19434867)
    
    Coverage remained the same at 95.253% when pulling **74a18ce4c6ff7e7f5db9ed788d5f4999f7213cfe on mureinik:junit-jupiter-time** into **94beded83960af2a15992f6cec8f1f59d1f3c051 on apache:master**.



---