Releases: sbabcoc/JUnit-Foundation
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 thegetFieldValue
method to the public interface; removesetFieldValue
method.MethodWatcher
- Add type parameter to this interface, and extend theTypeDiscloser
interface. Change method signatures to replace arguments specific toFrameworkMethod
with generic type andReflectiveCallable
object.RunAnnouncer
- Remove type parameter. Only post notifications toRunWatcher
providers that support methods of the current type.RunReflectiveCall
- Set type ofcallable
argument 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 theTypeDiscloser
interface.TypeDiscloser
- New interface to require implementations of generic interfaces to publicize their supported type.
First attempt at generic-izing support for child method classes
This is a first stab at replacing the hardcoded support for the native JUnit method class (FrameworkMethod
) with generic support for whatever method class happens to be running. As I discovered when applying this release to an actual use case (support for JUnit Cucumber), I didn't go far enough. Here's what changed in this release:
AtomicTest
- Replace hardcoded support forFrameworkMethod
with generic type parameter.LifecycleHooks
- Add type parameter toAtomicTest
references. Replace custom reflection-based method invocation with Apache CommonsMethodUtils
call.RunAnnouncer
- Add type parameter to this class, and toAtomicTest
andRunWatcher
references.RunChild
- Expand scope ofAtomicTest
creation to ensure that clients are able to acquire test objects related to non-native runners.RunWatcher
- Add type parameter to this interface and toAtomicTest
references.
Add debug logging
In conjunction with test lifecycle notifications, JUnit Foundation
now emits debug log messages.
Enable global timeout support on Java 8
The hierarchy for the Method
class differs between Java 7 and Java 8. This revision tweaks the implementation of global timeout support to work properly with both versions of the Java runtime.
Fix Java 7 support; fix global timeout support
My initial effort at implementing Java 7 support missed the mark. This release uses the tool chain
plug-in to ensure that the Java 7 JDK is used for compilation. This changed revealed that I had more Java 8 code and dependencies to replace with Java 7 equivalents. In the process, I discovered that my global timeout implementation probably shouldn't have ever worked, as I was applying the timeout at the wrong level.
Fix handling of artifact path
There was a disparity in the implementation of the artifact path feature between this project and TestNG Foundation. This release resolve the disparity, using the default artifact path of the base class as the root folder and specific artifact types appending their resource folder names to that. This change required converting ArtifactType
from an interface to an abstract base class.