Revert "Tests: Remove a couple test uses of onModule (#21414)"

This reverts commit b326f0bc51.
This commit is contained in:
javanna 2016-11-09 11:32:16 +01:00 committed by Luca Cavanna
parent 10d358a985
commit 2f32c1173b
12 changed files with 84 additions and 100 deletions

View file

@ -20,11 +20,17 @@ If you squashed the whole thing into one class it'd look like:
[source,java]
--------------------------------------------------
public class MyNativeScriptPlugin extends Plugin implements ScriptPlugin {
public class MyNativeScriptPlugin extends Plugin {
@Override
public List<NativeScriptFactory> getNativeScripts() {
return Collections.singletonList(new MyNativeScriptFactory());
public String name() {
return "my-native-script";
}
@Override
public String description() {
return "my native script that does something great";
}
public void onModule(ScriptModule scriptModule) {
scriptModule.registerScript("my_script", MyNativeScriptFactory.class);
}
public static class MyNativeScriptFactory implements NativeScriptFactory {