use of com.tvd12.ezyfoxserver.request.EzySimpleHandshakeRequest in project ezyfox-server by youngmonkeys.
the class EzyHandShakeController2Test method test.
@Test
public void test() {
EzyServerContext ctx = newServerContext();
EzySession first = getSessionManager(ctx).provideSession(EzyConnectionType.SOCKET);
System.err.println("first.token: " + first);
System.err.println("alive sessions: " + getSessionManager(ctx).getAliveSessions());
assertTrue(getSessionManager(ctx).containsSession(first.getId()));
EzySession session = getSessionManager(ctx).provideSession(EzyConnectionType.SOCKET);
System.err.println("session: " + session);
EzyArray data = newHandShakeData(first.getToken());
EzySimpleHandshakeRequest request = new EzySimpleHandshakeRequest();
request.deserializeParams(data);
request.setSession(session);
EzyHandshakeParams requestParams = request.getParams();
assertEquals(first.getToken(), requestParams.getReconnectToken());
EzyHandshakeController controller = new EzyHandshakeController();
controller.handle(ctx, request);
}
use of com.tvd12.ezyfoxserver.request.EzySimpleHandshakeRequest in project ezyfox-server by youngmonkeys.
the class EzyHandShakeControllerTest method test.
@Test
public void test() {
EzyServerContext ctx = newServerContext();
EzySession session = newSession();
EzyArray data = newHandShakeData();
EzyHandshakeController controller = new EzyHandshakeController();
EzySimpleHandshakeRequest request = new EzySimpleHandshakeRequest();
request.deserializeParams(data);
request.setSession(session);
controller.handle(ctx, request);
}
use of com.tvd12.ezyfoxserver.request.EzySimpleHandshakeRequest in project ezyfox-server by youngmonkeys.
the class EzyHandShakeControllerTest method testDeserializeParamsPerformance.
@Test
public void testDeserializeParamsPerformance() {
EzyArray data = newHandShakeData();
long time = Performance.create().test(() -> {
EzySimpleHandshakeRequest request = new EzySimpleHandshakeRequest();
request.deserializeParams(data);
}).getTime();
System.out.println("testDeserializeParamsPerformance, time = " + time);
}
Aggregations