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

jsedding pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-junit-core.git

commit dcbc2989bcd956b4f54fb45520505e08a69d6951
Author: Julian Sedding <[email protected]>
AuthorDate: Thu Jun 24 17:40:18 2021 +0200

    SLING-10549 - Regression: BundleTestsProvider recognizes too many 
test-classes
---
 src/main/java/org/apache/sling/junit/impl/BundleTestsProvider.java | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/apache/sling/junit/impl/BundleTestsProvider.java 
b/src/main/java/org/apache/sling/junit/impl/BundleTestsProvider.java
index de7b785..e120b6d 100644
--- a/src/main/java/org/apache/sling/junit/impl/BundleTestsProvider.java
+++ b/src/main/java/org/apache/sling/junit/impl/BundleTestsProvider.java
@@ -111,10 +111,11 @@ public class BundleTestsProvider extends 
AbstractTestsProvider {
 
             Predicate<String> isTestClass;
             try {
-                isTestClass = Pattern.compile(headerValue).asPredicate();
+                final Pattern testClassRegexp = Pattern.compile(headerValue);
+                isTestClass = name -> testClassRegexp.matcher(name).matches();
             } catch (PatternSyntaxException pse) {
-                LOG.warn("Bundle '{}' has an invalid pattern for {} header, 
ignored: '{}'",
-                        bundle.getSymbolicName(), SLING_TEST_REGEXP, 
headerValue);
+                LOG.warn("Bundle '{}' has an invalid pattern for {} header, 
ignored: '{}', message: '{}'",
+                        bundle.getSymbolicName(), SLING_TEST_REGEXP, 
headerValue, pse.getMessage());
                 return Collections.emptySet();
             }
 

Reply via email to