use of com.tvd12.ezyfoxserver.EzyPluginsStarter in project ezyfox-server by youngmonkeys.
the class EzyPluginsStarterTest method test1.
@Test
public void test1() {
EzyPluginsStarter starter = new EzyPluginsStarter.Builder() {
@Override
public EzyPluginsStarter build() {
return new EzyPluginsStarter(this) {
public java.util.Set<String> getPluginNames() {
return Sets.newHashSet("test");
}
public EzyPluginEntryLoader newPluginEntryLoader(String pluginName) throws Exception {
throw new Exception();
}
};
}
}.zoneContext(EzyZoneContextsTest.newDefaultZoneContext()).build();
starter.start();
}
use of com.tvd12.ezyfoxserver.EzyPluginsStarter in project ezyfox-server by youngmonkeys.
the class EzyPluginsStarterTest method newAppEntryLoaderArgsNotNullTest.
@Test
public void newAppEntryLoaderArgsNotNullTest() {
// given
EzySimpleZoneContext zoneContext = EzyZoneContextsTest.newDefaultZoneContext();
EzySimplePlugin plugin = new EzySimplePlugin();
EzySimplePluginSetting pluginSetting = new EzySimplePluginSetting();
pluginSetting.setName("abc");
pluginSetting.setEntryLoader(InternalPluginEntryLoader.class);
pluginSetting.setEntryLoaderArgs(new String[] { "Hello" });
plugin.setSetting(pluginSetting);
EzySimplePluginContext pluginContext = new EzySimplePluginContext();
pluginContext.setPlugin(plugin);
EzySimpleZoneSetting zoneSetting = new EzySimpleZoneSetting();
EzySimplePluginsSetting pluginsSetting = new EzySimplePluginsSetting();
pluginsSetting.setItem(pluginSetting);
zoneSetting.setPlugins(pluginsSetting);
zoneContext.addPluginContext(pluginSetting, pluginContext);
EzySimpleZone zone = new EzySimpleZone();
zone.setSetting(zoneSetting);
zoneContext.setZone(zone);
EzyPluginsStarter starter = new EzyPluginsStarter.Builder().zoneContext(zoneContext).build();
// when
starter.start();
// then
Asserts.assertNotNull(plugin.getEntry());
}
Aggregations