use of com.tvd12.ezyfoxserver.setting.EzyThreadPoolSizeSetting in project ezyfox-server by youngmonkeys.
the class EzyAbstractServerBootstrapBuilderTest method commonTest.
@Test
public void commonTest() {
// given
EzySimpleServer server = newServer();
MyTestServerBootstrapBuilder builder = (MyTestServerBootstrapBuilder) new MyTestServerBootstrapBuilder().server(server);
// when
EzyThreadPoolSizeSetting threadPoolSizeSetting = (EzyThreadPoolSizeSetting) ReflectMethodUtil.invokeMethod("getThreadPoolSizeSetting", builder);
// then
Asserts.assertEquals(server.getSettings().getThreadPoolSize(), threadPoolSizeSetting);
}
use of com.tvd12.ezyfoxserver.setting.EzyThreadPoolSizeSetting in project ezyfox-server by youngmonkeys.
the class EzyServerBootstrapTest method commonTest.
@Test
public void commonTest() {
// given
EzySimpleConfig config = new EzySimpleConfig();
config.setPrintBanner(false);
EzySimpleSettings settings = new EzySimpleSettings();
EzySimpleServer server = new EzySimpleServer();
server.setSettings(settings);
server.setConfig(config);
EzyServerContext serverContext = mock(EzyServerContext.class);
when(serverContext.getServer()).thenReturn(server);
EzyServerBootstrap sut = new EzyServerBootstrap() {
@Override
protected void startOtherBootstraps(Runnable callback) {
callback.run();
}
};
sut.setContext(serverContext);
// when
ReflectMethodUtil.invokeMethod("printBanner", sut);
EzyUdpSetting udpSetting = (EzyUdpSetting) ReflectMethodUtil.invokeMethod("getUdpSetting", sut);
EzyThreadPoolSizeSetting threadPoolSizeSetting = (EzyThreadPoolSizeSetting) ReflectMethodUtil.invokeMethod("getThreadPoolSizeSetting", sut);
// then
Asserts.assertEquals(server.getSettings().getUdp(), udpSetting);
Asserts.assertEquals(server.getSettings().getThreadPoolSize(), threadPoolSizeSetting);
}
Aggregations