Search in sources :

Example 1 with EzyBroadcastAppsEventImpl

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);
}
Also used : EzySimpleServerInitializingEvent(com.tvd12.ezyfoxserver.event.EzySimpleServerInitializingEvent) EzyZone(com.tvd12.ezyfoxserver.EzyZone) EzyEvent(com.tvd12.ezyfoxserver.event.EzyEvent) EzySimpleUser(com.tvd12.ezyfoxserver.entity.EzySimpleUser) EzyZoneContext(com.tvd12.ezyfoxserver.context.EzyZoneContext) EzyBroadcastAppsEventImpl(com.tvd12.ezyfoxserver.command.impl.EzyBroadcastAppsEventImpl) EzyAppContext(com.tvd12.ezyfoxserver.context.EzyAppContext) EzySimpleZoneSetting(com.tvd12.ezyfoxserver.setting.EzySimpleZoneSetting) Test(org.testng.annotations.Test) BaseTest(com.tvd12.test.base.BaseTest)

Example 2 with EzyBroadcastAppsEventImpl

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);
}
Also used : EzyBroadcastAppsEventImpl(com.tvd12.ezyfoxserver.command.impl.EzyBroadcastAppsEventImpl) EzyZoneBroadcastEventImpl(com.tvd12.ezyfoxserver.command.impl.EzyZoneBroadcastEventImpl) EzyBroadcastPluginsEventImpl(com.tvd12.ezyfoxserver.command.impl.EzyBroadcastPluginsEventImpl)

Aggregations

EzyBroadcastAppsEventImpl (com.tvd12.ezyfoxserver.command.impl.EzyBroadcastAppsEventImpl)2 EzyZone (com.tvd12.ezyfoxserver.EzyZone)1 EzyBroadcastPluginsEventImpl (com.tvd12.ezyfoxserver.command.impl.EzyBroadcastPluginsEventImpl)1 EzyZoneBroadcastEventImpl (com.tvd12.ezyfoxserver.command.impl.EzyZoneBroadcastEventImpl)1 EzyAppContext (com.tvd12.ezyfoxserver.context.EzyAppContext)1 EzyZoneContext (com.tvd12.ezyfoxserver.context.EzyZoneContext)1 EzySimpleUser (com.tvd12.ezyfoxserver.entity.EzySimpleUser)1 EzyEvent (com.tvd12.ezyfoxserver.event.EzyEvent)1 EzySimpleServerInitializingEvent (com.tvd12.ezyfoxserver.event.EzySimpleServerInitializingEvent)1 EzySimpleZoneSetting (com.tvd12.ezyfoxserver.setting.EzySimpleZoneSetting)1 BaseTest (com.tvd12.test.base.BaseTest)1 Test (org.testng.annotations.Test)1