Skip to content

Releases: sbabcoc/JUnit-Foundation

Expand unit test suite to guard against regression

07 Jun 20:16

Choose a tag to compare

This release is primarily devoted to beefing up the unit test suite - expanding coverage of existing tests and adding a new test. The expanded tests now check the sequence of lifecycle event notifications published for each corresponding test method.

In the process, I noticed and fixed a few instances where I'd specified JUnit assertion imports for TestNG test classes. I fixed these.

I also expanded the README content to include links to the implementations of supported test runners.

Fix handling of suite-level failures; expose description-to-target mappings

29 May 01:22

Choose a tag to compare

The initial focus for this release was to expose the mappings from Description to test class instance (a.k.a. - target). In the process, I discovered fundamental issues in the way I was handling suite-level failures.

Prior to implementing the changes in this release, notifications for exceptions thrown by @BeforeClass and @AfterClass methods would be published with no context (AtomicTest == null). This was terribly uninformative. Now, these failures include non-test context objects. The description of a non-test context object represents the test class to which the failed configuration method belongs.

I also fixed a few random bugs and inefficiencies along the way.

  • Add method to map from Description to Target
  • Fix handling of suite-level failures:
    • AtomicTest: Add support for suite descriptions
    • EachTestNotifierInit: Remove 'ensureAtomicTestOf(Description)'; optimized runner acquisition
    • LifecycleHooks: 'describeChild' - Ensure runner can support specified child
    • RunAnnouncer: Add private shims to create ephemeral atomic test objects for ignored tests and suite failures

Upgrade Junit to version 4.13.2

20 May 23:17

Choose a tag to compare

In this release, we upgraded to the latest release of JUnit (4.13.2)

Add support for automatic retry of failed parameterized tests

07 May 19:29

Choose a tag to compare

In this release, I enhanced the automatic retry feature to include failures of tests under parameterized runners. Previously, enabling automatic retry with parameterized tests would result in a variety of bad behavior.

NOTE: The numbering for this release skips over 15.1.0, which was deleted because I rushed the process and failed to actually merge the related pull request (#102) prior to publishing it. 🤦‍♂️

In addition to this added retry support, I fixed a few bugs I encountered along the way. Here's a summary:

  • Create a fresh "atomic test" statement for each post-failure retry attempt.
  • Refactor implementation to eliminate duplicate code in Theories runner support.
  • Create a new annotation proxy to indicate retried @Theory methods.
  • Optimize handling of ignored tests to avoid checking for activation of the automatic retry feature.
  • Enhance the method descriptions produced by JUnitParams, adding the test class and annotations.
  • Genericize the return type of LifecycleHooks.callProxy, eliminating the need for clients to type-cast the results.
  • Expand JavaDoc and add code comments to illuminate behaviors and explain "magic".

Release test watcher references as each test finishes

02 May 21:04

Choose a tag to compare

In this release, I added code to release references to test watchers as each test finishes. Prior to this release, these references were retained for the lifetime of the JVM executing the tests, which had the potential to exhaust available memory. For example, each JUnit Foundation unit test attaches a test watcher that retains a reference to the test class instance that created it. Because these references were never explicitly released, test class instances would accumulate during the course of test execution, causing memory consumption to escalate as more tests ran.

NOTE: I tagged this as a major-version release due to the remote possibility that someone besides me was relying on the ability to interact with test watchers after the associated atomic test has finished. Managing these references is now the responsibility of the client.

Resolve issue acquiring runner in threaded execution context

10 Apr 02:40

Choose a tag to compare

If the JUnit framework detects that a timeout rule is in effect, new time-limited threads are spawned to execute test methods. In this context, the "thread runner" is initially unset when RunReflectiveCall is invoked. This release adds logic to store the association between test class instances and the runners that created them, and these associations provide the runner objects for these new threads.

Fix event sequencing issues

07 Apr 05:38

Choose a tag to compare

The previous release contained a bug that caused runStarted events to be published after the invocation events for @BeforeClass methods. There were also object management issues that may have caused erratic behavior when tests were run in parallel.

Release framework object ASAP to reduce memory consumption

06 Apr 20:53

Choose a tag to compare

This release resolves memory consumption issues caused by the retention of framework objects collected during the course of test execution. While implementing these revisions, I discovered and resolved a few fundamental issues in the handling of parameterized tests as well.

Resolving these fundamental issues required me to revise a few public interfaces, which informed the major-version bump.

  • The AtomicTest class is no longer parameterized.
  • The RunWatcher interface is no longer parameterized.
  • The LifecycleHooks class now provides target => atomic test mappings.
  • The LifecycleHooks class now provides description => atomic test mappings.
  • The LifecycleHooks class no longer publishes runner <=> target mappings.
  • The signature of the TestObjectWatcher.testObjectCreated() interface method has changed.

Add JavaDoc to the configuration settings; deprecate the RuleChainWalker

05 Mar 09:25

Choose a tag to compare

This release is focused on resolving a couple of minor issues, both related to a lack of documentation.

  • I added JavaDoc to the constants of the JUnitConfig class to resolve #85.
  • I deprecated the RuleChainWalker class to resolve #84.

The latter change was informed by the fact that the @rule annotation now includes an order parameter that provides the same sort of invocation order control that the RuleChain class gives.

Release references to out-of-scope JUnit framework objects

27 Feb 01:13

Choose a tag to compare

In this release, references to JUnit framework objects are released when these objects pass out-of-scope. This should resolve excessive memory utilization problems associated with large test suites.

Previously, references were retained for the lifetime of the Java instance that hosted test execution. If the test collection was relatively modest, this didn't constitute a significant issue. However, the accumulation of objects during the execution of large suites of tests could result in out-of-memory failures.