use of com.tvd12.ezyfoxserver.command.impl.EzyBroadcastAppsEventImpl in project ezyfox-server by youngmonkeys.
the class EzyBroadcastAppsEventImplTest method test.
@Test
public void test() {
EzyEvent event2 = new EzySimpleServerInitializingEvent();
EzyZoneContext zoneContext = mock(EzyZoneContext.class);
List<EzyAppContext> appContexts = Lists.newArrayList(newAppContext("1", event2), newAppContext("2", event2), newAppContext("3", event2));
when(zoneContext.getAppContexts()).thenReturn(appContexts);
EzyZone zone = mock(EzyZone.class);
EzySimpleZoneSetting zoneSetting = new EzySimpleZoneSetting();
zoneSetting.setName("test");
when(zone.getSetting()).thenReturn(zoneSetting);
when(zoneContext.getZone()).thenReturn(zone);
EzyBroadcastAppsEventImpl cmd = new EzyBroadcastAppsEventImpl(zoneContext);
EzyEvent event = new EzySimpleServerInitializingEvent();
cmd.fire(EzyEventType.SERVER_INITIALIZING, event, true);
cmd.fire(EzyEventType.SERVER_INITIALIZING, event, false);
EzySimpleUser user = new EzySimpleUser();
user.setName("user1");
cmd.fire(EzyEventType.SERVER_INITIALIZING, event, user, true);
cmd.fire(EzyEventType.SERVER_INITIALIZING, event, "user1", true);
cmd.fire(EzyEventType.SERVER_INITIALIZING, event2, true);
}
use of com.tvd12.ezyfoxserver.command.impl.EzyBroadcastAppsEventImpl in project ezyfox-server by youngmonkeys.
the class EzySimpleZoneContext method doInit.
@Override
protected void doInit() {
this.broadcastEvent = new EzyZoneBroadcastEventImpl(this);
this.broadcastAppsEvent = new EzyBroadcastAppsEventImpl(this);
this.broadcastPluginsEvent = new EzyBroadcastPluginsEventImpl(this);
this.properties.put(EzyBroadcastEvent.class, broadcastEvent);
this.properties.put(EzyBroadcastAppsEvent.class, broadcastAppsEvent);
this.properties.put(EzyBroadcastPluginsEvent.class, broadcastPluginsEvent);
}
Aggregations