Releases: sbabcoc/JUnit-Foundation
Improve tracking and publication of ReflectiveCallable objects
This release fixes a fundamental deficiency with my initial attempt to record and publish ReflectiveCallable objects. Saving these in the AtomIdentity object and publishing from there wouldn't have worked for atomic tests with configuration methods. I now record every "callable" object with its associated JUnit framework object.
I also fixed the handling of ignored tests, generating an AtomicTest object to send with the notification.
NOTE: This is a breaking change, and I should probably advance to the next major version, but the feature I broke is so obscure that I marked it as a feature release instead.
AtomicTest: Implement 'equals' and 'hashcode' methods
In order for AtomicTest objects to be used as hash keys, this class needs to provide implementations for the equals and hashcode methods. This release adds these methods.
Enhance RunWatcher notifications and ArtifactParams feature
In this release, I revised the way I associate test method Description objects to atomic tests to ensure that the notifications I send to RunWatcher service providers include the descriptions that were used when the associated methods were actually invoked. This resolves an inconsistency related to the JUnitParams test runner.
I also enhanced the ArtifactParams feature, adding code in RunReflectiveCall to record the "callable" object in the AtomIdentity test watcher. This object is a closure which may contain the parameters that were supplied to the actual test method. This enhancement can greatly simplify the implementation of the getParameters() method of the ArtifactParams interface.
Add a few more 'null' checks
There were a few spots RunAnnouncer where we were at risk for triggering NullPointerException failures. This release add 'null' checks to prevent these failures.
Consolidate watcher declarations into a single SPI configuration file
This release consolidates the declaration of JUnit Foundation service providers into a single configuration file. Support for the previous file-per-interface approach is retained to provide backward compatibility.
One significant benefit to switching from ServiceLoaders to pre-initialized unmodifiable lists is that I no longer need to synchronize my iterators. The code is therefore smaller and less complicated.
Another benefit is that we no longer end up with multiple instances of each service provider that implements multiple interfaces. Previously, a separate instance would be created for each implemented interface.
NOTE: If you have a project with JUnit Foundation service provides that was created prior to this release, your current file-per-interface SPI configuration files will continue to be recognized, and you still get the benefit of proper handling of service providers that implement multiple interfaces. However, we recommend that you take this opportunity to consolidate all your SPI configurations into the common file:
META-INF/services/com.nordstrom.automation.junit.JUnitWatcher
Consolidate parameter-based and rule-based timeout management
In this release, I refactored the implementation for parameter-based and rule-base timeout management. I refined the interactions between these two mechanisms to provide the most rational behavior. I added unit tests to verify functional coordination and updated the documentation to include details of the options and behaviors provided.
A significant enhancement provided by this release is the ability to disable timeout enforcement
locally and globally. In a test class, declaring a Timeout rule with an interval of zero (0) disables timeout enforcement for all of the tests in the class. Setting the value of the TIMEOUT_RULE configuration option to zero (0) disables timeout enforcement entirely. This is especially useful while debugging, when extended execution times would result in test-terminating timeouts.
Add support for rule-based timeout management
This release adds support for rule-based timeout management. This support is implemented to coordinate with and complement timeouts specified via the timeout element of the @Test annotation.
Upgrade to latest dependencies
junit-foundation-11.0.2 [maven-release-plugin] copy for tag junit-foundation-11.0.2
If thread runner lacks atomic test, use failure description
This release resolves a NullPointerException failure in RunAnnouncer.setTestFailure(Failure) that occurred whenever a failure was encountered in a @BeforeClass method. The issue was that the failure occurs in the context of the Suite runner, but the notification is generated from a BlockJUnit4ClassRunner. The solution was to use the Description to retrieve the AtomicTest.
Resolves #53
Finish the task of generic-izing support for child method classes
This is a follow-on to the previous release, to address issues identified while trying to apply that release to an actual use case (JUnit Cucumber support).
LifecycleHooks- Add thegetFieldValuemethod to the public interface; removesetFieldValuemethod.MethodWatcher- Add type parameter to this interface, and extend theTypeDiscloserinterface. Change method signatures to replace arguments specific toFrameworkMethodwith generic type andReflectiveCallableobject.RunAnnouncer- Remove type parameter. Only post notifications toRunWatcherproviders that support methods of the current type.RunReflectiveCall- Set type ofcallableargument to its actual class (ReflectiveCallable). Remove object unwrapping specific toFrameworkMethod. Update invocation notifications to their revised signatures. Ensure that we don't die when logging debug messages.RunWatcher- Extend theTypeDiscloserinterface.TypeDiscloser- New interface to require implementations of generic interfaces to publicize their supported type.