Search in sources :

Example 1 with EzyAppSendResponseImpl

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

the class EzySimpleAppContext method doInit.

@Override
protected void doInit() {
    EzySetup setup = new EzyAppSetupImpl(app);
    this.sendResponse = new EzyAppSendResponseImpl(this);
    this.properties.put(EzyAppSendResponse.class, sendResponse);
    this.properties.put(EzyHandleException.class, new EzyAppHandleExceptionImpl(app));
    this.properties.put(EzySetup.class, setup);
    this.properties.put(EzyAppSetup.class, setup);
}
Also used : EzyAppHandleExceptionImpl(com.tvd12.ezyfoxserver.command.impl.EzyAppHandleExceptionImpl) EzyAppSetupImpl(com.tvd12.ezyfoxserver.command.impl.EzyAppSetupImpl) EzyAppSendResponseImpl(com.tvd12.ezyfoxserver.command.impl.EzyAppSendResponseImpl)

Example 2 with EzyAppSendResponseImpl

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

the class EzyAppSendResponseImplTest method test.

@Test
public void test() {
    EzyAppContext appContext = mock(EzyAppContext.class);
    EzyApplication app = mock(EzyApplication.class);
    when(appContext.getApp()).thenReturn(app);
    EzySimpleAppSetting appSetting = new EzySimpleAppSetting();
    appSetting.setName("test");
    when(app.getSetting()).thenReturn(appSetting);
    EzyZoneContext zoneContext = mock(EzyZoneContext.class);
    when(appContext.getParent()).thenReturn(zoneContext);
    EzyServerContext serverContext = mock(EzyServerContext.class);
    when(zoneContext.getParent()).thenReturn(serverContext);
    EzyAppSendResponseImpl cmd = new EzyAppSendResponseImpl(appContext);
    EzyData data = EzyEntityFactory.newArrayBuilder().build();
    EzyAbstractSession session = spy(EzyAbstractSession.class);
    cmd.execute(data, session, false);
    cmd.execute(data, Lists.newArrayList(session), false);
}
Also used : EzySimpleAppSetting(com.tvd12.ezyfoxserver.setting.EzySimpleAppSetting) EzyApplication(com.tvd12.ezyfoxserver.EzyApplication) EzyZoneContext(com.tvd12.ezyfoxserver.context.EzyZoneContext) EzyAbstractSession(com.tvd12.ezyfoxserver.entity.EzyAbstractSession) EzyServerContext(com.tvd12.ezyfoxserver.context.EzyServerContext) EzyData(com.tvd12.ezyfox.entity.EzyData) EzyAppContext(com.tvd12.ezyfoxserver.context.EzyAppContext) EzyAppSendResponseImpl(com.tvd12.ezyfoxserver.command.impl.EzyAppSendResponseImpl) Test(org.testng.annotations.Test) BaseTest(com.tvd12.test.base.BaseTest)

Aggregations

EzyAppSendResponseImpl (com.tvd12.ezyfoxserver.command.impl.EzyAppSendResponseImpl)2 EzyData (com.tvd12.ezyfox.entity.EzyData)1 EzyApplication (com.tvd12.ezyfoxserver.EzyApplication)1 EzyAppHandleExceptionImpl (com.tvd12.ezyfoxserver.command.impl.EzyAppHandleExceptionImpl)1 EzyAppSetupImpl (com.tvd12.ezyfoxserver.command.impl.EzyAppSetupImpl)1 EzyAppContext (com.tvd12.ezyfoxserver.context.EzyAppContext)1 EzyServerContext (com.tvd12.ezyfoxserver.context.EzyServerContext)1 EzyZoneContext (com.tvd12.ezyfoxserver.context.EzyZoneContext)1 EzyAbstractSession (com.tvd12.ezyfoxserver.entity.EzyAbstractSession)1 EzySimpleAppSetting (com.tvd12.ezyfoxserver.setting.EzySimpleAppSetting)1 BaseTest (com.tvd12.test.base.BaseTest)1 Test (org.testng.annotations.Test)1