Sling 9915 support for sling annotations test runner (#5)

* SLING-9915 Remove deprecated flags

* SLING-9915 Refactored ServiceGetter.java and made public such that it can be used by AnnotationsProcessor.java

* SLING-9915 Added filter() method to TestReference interface

* Added tests for TestReference(String filter)

* Update AnnotationsProcessor::processTestReference to get the filter passed to the TestReference annotation, and call  getService(Class<?> c, String filter) which now uses ServiceGetter

* update package version to 1.2.0 as per bnd-baseline-maven-plugin recommendation

* Moved ServiceGetter.java to org.apache.sling.junit.impl package

* change TestReference second parameter to be called target (not filter)

* When using ServiceGetters, make sure to execute close method after the tests

* Refactored AnnotationsProcessor::getService since ServiceGetter handles edge-cases

* fixes for sonarcloud code smells

* WIP: Started integration tests for @TestReference. Not working.

* WIP: Fix integration tests

* WIP Continued PAX-style test for TestReference annotation

* WIP continued - fix integration tests setup

* Updated README with more detailed instructions for debugging

* Unget services provided by @TestReference for every test executed by a SlingAnnotationsTestRunner instance

* update per review notes 12/2/2020

* updated parent to sling-bundle-parent v40

* removed unused import

Co-authored-by: Bertrand Delacretaz <bdelacretaz@apache.org>

Merging to master based on the PR approval from jsedding and input on the dev email 12/5/2020.
21 files changed
tree: 1765ca1e47a523fbdc8f7188278094b0a8591c33
  1. src/
  2. .gitignore
  3. bnd.bnd
  4. CODE_OF_CONDUCT.md
  5. CONTRIBUTING.md
  6. Jenkinsfile
  7. LICENSE
  8. pom.xml
  9. README.md
README.md

Apache Sling

Build Status Test Status Coverage Sonarcloud Status JavaDoc Maven Central junit License

Apache Sling JUnit Core

This module is part of the Apache Sling project.

Runs JUnit tests in an OSGi framework and provides the JUnit libraries