cmrockwell commented on a change in pull request #5:
URL:
https://github.com/apache/sling-org-apache-sling-junit-core/pull/5#discussion_r532946310
##########
File path:
src/main/java/org/apache/sling/junit/annotations/SlingAnnotationsTestRunner.java
##########
@@ -56,4 +57,16 @@ protected Object createTest() throws Exception {
return top.process(super.createTest());
}
}
+
+ @Override
+ public void run(RunNotifier notifier){
+ try {
+ super.run(notifier);
+ } catch (Exception e) {
+ log.error("Test 'run' method", e);
+ } finally {
+ AnnotationsProcessor ap = (AnnotationsProcessor) top;
+ ap.closeAllServices();
Review comment:
Thanks @jsedding for the detailed comment about un-getting services
provided by @TestReference. I went with your first suggestion in this commit...
https://github.com/apache/sling-org-apache-sling-junit-core/pull/5/commits/e3f8233f52b1d96aedf61bf47c0898e74d00e86f
Do you think it's necessary to change the TestObjectProcessor API for
cleanupTest? Not sure what you think about this, but casting to
AnnotationsProcessor avoided an API change.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]