use of org.agrona.ExpandableArrayBuffer in project Aeron by real-logic.
the class ClusterNodeTest method shouldSendResponseAfterServiceMessage.
@Test
@InterruptAfter(10)
public void shouldSendResponseAfterServiceMessage() {
final ExpandableArrayBuffer msgBuffer = new ExpandableArrayBuffer();
final String msg = "Hello World!";
msgBuffer.putStringWithoutLengthAscii(0, msg);
final MutableInteger messageCount = new MutableInteger();
final EgressListener listener = (clusterSessionId, timestamp, buffer, offset, length, header) -> {
assertEquals(msg, buffer.getStringWithoutLengthAscii(offset, length));
messageCount.value += 1;
};
container = launchServiceMessageIngressService();
aeronCluster = connectToCluster(listener);
offerMessage(msgBuffer, msg);
awaitResponse(messageCount);
ClusterTests.failOnClusterError();
}
Aggregations