use of com.tvd12.ezyfoxserver.setting.EzyUdpSetting 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