### Question:
ScriptEngineContainer { public ScriptEngine getScriptEngine(ScriptLocation script) throws EngineException { for (ScriptEngineService service : m_container.getComponents(ScriptEngineService.class)) { final ScriptEngine engine = service.createScriptEngine(script); if (engine != null) { return engine; } } throw new EngineException("No suitable script engine installed for '" + script + "'"); } ScriptEngineContainer(GrinderProperties properties,
                               Logger logger,
                               DCRContext dcrContext,
                               ScriptLocation scriptLocation); ScriptEngine getScriptEngine(ScriptLocation script); Instrumenter createInstrumenter();  }### Answer:
@Test public void testUnknownScriptType() throws Exception { final ScriptEngineContainer container = new ScriptEngineContainer(m_properties, m_logger, m_dcrContext, m_pyScript); try { container.getScriptEngine(new ScriptLocation(new File("foo.xxx"))); fail("Expected EngineException"); } catch (EngineException e) { assertContains(e.getMessage(), "No suitable script engine"); } }
@Test public void testJythonScript() throws Exception { final ScriptLocation pyScript = new ScriptLocation(new Directory(getDirectory()), new File("my.py")); createFile(pyScript.getFile(), "class TestRunner: pass"); final ScriptEngineContainer container = new ScriptEngineContainer(m_properties, m_logger, m_dcrContext, m_pyScript); final ScriptEngine scriptEngine = container.getScriptEngine(pyScript); assertContains(scriptEngine.getDescription(), "Jython"); }