Search in sources :

Example 1 with EzyPluginSendResponseImpl

use of com.tvd12.ezyfoxserver.command.impl.EzyPluginSendResponseImpl in project ezyfox-server by youngmonkeys.

the class EzyPluginSendResponseImplTest method test.

@Test
public void test() {
    EzyPluginContext pluginContext = mock(EzyPluginContext.class);
    EzyPlugin plugin = mock(EzyPlugin.class);
    when(pluginContext.getPlugin()).thenReturn(plugin);
    EzySimplePluginSetting pluginSetting = new EzySimplePluginSetting();
    pluginSetting.setName("test");
    when(plugin.getSetting()).thenReturn(pluginSetting);
    EzyZoneContext zoneContext = mock(EzyZoneContext.class);
    when(pluginContext.getParent()).thenReturn(zoneContext);
    EzyServerContext serverContext = mock(EzyServerContext.class);
    when(zoneContext.getParent()).thenReturn(serverContext);
    EzyPluginSendResponseImpl cmd = new EzyPluginSendResponseImpl(pluginContext);
    EzyObject data = EzyEntityFactory.newObjectBuilder().build();
    EzyAbstractSession session = spy(EzyAbstractSession.class);
    cmd.execute(data, session, false);
    cmd.execute(data, Lists.newArrayList(session), false);
}
Also used : EzyZoneContext(com.tvd12.ezyfoxserver.context.EzyZoneContext) EzyPluginSendResponseImpl(com.tvd12.ezyfoxserver.command.impl.EzyPluginSendResponseImpl) EzyAbstractSession(com.tvd12.ezyfoxserver.entity.EzyAbstractSession) EzyPluginContext(com.tvd12.ezyfoxserver.context.EzyPluginContext) EzyServerContext(com.tvd12.ezyfoxserver.context.EzyServerContext) EzyPlugin(com.tvd12.ezyfoxserver.EzyPlugin) EzyObject(com.tvd12.ezyfox.entity.EzyObject) EzySimplePluginSetting(com.tvd12.ezyfoxserver.setting.EzySimplePluginSetting) Test(org.testng.annotations.Test) BaseTest(com.tvd12.test.base.BaseTest)

Example 2 with EzyPluginSendResponseImpl

use of com.tvd12.ezyfoxserver.command.impl.EzyPluginSendResponseImpl in project ezyfox-server by youngmonkeys.

the class EzySimplePluginContext method doInit.

@Override
protected void doInit() {
    EzySetup setup = new EzyPluginSetupImpl(plugin);
    this.sendResponse = new EzyPluginSendResponseImpl(this);
    this.properties.put(EzyPluginSendResponse.class, sendResponse);
    this.properties.put(EzyHandleException.class, new EzyPluginHandleExceptionImpl(plugin));
    this.properties.put(EzySetup.class, setup);
    this.properties.put(EzyPluginSetup.class, setup);
}
Also used : EzyPluginHandleExceptionImpl(com.tvd12.ezyfoxserver.command.impl.EzyPluginHandleExceptionImpl) EzyPluginSendResponseImpl(com.tvd12.ezyfoxserver.command.impl.EzyPluginSendResponseImpl) EzyPluginSetupImpl(com.tvd12.ezyfoxserver.command.impl.EzyPluginSetupImpl)

Aggregations

EzyPluginSendResponseImpl (com.tvd12.ezyfoxserver.command.impl.EzyPluginSendResponseImpl)2 EzyObject (com.tvd12.ezyfox.entity.EzyObject)1 EzyPlugin (com.tvd12.ezyfoxserver.EzyPlugin)1 EzyPluginHandleExceptionImpl (com.tvd12.ezyfoxserver.command.impl.EzyPluginHandleExceptionImpl)1 EzyPluginSetupImpl (com.tvd12.ezyfoxserver.command.impl.EzyPluginSetupImpl)1 EzyPluginContext (com.tvd12.ezyfoxserver.context.EzyPluginContext)1 EzyServerContext (com.tvd12.ezyfoxserver.context.EzyServerContext)1 EzyZoneContext (com.tvd12.ezyfoxserver.context.EzyZoneContext)1 EzyAbstractSession (com.tvd12.ezyfoxserver.entity.EzyAbstractSession)1 EzySimplePluginSetting (com.tvd12.ezyfoxserver.setting.EzySimplePluginSetting)1 BaseTest (com.tvd12.test.base.BaseTest)1 Test (org.testng.annotations.Test)1