You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by cr...@apache.org on 2020/11/20 23:42:12 UTC

[sling-org-apache-sling-junit-core] 02/05: SLING-9915 Added filter() method to TestReference interface

This is an automated email from the ASF dual-hosted git repository.

cris pushed a commit to branch SLING-9915-Support-for-SlingAnnotationsTestRunner
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-junit-core.git

commit b505ee89c5ad1656edce17b76c10640b83c54ae2
Author: Cris Rockwell <cm...@umich.edu>
AuthorDate: Fri Nov 20 18:31:57 2020 -0500

    SLING-9915 Added filter() method to TestReference interface
---
 src/main/java/org/apache/sling/junit/annotations/AutoDetect.java    | 3 +++
 src/main/java/org/apache/sling/junit/annotations/TestReference.java | 6 ++++++
 2 files changed, 9 insertions(+)

diff --git a/src/main/java/org/apache/sling/junit/annotations/AutoDetect.java b/src/main/java/org/apache/sling/junit/annotations/AutoDetect.java
index e501b3e..c26e885 100644
--- a/src/main/java/org/apache/sling/junit/annotations/AutoDetect.java
+++ b/src/main/java/org/apache/sling/junit/annotations/AutoDetect.java
@@ -25,4 +25,7 @@ public class AutoDetect {
     private AutoDetect() {
         // disallows instancing this class
     }
+    private AutoDetect(String filter) {
+        // disallows instancing this class
+    }
 }
diff --git a/src/main/java/org/apache/sling/junit/annotations/TestReference.java b/src/main/java/org/apache/sling/junit/annotations/TestReference.java
index 56791cb..c8db670 100644
--- a/src/main/java/org/apache/sling/junit/annotations/TestReference.java
+++ b/src/main/java/org/apache/sling/junit/annotations/TestReference.java
@@ -39,6 +39,12 @@ public @interface TestReference {
     String name() default "";
 
     /**
+     * LDAP-style filter for targeting a specific reference implementation
+     *
+     * @return the local name of the reference ("" by default)
+     */
+    String filter() default "";
+    /**
      * The name of the service interface. This name is used by the Service Component Runtime to access the service on behalf of the
      * component. The default value for is the type of the field to which the annotation applies.
      *