use of com.tvd12.ezyfoxserver.wrapper.impl.EzyZoneUserManagerImpl in project ezyfox-server by youngmonkeys.
the class EzyZoneUserManagerImplTest method newZoneUserManager.
private EzyZoneUserManagerImpl newZoneUserManager() {
EzyServerContext serverContext = mock(EzyServerContext.class);
EzyZoneContext zoneContext = mock(EzyZoneContext.class);
when(serverContext.getZoneContext(1)).thenReturn(zoneContext);
TestBlockingSocketUserRemovalQueue queue = new TestBlockingSocketUserRemovalQueue();
EzySimpleUserDelegate userDelegate = new EzySimpleUserDelegate(serverContext, queue);
return (EzyZoneUserManagerImpl) EzyZoneUserManagerImpl.builder().idleValidationDelay(10).idleValidationInterval(10).idleValidationThreadPoolSize(1).userDelegate(userDelegate).build();
}
use of com.tvd12.ezyfoxserver.wrapper.impl.EzyZoneUserManagerImpl in project ezyfox-server by youngmonkeys.
the class EzyZoneUserManagerImplTest method newAndAddIdleUser.
private void newAndAddIdleUser(EzyZoneUserManagerImpl manager) {
EzyAbstractSession session = mock(EzyAbstractSession.class);
EzySimpleUser user = new EzySimpleUser();
user.setZoneId(1);
user.setName("user3");
user.setMaxIdleTime(Integer.MAX_VALUE);
manager.addUser(session, user);
user.removeSession(session);
user.setMaxIdleTime(0);
}
use of com.tvd12.ezyfoxserver.wrapper.impl.EzyZoneUserManagerImpl in project ezyfox-server by youngmonkeys.
the class EzyZoneUserManagerImplTest method destroyWithIdleValidationService.
@Test
public void destroyWithIdleValidationService() {
// given
EzyZoneUserManagerImpl sut = newZoneUserManager();
// when
sut.destroy();
// then
Asserts.assertNull(FieldUtil.getFieldValue(sut, "idleValidationService"));
}
Aggregations