Releases: sbabcoc/JUnit-Foundation
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 forFrameworkMethodwith generic type parameter.LifecycleHooks- Add type parameter toAtomicTestreferences. Replace custom reflection-based method invocation with Apache CommonsMethodUtilscall.RunAnnouncer- Add type parameter to this class, and toAtomicTestandRunWatcherreferences.RunChild- Expand scope ofAtomicTestcreation to ensure that clients are able to acquire test objects related to non-native runners.RunWatcher- Add type parameter to this interface and toAtomicTestreferences.
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.
Enable inclusion in Java 7 projects
This release enabled Java 7 projects to use JUnit Foundation. In addition to removing all Java 8 implementation from this project's sources, this involved ensuring that the correct JDK is used for compilation and selecting Java 7 compatible releases of all dependencies.
- Switched from Java 8
Optionalto Google GuavaOptional - Switched from interfaces with
staticanddefaultmethods to abstract classes - Add implementation for
computeIfAbsent() - Replace lambdas with anonymous classes and Google Guava
Functionobjects
Fix issue with handling of exceptions thrown by test rules
If an attached test rule threw an exception, handling of the failure resulted in a NullPointerException. This was caused by an inability to associate the failure to its corresponding "atomic" test. This release resolves the issue by mapping each BlockJUnit4ClassRunner with its associated "atomic" test much earlier in the process. I added the ability to map Description objects to "atomic" tests as well, which is why this is a feature release.
Add support for Kotlin test method names
In Kotlin, test method names can include spaces. I guess underscores and camel-casing are just too difficult for some folks to parse. In this release, I revised the pattern I use to extract test method names to handle this syntactic sugar aberration.
Add support for expected exceptions
- Create
AtomicTestobject prior to execution of first "particle" method, storing it in a map keyed with the associated runner. - Add methods:
LifecycleHooks.getAtomicTestOf(Object)RunAnnouncer.newAtomicTest(Description)RunAnnouncer.getAtomicTestOf(Object)RunAnnouncer.setTestFailure(Failure)
- Update
RunAnnouncerlistener methods to create and use a singleAtomicTestobject for the entire run of each "atomic" test.
Create comprehensive watcher finder method
- Add comprehensive
LifecycleHooks.getAttachedWatcher()method to enable tests to harvest values collected by attached JUnit watchers. TheHookInstallationTestclass uses this method to harvest method names seen by theUnitTestWatcherclass during test execution. - Add
LifecycleHooks.getAttachedListener()method to enable tests to harvest values collected by attached JUnit run listeners. - These methods invoke identically-named package-private methods of internal implementation classes.