Search in sources :

Example 1 with PCmdEchoResponse

use of com.navercorp.pinpoint.grpc.trace.PCmdEchoResponse in project pinpoint by naver.

the class GrpcCommandServiceTest method assertHandleMessage.

private void assertHandleMessage(GrpcCommandService commandService, TransportMetadata transportMetaData) {
    RecordedStreamObserver<Empty> recordedStreamObserver = new RecordedStreamObserver<>();
    PCmdEchoResponse defaultInstance = PCmdEchoResponse.getDefaultInstance();
    commandService.commandEcho(defaultInstance, recordedStreamObserver);
    Assert.assertNull(recordedStreamObserver.getLatestThrowable());
    attachContext(createTransportMetaData(transportMetaData.getRemoteAddress(), transportMetaData.getTransportId() + 1));
    commandService.commandEcho(defaultInstance, recordedStreamObserver);
    Assert.assertNotNull(recordedStreamObserver.getLatestThrowable());
    StreamObserver<PCmdActiveThreadCountRes> pCmdActiveThreadCountResStreamObserver = commandService.commandStreamActiveThreadCount(new TempServerCallStreamObserver<>());
    Assert.assertNotNull(pCmdActiveThreadCountResStreamObserver);
    attachContext(transportMetaData);
    TempServerCallStreamObserver<Empty> streamConnectionManagerObserver = new TempServerCallStreamObserver<>();
    pCmdActiveThreadCountResStreamObserver = commandService.commandStreamActiveThreadCount(streamConnectionManagerObserver);
    Assert.assertNull(streamConnectionManagerObserver.getLatestException());
    pCmdActiveThreadCountResStreamObserver.onNext(PCmdActiveThreadCountRes.getDefaultInstance());
    Assert.assertNotNull(streamConnectionManagerObserver.getLatestException());
}
Also used : PCmdActiveThreadCountRes(com.navercorp.pinpoint.grpc.trace.PCmdActiveThreadCountRes) Empty(com.google.protobuf.Empty) PCmdEchoResponse(com.navercorp.pinpoint.grpc.trace.PCmdEchoResponse) RecordedStreamObserver(com.navercorp.pinpoint.collector.receiver.grpc.RecordedStreamObserver)

Aggregations

Empty (com.google.protobuf.Empty)1 RecordedStreamObserver (com.navercorp.pinpoint.collector.receiver.grpc.RecordedStreamObserver)1 PCmdActiveThreadCountRes (com.navercorp.pinpoint.grpc.trace.PCmdActiveThreadCountRes)1 PCmdEchoResponse (com.navercorp.pinpoint.grpc.trace.PCmdEchoResponse)1