生成具有以下信息和格式的测试文件:
{ "component": "<component name>", "locations": [ { "representative_class": <class name with package>, "module": "<module name>" }, ... ] }无痛:
{ "component": "lang-painless", "locations": [ { "representative_class": "org/objectweb/asm/tree/analysis/Analyzer.class", "module": "org.objectweb.asm.tree.analysis" }, ... ] }然后它将以下文件复制到 jar 中以供单元测试使用:
* META-INF/test-build-info.json * META-INF/es-plugins/<plugin name>/plugin-descriptor.properties * META-INF/es-plugins/<plugin name>/entitlement-policy.yaml对于服务器来说,jar 中的文件变成如下形式:
* META-INF/test-build-info.json这应该提供足够的信息,以便BootstrapForTesting能够构建调用者类到策略文件的映射,使用类文件在类路径中查找 jar 或目录,然后将其与其指定的模块关联,最后使用指定的模块查找相应的授权策略。caller class -> specified module -> entitlement policy