Question ad creating a testcase that needs a jar on class- or module path
Rony G. Flatscher
Rony.Flatscher at wu.ac.at
Fri Jan 31 15:28:32 UTC 2020
How would one go about creating a testcase that needs a jar-file either on the class- or module path?
Are there any test units that would demonstrate how to do it? If not, what approach would you
suggest (and if so, are there any samples already somewhere to study)?
---
Background: for creating a testcase using a pseudo script engine ("RgfPseudoScriptEngine") that logs
its invocations with the script context Bindings for each invocation and which then will be analyzed
and used for the test assertions, there is a need to have the pseudo script engine made available
via the Java scripting framework.
There is a jar-file (that includes the sources as well) with the necessary definitions:
* via class path: "META-INF/services/javax.script.ScriptEngineFactory" entry:
rgf.scriptEngine.RgfPseudoScriptEngineFactory
* via module path which will use the information in "module-info.java":
module rgf.scriptEngine {
requires java.scripting;
provides javax.script.ScriptEngineFactory with rgf.scriptEngine.RgfPseudoScriptEngineFactory;
exports rgf.scriptEngine;
}
TIA,
---rony
More information about the openjfx-dev
mailing list