You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geode.apache.org by Dale Emery <de...@vmware.com> on 2021/10/12 22:37:43 UTC

Added Support for JUnit 5

In September 2021, Geode added support for writing and running tests using JUnit 5.

Most Geode modules now support JUnit 5. For most Geode modules, you can now write each test class using either JUnit 5's "Jupiter" API or the legacy JUnit 4 API.

Which modules support JUnit 5? Any source set that depends on geode-junit or geode-dunit already has JUnit 5 support. For those source sets you can start writing tests using the JUnit Jupiter API now, and Gradle will run them.

To add JUnit 5 support to a module or source set: Add lines like these to the "dependencies" configuration of the module’s build.gradle file:

                                testImplementation('org.junit.jupiter:junit-jupiter-api')
                                testRuntimeOnly('org.junit.jupiter:junit-jupiter-engine')

The first line allows you to write unit tests using the JUnit Jupiter API. The second line allows Gradle to run your JUnit Jupiter unit tests.

To use JUnit Jupiter to write and run other kinds of tests (e.g. integrationTest or distributedTest), add similar lines to configure the appropriate source sets.

LIMITATIONS

  *   Because Geode support for JUnit Jupiter is so new, we have not yet added test framework code that takes advantage of its features.
  *   JUnit Jupiter does not support the use of Rules.

SEE ALSO

  *   The JUnit 5 User Guide: https://junit.org/junit5/docs/current/user-guide/
  *   Using JUnit 5 (a copy of this message on the Geode wiki): https://cwiki.apache.org/confluence/display/GEODE/Using+JUnit+5

Dale Emery


Re: Added Support for JUnit 5

Posted by Gregory Green <gr...@vmware.com>.
This is awesome, thank you 

-----
Gregory Green | Advisor Solution Engineer | Tanzu Data 
Mobile: 732.737.7119| Email: gregoryg@vmware.com 
--
Articles/Videos
Monoliths to Microservices? Don’t Forget to Transform the Data Layer <https://content.pivotal.io/engineers/moving-from-monoliths-to-microservices-don-t-forget-to-transform-the-data-layer-here-s-how>
A Caching Approach to Data Transformation of Legacy RDBMS <https://www.youtube.com/watch?v=h5UvIJo7eBc>
How to Build Modern Data Pipelines with GemFire and SCDF <https://content.pivotal.io/blog/how-to-build-modern-data-pipelines-with-pivotal-gemfire-and-spring-cloud-data-flow>
GemFire AWS Quickstart <https://youtu.be/QqWKzZ2MeOY>
 
 

On 10/13/21, 12:27 PM, "Kirk Lund" <kl...@apache.org> wrote:

    Good job Dale and thanks!

    On Tue, Oct 12, 2021 at 3:37 PM Dale Emery <de...@vmware.com> wrote:

    > In September 2021, Geode added support for writing and running tests using
    > JUnit 5.
    >
    > Most Geode modules now support JUnit 5. For most Geode modules, you can
    > now write each test class using either JUnit 5's "Jupiter" API or the
    > legacy JUnit 4 API.
    >
    > Which modules support JUnit 5? Any source set that depends on geode-junit
    > or geode-dunit already has JUnit 5 support. For those source sets you can
    > start writing tests using the JUnit Jupiter API now, and Gradle will run
    > them.
    >
    > To add JUnit 5 support to a module or source set: Add lines like these to
    > the "dependencies" configuration of the module’s build.gradle file:
    >
    >
    > testImplementation('org.junit.jupiter:junit-jupiter-api')
    >
    > testRuntimeOnly('org.junit.jupiter:junit-jupiter-engine')
    >
    > The first line allows you to write unit tests using the JUnit Jupiter API.
    > The second line allows Gradle to run your JUnit Jupiter unit tests.
    >
    > To use JUnit Jupiter to write and run other kinds of tests (e.g.
    > integrationTest or distributedTest), add similar lines to configure the
    > appropriate source sets.
    >
    > LIMITATIONS
    >
    >   *   Because Geode support for JUnit Jupiter is so new, we have not yet
    > added test framework code that takes advantage of its features.
    >   *   JUnit Jupiter does not support the use of Rules.
    >
    > SEE ALSO
    >
    >   *   The JUnit 5 User Guide:
    > https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fjunit.org%2Fjunit5%2Fdocs%2Fcurrent%2Fuser-guide%2F&amp;data=04%7C01%7Cgregoryg%40vmware.com%7C79cfd62c0e3246639b3e08d98e6653d5%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637697392435164713%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=4pQW6ayi%2BetPhjgwamjuJGLzLqaaPHFG8v%2FpTcA03fc%3D&amp;reserved=0
    >   *   Using JUnit 5 (a copy of this message on the Geode wiki):
    > https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcwiki.apache.org%2Fconfluence%2Fdisplay%2FGEODE%2FUsing%2BJUnit%2B5&amp;data=04%7C01%7Cgregoryg%40vmware.com%7C79cfd62c0e3246639b3e08d98e6653d5%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637697392435164713%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=pcUCajdRMmxY5pqjM4w2l4pKtrdZc%2FrolrYbJiU4Ldo%3D&amp;reserved=0
    >
    > Dale Emery
    >
    >


Re: Added Support for JUnit 5

Posted by Kirk Lund <kl...@apache.org>.
Good job Dale and thanks!

On Tue, Oct 12, 2021 at 3:37 PM Dale Emery <de...@vmware.com> wrote:

> In September 2021, Geode added support for writing and running tests using
> JUnit 5.
>
> Most Geode modules now support JUnit 5. For most Geode modules, you can
> now write each test class using either JUnit 5's "Jupiter" API or the
> legacy JUnit 4 API.
>
> Which modules support JUnit 5? Any source set that depends on geode-junit
> or geode-dunit already has JUnit 5 support. For those source sets you can
> start writing tests using the JUnit Jupiter API now, and Gradle will run
> them.
>
> To add JUnit 5 support to a module or source set: Add lines like these to
> the "dependencies" configuration of the module’s build.gradle file:
>
>
> testImplementation('org.junit.jupiter:junit-jupiter-api')
>
> testRuntimeOnly('org.junit.jupiter:junit-jupiter-engine')
>
> The first line allows you to write unit tests using the JUnit Jupiter API.
> The second line allows Gradle to run your JUnit Jupiter unit tests.
>
> To use JUnit Jupiter to write and run other kinds of tests (e.g.
> integrationTest or distributedTest), add similar lines to configure the
> appropriate source sets.
>
> LIMITATIONS
>
>   *   Because Geode support for JUnit Jupiter is so new, we have not yet
> added test framework code that takes advantage of its features.
>   *   JUnit Jupiter does not support the use of Rules.
>
> SEE ALSO
>
>   *   The JUnit 5 User Guide:
> https://junit.org/junit5/docs/current/user-guide/
>   *   Using JUnit 5 (a copy of this message on the Geode wiki):
> https://cwiki.apache.org/confluence/display/GEODE/Using+JUnit+5
>
> Dale Emery
>
>

Re: Added Support for JUnit 5

Posted by Jacob Barrett <ja...@vmware.com>.
This is amazing!

> On Oct 12, 2021, at 3:37 PM, Dale Emery <de...@vmware.com> wrote:
> 
> In September 2021, Geode added support for writing and running tests using JUnit 5.
> 
> Most Geode modules now support JUnit 5. For most Geode modules, you can now write each test class using either JUnit 5's "Jupiter" API or the legacy JUnit 4 API.
> 
> Which modules support JUnit 5? Any source set that depends on geode-junit or geode-dunit already has JUnit 5 support. For those source sets you can start writing tests using the JUnit Jupiter API now, and Gradle will run them.
> 
> To add JUnit 5 support to a module or source set: Add lines like these to the "dependencies" configuration of the module’s build.gradle file:
> 
>                                testImplementation('org.junit.jupiter:junit-jupiter-api')
>                                testRuntimeOnly('org.junit.jupiter:junit-jupiter-engine')
> 
> The first line allows you to write unit tests using the JUnit Jupiter API. The second line allows Gradle to run your JUnit Jupiter unit tests.
> 
> To use JUnit Jupiter to write and run other kinds of tests (e.g. integrationTest or distributedTest), add similar lines to configure the appropriate source sets.
> 
> LIMITATIONS
> 
>  *   Because Geode support for JUnit Jupiter is so new, we have not yet added test framework code that takes advantage of its features.
>  *   JUnit Jupiter does not support the use of Rules.
> 
> SEE ALSO
> 
>  *   The JUnit 5 User Guide: https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fjunit.org%2Fjunit5%2Fdocs%2Fcurrent%2Fuser-guide%2F&amp;data=04%7C01%7Cjabarrett%40vmware.com%7C736b38c71e7a427f0c2c08d98dd0ef35%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C1%7C637696750780087368%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=mT8Xx10xI1KL8p7kgvpc3VMkTvxjJDPZUz1z%2F4EcaRQ%3D&amp;reserved=0
>  *   Using JUnit 5 (a copy of this message on the Geode wiki): https://cwiki.apache.org/confluence/display/GEODE/Using+JUnit+5
> 
> Dale Emery
>