Construct a SimpleRequest with the specified dimensions.
(Messages.PayloadType payloadType, int reqLength,
int respLength)
| 269 | * Construct a {@link SimpleRequest} with the specified dimensions. |
| 270 | */ |
| 271 | public static SimpleRequest makeRequest(Messages.PayloadType payloadType, int reqLength, |
| 272 | int respLength) { |
| 273 | ByteString body = ByteString.copyFrom(new byte[reqLength]); |
| 274 | Payload payload = Payload.newBuilder() |
| 275 | .setType(payloadType) |
| 276 | .setBody(body) |
| 277 | .build(); |
| 278 | |
| 279 | return SimpleRequest.newBuilder() |
| 280 | .setResponseType(payloadType) |
| 281 | .setResponseSize(respLength) |
| 282 | .setPayload(payload) |
| 283 | .build(); |
| 284 | } |
| 285 | |
| 286 | /** |
| 287 | * Picks a port that is not used right at this moment. |
no test coverage detected