Search in sources :

Example 1 with EzyPluginSetupImpl

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

the class EzyPluginSetupImplTest method test.

@Test
public void test() {
    EzySimplePlugin plugin = new EzySimplePlugin();
    EzyPluginSetupImpl cmd = new EzyPluginSetupImpl(plugin);
    cmd.setRequestController((ctx, event) -> {
    });
}
Also used : EzyPluginSetupImpl(com.tvd12.ezyfoxserver.command.impl.EzyPluginSetupImpl) EzySimplePlugin(com.tvd12.ezyfoxserver.EzySimplePlugin) BaseTest(com.tvd12.test.base.BaseTest) Test(org.testng.annotations.Test)

Example 2 with EzyPluginSetupImpl

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

the class EzyPluginSetupImplTest method addEventControllerTest.

@SuppressWarnings("rawtypes")
@Test
public void addEventControllerTest() {
    // given
    EzySimplePlugin plugin = new EzySimplePlugin();
    EzyEventControllers eventControllers = mock(EzyEventControllers.class);
    plugin.setEventControllers(eventControllers);
    EzyPluginSetupImpl sut = new EzyPluginSetupImpl(plugin);
    EzyEventController controller = mock(EzyEventController.class);
    // when
    sut.addEventController(EzyEventType.SERVER_INITIALIZING, controller);
    // then
    verify(eventControllers, times(1)).addController(EzyEventType.SERVER_INITIALIZING, controller);
}
Also used : EzyEventControllers(com.tvd12.ezyfoxserver.wrapper.EzyEventControllers) EzyPluginSetupImpl(com.tvd12.ezyfoxserver.command.impl.EzyPluginSetupImpl) EzySimplePlugin(com.tvd12.ezyfoxserver.EzySimplePlugin) EzyEventController(com.tvd12.ezyfoxserver.controller.EzyEventController) BaseTest(com.tvd12.test.base.BaseTest) Test(org.testng.annotations.Test)

Example 3 with EzyPluginSetupImpl

use of com.tvd12.ezyfoxserver.command.impl.EzyPluginSetupImpl 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

EzyPluginSetupImpl (com.tvd12.ezyfoxserver.command.impl.EzyPluginSetupImpl)3 EzySimplePlugin (com.tvd12.ezyfoxserver.EzySimplePlugin)2 BaseTest (com.tvd12.test.base.BaseTest)2 Test (org.testng.annotations.Test)2 EzyPluginHandleExceptionImpl (com.tvd12.ezyfoxserver.command.impl.EzyPluginHandleExceptionImpl)1 EzyPluginSendResponseImpl (com.tvd12.ezyfoxserver.command.impl.EzyPluginSendResponseImpl)1 EzyEventController (com.tvd12.ezyfoxserver.controller.EzyEventController)1 EzyEventControllers (com.tvd12.ezyfoxserver.wrapper.EzyEventControllers)1