use of io.aklivity.zilla.runtime.engine.test.annotation.Configuration in project zilla by aklivity.
the class ServerStatsIT method shouldEchoPayloadLength10k.
@Test
@Configuration("server.json")
@Specification({ "${net}/echo.payload.length.10k/client", "${app}/echo.payload.length.10k/server" })
public void shouldEchoPayloadLength10k() throws Exception {
k3po.finish();
EngineStats stats = engine.stats("test", "net0");
assertThat(stats.initialBytes(), greaterThan(10240L));
assertThat(stats.replyBytes(), greaterThan(10240L));
}
use of io.aklivity.zilla.runtime.engine.test.annotation.Configuration in project zilla by aklivity.
the class ClientResetAndAbortIT method shouldShutdownOutputAndInputWhenClientSendsAbortAndReset.
@Test
@Configuration("client.host.json")
@Specification({ "${client}/client.sent.abort.and.reset/client" })
@BMRule(name = "shutdownInput", targetClass = "^java.nio.channels.SocketChannel", targetMethod = "shutdownInput()", helper = "io.aklivity.zilla.runtime.binding.tcp.internal.SocketChannelHelper$CountDownHelper", condition = "callerEquals(\"TcpClientFactory$TcpClient.onAppReset\", true, 2)", action = "countDown()")
public void shouldShutdownOutputAndInputWhenClientSendsAbortAndReset() throws Exception {
CountDownLatch shutdownInputCalled = new CountDownLatch(1);
CountDownHelper.initialize(shutdownInputCalled);
try (ServerSocketChannel server = ServerSocketChannel.open()) {
server.setOption(SO_REUSEADDR, true);
server.bind(new InetSocketAddress("127.0.0.1", 8080));
k3po.start();
try (SocketChannel channel = server.accept()) {
ByteBuffer buf = ByteBuffer.allocate(20);
int len = channel.read(buf);
assertEquals(-1, len);
shutdownInputCalled.await();
} finally {
k3po.finish();
}
}
}
use of io.aklivity.zilla.runtime.engine.test.annotation.Configuration in project zilla by aklivity.
the class ClientStatsIT method shouldSendAndReceiveData.
@Test
@Configuration("client.host.json")
@Specification({ "${client}/client.and.server.sent.data.multiple.frames/client", "${server}/client.and.server.sent.data.multiple.frames/server" })
public void shouldSendAndReceiveData() throws Exception {
k3po.finish();
EngineStats stats = engine.stats("test", "app0");
assertThat(stats.initialBytes(), equalTo(26L));
assertThat(stats.replyBytes(), equalTo(26L));
}
use of io.aklivity.zilla.runtime.engine.test.annotation.Configuration in project zilla by aklivity.
the class ServerIOExceptionFromReadIT method shouldNotResetWhenProcessingEndAfterIOExceptionFromRead.
@Test
@Configuration("server.json")
@Specification({ "${server}/server.received.abort.sent.end/server" })
public void shouldNotResetWhenProcessingEndAfterIOExceptionFromRead() throws Exception {
k3po.start();
try (SocketChannel channel = SocketChannel.open()) {
channel.connect(new InetSocketAddress("127.0.0.1", 8080));
k3po.awaitBarrier("CONNECTED");
channel.setOption(StandardSocketOptions.SO_LINGER, 0);
}
k3po.finish();
}
use of io.aklivity.zilla.runtime.engine.test.annotation.Configuration in project zilla by aklivity.
the class ServerIOExceptionFromReadIT method shouldReportIOExceptionFromReadAsAbortAndReset.
@Test
@Configuration("server.json")
@Specification({ "${server}/server.received.reset.and.abort/server" })
public void shouldReportIOExceptionFromReadAsAbortAndReset() throws Exception {
k3po.start();
try (SocketChannel channel = SocketChannel.open()) {
channel.connect(new InetSocketAddress("127.0.0.1", 8080));
k3po.awaitBarrier("CONNECTED");
channel.setOption(StandardSocketOptions.SO_LINGER, 0);
}
k3po.finish();
}
Aggregations