use of com.hazelcast.logging.LoggingService in project hazelcast by hazelcast.
the class SelectWithSelectorFix_NioNetworkingFactory method create.
@Override
public NioNetworking create(final MockServerContext serverContext, MetricsRegistry metricsRegistry) {
HazelcastProperties properties = serverContext.properties();
LoggingService loggingService = serverContext.loggingService;
return new NioNetworking(new NioNetworking.Context().loggingService(loggingService).metricsRegistry(metricsRegistry).threadNamePrefix(serverContext.getHazelcastName()).errorHandler(new TcpServerConnectionChannelErrorHandler(loggingService.getLogger(TcpServerConnectionChannelErrorHandler.class))).inputThreadCount(properties.getInteger(IO_INPUT_THREAD_COUNT)).outputThreadCount(properties.getInteger(IO_OUTPUT_THREAD_COUNT)).balancerIntervalSeconds(properties.getInteger(IO_BALANCER_INTERVAL_SECONDS)).selectorMode(SelectorMode.SELECT_WITH_FIX).selectorWorkaroundTest(true));
}
use of com.hazelcast.logging.LoggingService in project hazelcast by hazelcast.
the class TaskletExecutionServiceTest method before.
@Before
public void before() {
executor = Executors.newCachedThreadPool();
NodeEngineImpl neMock = mock(NodeEngineImpl.class);
HazelcastInstance hzMock = mock(HazelcastInstance.class);
when(neMock.getHazelcastInstance()).thenReturn(hzMock);
when(hzMock.getName()).thenReturn("test-hz-instance");
ExecutionService es = mock(ExecutionService.class);
when(neMock.getExecutionService()).thenReturn(es);
when(es.submit(eq(TASKLET_INIT_CLOSE_EXECUTOR_NAME), any(Runnable.class))).then(invocationOnMock -> executor.submit(invocationOnMock.<Runnable>getArgument(1)));
LoggingService loggingService = mock(LoggingService.class);
when(neMock.getLoggingService()).thenReturn(loggingService);
when(loggingService.getLogger(TaskletExecutionService.class)).thenReturn(Logger.getLogger(TaskletExecutionService.class));
MetricsRegistryImpl metricsRegistry = new MetricsRegistryImpl(mock(ILogger.class), ProbeLevel.INFO);
when(neMock.getMetricsRegistry()).thenReturn(metricsRegistry);
HazelcastProperties properties = new HazelcastProperties(new Properties());
tes = new TaskletExecutionService(neMock, THREAD_COUNT, properties);
classLoaderMock = mock(ClassLoader.class);
}
Aggregations