use of com.navercorp.pinpoint.rpc.TestAwaitTaskUtils in project pinpoint by naver.
the class PinpointServerStateTest method assertAvaiableWritableSocket.
private void assertAvaiableWritableSocket(final PinpointServerAcceptor serverAcceptor) {
boolean pass = awaitUtils.await(new TestAwaitTaskUtils() {
@Override
public boolean checkCompleted() {
return !serverAcceptor.getWritableSocketList().isEmpty();
}
});
Assert.assertTrue(pass);
}
use of com.navercorp.pinpoint.rpc.TestAwaitTaskUtils in project pinpoint by naver.
the class RequestManagerTest method testRegisterRequest.
@Test
public void testRegisterRequest() throws Exception {
HashedWheelTimer timer = getTimer();
RequestManager requestManager = new RequestManager(timer, 3000);
try {
RequestPacket packet = new RequestPacket(new byte[0]);
final Future future = requestManager.register(packet, 50);
TestAwaitUtils.await(new TestAwaitTaskUtils() {
@Override
public boolean checkCompleted() {
return future.isReady();
}
}, 10, 200);
Assert.assertTrue(future.isReady());
Assert.assertFalse(future.isSuccess());
Assert.assertTrue(future.getCause().getMessage().contains("timeout"));
logger.debug(future.getCause().getMessage());
} finally {
requestManager.close();
timer.stop();
}
}
use of com.navercorp.pinpoint.rpc.TestAwaitTaskUtils in project pinpoint by naver.
the class PinpointClientStateTest method assertHandlerState.
private void assertHandlerState(final SocketStateCode stateCode, final DefaultPinpointClientHandler handler) {
boolean passed = awaitUtils.await(new TestAwaitTaskUtils() {
@Override
public boolean checkCompleted() {
return handler.getCurrentStateCode() == stateCode;
}
});
Assert.assertTrue(passed);
}
use of com.navercorp.pinpoint.rpc.TestAwaitTaskUtils in project pinpoint by naver.
the class ReconnectTest method assertClientConnected.
private void assertClientConnected(final PinpointClient client) {
boolean pass = awaitUtils.await(new TestAwaitTaskUtils() {
@Override
public boolean checkCompleted() {
return client.isConnected();
}
});
Assert.assertTrue(pass);
}
use of com.navercorp.pinpoint.rpc.TestAwaitTaskUtils in project pinpoint by naver.
the class ReconnectTest method assertClientDisconnected.
private void assertClientDisconnected(final PinpointClient client) {
boolean pass = awaitUtils.await(new TestAwaitTaskUtils() {
@Override
public boolean checkCompleted() {
return !client.isConnected();
}
});
Assert.assertTrue(pass);
}
Aggregations