Issue #12185 code formatting

This commit is contained in:
Lars Krog-Jensen 2024-08-22 10:58:51 +02:00
parent 497da2da0a
commit 7aa4c79ab7
1 changed files with 17 additions and 15 deletions

View File

@ -99,7 +99,7 @@ public class QoSHandlerTest
LocalConnector.LocalEndPoint endPoint = connector.executeRequest(""" LocalConnector.LocalEndPoint endPoint = connector.executeRequest("""
GET /%d HTTP/1.1 GET /%d HTTP/1.1
Host: localhost Host: localhost
""".formatted(i)); """.formatted(i));
endPoints.add(endPoint); endPoints.add(endPoint);
// Wait that the request arrives at the server. // Wait that the request arrives at the server.
@ -110,7 +110,7 @@ public class QoSHandlerTest
LocalConnector.LocalEndPoint endPoint = connector.executeRequest(""" LocalConnector.LocalEndPoint endPoint = connector.executeRequest("""
GET /%d HTTP/1.1 GET /%d HTTP/1.1
Host: localhost Host: localhost
""".formatted(maxRequests)); """.formatted(maxRequests));
endPoints.add(endPoint); endPoints.add(endPoint);
@ -165,7 +165,7 @@ public class QoSHandlerTest
LocalConnector.LocalEndPoint endPoint0 = connector.executeRequest(""" LocalConnector.LocalEndPoint endPoint0 = connector.executeRequest("""
GET /0 HTTP/1.1 GET /0 HTTP/1.1
Host: localhost Host: localhost
"""); """);
await().atMost(5, TimeUnit.SECONDS).until(callbacks::size, is(1)); await().atMost(5, TimeUnit.SECONDS).until(callbacks::size, is(1));
@ -173,7 +173,7 @@ public class QoSHandlerTest
LocalConnector.LocalEndPoint endPoint1 = connector.executeRequest(""" LocalConnector.LocalEndPoint endPoint1 = connector.executeRequest("""
GET /1 HTTP/1.1 GET /1 HTTP/1.1
Host: localhost Host: localhost
"""); """);
await().atMost(5, TimeUnit.SECONDS).until(qosHandler::getSuspendedRequestCount, is(1L)); await().atMost(5, TimeUnit.SECONDS).until(qosHandler::getSuspendedRequestCount, is(1L));
@ -195,7 +195,7 @@ public class QoSHandlerTest
LocalConnector.LocalEndPoint endPoint2 = connector.executeRequest(""" LocalConnector.LocalEndPoint endPoint2 = connector.executeRequest("""
GET /2 HTTP/1.1 GET /2 HTTP/1.1
Host: localhost Host: localhost
"""); """);
await().atMost(5, TimeUnit.SECONDS).until(callbacks::size, is(1)); await().atMost(5, TimeUnit.SECONDS).until(callbacks::size, is(1));
callbacks.remove(0).succeeded(); callbacks.remove(0).succeeded();
@ -234,7 +234,7 @@ public class QoSHandlerTest
LocalConnector.LocalEndPoint endPoint0 = connector.executeRequest(""" LocalConnector.LocalEndPoint endPoint0 = connector.executeRequest("""
GET /0 HTTP/1.1 GET /0 HTTP/1.1
Host: localhost Host: localhost
"""); """);
await().atMost(5, TimeUnit.SECONDS).until(callbacks::size, is(1)); await().atMost(5, TimeUnit.SECONDS).until(callbacks::size, is(1));
@ -243,7 +243,7 @@ public class QoSHandlerTest
GET /1 HTTP/1.1 GET /1 HTTP/1.1
Host: localhost Host: localhost
Priority: 0 Priority: 0
"""); """);
await().atMost(5, TimeUnit.SECONDS).until(callbacks::size, is(1)); await().atMost(5, TimeUnit.SECONDS).until(callbacks::size, is(1));
@ -252,7 +252,7 @@ public class QoSHandlerTest
GET /2 HTTP/1.1 GET /2 HTTP/1.1
Host: localhost Host: localhost
Priority: 1 Priority: 1
"""); """);
await().atMost(5, TimeUnit.SECONDS).until(callbacks::size, is(1)); await().atMost(5, TimeUnit.SECONDS).until(callbacks::size, is(1));
@ -321,7 +321,7 @@ public class QoSHandlerTest
try (LocalConnector.LocalEndPoint endPoint = connector.executeRequest(""" try (LocalConnector.LocalEndPoint endPoint = connector.executeRequest("""
GET /%d/%d HTTP/1.1 GET /%d/%d HTTP/1.1
Host: localhost Host: localhost
""".formatted(i, j))) """.formatted(i, j)))
{ {
String text = endPoint.getResponse(false, parallelism * iterations * delay * 5, TimeUnit.MILLISECONDS); String text = endPoint.getResponse(false, parallelism * iterations * delay * 5, TimeUnit.MILLISECONDS);
@ -361,7 +361,7 @@ public class QoSHandlerTest
LocalConnector.LocalEndPoint normalEndPoint = connector.executeRequest(""" LocalConnector.LocalEndPoint normalEndPoint = connector.executeRequest("""
GET /normal/request HTTP/1.1 GET /normal/request HTTP/1.1
Host: localhost Host: localhost
"""); """);
await().atMost(5, TimeUnit.SECONDS).until(callbacks::size, is(1)); await().atMost(5, TimeUnit.SECONDS).until(callbacks::size, is(1));
@ -369,7 +369,7 @@ public class QoSHandlerTest
LocalConnector.LocalEndPoint anotherEndPoint = connector.executeRequest(""" LocalConnector.LocalEndPoint anotherEndPoint = connector.executeRequest("""
GET /another/normal/request HTTP/1.1 GET /another/normal/request HTTP/1.1
Host: localhost Host: localhost
"""); """);
await().atLeast(100, TimeUnit.MILLISECONDS).until(callbacks::size, is(1)); await().atLeast(100, TimeUnit.MILLISECONDS).until(callbacks::size, is(1));
@ -377,7 +377,7 @@ public class QoSHandlerTest
LocalConnector.LocalEndPoint specialEndPoint = connector.executeRequest(""" LocalConnector.LocalEndPoint specialEndPoint = connector.executeRequest("""
GET /special/info HTTP/1.1 GET /special/info HTTP/1.1
Host: localhost Host: localhost
"""); """);
// Wait that the request arrives at the server. // Wait that the request arrives at the server.
@ -425,7 +425,8 @@ public class QoSHandlerTest
Thread.sleep(delay); Thread.sleep(delay);
callback.succeeded(); callback.succeeded();
} }
catch (Throwable x) { catch (Throwable x)
{
callback.failed(x); callback.failed(x);
} }
return true; return true;
@ -440,8 +441,9 @@ public class QoSHandlerTest
try (LocalConnector.LocalEndPoint endPoint = connector.executeRequest(""" try (LocalConnector.LocalEndPoint endPoint = connector.executeRequest("""
GET /%d HTTP/1.1 GET /%d HTTP/1.1
Host: localhost Host: localhost
""".formatted(i))) { """.formatted(i)))
{
String text = endPoint.getResponse(false, parallelism * delay * 5, TimeUnit.MILLISECONDS); String text = endPoint.getResponse(false, parallelism * delay * 5, TimeUnit.MILLISECONDS);
HttpTester.Response response = HttpTester.parseResponse(text); HttpTester.Response response = HttpTester.parseResponse(text);
statusCodes.add(response.getStatus()); statusCodes.add(response.getStatus());