use of com.navercorp.pinpoint.thrift.dto.command.TCommandTransferResponse in project pinpoint by naver.
the class DefaultRouteHandlerTest method testName.
@Test
public void testName() throws Exception {
DefaultRouteHandler routeHandler = new DefaultRouteHandler(new ClusterPointRepository(), new DefaultRouteFilterChain(), new DefaultRouteFilterChain());
CountFilter requestFilter = new CountFilter();
routeHandler.addRequestFilter(requestFilter);
TCommandTransferResponse response = routeHandler.onRoute(createRequestEvent());
Assert.assertEquals(1, requestFilter.getCallCount());
CountFilter responseFilter = new CountFilter();
routeHandler.addResponseFilter(responseFilter);
response = routeHandler.onRoute(createRequestEvent());
Assert.assertEquals(2, requestFilter.getCallCount());
Assert.assertEquals(1, responseFilter.getCallCount());
Assert.assertEquals(TRouteResult.NOT_FOUND, response.getRouteResult());
}
use of com.navercorp.pinpoint.thrift.dto.command.TCommandTransferResponse in project pinpoint by naver.
the class PinpointRouteResponseTest method wrapResponse.
private TCommandTransferResponse wrapResponse(TRouteResult routeResult, byte[] payload) {
TCommandTransferResponse response = new TCommandTransferResponse();
response.setRouteResult(routeResult);
response.setPayload(payload);
return response;
}
use of com.navercorp.pinpoint.thrift.dto.command.TCommandTransferResponse in project pinpoint by naver.
the class DefaultRouteHandler method createResponse.
private TCommandTransferResponse createResponse(TRouteResult result, byte[] payload) {
TCommandTransferResponse response = new TCommandTransferResponse();
response.setRouteResult(result);
response.setPayload(payload);
return response;
}
use of com.navercorp.pinpoint.thrift.dto.command.TCommandTransferResponse in project pinpoint by naver.
the class DefaultRouteHandler method onRoute.
@Override
public TCommandTransferResponse onRoute(RequestEvent event) {
requestFilterChain.doEvent(event);
TCommandTransferResponse routeResult = onRoute0(event);
responseFilterChain.doEvent(new ResponseEvent(event, event.getRequestId(), routeResult));
return routeResult;
}
use of com.navercorp.pinpoint.thrift.dto.command.TCommandTransferResponse in project pinpoint by naver.
the class StreamRouteHandler method onRoute.
@Override
public TCommandTransferResponse onRoute(StreamEvent event) {
streamCreateFilterChain.doEvent(event);
TCommandTransferResponse routeResult = onRoute0(event);
return routeResult;
}
Aggregations