use of io.aeron.archive.client.ControlResponseAdapter in project aeron by real-logic.
the class TestUtil method awaitConnectedReply.
public static void awaitConnectedReply(final Subscription controlResponse, final long expectedCorrelationId, final LongConsumer receiveSessionId) {
final ControlResponseAdapter controlResponseAdapter = new ControlResponseAdapter(new FailControlResponseListener() {
public void onResponse(final long controlSessionId, final long correlationId, final long relevantId, final ControlResponseCode code, final String errorMessage) {
if (ControlResponseCode.OK != code) {
throw new IllegalStateException("expected=" + ControlResponseCode.OK + " actual=" + code);
}
if (correlationId != expectedCorrelationId) {
throw new IllegalStateException("expected=" + expectedCorrelationId + " actual=" + correlationId);
}
receiveSessionId.accept(controlSessionId);
}
}, controlResponse, 1);
await(() -> controlResponseAdapter.poll() != 0);
}
use of io.aeron.archive.client.ControlResponseAdapter in project aeron by real-logic.
the class TestUtil method awaitResponse.
static void awaitResponse(final Subscription controlResponse, final long expectedCorrelationId) {
final ControlResponseAdapter controlResponseAdapter = new ControlResponseAdapter(new FailControlResponseListener() {
public void onResponse(final long controlSessionId, final long correlationId, final long relevantId, final ControlResponseCode code, final String errorMessage) {
if (correlationId != expectedCorrelationId) {
throw new IllegalStateException("expected=" + expectedCorrelationId + " actual=" + correlationId);
}
}
}, controlResponse, 1);
await(() -> controlResponseAdapter.poll() != 0);
}
use of io.aeron.archive.client.ControlResponseAdapter in project Aeron by real-logic.
the class ArchiveTests method awaitConnectedReply.
public static void awaitConnectedReply(final Subscription controlResponse, final long expectedCorrelationId, final LongConsumer receiveSessionId) {
final ControlResponseAdapter controlResponseAdapter = new ControlResponseAdapter(new FailControlResponseListener() {
public void onResponse(final long controlSessionId, final long correlationId, final long relevantId, final ControlResponseCode code, final String errorMessage) {
if (ControlResponseCode.OK != code) {
throw new IllegalStateException("expected=" + ControlResponseCode.OK + " actual=" + code);
}
if (correlationId != expectedCorrelationId) {
throw new IllegalStateException("expected=" + expectedCorrelationId + " actual=" + correlationId);
}
receiveSessionId.accept(controlSessionId);
}
}, controlResponse, 1);
Tests.await(() -> controlResponseAdapter.poll() != 0, TIMEOUT_NS);
}
use of io.aeron.archive.client.ControlResponseAdapter in project Aeron by real-logic.
the class ArchiveTests method awaitOk.
public static void awaitOk(final Subscription controlResponse, final long expectedCorrelationId) {
final ControlResponseAdapter controlResponseAdapter = new ControlResponseAdapter(new FailControlResponseListener() {
public void onResponse(final long controlSessionId, final long correlationId, final long relevantId, final ControlResponseCode code, final String errorMessage) {
if (ControlResponseCode.OK != code) {
System.out.println(errorMessage);
throw new IllegalStateException("expected=" + ControlResponseCode.OK + " actual=" + code);
}
if (correlationId != expectedCorrelationId) {
throw new IllegalStateException("expected=" + expectedCorrelationId + " actual=" + correlationId);
}
}
}, controlResponse, 1);
Tests.await(() -> controlResponseAdapter.poll() != 0, TIMEOUT_NS);
}
use of io.aeron.archive.client.ControlResponseAdapter in project Aeron by real-logic.
the class ArchiveTests method awaitResponse.
static void awaitResponse(final Subscription controlResponse, final long expectedCorrelationId) {
final ControlResponseAdapter controlResponseAdapter = new ControlResponseAdapter(new FailControlResponseListener() {
public void onResponse(final long controlSessionId, final long correlationId, final long relevantId, final ControlResponseCode code, final String errorMessage) {
if (correlationId != expectedCorrelationId) {
throw new IllegalStateException("expected=" + expectedCorrelationId + " actual=" + correlationId);
}
}
}, controlResponse, 1);
Tests.await(() -> controlResponseAdapter.poll() != 0, TIMEOUT_NS);
}
Aggregations