|
18 | 18 | import org.elasticsearch.env.Environment; |
19 | 19 | import org.elasticsearch.env.TestEnvironment; |
20 | 20 | import org.elasticsearch.index.IndexModule; |
21 | | -import org.elasticsearch.jdk.RuntimeVersionFeature; |
22 | 21 | import org.elasticsearch.plugin.analysis.CharFilterFactory; |
23 | 22 | import org.elasticsearch.plugins.scanners.PluginInfo; |
24 | 23 | import org.elasticsearch.plugins.spi.BarPlugin; |
|
38 | 37 | import java.nio.charset.StandardCharsets; |
39 | 38 | import java.nio.file.Files; |
40 | 39 | import java.nio.file.Path; |
41 | | -import java.security.AccessControlException; |
42 | 40 | import java.util.ArrayList; |
43 | 41 | import java.util.Arrays; |
44 | 42 | import java.util.Collection; |
@@ -873,22 +871,6 @@ public Reader create(Reader reader) { |
873 | 871 | } |
874 | 872 | } |
875 | 873 |
|
876 | | - public void testCanCreateAClassLoader() { |
877 | | - assumeTrue("security manager must be available", RuntimeVersionFeature.isSecurityManagerAvailable()); |
878 | | - assertEquals( |
879 | | - "access denied (\"java.lang.RuntimePermission\" \"createClassLoader\")", |
880 | | - expectThrows(AccessControlException.class, () -> new Loader(this.getClass().getClassLoader())).getMessage() |
881 | | - ); |
882 | | - var loader = PrivilegedOperations.supplierWithCreateClassLoader(() -> new Loader(this.getClass().getClassLoader())); |
883 | | - assertEquals(this.getClass().getClassLoader(), loader.getParent()); |
884 | | - } |
885 | | - |
886 | | - static final class Loader extends ClassLoader { |
887 | | - Loader(ClassLoader parent) { |
888 | | - super(parent); |
889 | | - } |
890 | | - } |
891 | | - |
892 | 874 | // Closes the URLClassLoaders and UberModuleClassloaders of plugins loaded by the given plugin service. |
893 | 875 | // We can use the direct ClassLoader from the plugin because tests do not use any parent SPI ClassLoaders. |
894 | 876 | static void closePluginLoaders(PluginsService pluginService) { |
|
0 commit comments