mgr.registerEngineExtension(null, null);
fail("Expected NullPointerException");
} catch (NullPointerException e) {
}
try {
mgr.registerEngineExtension(null, new TestScriptEngineFactory());
fail("Expected NullPointerException");
} catch (NullPointerException e) {
}
try {
mgr.registerEngineExtension("", null);
fail("Expected NullPointerException");
} catch (NullPointerException e) {
}
assertNull(mgr.getEngineByExtension("")); // not yet defined
// Empty extensions are allowed
mgr.registerEngineExtension("", new TestScriptEngineFactory());
assertNotNull(mgr.getEngineByExtension("")); //now defined
assertNull(mgr.getEngineByExtension("junit2")); // not yet defined
mgr.registerEngineExtension("junit2", new TestScriptEngineFactory());
assertNotNull(mgr.getEngineByExtension("junit2")); //now defined
}