Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public class TcpServerBM
public void reinit() throws Exception
{
engine.start();
//routedId = controller.route(RouteKind.SERVER, "127.0.0.1:8080", "tcp#0").get();
//routedId = controller.route(RouteKind.SERVER, "127.0.0.1:12345", "tcp#0").get();
}

@TearDown(Level.Trial)
Expand Down Expand Up @@ -112,7 +112,7 @@ public GroupState()
public void init() throws Exception
{
channel = SocketChannel.open();
channel.connect(new InetSocketAddress("127.0.0.1", 8080));
channel.connect(new InetSocketAddress("127.0.0.1", 12345));
channel.configureBlocking(false);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void shouldReadCondition()
"{" +
"\"cidr\": \"127.0.0.0/24\"," +
"\"authority\": \"*.example.net\"," +
"\"port\": 8080" +
"\"port\": 12345" +
"}";

TcpConditionConfig condition = jsonb.fromJson(text, TcpConditionConfig.class);
Expand All @@ -59,7 +59,7 @@ public void shouldReadCondition()
assertThat(condition.authority, equalTo("*.example.net"));
assertThat(condition.ports, not(nullValue()));
assertThat(condition.ports.length, equalTo(1));
assertThat(condition.ports[0], equalTo(8080));
assertThat(condition.ports[0], equalTo(12345));
}

@Test
Expand All @@ -69,13 +69,13 @@ public void shouldWriteCondition()
.inject(identity())
.cidr("127.0.0.0/24")
.authority("*.example.net")
.ports(new int[] { 8080 })
.ports(new int[] { 12345 })
.build();

String text = jsonb.toJson(condition);

assertThat(text, not(nullValue()));
assertThat(text, equalTo("{\"cidr\":\"127.0.0.0/24\",\"authority\":\"*.example.net\",\"port\":8080}"));
assertThat(text, equalTo("{\"cidr\":\"127.0.0.0/24\",\"authority\":\"*.example.net\",\"port\":12345}"));
}

@Test
Expand All @@ -85,16 +85,16 @@ public void shouldReadConditionWithPortRange()
"{" +
"\"cidr\": \"127.0.0.0/24\"," +
"\"authority\": \"*.example.net\"," +
"\"port\": 8080-8081" +
"\"port\": 12345-12346" +
"}";

TcpConditionConfig condition = jsonb.fromJson(text, TcpConditionConfig.class);

assertThat(condition, not(nullValue()));
assertThat(condition.ports, not(nullValue()));
assertThat(condition.ports.length, equalTo(2));
assertThat(condition.ports[0], equalTo(8080));
assertThat(condition.ports[1], equalTo(8081));
assertThat(condition.ports[0], equalTo(12345));
assertThat(condition.ports[1], equalTo(12346));
}

@Test
Expand All @@ -104,14 +104,14 @@ public void shouldReadConditionWithPortRangeSingleton()
"{" +
"\"cidr\": \"127.0.0.0/24\"," +
"\"authority\": \"*.example.net\"," +
"\"port\": \"8080\"" +
"\"port\": \"12345\"" +
"}";

TcpConditionConfig condition = jsonb.fromJson(text, TcpConditionConfig.class);

assertThat(condition, not(nullValue()));
assertThat(condition.ports, not(nullValue()));
assertThat(condition.ports.length, equalTo(1));
assertThat(condition.ports[0], equalTo(8080));
assertThat(condition.ports[0], equalTo(12345));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public void shouldReadOptions()
String text =
"{" +
"\"host\": \"localhost\"," +
"\"port\": 8080" +
"\"port\": 12345" +
"}";

TcpOptionsConfig options = jsonb.fromJson(text, TcpOptionsConfig.class);
Expand All @@ -57,7 +57,7 @@ public void shouldReadOptions()
assertThat(options.host, equalTo("localhost"));
assertThat(options.ports, not(nullValue()));
assertThat(options.ports.length, equalTo(1));
assertThat(options.ports[0], equalTo(8080));
assertThat(options.ports[0], equalTo(12345));
}

@Test
Expand All @@ -66,7 +66,7 @@ public void shouldReadOptionsWithPortRange()
String text =
"{" +
"\"host\": \"localhost\"," +
"\"port\": \"8080-8081\"" +
"\"port\": \"12345-12346\"" +
"}";

TcpOptionsConfig options = jsonb.fromJson(text, TcpOptionsConfig.class);
Expand All @@ -75,8 +75,8 @@ public void shouldReadOptionsWithPortRange()
assertThat(options.host, equalTo("localhost"));
assertThat(options.ports, not(nullValue()));
assertThat(options.ports.length, equalTo(2));
assertThat(options.ports[0], equalTo(8080));
assertThat(options.ports[1], equalTo(8081));
assertThat(options.ports[0], equalTo(12345));
assertThat(options.ports[1], equalTo(12346));
}

@Test
Expand All @@ -85,7 +85,7 @@ public void shouldReadOptionsWithPortRangeSingleton()
String text =
"{" +
"\"host\": \"localhost\"," +
"\"port\": \"8080\"" +
"\"port\": \"12345\"" +
"}";

TcpOptionsConfig options = jsonb.fromJson(text, TcpOptionsConfig.class);
Expand All @@ -94,7 +94,7 @@ public void shouldReadOptionsWithPortRangeSingleton()
assertThat(options.host, equalTo("localhost"));
assertThat(options.ports, not(nullValue()));
assertThat(options.ports.length, equalTo(1));
assertThat(options.ports[0], equalTo(8080));
assertThat(options.ports[0], equalTo(12345));
}

@Test
Expand All @@ -103,13 +103,13 @@ public void shouldWriteOptions()
TcpOptionsConfig options = TcpOptionsConfig.builder()
.inject(identity())
.host("localhost")
.ports(new int[] { 8080 })
.ports(new int[] { 12345 })
.build();

String text = jsonb.toJson(options);

assertThat(text, not(nullValue()));
assertThat(text, equalTo("{\"host\":\"localhost\",\"port\":8080}"));
assertThat(text, equalTo("{\"host\":\"localhost\",\"port\":12345}"));
}

@Test
Expand All @@ -118,7 +118,7 @@ public void shouldReadOptionsWithBacklog()
String text =
"{" +
"\"host\": \"localhost\"," +
"\"port\": 8080," +
"\"port\": 12345," +
"\"backlog\": 1000" +
"}";

Expand All @@ -128,7 +128,7 @@ public void shouldReadOptionsWithBacklog()
assertThat(options.host, equalTo("localhost"));
assertThat(options.ports, not(nullValue()));
assertThat(options.ports.length, equalTo(1));
assertThat(options.ports[0], equalTo(8080));
assertThat(options.ports[0], equalTo(12345));
assertThat(options.backlog, equalTo(1000));
}

Expand All @@ -138,13 +138,13 @@ public void shouldWriteOptionsWithBacklog()
TcpOptionsConfig options = TcpOptionsConfig.builder()
.inject(identity())
.host("localhost")
.ports(new int[] { 8080 })
.ports(new int[] { 12345 })
.backlog(1000)
.build();

String text = jsonb.toJson(options);

assertThat(text, not(nullValue()));
assertThat(text, equalTo("{\"host\":\"localhost\",\"port\":8080,\"backlog\":1000}"));
assertThat(text, equalTo("{\"host\":\"localhost\",\"port\":12345,\"backlog\":1000}"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public void shouldReportIOExceptionFromReadAsAbortAndReset() throws Exception
try (ServerSocketChannel server = ServerSocketChannel.open())
{
server.setOption(SO_REUSEADDR, true);
server.bind(new InetSocketAddress("127.0.0.1", 8080));
server.bind(new InetSocketAddress("127.0.0.1", 12345));

k3po.start();

Expand All @@ -87,7 +87,7 @@ public void shouldNotResetWhenProcessingEndAfterIOExceptionFromRead() throws Exc
try (ServerSocketChannel server = ServerSocketChannel.open())
{
server.setOption(SO_REUSEADDR, true);
server.bind(new InetSocketAddress("127.0.0.1", 8080));
server.bind(new InetSocketAddress("127.0.0.1", 12345));

k3po.start();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void shouldAbortAndResetWhenImmediateWriteThrowsIOException() throws Exce
try (ServerSocketChannel server = ServerSocketChannel.open())
{
server.setOption(SO_REUSEADDR, true);
server.bind(new InetSocketAddress("127.0.0.1", 8080));
server.bind(new InetSocketAddress("127.0.0.1", 12345));

k3po.start();

Expand Down Expand Up @@ -112,7 +112,7 @@ public void shouldAbortAndResetWhenDeferredWriteThrowsIOException() throws Excep
try (ServerSocketChannel server = ServerSocketChannel.open())
{
server.setOption(SO_REUSEADDR, true);
server.bind(new InetSocketAddress("127.0.0.1", 8080));
server.bind(new InetSocketAddress("127.0.0.1", 12345));

k3po.start();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public void shouldReceiveClientSentDataAndEnd() throws Exception
try (ServerSocketChannel server = ServerSocketChannel.open())
{
server.setOption(SO_REUSEADDR, true);
server.bind(new InetSocketAddress("127.0.0.1", 8080));
server.bind(new InetSocketAddress("127.0.0.1", 12345));

k3po.start();

Expand Down Expand Up @@ -167,7 +167,7 @@ public void shouldWriteDataAfterReceivingEndOfRead() throws Exception
try (ServerSocketChannel server = ServerSocketChannel.open())
{
server.setOption(SO_REUSEADDR, true);
server.bind(new InetSocketAddress("127.0.0.1", 8080));
server.bind(new InetSocketAddress("127.0.0.1", 12345));

k3po.start();

Expand Down Expand Up @@ -202,7 +202,7 @@ public void shouldEstablishConnection() throws Exception
"${app}/connection.established.ipv6/client",
"${net}/connection.established/server"
})
@ScriptProperty("address \"tcp://[::1]:8080\"")
@ScriptProperty("address \"tcp://[::1]:12345\"")
public void shouldEstablishConnectionIPv6() throws Exception
{
k3po.finish();
Expand Down Expand Up @@ -297,7 +297,7 @@ public void shouldReceiveServerSentDataAndEnd() throws Exception
try (ServerSocketChannel server = ServerSocketChannel.open())
{
server.setOption(SO_REUSEADDR, true);
server.bind(new InetSocketAddress("127.0.0.1", 8080));
server.bind(new InetSocketAddress("127.0.0.1", 12345));

k3po.start();

Expand All @@ -323,7 +323,7 @@ public void shouldWriteDataAfterReceiveEnd() throws Exception
try (ServerSocketChannel server = ServerSocketChannel.open())
{
server.setOption(SO_REUSEADDR, true);
server.bind(new InetSocketAddress("127.0.0.1", 8080));
server.bind(new InetSocketAddress("127.0.0.1", 12345));

k3po.start();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public void shouldResetWhenWindowExceeded() throws Exception
try (ServerSocketChannel server = ServerSocketChannel.open())
{
server.setOption(SO_REUSEADDR, true);
server.bind(new InetSocketAddress("127.0.0.1", 8080));
server.bind(new InetSocketAddress("127.0.0.1", 12345));

k3po.start();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public void shouldHandleEndOfStreamWithPendingWrite() throws Exception
try (ServerSocketChannel server = ServerSocketChannel.open())
{
server.setOption(SO_REUSEADDR, true);
server.bind(new InetSocketAddress("127.0.0.1", 8080));
server.bind(new InetSocketAddress("127.0.0.1", 12345));

k3po.start();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public void shouldResetStreamsExceedingPartialWriteStreamsLimit() throws Excepti
try (ServerSocketChannel server = ServerSocketChannel.open())
{
server.setOption(SO_REUSEADDR, true);
server.bind(new InetSocketAddress("127.0.0.1", 8080));
server.bind(new InetSocketAddress("127.0.0.1", 12345));

k3po.start();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public void shouldShutdownOutputWhenClientSendsAbort() throws Exception
try (ServerSocketChannel server = ServerSocketChannel.open())
{
server.setOption(SO_REUSEADDR, true);
server.bind(new InetSocketAddress("127.0.0.1", 8080));
server.bind(new InetSocketAddress("127.0.0.1", 12345));

k3po.start();

Expand Down Expand Up @@ -106,7 +106,7 @@ public void shouldShutdownOutputAndInputWhenClientSendsAbortAndReset() throws Ex
try (ServerSocketChannel server = ServerSocketChannel.open())
{
server.setOption(SO_REUSEADDR, true);
server.bind(new InetSocketAddress("127.0.0.1", 8080));
server.bind(new InetSocketAddress("127.0.0.1", 12345));

k3po.start();

Expand Down Expand Up @@ -144,7 +144,7 @@ public void shouldShutdownInputWhenClientSendsReset() throws Exception
try (ServerSocketChannel server = ServerSocketChannel.open())
{
server.setOption(SO_REUSEADDR, true);
server.bind(new InetSocketAddress("127.0.0.1", 8080));
server.bind(new InetSocketAddress("127.0.0.1", 12345));

k3po.start();

Expand Down Expand Up @@ -185,7 +185,7 @@ public void shouldShutdownOutputAndInputWhenClientSendsResetAndEnd() throws Exce
try (ServerSocketChannel server = ServerSocketChannel.open())
{
server.setOption(SO_REUSEADDR, true);
server.bind(new InetSocketAddress("127.0.0.1", 8080));
server.bind(new InetSocketAddress("127.0.0.1", 12345));

k3po.start();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void shouldReportIOExceptionFromReadAsAbortAndReset() throws Exception

try (SocketChannel channel = SocketChannel.open())
{
channel.connect(new InetSocketAddress("127.0.0.1", 8080));
channel.connect(new InetSocketAddress("127.0.0.1", 12345));

k3po.awaitBarrier("CONNECTED");

Expand All @@ -84,7 +84,7 @@ public void shouldNotResetWhenProcessingEndAfterIOExceptionFromRead() throws Exc

try (SocketChannel channel = SocketChannel.open())
{
channel.connect(new InetSocketAddress("127.0.0.1", 8080));
channel.connect(new InetSocketAddress("127.0.0.1", 12345));

k3po.awaitBarrier("CONNECTED");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public void shouldResetWhenImmediateWriteThrowsIOException() throws Exception

try (SocketChannel channel = SocketChannel.open())
{
channel.connect(new InetSocketAddress("127.0.0.1", 8080));
channel.connect(new InetSocketAddress("127.0.0.1", 12345));

k3po.finish();
}
Expand Down Expand Up @@ -107,7 +107,7 @@ public void shouldResetWhenDeferredWriteThrowsIOException() throws Exception

try (SocketChannel channel = SocketChannel.open())
{
channel.connect(new InetSocketAddress("127.0.0.1", 8080));
channel.connect(new InetSocketAddress("127.0.0.1", 12345));

k3po.finish();
}
Expand Down
Loading