From a7444f7af465555f2e493313ab253c0c124a1158 Mon Sep 17 00:00:00 2001 From: Dawid Weiss Date: Fri, 6 Dec 2019 19:00:50 +0100 Subject: [PATCH] LUCENE-9077: Add support for running under gradle test runner. --- .../src/java/org/apache/solr/util/SolrSecurityManager.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/solr/test-framework/src/java/org/apache/solr/util/SolrSecurityManager.java b/solr/test-framework/src/java/org/apache/solr/util/SolrSecurityManager.java index 60411f04a6b..add572a2495 100644 --- a/solr/test-framework/src/java/org/apache/solr/util/SolrSecurityManager.java +++ b/solr/test-framework/src/java/org/apache/solr/util/SolrSecurityManager.java @@ -32,6 +32,7 @@ public final class SolrSecurityManager extends SecurityManager { static final String JUNIT4_TEST_RUNNER_PACKAGE = "com.carrotsearch.ant.tasks.junit4."; static final String ECLIPSE_TEST_RUNNER_PACKAGE = "org.eclipse.jdt.internal.junit.runner."; static final String IDEA_TEST_RUNNER_PACKAGE = "com.intellij.rt.execution.junit."; + static final String GRADLE_TEST_RUNNER_PACKAGE = "worker.org.gradle.process.internal.worker"; /** * Creates a new SolrSecurityManager. This ctor is called on JVM startup, @@ -156,7 +157,8 @@ public final class SolrSecurityManager extends SecurityManager { if (exitMethodHit != null) { if (className.startsWith(JUNIT4_TEST_RUNNER_PACKAGE) || className.startsWith(ECLIPSE_TEST_RUNNER_PACKAGE) || - className.startsWith(IDEA_TEST_RUNNER_PACKAGE)) { + className.startsWith(IDEA_TEST_RUNNER_PACKAGE) || + className.startsWith(GRADLE_TEST_RUNNER_PACKAGE)) { // this exit point is allowed, we return normally from closure: return /*void*/ null; } else {