use of net.runelite.client.RuneLiteModule in project runelite by runelite.
the class PluginManagerTest method before.
@Before
public void before() throws IOException {
RuneLite.setOptions(mock(OptionSet.class));
Injector injector = Guice.createInjector(new RuneLiteModule(), BoundFieldModule.of(this));
RuneLite.setInjector(injector);
runelite = injector.getInstance(RuneLite.class);
// Find plugins we expect to have
pluginClasses = new HashSet<>();
Set<ClassInfo> classes = ClassPath.from(getClass().getClassLoader()).getTopLevelClassesRecursive(PLUGIN_PACKAGE);
for (ClassInfo classInfo : classes) {
Class<?> clazz = classInfo.load();
PluginDescriptor pluginDescriptor = clazz.getAnnotation(PluginDescriptor.class);
if (pluginDescriptor != null) {
pluginClasses.add(clazz);
}
}
}
use of net.runelite.client.RuneLiteModule in project runelite by runelite.
the class PluginManagerTest method dumpGraph.
@Test
public void dumpGraph() throws Exception {
List<Module> modules = new ArrayList<>();
modules.add(new GraphvizModule());
modules.add(new RuneLiteModule());
runelite.setClient(client);
PluginManager pluginManager = new PluginManager();
pluginManager.loadCorePlugins();
for (Plugin p : pluginManager.getPlugins()) {
modules.add(p);
}
File file = folder.newFile();
try (PrintWriter out = new PrintWriter(file, "UTF-8")) {
Injector injector = Guice.createInjector(modules);
GraphvizGrapher grapher = injector.getInstance(GraphvizGrapher.class);
grapher.setOut(out);
grapher.setRankdir("TB");
grapher.graph(injector);
}
}
Aggregations