Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

147
Vistas
Verify if GraalVM is used

due to Nashorn being discontinued we are currently trying to change our (still Java 8) application (very big monolith) from Nashorn to GraalVM. Due to the application being used as library in multiple projects, instead of using the whole GraalVM runtime we decided to just adding the necessary jars to the class path (which seem to work so far).

To use GraalVM, I changed all occurrences of getEngineByName to graal.js as follow:

ScriptEngineManager sem = new ScriptEngineManager(null);
scriptEngine = sem.getEngineByName("graal.js");

Due to the application being very complex, understanding every aspect of the application is relatively difficult and I was wondering if there is a way of verifying what JavaScript engine is used with the prepared JavaScript string as input? My goal is to write a Unit test which verifies for every method which takes JavaScript as input, if GraalVM is really used.

What would be the best approach to achieve this?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

you can compare the class name of the script engine with com.oracle.truffle.js.scriptengine.GraalJSScriptEngine something like this:

ScriptEngine  scriptEngine = new ScriptEngineManager().getEngineByName("graal.js");
            String engineName = scriptEngine.getClass().getName();
            boolean isGraalJS = engineName.equals("com.oracle.truffle.js.scriptengine.GraalJSScriptEngine");
            System.out.println(isGraalJS);
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda