Remove (again) test uses of onModule (#21414)

This change was reverted after it caused random test failures. This was
due to a copy/paste error in the original PR which caused the mock
version of ClusterInfoService to be used whenever the mock *ZenPing* was
used, and the real ClusterInfoService to be used when MockZenPing was
not used.
This commit is contained in:
Ryan Ernst 2016-11-10 15:52:17 -08:00
parent 7ed195fe93
commit 48bfb142b9
12 changed files with 120 additions and 86 deletions

View file

@ -20,17 +20,11 @@ If you squashed the whole thing into one class it'd look like:
[source,java]
--------------------------------------------------
public class MyNativeScriptPlugin extends Plugin {
public class MyNativeScriptPlugin extends Plugin implements ScriptPlugin {
@Override
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 List<NativeScriptFactory> getNativeScripts() {
return Collections.singletonList(new MyNativeScriptFactory());
}
public static class MyNativeScriptFactory implements NativeScriptFactory {