Search in sources :

Example 1 with EzyErrorScheduledExecutorService

use of com.tvd12.ezyfox.concurrent.EzyErrorScheduledExecutorService in project ezyfox-server by youngmonkeys.

the class EzySimplePluginEntryTest method test2.

@Test
public void test2() throws Exception {
    EzySimpleSettings settings = new EzySimpleSettings();
    EzySimpleServer server = new EzySimpleServer();
    server.setSettings(settings);
    EzySimpleServerContext serverContext = new EzySimpleServerContext();
    serverContext.setServer(server);
    serverContext.init();
    EzySimpleZoneSetting zoneSetting = new EzySimpleZoneSetting();
    EzySimpleZone zone = new EzySimpleZone();
    zone.setSetting(zoneSetting);
    EzySimpleZoneContext zoneContext = new EzySimpleZoneContext();
    zoneContext.setZone(zone);
    zoneContext.init();
    zoneContext.setParent(serverContext);
    EzySimplePluginSetting pluginSetting = new EzySimplePluginSetting();
    pluginSetting.setName("test");
    EzyEventControllersSetting eventControllersSetting = new EzySimpleEventControllersSetting();
    EzyEventControllers eventControllers = EzyEventControllersImpl.create(eventControllersSetting);
    EzySimplePlugin plugin = new EzySimplePlugin();
    plugin.setSetting(pluginSetting);
    plugin.setEventControllers(eventControllers);
    ScheduledExecutorService pluginScheduledExecutorService = new EzyErrorScheduledExecutorService("not implement");
    EzySimplePluginContext pluginContext = new EzySimplePluginContext();
    pluginContext.setPlugin(plugin);
    pluginContext.setParent(zoneContext);
    pluginContext.setExecutorService(pluginScheduledExecutorService);
    pluginContext.init();
    EzySimplePluginEntry entry = new EzyPluginEntryEx2();
    entry.config(pluginContext);
    entry.start();
    entry.destroy();
}
Also used : EzyErrorScheduledExecutorService(com.tvd12.ezyfox.concurrent.EzyErrorScheduledExecutorService) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) EzyErrorScheduledExecutorService(com.tvd12.ezyfox.concurrent.EzyErrorScheduledExecutorService) EzySimpleServer(com.tvd12.ezyfoxserver.EzySimpleServer) EzySimpleServerContext(com.tvd12.ezyfoxserver.context.EzySimpleServerContext) EzySimpleZoneContext(com.tvd12.ezyfoxserver.context.EzySimpleZoneContext) EzySimplePlugin(com.tvd12.ezyfoxserver.EzySimplePlugin) EzySimpleZone(com.tvd12.ezyfoxserver.EzySimpleZone) EzyEventControllers(com.tvd12.ezyfoxserver.wrapper.EzyEventControllers) EzySimplePluginContext(com.tvd12.ezyfoxserver.context.EzySimplePluginContext) EzySimplePluginEntry(com.tvd12.ezyfoxserver.support.entry.EzySimplePluginEntry) Test(org.testng.annotations.Test)

Example 2 with EzyErrorScheduledExecutorService

use of com.tvd12.ezyfox.concurrent.EzyErrorScheduledExecutorService in project ezyfox-server by youngmonkeys.

the class EzyUserRequestPluginSingletonControllerTest method test.

@Test
public void test() throws Exception {
    EzySimpleSettings settings = new EzySimpleSettings();
    EzySimpleServer server = new EzySimpleServer();
    server.setSettings(settings);
    EzySimpleServerContext serverContext = new EzySimpleServerContext();
    serverContext.setServer(server);
    serverContext.init();
    EzySimpleZoneSetting zoneSetting = new EzySimpleZoneSetting();
    EzySimpleZone zone = new EzySimpleZone();
    zone.setSetting(zoneSetting);
    EzyZoneUserManager zoneUserManager = EzyZoneUserManagerImpl.builder().zoneName("test").build();
    zone.setUserManager(zoneUserManager);
    EzySimpleZoneContext zoneContext = new EzySimpleZoneContext();
    zoneContext.setZone(zone);
    zoneContext.init();
    zoneContext.setParent(serverContext);
    EzySimplePluginSetting pluginSetting = new EzySimplePluginSetting();
    pluginSetting.setName("test");
    EzyEventControllersSetting eventControllersSetting = new EzySimpleEventControllersSetting();
    EzyEventControllers eventControllers = EzyEventControllersImpl.create(eventControllersSetting);
    EzySimplePlugin plugin = new EzySimplePlugin();
    plugin.setSetting(pluginSetting);
    plugin.setEventControllers(eventControllers);
    ScheduledExecutorService pluginScheduledExecutorService = new EzyErrorScheduledExecutorService("not implement");
    EzySimplePluginContext pluginContext = new EzySimplePluginContext();
    pluginContext.setPlugin(plugin);
    pluginContext.setParent(zoneContext);
    pluginContext.setExecutorService(pluginScheduledExecutorService);
    pluginContext.init();
    EzySimplePluginEntry entry = new EzyPluginEntryEx();
    entry.config(pluginContext);
    entry.start();
    handleClientRequest(pluginContext);
    EzyBeanContext beanContext = pluginContext.get(EzyBeanContext.class);
    EzyRequestCommandManager requestCommandManager = beanContext.getSingleton(EzyRequestCommandManager.class);
    EzyFeatureCommandManager featureCommandManager = beanContext.getSingleton(EzyFeatureCommandManager.class);
    Asserts.assertTrue(requestCommandManager.containsCommand("v1.2.2/hello"));
    Asserts.assertTrue(requestCommandManager.isManagementCommand("v1.2.2/hello"));
    Asserts.assertTrue(requestCommandManager.isPaymentCommand("v1.2.2/hello"));
    Asserts.assertEquals(featureCommandManager.getFeatureByCommand("v1.2.2/hello"), "hello.world");
    entry.destroy();
}
Also used : EzyErrorScheduledExecutorService(com.tvd12.ezyfox.concurrent.EzyErrorScheduledExecutorService) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) EzyErrorScheduledExecutorService(com.tvd12.ezyfox.concurrent.EzyErrorScheduledExecutorService) EzySimpleServer(com.tvd12.ezyfoxserver.EzySimpleServer) EzyBeanContext(com.tvd12.ezyfox.bean.EzyBeanContext) EzySimpleServerContext(com.tvd12.ezyfoxserver.context.EzySimpleServerContext) EzySimpleZoneContext(com.tvd12.ezyfoxserver.context.EzySimpleZoneContext) EzyFeatureCommandManager(com.tvd12.ezyfoxserver.support.manager.EzyFeatureCommandManager) EzySimplePlugin(com.tvd12.ezyfoxserver.EzySimplePlugin) EzyRequestCommandManager(com.tvd12.ezyfoxserver.support.manager.EzyRequestCommandManager) EzyZoneUserManager(com.tvd12.ezyfoxserver.wrapper.EzyZoneUserManager) EzySimpleZone(com.tvd12.ezyfoxserver.EzySimpleZone) EzyEventControllers(com.tvd12.ezyfoxserver.wrapper.EzyEventControllers) EzySimplePluginContext(com.tvd12.ezyfoxserver.context.EzySimplePluginContext) EzySimplePluginEntry(com.tvd12.ezyfoxserver.support.entry.EzySimplePluginEntry) Test(org.testng.annotations.Test) BaseTest(com.tvd12.test.base.BaseTest)

Example 3 with EzyErrorScheduledExecutorService

use of com.tvd12.ezyfox.concurrent.EzyErrorScheduledExecutorService in project ezyfox-server by youngmonkeys.

the class EzyDefaultAppEntryTest method test2.

@Test
public void test2() throws Exception {
    EzySimpleSettings settings = new EzySimpleSettings();
    EzySimpleServer server = new EzySimpleServer();
    server.setSettings(settings);
    EzySimpleServerContext serverContext = new EzySimpleServerContext();
    serverContext.setServer(server);
    serverContext.init();
    EzySimpleZoneSetting zoneSetting = new EzySimpleZoneSetting();
    EzySimpleZone zone = new EzySimpleZone();
    zone.setSetting(zoneSetting);
    EzySimpleZoneContext zoneContext = new EzySimpleZoneContext();
    zoneContext.setZone(zone);
    zoneContext.init();
    zoneContext.setParent(serverContext);
    EzySimpleAppSetting appSetting = new EzySimpleAppSetting();
    appSetting.setName("test");
    EzyAppUserManager appUserManager = EzyAppUserManagerImpl.builder().build();
    EzyEventControllersSetting eventControllersSetting = new EzySimpleEventControllersSetting();
    EzyEventControllers eventControllers = EzyEventControllersImpl.create(eventControllersSetting);
    EzySimpleApplication application = new EzySimpleApplication();
    application.setSetting(appSetting);
    application.setUserManager(appUserManager);
    application.setEventControllers(eventControllers);
    ScheduledExecutorService appScheduledExecutorService = new EzyErrorScheduledExecutorService("not implement");
    EzySimpleAppContext appContext = new EzySimpleAppContext();
    appContext.setApp(application);
    appContext.setParent(zoneContext);
    appContext.setExecutorService(appScheduledExecutorService);
    appContext.init();
    EzySimpleAppEntry entry = new EzyAppEntryEx2();
    entry.config(appContext);
    entry.start();
    entry.destroy();
}
Also used : EzyErrorScheduledExecutorService(com.tvd12.ezyfox.concurrent.EzyErrorScheduledExecutorService) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) EzyErrorScheduledExecutorService(com.tvd12.ezyfox.concurrent.EzyErrorScheduledExecutorService) EzySimpleServer(com.tvd12.ezyfoxserver.EzySimpleServer) EzySimpleServerContext(com.tvd12.ezyfoxserver.context.EzySimpleServerContext) EzySimpleZoneContext(com.tvd12.ezyfoxserver.context.EzySimpleZoneContext) EzySimpleZone(com.tvd12.ezyfoxserver.EzySimpleZone) EzySimpleApplication(com.tvd12.ezyfoxserver.EzySimpleApplication) EzyEventControllers(com.tvd12.ezyfoxserver.wrapper.EzyEventControllers) EzyAppUserManager(com.tvd12.ezyfoxserver.wrapper.EzyAppUserManager) EzySimpleAppContext(com.tvd12.ezyfoxserver.context.EzySimpleAppContext) EzySimpleAppEntry(com.tvd12.ezyfoxserver.support.entry.EzySimpleAppEntry) Test(org.testng.annotations.Test)

Example 4 with EzyErrorScheduledExecutorService

use of com.tvd12.ezyfox.concurrent.EzyErrorScheduledExecutorService in project ezyfox-server by youngmonkeys.

the class EzySimpleAppEntryTest method test2.

@Test
public void test2() throws Exception {
    EzySimpleSettings settings = new EzySimpleSettings();
    EzySimpleServer server = new EzySimpleServer();
    server.setSettings(settings);
    EzySimpleServerContext serverContext = new EzySimpleServerContext();
    serverContext.setServer(server);
    serverContext.init();
    EzySimpleZoneSetting zoneSetting = new EzySimpleZoneSetting();
    EzySimpleZone zone = new EzySimpleZone();
    zone.setSetting(zoneSetting);
    EzySimpleZoneContext zoneContext = new EzySimpleZoneContext();
    zoneContext.setZone(zone);
    zoneContext.init();
    zoneContext.setParent(serverContext);
    EzySimpleAppSetting appSetting = new EzySimpleAppSetting();
    appSetting.setName("test");
    EzyAppUserManager appUserManager = EzyAppUserManagerImpl.builder().build();
    EzyEventControllersSetting eventControllersSetting = new EzySimpleEventControllersSetting();
    EzyEventControllers eventControllers = EzyEventControllersImpl.create(eventControllersSetting);
    EzySimpleApplication application = new EzySimpleApplication();
    application.setSetting(appSetting);
    application.setUserManager(appUserManager);
    application.setEventControllers(eventControllers);
    ScheduledExecutorService appScheduledExecutorService = new EzyErrorScheduledExecutorService("not implement");
    EzySimpleAppContext appContext = new EzySimpleAppContext();
    appContext.setApp(application);
    appContext.setParent(zoneContext);
    appContext.setExecutorService(appScheduledExecutorService);
    appContext.init();
    EzySimpleAppEntry entry = new EzyAppEntryEx2();
    entry.config(appContext);
    entry.start();
    entry.destroy();
}
Also used : EzyErrorScheduledExecutorService(com.tvd12.ezyfox.concurrent.EzyErrorScheduledExecutorService) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) EzyErrorScheduledExecutorService(com.tvd12.ezyfox.concurrent.EzyErrorScheduledExecutorService) EzySimpleServer(com.tvd12.ezyfoxserver.EzySimpleServer) EzySimpleServerContext(com.tvd12.ezyfoxserver.context.EzySimpleServerContext) EzySimpleZoneContext(com.tvd12.ezyfoxserver.context.EzySimpleZoneContext) EzySimpleZone(com.tvd12.ezyfoxserver.EzySimpleZone) EzySimpleApplication(com.tvd12.ezyfoxserver.EzySimpleApplication) EzyEventControllers(com.tvd12.ezyfoxserver.wrapper.EzyEventControllers) EzyAppUserManager(com.tvd12.ezyfoxserver.wrapper.EzyAppUserManager) EzySimpleAppContext(com.tvd12.ezyfoxserver.context.EzySimpleAppContext) EzySimpleAppEntry(com.tvd12.ezyfoxserver.support.entry.EzySimpleAppEntry) Test(org.testng.annotations.Test)

Example 5 with EzyErrorScheduledExecutorService

use of com.tvd12.ezyfox.concurrent.EzyErrorScheduledExecutorService in project ezyfox-server by youngmonkeys.

the class EzyUserRequestAppSingletonControllerTest method test.

@Test
public void test() throws Exception {
    EzyRequestHandlerImplementer.setDebug(true);
    EzyExceptionHandlerImplementer.setDebug(true);
    EzySimpleSettings settings = new EzySimpleSettings();
    EzySimpleServer server = new EzySimpleServer();
    server.setSettings(settings);
    EzySimpleServerContext serverContext = new EzySimpleServerContext();
    serverContext.setServer(server);
    serverContext.init();
    EzySimpleZoneSetting zoneSetting = new EzySimpleZoneSetting();
    EzySimpleZone zone = new EzySimpleZone();
    zone.setSetting(zoneSetting);
    EzySimpleZoneContext zoneContext = new EzySimpleZoneContext();
    zoneContext.setZone(zone);
    zoneContext.init();
    zoneContext.setParent(serverContext);
    EzySimpleAppSetting appSetting = new EzySimpleAppSetting();
    appSetting.setName("test");
    EzyAppUserManager appUserManager = EzyAppUserManagerImpl.builder().build();
    EzyEventControllersSetting eventControllersSetting = new EzySimpleEventControllersSetting();
    EzyEventControllers eventControllers = EzyEventControllersImpl.create(eventControllersSetting);
    EzySimpleApplication application = new EzySimpleApplication();
    application.setSetting(appSetting);
    application.setUserManager(appUserManager);
    application.setEventControllers(eventControllers);
    ScheduledExecutorService appScheduledExecutorService = new EzyErrorScheduledExecutorService("not implement");
    EzySimpleAppContext appContext = new EzySimpleAppContext();
    appContext.setApp(application);
    appContext.setParent(zoneContext);
    appContext.setExecutorService(appScheduledExecutorService);
    appContext.init();
    EzySimpleAppEntry entry = new EzyAppEntryEx();
    entry.config(appContext);
    entry.start();
    handleClientRequest(appContext);
    EzyBeanContext beanContext = appContext.get(EzyBeanContext.class);
    EzyRequestCommandManager requestCommandManager = beanContext.getSingleton(EzyRequestCommandManager.class);
    EzyFeatureCommandManager featureCommandManager = beanContext.getSingleton(EzyFeatureCommandManager.class);
    Asserts.assertTrue(requestCommandManager.containsCommand("v1.2.2/hello"));
    Asserts.assertTrue(requestCommandManager.containsCommand("v122/listener/hello"));
    Asserts.assertTrue(requestCommandManager.isManagementCommand("v1.2.2/hello"));
    Asserts.assertTrue(requestCommandManager.isPaymentCommand("v1.2.2/hello"));
    Asserts.assertEquals(featureCommandManager.getFeatureByCommand("v1.2.2/hello"), "hello.world");
    entry.destroy();
}
Also used : EzyErrorScheduledExecutorService(com.tvd12.ezyfox.concurrent.EzyErrorScheduledExecutorService) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) EzyErrorScheduledExecutorService(com.tvd12.ezyfox.concurrent.EzyErrorScheduledExecutorService) EzySimpleServer(com.tvd12.ezyfoxserver.EzySimpleServer) EzyBeanContext(com.tvd12.ezyfox.bean.EzyBeanContext) EzySimpleServerContext(com.tvd12.ezyfoxserver.context.EzySimpleServerContext) EzySimpleZoneContext(com.tvd12.ezyfoxserver.context.EzySimpleZoneContext) EzyFeatureCommandManager(com.tvd12.ezyfoxserver.support.manager.EzyFeatureCommandManager) EzyRequestCommandManager(com.tvd12.ezyfoxserver.support.manager.EzyRequestCommandManager) EzySimpleZone(com.tvd12.ezyfoxserver.EzySimpleZone) EzySimpleApplication(com.tvd12.ezyfoxserver.EzySimpleApplication) EzyEventControllers(com.tvd12.ezyfoxserver.wrapper.EzyEventControllers) EzyAppUserManager(com.tvd12.ezyfoxserver.wrapper.EzyAppUserManager) EzySimpleAppContext(com.tvd12.ezyfoxserver.context.EzySimpleAppContext) EzySimpleAppEntry(com.tvd12.ezyfoxserver.support.entry.EzySimpleAppEntry) Test(org.testng.annotations.Test) BaseTest(com.tvd12.test.base.BaseTest)

Aggregations

EzyErrorScheduledExecutorService (com.tvd12.ezyfox.concurrent.EzyErrorScheduledExecutorService)10 EzySimpleServer (com.tvd12.ezyfoxserver.EzySimpleServer)10 EzySimpleZone (com.tvd12.ezyfoxserver.EzySimpleZone)10 EzySimpleServerContext (com.tvd12.ezyfoxserver.context.EzySimpleServerContext)10 EzySimpleZoneContext (com.tvd12.ezyfoxserver.context.EzySimpleZoneContext)10 EzyEventControllers (com.tvd12.ezyfoxserver.wrapper.EzyEventControllers)10 ScheduledExecutorService (java.util.concurrent.ScheduledExecutorService)10 Test (org.testng.annotations.Test)10 EzySimpleApplication (com.tvd12.ezyfoxserver.EzySimpleApplication)5 EzySimplePlugin (com.tvd12.ezyfoxserver.EzySimplePlugin)5 EzySimpleAppContext (com.tvd12.ezyfoxserver.context.EzySimpleAppContext)5 EzySimplePluginContext (com.tvd12.ezyfoxserver.context.EzySimplePluginContext)5 EzySimpleAppEntry (com.tvd12.ezyfoxserver.support.entry.EzySimpleAppEntry)5 EzySimplePluginEntry (com.tvd12.ezyfoxserver.support.entry.EzySimplePluginEntry)5 EzyAppUserManager (com.tvd12.ezyfoxserver.wrapper.EzyAppUserManager)5 EzyBeanContext (com.tvd12.ezyfox.bean.EzyBeanContext)2 EzyEventController (com.tvd12.ezyfoxserver.controller.EzyEventController)2 EzyFeatureCommandManager (com.tvd12.ezyfoxserver.support.manager.EzyFeatureCommandManager)2 EzyRequestCommandManager (com.tvd12.ezyfoxserver.support.manager.EzyRequestCommandManager)2 BaseTest (com.tvd12.test.base.BaseTest)2