Reassessing TestNG vs. Junit

This page summarizes the projects mentioned and recommended in the original post on /r/java

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • Kotest

    Powerful, elegant and flexible test framework for Kotlin with additional assertions, property testing and data driven testing

    I think that it's time for a completely new testing DSL which in turn could be based on JUnit. I'm thinking of something like Jest or Jasmine known from JavaScript or Kotest (Kotlin).

  • jest

    Delightful JavaScript Testing.

    I think that it's time for a completely new testing DSL which in turn could be based on JUnit. I'm thinking of something like Jest or Jasmine known from JavaScript or Kotest (Kotlin).

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

  • jasmine

    Simple JavaScript testing framework for browsers and node.js

    I think that it's time for a completely new testing DSL which in turn could be based on JUnit. I'm thinking of something like Jest or Jasmine known from JavaScript or Kotest (Kotlin).

  • TestNG

    TestNG testing framework

    Recently though we've run across a few issues with the asserts in TestNG. In 7.3.0, some changes broke assertSame/assertNotSame that also broke some of our tests. This was partially fixed in 7.4.0, but some overloads of assertEquals were still broken. This is fixed, but I don't think the fix has been delivered in a release yet. Further investigation revealed that at least one overload of assertNotEquals has been broken, apparently since 6.9.5 or even earlier.

  • Caffeine

    A high performance caching library for Java

    Looking at OpenJDK's Vector testing and it seems to have a lot of duplication. A powerful feature of TestNG/JUnit5 is that you can control the data provider by inspecting the method's metadata and attach listeners to perform common validation. Caffeine runs millions of test cases by using an @CacheSpec annotation, providing the data param and a context object (example, and a cross-test validation listener. The specification constraint runs the test for every configuration, OpenJDK has a custom codegen template which loses all tooling support. From a brief glance through your usages, I believe you could get a much better QoL by using some of the advanced techniques in either framework.

  • JDK

    JDK main-line development https://openjdk.org/projects/jdk

    Looking at OpenJDK's Vector testing and it seems to have a lot of duplication. A powerful feature of TestNG/JUnit5 is that you can control the data provider by inspecting the method's metadata and attach listeners to perform common validation. Caffeine runs millions of test cases by using an @CacheSpec annotation, providing the data param and a context object (example, and a cross-test validation listener. The specification constraint runs the test for every configuration, OpenJDK has a custom codegen template which loses all tooling support. From a brief glance through your usages, I believe you could get a much better QoL by using some of the advanced techniques in either framework.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts