From 8c65309963a286a700698ccfd05426f6cfe2767f Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Tue, 14 Jan 2020 12:33:34 -0600 Subject: [PATCH 1/8] Addressing Checkstyle violations in src/test/java Signed-off-by: Joakim Erdfelt --- .../jetty/example/asyncrest/DemoServer.java | 4 +- .../annotations/TestAnnotationParser.java | 2 +- .../client/ClientConnectionCloseTest.java | 17 +- .../client/HttpClientAuthenticationTest.java | 40 +-- .../client/HttpClientChunkedContentTest.java | 4 +- .../jetty/client/HttpClientRedirectTest.java | 38 +-- .../eclipse/jetty/client/HttpClientTest.java | 57 ++--- .../jetty/client/HttpClientURITest.java | 1 + .../client/HttpConnectionLifecycleTest.java | 22 +- .../eclipse/jetty/client/HttpCookieTest.java | 50 ++-- .../org/eclipse/jetty/client/api/Usage.java | 5 +- .../http/HttpDestinationOverHTTPTest.java | 12 +- .../client/http/HttpReceiverOverHTTPTest.java | 14 +- .../client/http/HttpSenderOverHTTPTest.java | 14 +- .../util/MultiPartContentProviderTest.java | 1 + .../client/util/TypedContentProviderTest.java | 1 + .../jetty/deploy/AppLifeCycleTest.java | 18 +- .../jetty/deploy/BadAppDeployTest.java | 4 +- .../DeploymentManagerLifeCyclePathTest.java | 6 +- .../jetty/fcgi/server/HttpClientTest.java | 2 + .../proxy/DrupalHTTP2FastCGIProxyServer.java | 8 +- .../WordPressHTTP2FastCGIProxyServer.java | 10 +- .../TestEndpointMultiplePublishProblem.java | 4 +- .../jetty/http/GZIPContentDecoderTest.java | 4 +- .../org/eclipse/jetty/http/HttpFieldTest.java | 11 +- .../jetty/http/HttpGeneratorServerTest.java | 2 +- .../eclipse/jetty/http/HttpParserTest.java | 14 +- .../org/eclipse/jetty/http/HttpTester.java | 4 +- .../org/eclipse/jetty/http/HttpURITest.java | 1 + .../org/eclipse/jetty/http/MimeTypesTest.java | 12 +- .../jetty/http/MultiPartParserTest.java | 187 +++++++------- .../org/eclipse/jetty/http/PathMapTest.java | 6 +- .../jetty/http/QuotedQualityCSVTest.java | 12 +- .../org/eclipse/jetty/http/SyntaxTest.java | 8 +- .../http/matchers/HttpFieldsMatchersTest.java | 6 +- .../jetty/http/pathmap/PathMappingsTest.java | 1 + .../pathmap/ServletPathSpecOrderTest.java | 1 + .../http/pathmap/UriTemplatePathSpecTest.java | 2 +- .../jetty/http2/client/ProxyProtocolTest.java | 4 +- .../http2/client/SmallThreadPoolLoadTest.java | 4 +- .../jetty/http2/hpack/HpackDecoderTest.java | 10 +- .../eclipse/jetty/http2/hpack/HpackTest.java | 1 + .../jetty/http2/hpack/NBitIntegerTest.java | 12 +- .../jetty/http2/server/H2SpecServer.java | 8 +- .../jetty/http2/server/HTTP2CServerTest.java | 10 +- .../jetty/http2/server/HTTP2ServerTest.java | 6 +- .../infinispan/EmbeddedQueryManagerTest.java | 19 +- .../infinispan/RemoteQueryManagerTest.java | 8 +- .../eclipse/jetty/io/CyclicTimeoutTest.java | 4 +- .../jetty/io/SocketChannelEndPointTest.java | 20 +- .../jetty/util/StringReplaceBenchmark.java | 12 +- .../jetty/maven/plugin/it/TestGetContent.java | 5 +- .../jetty/security/openid/JwtDecoderTest.java | 24 +- .../openid/OpenIdAuthenticationTest.java | 4 +- .../jetty/security/openid/OpenIdProvider.java | 4 +- .../eclipse/jetty/osgi/test/TestOSGiUtil.java | 7 +- .../jetty/plus/webapp/TestConfiguration.java | 4 +- .../jetty/security/ConstraintTest.java | 44 ++-- .../jetty/security/DataConstraintsTest.java | 8 +- .../security/SpecExampleConstraintTest.java | 24 +- .../SpnegoAuthenticatorTest.java | 8 +- .../jetty/server/handler/AbstractHandler.java | 3 - .../server/session/JDBCSessionDataStore.java | 22 +- .../jetty/server/AsyncCompletionTest.java | 14 +- .../eclipse/jetty/server/AsyncStressTest.java | 48 ++-- ...Test.java => CookieCutterLenientTest.java} | 2 +- .../jetty/server/CookieCutterTest.java | 20 +- .../jetty/server/DelayedServerTest.java | 10 +- .../org/eclipse/jetty/server/DumpHandler.java | 10 +- .../jetty/server/ErrorHandlerTest.java | 6 + .../jetty/server/GracefulStopTest.java | 10 +- .../eclipse/jetty/server/HttpOutputTest.java | 1 + .../jetty/server/HttpServerTestBase.java | 7 +- .../jetty/server/HttpServerTestFixture.java | 3 +- .../eclipse/jetty/server/HttpWriterTest.java | 39 +-- .../jetty/server/InclusiveByteRangeTest.java | 26 +- .../jetty/server/LocalConnectorTest.java | 20 +- .../eclipse/jetty/server/MockConnector.java | 2 +- .../jetty/server/PartialRFC2616Test.java | 54 ++--- .../org/eclipse/jetty/server/RequestTest.java | 27 ++- .../eclipse/jetty/server/ResponseTest.java | 40 +-- .../jetty/server/ServerConnectorTest.java | 6 +- .../server/ServerConnectorTimeoutTest.java | 22 +- .../jetty/server/ServletWriterTest.java | 3 +- .../org/eclipse/jetty/server/StressTest.java | 8 +- .../server/handler/ContextHandlerTest.java | 17 +- .../server/handler/InetAccessHandlerTest.java | 8 +- .../server/handler/ResourceHandlerTest.java | 4 +- .../server/resource/RangeWriterTest.java | 8 +- .../jetty/server/ssl/SSLEngineTest.java | 4 +- .../ssl/SniSslConnectionFactoryTest.java | 2 - .../server/ssl/SslConnectionFactoryTest.java | 14 +- .../jetty/servlet/AsyncContextTest.java | 12 +- .../jetty/servlet/AsyncListenerTest.java | 80 +++--- .../jetty/servlet/AsyncServletIOTest.java | 6 +- .../jetty/servlet/AsyncServletTest.java | 78 +++--- .../servlet/ComplianceViolations2616Test.java | 4 +- .../jetty/servlet/DefaultServletTest.java | 74 +++--- .../eclipse/jetty/servlet/DispatcherTest.java | 4 +- .../eclipse/jetty/servlet/ErrorPageTest.java | 18 +- .../jetty/servlet/GzipHandlerTest.java | 9 +- .../eclipse/jetty/servlet/RequestURITest.java | 4 +- .../servlet/ServletContextResourcesTest.java | 4 +- .../jetty/servlet/ServletLifeCycleTest.java | 48 ++-- .../jetty/servlet/ServletRequestLogTest.java | 4 +- .../handler/gzip/GzipContentLengthTest.java | 12 +- .../gzip/GzipDefaultNoRecompressTest.java | 2 +- .../eclipse/jetty/servlets/DoSFilterTest.java | 4 +- .../servlets/EventSourceServletTest.java | 2 +- .../IncludeExcludeBasedFilterTest.java | 8 +- .../jetty/servlets/MultipartFilterTest.java | 1 + .../eclipse/jetty/servlets/PutFilterTest.java | 14 +- .../spring/SpringXmlConfigurationTest.java | 2 +- .../org/eclipse/jetty/start/BaseHomeTest.java | 10 +- .../java/org/eclipse/jetty/start/FSTest.java | 2 +- .../jetty/start/IncludeJettyDirTest.java | 14 +- .../jetty/start/ModuleGraphWriterTest.java | 2 +- .../org/eclipse/jetty/start/ModulesTest.java | 2 +- .../jetty/start/config/ConfigSourcesTest.java | 16 +- .../MavenLocalRepoFileInitializerTest.java | 16 +- .../jetty/unixsocket/UnixSocketClient.java | 6 +- .../org/eclipse/jetty/util/ajax/JSONTest.java | 18 +- .../org/eclipse/jetty/util/B64CodeTest.java | 4 +- .../eclipse/jetty/util/BufferUtilTest.java | 6 +- .../org/eclipse/jetty/util/DateCacheTest.java | 2 +- .../org/eclipse/jetty/util/LazyListTest.java | 228 +++++++++--------- .../org/eclipse/jetty/util/MultiMapTest.java | 42 ++-- .../eclipse/jetty/util/PathWatcherTest.java | 16 +- .../jetty/util/QuotedStringTokenizerTest.java | 8 +- .../util/RolloverFileOutputStreamTest.java | 10 +- .../org/eclipse/jetty/util/ScannerTest.java | 26 +- .../eclipse/jetty/util/StringUtilTest.java | 1 + .../org/eclipse/jetty/util/TypeUtilTest.java | 12 +- .../org/eclipse/jetty/util/URIUtilTest.java | 3 + .../eclipse/jetty/util/URLEncodedTest.java | 149 ++++++------ .../util/UrlEncodedInvalidEncodingTest.java | 4 +- .../jetty/util/Utf8AppendableTest.java | 11 +- .../LifeCycleListenerNestedTest.java | 6 +- .../org/eclipse/jetty/util/log/LogTest.java | 7 +- .../eclipse/jetty/util/log/StdErrLogTest.java | 28 +-- .../util/resource/FileSystemResourceTest.java | 22 +- .../jetty/util/resource/JarResourceTest.java | 4 +- .../jetty/util/resource/JrtResourceTest.java | 12 +- .../jetty/util/resource/PathResourceTest.java | 10 +- .../util/resource/ResourceCollectionTest.java | 22 +- .../jetty/util/security/PasswordTest.java | 1 + .../jetty/util/ssl/SslContextFactoryTest.java | 2 +- .../org/eclipse/jetty/util/ssl/X509Test.java | 24 +- .../util/thread/AbstractThreadPoolTest.java | 4 +- .../util/thread/QueuedThreadPoolTest.java | 4 +- .../jetty/webapp/ClasspathPatternTest.java | 52 ++-- .../jetty/webapp/HugeResourceTest.java | 2 +- .../jetty/webapp/WebInfConfigurationTest.java | 1 + .../websocket/jsr356/LargeMessageTest.java | 2 +- ...tedEndpointScannerGoodSignaturesTest.java} | 4 +- ...EndpointScannerInvalidSignaturesTest.java} | 4 +- .../metadata/EncoderMetadataSetTest.java | 6 +- .../jsr356/utils/ReflectUtilsTest.java | 16 +- .../jsr356/server/ConfiguratorTest.java | 8 +- .../DelayedStartClientOnServerTest.java | 18 +- .../jsr356/server/RestartContextTest.java | 4 +- ...tedEndpointScannerGoodSignaturesTest.java} | 4 +- ...EndpointScannerInvalidSignaturesTest.java} | 4 +- .../websocket/jsr356/server/SessionTest.java | 28 +-- .../jetty/websocket/tests/ErrorCloseTest.java | 14 +- .../tests/client/ClientConnectTest.java | 12 +- .../tests/client/ClientSessionsTest.java | 2 +- .../tests/client/WebSocketClientTest.java | 12 +- .../tests/server/PartialListenerTest.java | 2 +- .../api/extensions/ExtensionConfigTest.java | 4 +- ...QuoteTest.java => QuoteUtilQuoteTest.java} | 2 +- .../websocket/api/util/QuoteUtilTest.java | 18 +- .../client/ConnectionManagerTest.java | 12 +- .../client/TomcatServerQuirksTest.java | 2 +- .../client/WebSocketClientInitTest.java | 4 +- .../jetty/websocket/common/GeneratorTest.java | 12 +- .../jetty/websocket/common/ParserTest.java | 11 +- .../common/TextPayloadParserTest.java | 1 + .../{TestABCase1_1.java => TestABCase11.java} | 30 +-- .../{TestABCase1_2.java => TestABCase12.java} | 30 +-- .../websocket/common/ab/TestABCase2.java | 22 +- .../websocket/common/ab/TestABCase4.java | 8 +- .../{TestABCase7_3.java => TestABCase73.java} | 26 +- .../common/events/EventDriverTest.java | 12 +- .../events/JettyAnnotatedScannerTest.java | 4 +- .../compress/ByteAccumulatorTest.java | 4 +- .../compress/DeflateFrameExtensionTest.java | 22 +- .../PerMessageDeflateExtensionTest.java | 26 +- .../common/io/ConnectionStateTest.java | 6 +- .../io/http/HttpResponseHeaderParserTest.java | 2 +- .../common/message/MessageDebug.java | 1 + .../common/message/Utf8CharBufferTest.java | 1 + .../websocket/common/test/UnitGenerator.java | 2 +- .../common/util/Utf8PartialBuilderTest.java | 7 +- .../server/RedirectWebSocketClientTest.java | 22 +- .../websocket/server/SimpleServletServer.java | 22 +- .../websocket/server/ab/TestABCase1.java | 32 +-- .../websocket/server/ab/TestABCase2.java | 22 +- .../websocket/server/ab/TestABCase3.java | 14 +- .../websocket/server/ab/TestABCase4.java | 20 +- .../websocket/server/ab/TestABCase5.java | 42 ++-- .../websocket/server/ab/TestABCase6.java | 23 +- ...se6_BadUTF.java => TestABCase6BadUTF.java} | 2 +- ...6_GoodUTF.java => TestABCase6GoodUTF.java} | 4 +- .../websocket/server/ab/TestABCase7.java | 24 +- ...es.java => TestABCase7BadStatusCodes.java} | 4 +- ...s.java => TestABCase7GoodStatusCodes.java} | 4 +- .../websocket/server/ab/TestABCase9.java | 84 +++---- .../jetty/continuation/ContinuationsTest.java | 78 +++--- .../jetty/tests/distribution/BadAppTests.java | 6 +- .../http/client/HttpClientContinueTest.java | 46 ++-- .../jetty/test/DefaultHandlerTest.java | 6 +- .../jetty/test/DeploymentErrorTest.java | 8 +- .../jetty/test/HttpInputIntegrationTest.java | 4 +- .../jetty/test/rfcs/RFC2616BaseTest.java | 92 +++---- .../test/support/rawhttp/HttpTesting.java | 2 + .../quickstart/AttributeNormalizerTest.java | 8 +- ...ttributeNormalizerToCanonicalUriTest.java} | 2 +- .../jetty/server/session/JdbcTestHelper.java | 14 +- .../java/org/eclipse/jetty/TestServer.java | 16 +- .../jetty/TestTransparentProxyServer.java | 14 +- 221 files changed, 1792 insertions(+), 1746 deletions(-) rename jetty-server/src/test/java/org/eclipse/jetty/server/{CookieCutter_LenientTest.java => CookieCutterLenientTest.java} (99%) rename jetty-websocket/javax-websocket-client-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/endpoints/{ClientAnnotatedEndpointScanner_GoodSignaturesTest.java => ClientAnnotatedEndpointScannerGoodSignaturesTest.java} (98%) rename jetty-websocket/javax-websocket-client-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/endpoints/{ClientAnnotatedEndpointScanner_InvalidSignaturesTest.java => ClientAnnotatedEndpointScannerInvalidSignaturesTest.java} (96%) rename jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/{ServerAnnotatedEndpointScanner_GoodSignaturesTest.java => ServerAnnotatedEndpointScannerGoodSignaturesTest.java} (98%) rename jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/{ServerAnnotatedEndpointScanner_InvalidSignaturesTest.java => ServerAnnotatedEndpointScannerInvalidSignaturesTest.java} (95%) rename jetty-websocket/websocket-api/src/test/java/org/eclipse/jetty/websocket/api/util/{QuoteUtil_QuoteTest.java => QuoteUtilQuoteTest.java} (98%) rename jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/ab/{TestABCase1_1.java => TestABCase11.java} (95%) rename jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/ab/{TestABCase1_2.java => TestABCase12.java} (94%) rename jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/ab/{TestABCase7_3.java => TestABCase73.java} (92%) rename jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/ab/{TestABCase6_BadUTF.java => TestABCase6BadUTF.java} (99%) rename jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/ab/{TestABCase6_GoodUTF.java => TestABCase6GoodUTF.java} (97%) rename jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/ab/{TestABCase7_BadStatusCodes.java => TestABCase7BadStatusCodes.java} (96%) rename jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/ab/{TestABCase7_GoodStatusCodes.java => TestABCase7GoodStatusCodes.java} (96%) rename tests/test-quickstart/src/test/java/org/eclipse/jetty/quickstart/{AttributeNormalizer_ToCanonicalUriTest.java => AttributeNormalizerToCanonicalUriTest.java} (97%) diff --git a/examples/async-rest/async-rest-webapp/src/test/java/org/eclipse/jetty/example/asyncrest/DemoServer.java b/examples/async-rest/async-rest-webapp/src/test/java/org/eclipse/jetty/example/asyncrest/DemoServer.java index b641f5ab1bd8..653979f75b2e 100644 --- a/examples/async-rest/async-rest-webapp/src/test/java/org/eclipse/jetty/example/asyncrest/DemoServer.java +++ b/examples/async-rest/async-rest-webapp/src/test/java/org/eclipse/jetty/example/asyncrest/DemoServer.java @@ -26,13 +26,13 @@ public class DemoServer public static void main(String[] args) throws Exception { - String jetty_home = System.getProperty("jetty.home", "."); + String jettyHome = System.getProperty("jetty.home", "."); Server server = new Server(Integer.getInteger("jetty.http.port", 8080).intValue()); WebAppContext webapp = new WebAppContext(); webapp.setContextPath("/"); - webapp.setWar(jetty_home + "/target/async-rest/"); + webapp.setWar(jettyHome + "/target/async-rest/"); webapp.setParentLoaderPriority(true); webapp.setServerClasses(new String[]{}); server.setHandler(webapp); diff --git a/jetty-annotations/src/test/java/org/eclipse/jetty/annotations/TestAnnotationParser.java b/jetty-annotations/src/test/java/org/eclipse/jetty/annotations/TestAnnotationParser.java index ac33ca5c2fee..1c6b2dcd4d37 100644 --- a/jetty-annotations/src/test/java/org/eclipse/jetty/annotations/TestAnnotationParser.java +++ b/jetty-annotations/src/test/java/org/eclipse/jetty/annotations/TestAnnotationParser.java @@ -220,7 +220,7 @@ public void testJep238MultiReleaseInJar() throws Exception } @Test - public void testJep238MultiReleaseInJar_JDK10() throws Exception + public void testJep238MultiReleaseInJarJDK10() throws Exception { File jdk10Jar = MavenTestingUtils.getTestResourceFile("jdk10/multirelease-10.jar"); AnnotationParser parser = new AnnotationParser(); diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/ClientConnectionCloseTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/ClientConnectionCloseTest.java index d7e41d2e9503..8dca0fb32541 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/ClientConnectionCloseTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/ClientConnectionCloseTest.java @@ -23,7 +23,6 @@ import java.nio.ByteBuffer; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.servlet.ServletException; import javax.servlet.ServletInputStream; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -50,13 +49,13 @@ public class ClientConnectionCloseTest extends AbstractHttpClientServerTest { @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_ClientConnectionClose_ServerConnectionClose_ClientClosesAfterExchange(Scenario scenario) throws Exception + public void testClientConnectionCloseServerConnectionCloseClientClosesAfterExchange(Scenario scenario) throws Exception { byte[] data = new byte[128 * 1024]; start(scenario, new AbstractHandler() { @Override - public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException + public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException { baseRequest.setHandled(true); @@ -107,12 +106,12 @@ public void handle(String target, Request baseRequest, HttpServletRequest reques @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_ClientConnectionClose_ServerDoesNotRespond_ClientIdleTimeout(Scenario scenario) throws Exception + public void testClientConnectionCloseServerDoesNotRespondClientIdleTimeout(Scenario scenario) throws Exception { start(scenario, new AbstractHandler() { @Override - public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException + public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) { baseRequest.setHandled(true); request.startAsync(); @@ -149,13 +148,13 @@ public void handle(String target, Request baseRequest, HttpServletRequest reques @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_ClientConnectionClose_ServerPartialResponse_ClientIdleTimeout(Scenario scenario) throws Exception + public void testClientConnectionCloseServerPartialResponseClientIdleTimeout(Scenario scenario) throws Exception { long idleTimeout = 1000; start(scenario, new AbstractHandler() { @Override - public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException + public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException { baseRequest.setHandled(true); @@ -213,12 +212,12 @@ public void handle(String target, Request baseRequest, HttpServletRequest reques @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_ClientConnectionClose_ServerNoConnectionClose_ClientCloses(Scenario scenario) throws Exception + public void testClientConnectionCloseServerNoConnectionCloseClientCloses(Scenario scenario) throws Exception { start(scenario, new AbstractHandler() { @Override - public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException + public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException { baseRequest.setHandled(true); response.setContentLength(0); diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientAuthenticationTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientAuthenticationTest.java index 0739c4894eab..e85394eb905c 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientAuthenticationTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientAuthenticationTest.java @@ -115,51 +115,51 @@ private void start(final Scenario scenario, Authenticator authenticator, Handler @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_BasicAuthentication(Scenario scenario) throws Exception + public void testBasicAuthentication(Scenario scenario) throws Exception { startBasic(scenario, new EmptyServerHandler()); URI uri = URI.create(scenario.getScheme() + "://localhost:" + connector.getLocalPort()); - test_Authentication(scenario, new BasicAuthentication(uri, realm, "basic", "basic")); + testAuthentication(scenario, new BasicAuthentication(uri, realm, "basic", "basic")); } @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_BasicEmptyRealm(Scenario scenario) throws Exception + public void testBasicEmptyRealm(Scenario scenario) throws Exception { realm = ""; startBasic(scenario, new EmptyServerHandler()); URI uri = URI.create(scenario.getScheme() + "://localhost:" + connector.getLocalPort()); - test_Authentication(scenario, new BasicAuthentication(uri, realm, "basic", "basic")); + testAuthentication(scenario, new BasicAuthentication(uri, realm, "basic", "basic")); } @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_BasicAnyRealm(Scenario scenario) throws Exception + public void testBasicAnyRealm(Scenario scenario) throws Exception { startBasic(scenario, new EmptyServerHandler()); URI uri = URI.create(scenario.getScheme() + "://localhost:" + connector.getLocalPort()); - test_Authentication(scenario, new BasicAuthentication(uri, ANY_REALM, "basic", "basic")); + testAuthentication(scenario, new BasicAuthentication(uri, ANY_REALM, "basic", "basic")); } @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_DigestAuthentication(Scenario scenario) throws Exception + public void testDigestAuthentication(Scenario scenario) throws Exception { startDigest(scenario, new EmptyServerHandler()); URI uri = URI.create(scenario.getScheme() + "://localhost:" + connector.getLocalPort()); - test_Authentication(scenario, new DigestAuthentication(uri, realm, "digest", "digest")); + testAuthentication(scenario, new DigestAuthentication(uri, realm, "digest", "digest")); } @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_DigestAnyRealm(Scenario scenario) throws Exception + public void testDigestAnyRealm(Scenario scenario) throws Exception { startDigest(scenario, new EmptyServerHandler()); URI uri = URI.create(scenario.getScheme() + "://localhost:" + connector.getLocalPort()); - test_Authentication(scenario, new DigestAuthentication(uri, ANY_REALM, "digest", "digest")); + testAuthentication(scenario, new DigestAuthentication(uri, ANY_REALM, "digest", "digest")); } - private void test_Authentication(final Scenario scenario, Authentication authentication) throws Exception + private void testAuthentication(final Scenario scenario, Authentication authentication) throws Exception { AuthenticationStore authenticationStore = client.getAuthenticationStore(); @@ -226,7 +226,7 @@ public void onSuccess(Request request) @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_BasicAuthentication_ThenRedirect(Scenario scenario) throws Exception + public void testBasicAuthenticationThenRedirect(Scenario scenario) throws Exception { startBasic(scenario, new EmptyServerHandler() { @@ -271,7 +271,7 @@ public void onSuccess(Request request) @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_Redirect_ThenBasicAuthentication(Scenario scenario) throws Exception + public void testRedirectThenBasicAuthentication(Scenario scenario) throws Exception { startBasic(scenario, new EmptyServerHandler() { @@ -310,7 +310,7 @@ public void onSuccess(Request request) @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_BasicAuthentication_WithAuthenticationRemoved(Scenario scenario) throws Exception + public void testBasicAuthenticationWithAuthenticationRemoved(Scenario scenario) throws Exception { startBasic(scenario, new EmptyServerHandler()); @@ -359,7 +359,7 @@ public void onSuccess(Request request) @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_BasicAuthentication_WithWrongPassword(Scenario scenario) throws Exception + public void testBasicAuthenticationWithWrongPassword(Scenario scenario) throws Exception { startBasic(scenario, new EmptyServerHandler()); @@ -379,7 +379,7 @@ public void test_BasicAuthentication_WithWrongPassword(Scenario scenario) throws @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_Authentication_ThrowsException(Scenario scenario) throws Exception + public void testAuthenticationThrowsException(Scenario scenario) throws Exception { startBasic(scenario, new EmptyServerHandler()); @@ -419,7 +419,7 @@ public Result authenticate(Request request, ContentResponse response, HeaderInfo @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_PreemptedAuthentication(Scenario scenario) throws Exception + public void testPreemptedAuthentication(Scenario scenario) throws Exception { startBasic(scenario, new EmptyServerHandler()); @@ -449,7 +449,7 @@ public void onSuccess(Request request) @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_NonReproducibleContent(Scenario scenario) throws Exception + public void testNonReproducibleContent(Scenario scenario) throws Exception { startBasic(scenario, new EmptyServerHandler()); @@ -484,7 +484,7 @@ public boolean isReproducible() @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_RequestFailsAfterResponse(Scenario scenario) throws Exception + public void testRequestFailsAfterResponse(Scenario scenario) throws Exception { startBasic(scenario, new EmptyServerHandler() { @@ -576,7 +576,7 @@ public void onComplete(Result result) @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_InfiniteAuthentication(Scenario scenario) throws Exception + public void testInfiniteAuthentication(Scenario scenario) throws Exception { String authType = "Authenticate"; start(scenario, new EmptyServerHandler() diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientChunkedContentTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientChunkedContentTest.java index 25dbf475aee7..46edd0177a5e 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientChunkedContentTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientChunkedContentTest.java @@ -63,7 +63,7 @@ public void dispose() throws Exception } @Test - public void test_Server_HeadersPauseTerminal_Client_Response() throws Exception + public void testServerHeadersPauseTerminalClientResponse() throws Exception { startClient(); @@ -115,7 +115,7 @@ public void onComplete(Result result) } @Test - public void test_Server_ContentTerminal_Client_ContentDelay() throws Exception + public void testServerContentTerminalClientContentDelay() throws Exception { startClient(); diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientRedirectTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientRedirectTest.java index c8c4b0a4a995..4ff3669e3455 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientRedirectTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientRedirectTest.java @@ -59,7 +59,7 @@ public class HttpClientRedirectTest extends AbstractHttpClientServerTest { @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_303(Scenario scenario) throws Exception + public void test303(Scenario scenario) throws Exception { start(scenario, new RedirectHandler()); @@ -75,7 +75,7 @@ public void test_303(Scenario scenario) throws Exception @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_303_302(Scenario scenario) throws Exception + public void test303302(Scenario scenario) throws Exception { start(scenario, new RedirectHandler()); @@ -91,7 +91,7 @@ public void test_303_302(Scenario scenario) throws Exception @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_303_302_OnDifferentDestinations(Scenario scenario) throws Exception + public void test303302OnDifferentDestinations(Scenario scenario) throws Exception { start(scenario, new RedirectHandler()); @@ -107,7 +107,7 @@ public void test_303_302_OnDifferentDestinations(Scenario scenario) throws Excep @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_301(Scenario scenario) throws Exception + public void test301(Scenario scenario) throws Exception { start(scenario, new RedirectHandler()); @@ -124,7 +124,7 @@ public void test_301(Scenario scenario) throws Exception @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_301_WithWrongMethod(Scenario scenario) throws Exception + public void test301WithWrongMethod(Scenario scenario) throws Exception { start(scenario, new RedirectHandler()); @@ -144,7 +144,7 @@ public void test_301_WithWrongMethod(Scenario scenario) throws Exception @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_307_WithRequestContent(Scenario scenario) throws Exception + public void test307WithRequestContent(Scenario scenario) throws Exception { start(scenario, new RedirectHandler()); @@ -184,7 +184,7 @@ public void testMaxRedirections(Scenario scenario) throws Exception @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_303_WithConnectionClose_WithBigRequest(Scenario scenario) throws Exception + public void test303WithConnectionCloseWithBigRequest(Scenario scenario) throws Exception { start(scenario, new RedirectHandler()); @@ -314,84 +314,84 @@ public void testRedirectFailed(Scenario scenario) throws Exception @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_HEAD_301(Scenario scenario) throws Exception + public void testHEAD301(Scenario scenario) throws Exception { testSameMethodRedirect(scenario, HttpMethod.HEAD, HttpStatus.MOVED_PERMANENTLY_301); } @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_POST_301(Scenario scenario) throws Exception + public void testPOST301(Scenario scenario) throws Exception { testGETRedirect(scenario, HttpMethod.POST, HttpStatus.MOVED_PERMANENTLY_301); } @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_PUT_301(Scenario scenario) throws Exception + public void testPUT301(Scenario scenario) throws Exception { testSameMethodRedirect(scenario, HttpMethod.PUT, HttpStatus.MOVED_PERMANENTLY_301); } @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_HEAD_302(Scenario scenario) throws Exception + public void testHEAD302(Scenario scenario) throws Exception { testSameMethodRedirect(scenario, HttpMethod.HEAD, HttpStatus.FOUND_302); } @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_POST_302(Scenario scenario) throws Exception + public void testPOST302(Scenario scenario) throws Exception { testGETRedirect(scenario, HttpMethod.POST, HttpStatus.FOUND_302); } @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_PUT_302(Scenario scenario) throws Exception + public void testPUT302(Scenario scenario) throws Exception { testSameMethodRedirect(scenario, HttpMethod.PUT, HttpStatus.FOUND_302); } @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_HEAD_303(Scenario scenario) throws Exception + public void testHEAD303(Scenario scenario) throws Exception { testSameMethodRedirect(scenario, HttpMethod.HEAD, HttpStatus.SEE_OTHER_303); } @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_POST_303(Scenario scenario) throws Exception + public void testPOST303(Scenario scenario) throws Exception { testGETRedirect(scenario, HttpMethod.POST, HttpStatus.SEE_OTHER_303); } @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_PUT_303(Scenario scenario) throws Exception + public void testPUT303(Scenario scenario) throws Exception { testGETRedirect(scenario, HttpMethod.PUT, HttpStatus.SEE_OTHER_303); } @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_HEAD_307(Scenario scenario) throws Exception + public void testHEAD307(Scenario scenario) throws Exception { testSameMethodRedirect(scenario, HttpMethod.HEAD, HttpStatus.TEMPORARY_REDIRECT_307); } @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_POST_307(Scenario scenario) throws Exception + public void testPOST307(Scenario scenario) throws Exception { testSameMethodRedirect(scenario, HttpMethod.POST, HttpStatus.TEMPORARY_REDIRECT_307); } @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_PUT_307(Scenario scenario) throws Exception + public void testPUT307(Scenario scenario) throws Exception { testSameMethodRedirect(scenario, HttpMethod.PUT, HttpStatus.TEMPORARY_REDIRECT_307); } diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientTest.java index 5af6ddda7678..b082a9753c97 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientTest.java @@ -112,6 +112,7 @@ @ExtendWith(WorkDirExtension.class) public class HttpClientTest extends AbstractHttpClientServerTest { + // @checkstyle-disable-check : AvoidEscapedUnicodeCharactersCheck public WorkDir testdir; @ParameterizedTest @@ -151,7 +152,7 @@ public void testStoppingClosesConnections(Scenario scenario) throws Exception @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_DestinationCount(Scenario scenario) throws Exception + public void testDestinationCount(Scenario scenario) throws Exception { start(scenario, new EmptyServerHandler()); @@ -171,7 +172,7 @@ public void test_DestinationCount(Scenario scenario) throws Exception @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_GET_ResponseWithoutContent(Scenario scenario) throws Exception + public void testGETResponseWithoutContent(Scenario scenario) throws Exception { start(scenario, new EmptyServerHandler()); @@ -183,7 +184,7 @@ public void test_GET_ResponseWithoutContent(Scenario scenario) throws Exception @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_GET_ResponseWithContent(Scenario scenario) throws Exception + public void testGETResponseWithContent(Scenario scenario) throws Exception { final byte[] data = new byte[]{0, 1, 2, 3, 4, 5, 6, 7}; start(scenario, new AbstractHandler() @@ -207,7 +208,7 @@ public void handle(String target, org.eclipse.jetty.server.Request baseRequest, @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_GET_WithParameters_ResponseWithContent(Scenario scenario) throws Exception + public void testGETWithParametersResponseWithContent(Scenario scenario) throws Exception { final String paramName1 = "a"; final String paramName2 = "b"; @@ -240,7 +241,7 @@ public void handle(String target, org.eclipse.jetty.server.Request baseRequest, @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_GET_WithParametersMultiValued_ResponseWithContent(Scenario scenario) throws Exception + public void testGETWithParametersMultiValuedResponseWithContent(Scenario scenario) throws Exception { final String paramName1 = "a"; final String paramName2 = "b"; @@ -279,7 +280,7 @@ public void handle(String target, org.eclipse.jetty.server.Request baseRequest, @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_POST_WithParameters(Scenario scenario) throws Exception + public void testPOSTWithParameters(Scenario scenario) throws Exception { final String paramName = "a"; final String paramValue = "\u20AC"; @@ -311,7 +312,7 @@ public void handle(String target, org.eclipse.jetty.server.Request baseRequest, @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_PUT_WithParameters(Scenario scenario) throws Exception + public void testPUTWithParameters(Scenario scenario) throws Exception { final String paramName = "a"; final String paramValue = "\u20AC"; @@ -345,7 +346,7 @@ public void handle(String target, org.eclipse.jetty.server.Request baseRequest, @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_POST_WithParameters_WithContent(Scenario scenario) throws Exception + public void testPOSTWithParametersWithContent(Scenario scenario) throws Exception { final byte[] content = {0, 1, 2, 3}; final String paramName = "a"; @@ -380,7 +381,7 @@ public void handle(String target, org.eclipse.jetty.server.Request baseRequest, @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_POST_WithContent_NotifiesRequestContentListener(Scenario scenario) throws Exception + public void testPOSTWithContentNotifiesRequestContentListener(Scenario scenario) throws Exception { start(scenario, new AbstractHandler() { @@ -411,7 +412,7 @@ public void handle(String target, org.eclipse.jetty.server.Request baseRequest, @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_POST_WithContent_TracksProgress(Scenario scenario) throws Exception + public void testPOSTWithContentTracksProgress(Scenario scenario) throws Exception { start(scenario, new AbstractHandler() { @@ -445,7 +446,7 @@ public void handle(String target, org.eclipse.jetty.server.Request baseRequest, @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_QueuedRequest_IsSent_WhenPreviousRequestSucceeded(Scenario scenario) throws Exception + public void testQueuedRequestIsSentWhenPreviousRequestSucceeded(Scenario scenario) throws Exception { start(scenario, new EmptyServerHandler()); @@ -494,7 +495,7 @@ public void onSuccess(Response response) @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_QueuedRequest_IsSent_WhenPreviousRequestClosedConnection(Scenario scenario) throws Exception + public void testQueuedRequestIsSentWhenPreviousRequestClosedConnection(Scenario scenario) throws Exception { start(scenario, new AbstractHandler() { @@ -510,7 +511,7 @@ public void handle(String target, org.eclipse.jetty.server.Request baseRequest, client.setMaxConnectionsPerDestination(1); - try (StacklessLogging stackless = new StacklessLogging(org.eclipse.jetty.server.HttpChannel.class)) + try (StacklessLogging ignored = new StacklessLogging(org.eclipse.jetty.server.HttpChannel.class)) { final CountDownLatch latch = new CountDownLatch(2); client.newRequest("localhost", connector.getLocalPort()) @@ -535,7 +536,7 @@ public void handle(String target, org.eclipse.jetty.server.Request baseRequest, @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_ExchangeIsComplete_OnlyWhenBothRequestAndResponseAreComplete(Scenario scenario) throws Exception + public void testExchangeIsCompleteOnlyWhenBothRequestAndResponseAreComplete(Scenario scenario) throws Exception { start(scenario, new AbstractHandler() { @@ -614,7 +615,7 @@ public void onComplete(Result result) @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_ExchangeIsComplete_WhenRequestFailsMidway_WithResponse(Scenario scenario) throws Exception + public void testExchangeIsCompleteWhenRequestFailsMidwayWithResponse(Scenario scenario) throws Exception { start(scenario, new AbstractHandler() { @@ -677,7 +678,7 @@ public void onComplete(Result result) @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_ExchangeIsComplete_WhenRequestFails_WithNoResponse(Scenario scenario) throws Exception + public void testExchangeIsCompleteWhenRequestFailsWithNoResponse(Scenario scenario) throws Exception { start(scenario, new EmptyServerHandler()); @@ -707,7 +708,7 @@ public void onComplete(Result result) @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) @DisabledIfSystemProperty(named = "env", matches = "ci") // TODO: SLOW, needs review - public void test_Request_IdleTimeout(Scenario scenario) throws Exception + public void testRequestIdleTimeout(Scenario scenario) throws Exception { final long idleTimeout = 1000; start(scenario, new AbstractHandler() @@ -824,7 +825,7 @@ public void onComplete(Result result) @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_HEAD_With_ResponseContentLength(Scenario scenario) throws Exception + public void testHEADWithResponseContentLength(Scenario scenario) throws Exception { final int length = 1024; start(scenario, new AbstractHandler() @@ -1328,7 +1329,7 @@ public void testLongPollIsAbortedWhenClientIsStopped(Scenario scenario) throws E start(scenario, new AbstractHandler() { @Override - public void handle(String target, org.eclipse.jetty.server.Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException + public void handle(String target, org.eclipse.jetty.server.Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws ServletException { baseRequest.setHandled(true); request.startAsync(); @@ -1355,7 +1356,7 @@ public void handle(String target, org.eclipse.jetty.server.Request baseRequest, @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void testSmallContentDelimitedByEOFWithSlowRequestHTTP10(Scenario scenario) throws Exception + public void testSmallContentDelimitedByEOFWithSlowRequestHTTP10(Scenario scenario) { Assumptions.assumeTrue(HttpScheme.HTTP.is(scenario.getScheme())); @@ -1370,7 +1371,7 @@ public void testSmallContentDelimitedByEOFWithSlowRequestHTTP10(Scenario scenari @ParameterizedTest @ArgumentsSource(NonSslScenarioProvider.class) - public void testBigContentDelimitedByEOFWithSlowRequestHTTP10(Scenario scenario) throws Exception + public void testBigContentDelimitedByEOFWithSlowRequestHTTP10(Scenario scenario) { ExecutionException e = assertThrows(ExecutionException.class, () -> { @@ -1409,7 +1410,7 @@ private void testContentDelimitedByEOFWithSlowRequest(final Scenario scenario, f start(scenario, new AbstractHandler() { @Override - public void handle(String target, org.eclipse.jetty.server.Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException + public void handle(String target, org.eclipse.jetty.server.Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException { baseRequest.setHandled(true); // Send Connection: close to avoid that the server chunks the content with HTTP 1.1. @@ -1445,7 +1446,7 @@ public void testRequestRetries(Scenario scenario) throws Exception start(scenario, new AbstractHandler() { @Override - public void handle(String target, org.eclipse.jetty.server.Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException + public void handle(String target, org.eclipse.jetty.server.Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException { int count = requests.incrementAndGet(); if (count == maxRetries) @@ -1474,7 +1475,7 @@ public void testCompleteNotInvokedUntilContentConsumed(Scenario scenario) throws start(scenario, new AbstractHandler() { @Override - public void handle(String target, org.eclipse.jetty.server.Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException + public void handle(String target, org.eclipse.jetty.server.Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException { baseRequest.setHandled(true); ServletOutputStream output = response.getOutputStream(); @@ -1524,7 +1525,7 @@ public void testRequestSentOnlyAfterConnectionOpen(Scenario scenario) throws Exc startServer(scenario, new AbstractHandler() { @Override - public void handle(String target, org.eclipse.jetty.server.Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException + public void handle(String target, org.eclipse.jetty.server.Request baseRequest, HttpServletRequest request, HttpServletResponse response) { baseRequest.setHandled(true); } @@ -1628,13 +1629,13 @@ public void testCONNECTWithHTTP10(Scenario scenario) throws Exception @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_IPv6_Host(Scenario scenario) throws Exception + public void testIPv6Host(Scenario scenario) throws Exception { Assumptions.assumeTrue(Net.isIpv6InterfaceAvailable()); start(scenario, new AbstractHandler() { @Override - public void handle(String target, org.eclipse.jetty.server.Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException + public void handle(String target, org.eclipse.jetty.server.Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException { baseRequest.setHandled(true); response.setContentType("text/plain"); @@ -1709,7 +1710,7 @@ public void testHostWithHTTP10(Scenario scenario) throws Exception start(scenario, new AbstractHandler() { @Override - public void handle(String target, org.eclipse.jetty.server.Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException + public void handle(String target, org.eclipse.jetty.server.Request baseRequest, HttpServletRequest request, HttpServletResponse response) { baseRequest.setHandled(true); assertThat(request.getHeader("Host"), Matchers.notNullValue()); diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientURITest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientURITest.java index 4dfca1528c7a..d17dd37d66b7 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientURITest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientURITest.java @@ -59,6 +59,7 @@ public class HttpClientURITest extends AbstractHttpClientServerTest { + // @checkstyle-disable-check : AvoidEscapedUnicodeCharactersCheck @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) public void testIPv6Host(Scenario scenario) throws Exception diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpConnectionLifecycleTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpConnectionLifecycleTest.java index b056bd8c6716..fcad29b9b032 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpConnectionLifecycleTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpConnectionLifecycleTest.java @@ -18,14 +18,12 @@ package org.eclipse.jetty.client; -import java.io.IOException; import java.nio.ByteBuffer; import java.util.Arrays; import java.util.Collection; import java.util.Queue; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -62,7 +60,7 @@ public HttpClient newHttpClient(Scenario scenario, HttpClientTransport transport @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_SuccessfulRequest_ReturnsConnection(Scenario scenario) throws Exception + public void testSuccessfulRequestReturnsConnection(Scenario scenario) throws Exception { start(scenario, new EmptyServerHandler()); @@ -113,7 +111,7 @@ public void onComplete(Result result) @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_FailedRequest_RemovesConnection(Scenario scenario) throws Exception + public void testFailedRequestRemovesConnection(Scenario scenario) throws Exception { start(scenario, new EmptyServerHandler()); @@ -165,7 +163,7 @@ public void onComplete(Result result) @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_BadRequest_RemovesConnection(Scenario scenario) throws Exception + public void testBadRequestRemovesConnection(Scenario scenario) throws Exception { start(scenario, new EmptyServerHandler()); @@ -227,7 +225,7 @@ public void onComplete(Result result) @ArgumentsSource(ScenarioProvider.class) @Tag("Slow") @DisabledIfSystemProperty(named = "env", matches = "ci") // TODO: SLOW, needs review - public void test_BadRequest_WithSlowRequest_RemovesConnection(Scenario scenario) throws Exception + public void testBadRequestWithSlowRequestRemovesConnection(Scenario scenario) throws Exception { start(scenario, new EmptyServerHandler()); @@ -301,7 +299,7 @@ public void onComplete(Result result) @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_ConnectionFailure_RemovesConnection(Scenario scenario) throws Exception + public void testConnectionFailureRemovesConnection(Scenario scenario) throws Exception { start(scenario, new EmptyServerHandler()); @@ -336,12 +334,12 @@ public void test_ConnectionFailure_RemovesConnection(Scenario scenario) throws E @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_ResponseWithConnectionCloseHeader_RemovesConnection(Scenario scenario) throws Exception + public void testResponseWithConnectionCloseHeaderRemovesConnection(Scenario scenario) throws Exception { start(scenario, new AbstractHandler() { @Override - public void handle(String target, org.eclipse.jetty.server.Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException + public void handle(String target, org.eclipse.jetty.server.Request baseRequest, HttpServletRequest request, HttpServletResponse response) { response.setHeader("Connection", "close"); baseRequest.setHandled(true); @@ -382,14 +380,14 @@ public void onComplete(Result result) @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_BigRequestContent_ResponseWithConnectionCloseHeader_RemovesConnection(Scenario scenario) throws Exception + public void testBigRequestContentResponseWithConnectionCloseHeaderRemovesConnection(Scenario scenario) throws Exception { try (StacklessLogging ignore = new StacklessLogging(HttpConnection.class)) { start(scenario, new AbstractHandler() { @Override - public void handle(String target, org.eclipse.jetty.server.Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException + public void handle(String target, org.eclipse.jetty.server.Request baseRequest, HttpServletRequest request, HttpServletResponse response) { response.setHeader("Connection", "close"); baseRequest.setHandled(true); @@ -441,7 +439,7 @@ public void onComplete(Result result) @ArgumentsSource(ScenarioProvider.class) @Tag("Slow") @DisabledIfSystemProperty(named = "env", matches = "ci") // TODO: SLOW, needs review - public void test_IdleConnection_IsClosed_OnRemoteClose(Scenario scenario) throws Exception + public void testIdleConnectionIsClosedOnRemoteClose(Scenario scenario) throws Exception { start(scenario, new EmptyServerHandler()); diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpCookieTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpCookieTest.java index f03c235e4394..3da1b55c4465 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpCookieTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpCookieTest.java @@ -18,7 +18,6 @@ package org.eclipse.jetty.client; -import java.io.IOException; import java.net.HttpCookie; import java.net.URI; import java.util.Arrays; @@ -27,7 +26,6 @@ import java.util.Optional; import java.util.Set; import java.util.concurrent.TimeUnit; -import javax.servlet.ServletException; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -52,14 +50,14 @@ public class HttpCookieTest extends AbstractHttpClientServerTest @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_CookieIsStored(Scenario scenario) throws Exception + public void testCookieIsStored(Scenario scenario) throws Exception { final String name = "foo"; final String value = "bar"; start(scenario, new EmptyServerHandler() { @Override - protected void service(String target, Request jettyRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException + protected void service(String target, Request jettyRequest, HttpServletRequest request, HttpServletResponse response) { response.addCookie(new Cookie(name, value)); } @@ -82,14 +80,14 @@ protected void service(String target, Request jettyRequest, HttpServletRequest r @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_CookieIsSent(Scenario scenario) throws Exception + public void testCookieIsSent(Scenario scenario) throws Exception { final String name = "foo"; final String value = "bar"; start(scenario, new EmptyServerHandler() { @Override - protected void service(String target, Request jettyRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException + protected void service(String target, Request jettyRequest, HttpServletRequest request, HttpServletResponse response) { Cookie[] cookies = request.getCookies(); assertNotNull(cookies); @@ -113,12 +111,12 @@ protected void service(String target, Request jettyRequest, HttpServletRequest r @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_CookieWithoutValue(Scenario scenario) throws Exception + public void testCookieWithoutValue(Scenario scenario) throws Exception { start(scenario, new EmptyServerHandler() { @Override - protected void service(String target, Request jettyRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException + protected void service(String target, Request jettyRequest, HttpServletRequest request, HttpServletResponse response) { response.addHeader("Set-Cookie", ""); } @@ -133,14 +131,14 @@ protected void service(String target, Request jettyRequest, HttpServletRequest r @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_PerRequestCookieIsSent(Scenario scenario) throws Exception + public void testPerRequestCookieIsSent(Scenario scenario) throws Exception { final String name = "foo"; final String value = "bar"; start(scenario, new EmptyServerHandler() { @Override - protected void service(String target, Request jettyRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException + protected void service(String target, Request jettyRequest, HttpServletRequest request, HttpServletResponse response) { Cookie[] cookies = request.getCookies(); assertNotNull(cookies); @@ -161,7 +159,7 @@ protected void service(String target, Request jettyRequest, HttpServletRequest r @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_SetCookieWithoutPath_RequestURIWithOneSegment(Scenario scenario) throws Exception + public void testSetCookieWithoutPathRequestURIWithOneSegment(Scenario scenario) throws Exception { String headerName = "X-Request"; String cookieName = "a"; @@ -169,7 +167,7 @@ public void test_SetCookieWithoutPath_RequestURIWithOneSegment(Scenario scenario start(scenario, new EmptyServerHandler() { @Override - protected void service(String target, Request jettyRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException + protected void service(String target, Request jettyRequest, HttpServletRequest request, HttpServletResponse response) { int r = request.getIntHeader(headerName); if ("/foo".equals(target) && r == 0) @@ -217,7 +215,7 @@ protected void service(String target, Request jettyRequest, HttpServletRequest r @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_SetCookieWithoutPath_RequestURIWithTwoSegments(Scenario scenario) throws Exception + public void testSetCookieWithoutPathRequestURIWithTwoSegments(Scenario scenario) throws Exception { String headerName = "X-Request"; String cookieName = "a"; @@ -225,7 +223,7 @@ public void test_SetCookieWithoutPath_RequestURIWithTwoSegments(Scenario scenari start(scenario, new EmptyServerHandler() { @Override - protected void service(String target, Request jettyRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException + protected void service(String target, Request jettyRequest, HttpServletRequest request, HttpServletResponse response) { int r = request.getIntHeader(headerName); if ("/foo/bar".equals(target) && r == 0) @@ -278,7 +276,7 @@ protected void service(String target, Request jettyRequest, HttpServletRequest r @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_SetCookieWithLongerPath(Scenario scenario) throws Exception + public void testSetCookieWithLongerPath(Scenario scenario) throws Exception { String headerName = "X-Request"; String cookieName = "a"; @@ -286,7 +284,7 @@ public void test_SetCookieWithLongerPath(Scenario scenario) throws Exception start(scenario, new EmptyServerHandler() { @Override - protected void service(String target, Request jettyRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException + protected void service(String target, Request jettyRequest, HttpServletRequest request, HttpServletResponse response) { int r = request.getIntHeader(headerName); if ("/foo".equals(target) && r == 0) @@ -339,7 +337,7 @@ protected void service(String target, Request jettyRequest, HttpServletRequest r @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_SetCookieWithShorterPath(Scenario scenario) throws Exception + public void testSetCookieWithShorterPath(Scenario scenario) throws Exception { String headerName = "X-Request"; String cookieName = "a"; @@ -347,7 +345,7 @@ public void test_SetCookieWithShorterPath(Scenario scenario) throws Exception start(scenario, new EmptyServerHandler() { @Override - protected void service(String target, Request jettyRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException + protected void service(String target, Request jettyRequest, HttpServletRequest request, HttpServletResponse response) { int r = request.getIntHeader(headerName); if ("/foo/bar".equals(target) && r == 0) @@ -400,7 +398,7 @@ protected void service(String target, Request jettyRequest, HttpServletRequest r @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_TwoSetCookieWithSameNameSamePath(Scenario scenario) throws Exception + public void testTwoSetCookieWithSameNameSamePath(Scenario scenario) throws Exception { String headerName = "X-Request"; String cookieName = "a"; @@ -409,7 +407,7 @@ public void test_TwoSetCookieWithSameNameSamePath(Scenario scenario) throws Exce start(scenario, new EmptyServerHandler() { @Override - protected void service(String target, Request jettyRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException + protected void service(String target, Request jettyRequest, HttpServletRequest request, HttpServletResponse response) { int r = request.getIntHeader(headerName); if ("/foo".equals(target) && r == 0) @@ -463,7 +461,7 @@ protected void service(String target, Request jettyRequest, HttpServletRequest r @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_TwoSetCookieWithSameNameDifferentPath(Scenario scenario) throws Exception + public void testTwoSetCookieWithSameNameDifferentPath(Scenario scenario) throws Exception { String headerName = "X-Request"; String cookieName = "a"; @@ -472,7 +470,7 @@ public void test_TwoSetCookieWithSameNameDifferentPath(Scenario scenario) throws start(scenario, new EmptyServerHandler() { @Override - protected void service(String target, Request jettyRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException + protected void service(String target, Request jettyRequest, HttpServletRequest request, HttpServletResponse response) { int r = request.getIntHeader(headerName); if ("/foo".equals(target) && r == 0) @@ -533,7 +531,7 @@ protected void service(String target, Request jettyRequest, HttpServletRequest r @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_TwoSetCookieWithSameNamePath1PrefixOfPath2(Scenario scenario) throws Exception + public void testTwoSetCookieWithSameNamePath1PrefixOfPath2(Scenario scenario) throws Exception { String headerName = "X-Request"; String cookieName = "a"; @@ -542,7 +540,7 @@ public void test_TwoSetCookieWithSameNamePath1PrefixOfPath2(Scenario scenario) t start(scenario, new EmptyServerHandler() { @Override - protected void service(String target, Request jettyRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException + protected void service(String target, Request jettyRequest, HttpServletRequest request, HttpServletResponse response) { int r = request.getIntHeader(headerName); if ("/foo".equals(target) && r == 0) @@ -606,7 +604,7 @@ protected void service(String target, Request jettyRequest, HttpServletRequest r @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_CookiePathWithTrailingSlash(Scenario scenario) throws Exception + public void testCookiePathWithTrailingSlash(Scenario scenario) throws Exception { String headerName = "X-Request"; String cookieName = "a"; @@ -614,7 +612,7 @@ public void test_CookiePathWithTrailingSlash(Scenario scenario) throws Exception start(scenario, new EmptyServerHandler() { @Override - protected void service(String target, Request jettyRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException + protected void service(String target, Request jettyRequest, HttpServletRequest request, HttpServletResponse response) { int r = request.getIntHeader(headerName); if ("/foo/bar".equals(target) && r == 0) diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/api/Usage.java b/jetty-client/src/test/java/org/eclipse/jetty/client/api/Usage.java index b9ecc86c6bbb..9fdb072790ff 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/api/Usage.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/api/Usage.java @@ -49,10 +49,11 @@ import static org.junit.jupiter.api.Assertions.assertTrue; @Disabled +// @checkstyle-disable-check : AvoidEscapedUnicodeCharactersCheck public class Usage { @Test - public void testGETBlocking_ShortAPI() throws Exception + public void testGETBlockingShortAPI() throws Exception { HttpClient client = new HttpClient(); client.start(); @@ -120,7 +121,7 @@ public void onComplete(Result result) } @Test - public void testPOSTWithParams_ShortAPI() throws Exception + public void testPOSTWithParamsShortAPI() throws Exception { HttpClient client = new HttpClient(); client.start(); diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/http/HttpDestinationOverHTTPTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/http/HttpDestinationOverHTTPTest.java index f09569174eb1..2b45c3ea8a14 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/http/HttpDestinationOverHTTPTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/http/HttpDestinationOverHTTPTest.java @@ -52,7 +52,7 @@ public class HttpDestinationOverHTTPTest extends AbstractHttpClientServerTest { @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_FirstAcquire_WithEmptyQueue(Scenario scenario) throws Exception + public void testFirstAcquireWithEmptyQueue(Scenario scenario) throws Exception { start(scenario, new EmptyServerHandler()); @@ -72,7 +72,7 @@ public void test_FirstAcquire_WithEmptyQueue(Scenario scenario) throws Exception @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_SecondAcquire_AfterFirstAcquire_WithEmptyQueue_ReturnsSameConnection(Scenario scenario) throws Exception + public void testSecondAcquireAfterFirstAcquireWithEmptyQueueReturnsSameConnection(Scenario scenario) throws Exception { start(scenario, new EmptyServerHandler()); @@ -96,7 +96,7 @@ public void test_SecondAcquire_AfterFirstAcquire_WithEmptyQueue_ReturnsSameConne @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_SecondAcquire_ConcurrentWithFirstAcquire_WithEmptyQueue_CreatesTwoConnections(Scenario scenario) throws Exception + public void testSecondAcquireConcurrentWithFirstAcquireWithEmptyQueueCreatesTwoConnections(Scenario scenario) throws Exception { start(scenario, new EmptyServerHandler()); @@ -154,7 +154,7 @@ protected void onCreated(Connection connection) @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_Acquire_Process_Release_Acquire_ReturnsSameConnection(Scenario scenario) throws Exception + public void testAcquireProcessReleaseAcquireReturnsSameConnection(Scenario scenario) throws Exception { start(scenario, new EmptyServerHandler()); @@ -181,7 +181,7 @@ public void test_Acquire_Process_Release_Acquire_ReturnsSameConnection(Scenario @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_IdleConnection_IdleTimeout(Scenario scenario) throws Exception + public void testIdleConnectionIdleTimeout(Scenario scenario) throws Exception { start(scenario, new EmptyServerHandler()); @@ -209,7 +209,7 @@ public void test_IdleConnection_IdleTimeout(Scenario scenario) throws Exception @ParameterizedTest @ArgumentsSource(ScenarioProvider.class) - public void test_Request_Failed_If_MaxRequestsQueuedPerDestination_Exceeded(Scenario scenario) throws Exception + public void testRequestFailedIfMaxRequestsQueuedPerDestinationExceeded(Scenario scenario) throws Exception { start(scenario, new EmptyServerHandler()); String scheme = scenario.getScheme(); diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/http/HttpReceiverOverHTTPTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/http/HttpReceiverOverHTTPTest.java index bc8f60efa0ef..578a2e4afe52 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/http/HttpReceiverOverHTTPTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/http/HttpReceiverOverHTTPTest.java @@ -61,7 +61,7 @@ public class HttpReceiverOverHTTPTest private ByteArrayEndPoint endPoint; private HttpConnectionOverHTTP connection; - public static Stream complianceModes() throws Exception + public static Stream complianceModes() { return Stream.of( HttpCompliance.LEGACY, @@ -102,7 +102,7 @@ protected HttpExchange newExchange() @ParameterizedTest @MethodSource("complianceModes") - public void test_Receive_NoResponseContent(HttpCompliance compliance) throws Exception + public void testReceiveNoResponseContent(HttpCompliance compliance) throws Exception { init(compliance); endPoint.addInput( @@ -126,7 +126,7 @@ public void test_Receive_NoResponseContent(HttpCompliance compliance) throws Exc @ParameterizedTest @MethodSource("complianceModes") - public void test_Receive_ResponseContent(HttpCompliance compliance) throws Exception + public void testReceiveResponseContent(HttpCompliance compliance) throws Exception { init(compliance); String content = "0123456789ABCDEF"; @@ -154,7 +154,7 @@ public void test_Receive_ResponseContent(HttpCompliance compliance) throws Excep @ParameterizedTest @MethodSource("complianceModes") - public void test_Receive_ResponseContent_EarlyEOF(HttpCompliance compliance) throws Exception + public void testReceiveResponseContentEarlyEOF(HttpCompliance compliance) throws Exception { init(compliance); String content1 = "0123456789"; @@ -176,7 +176,7 @@ public void test_Receive_ResponseContent_EarlyEOF(HttpCompliance compliance) thr @ParameterizedTest @MethodSource("complianceModes") - public void test_Receive_ResponseContent_IdleTimeout(HttpCompliance compliance) throws Exception + public void testReceiveResponseContentIdleTimeout(HttpCompliance compliance) throws Exception { init(compliance); endPoint.addInput( @@ -197,7 +197,7 @@ public void test_Receive_ResponseContent_IdleTimeout(HttpCompliance compliance) @ParameterizedTest @MethodSource("complianceModes") - public void test_Receive_BadResponse(HttpCompliance compliance) throws Exception + public void testReceiveBadResponse(HttpCompliance compliance) throws Exception { init(compliance); endPoint.addInput( @@ -216,7 +216,7 @@ public void test_Receive_BadResponse(HttpCompliance compliance) throws Exception @ParameterizedTest @MethodSource("complianceModes") - public void test_FillInterested_RacingWith_BufferRelease(HttpCompliance compliance) throws Exception + public void testFillInterestedRacingWithBufferRelease(HttpCompliance compliance) throws Exception { init(compliance); connection = new HttpConnectionOverHTTP(endPoint, destination, new Promise.Adapter<>()) diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/http/HttpSenderOverHTTPTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/http/HttpSenderOverHTTPTest.java index 0c8b642f432a..7cb7795af387 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/http/HttpSenderOverHTTPTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/http/HttpSenderOverHTTPTest.java @@ -61,7 +61,7 @@ public void destroy() throws Exception } @Test - public void test_Send_NoRequestContent() throws Exception + public void testSendNoRequestContent() throws Exception { ByteArrayEndPoint endPoint = new ByteArrayEndPoint(); HttpDestinationOverHTTP destination = new HttpDestinationOverHTTP(client, new Origin("http", "localhost", 8080)); @@ -95,7 +95,7 @@ public void onSuccess(Request request) @Test @DisabledIfSystemProperty(named = "env", matches = "ci") // TODO: SLOW, needs review - public void test_Send_NoRequestContent_IncompleteFlush() throws Exception + public void testSendNoRequestContentIncompleteFlush() throws Exception { ByteArrayEndPoint endPoint = new ByteArrayEndPoint("", 16); HttpDestinationOverHTTP destination = new HttpDestinationOverHTTP(client, new Origin("http", "localhost", 8080)); @@ -123,7 +123,7 @@ public void test_Send_NoRequestContent_IncompleteFlush() throws Exception } @Test - public void test_Send_NoRequestContent_Exception() throws Exception + public void testSendNoRequestContentException() throws Exception { ByteArrayEndPoint endPoint = new ByteArrayEndPoint(); // Shutdown output to trigger the exception on write @@ -155,7 +155,7 @@ public void onComplete(Result result) } @Test - public void test_Send_NoRequestContent_IncompleteFlush_Exception() throws Exception + public void testSendNoRequestContentIncompleteFlushException() throws Exception { ByteArrayEndPoint endPoint = new ByteArrayEndPoint("", 16); HttpDestinationOverHTTP destination = new HttpDestinationOverHTTP(client, new Origin("http", "localhost", 8080)); @@ -191,7 +191,7 @@ public void onComplete(Result result) } @Test - public void test_Send_SmallRequestContent_InOneBuffer() throws Exception + public void testSendSmallRequestContentInOneBuffer() throws Exception { ByteArrayEndPoint endPoint = new ByteArrayEndPoint(); HttpDestinationOverHTTP destination = new HttpDestinationOverHTTP(client, new Origin("http", "localhost", 8080)); @@ -226,7 +226,7 @@ public void onSuccess(Request request) } @Test - public void test_Send_SmallRequestContent_InTwoBuffers() throws Exception + public void testSendSmallRequestContentInTwoBuffers() throws Exception { ByteArrayEndPoint endPoint = new ByteArrayEndPoint(); HttpDestinationOverHTTP destination = new HttpDestinationOverHTTP(client, new Origin("http", "localhost", 8080)); @@ -262,7 +262,7 @@ public void onSuccess(Request request) } @Test - public void test_Send_SmallRequestContent_Chunked_InTwoChunks() throws Exception + public void testSendSmallRequestContentChunkedInTwoChunks() throws Exception { ByteArrayEndPoint endPoint = new ByteArrayEndPoint(); HttpDestinationOverHTTP destination = new HttpDestinationOverHTTP(client, new Origin("http", "localhost", 8080)); diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/util/MultiPartContentProviderTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/util/MultiPartContentProviderTest.java index 4e44d72480ae..98f91a7a5ab8 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/util/MultiPartContentProviderTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/util/MultiPartContentProviderTest.java @@ -62,6 +62,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; +// @checkstyle-disable-check : AvoidEscapedUnicodeCharactersCheck public class MultiPartContentProviderTest extends AbstractHttpClientServerTest { @ParameterizedTest diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/util/TypedContentProviderTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/util/TypedContentProviderTest.java index 260a47d67b27..df0747187470 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/util/TypedContentProviderTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/util/TypedContentProviderTest.java @@ -51,6 +51,7 @@ public void testFormContentProvider(Scenario scenario) throws Exception final String value1 = "1"; final String name2 = "b"; final String value2 = "2"; + // @checkstyle-disable-check : AvoidEscapedUnicodeCharactersCheck final String value3 = "\u20AC"; start(scenario, new AbstractHandler() diff --git a/jetty-deploy/src/test/java/org/eclipse/jetty/deploy/AppLifeCycleTest.java b/jetty-deploy/src/test/java/org/eclipse/jetty/deploy/AppLifeCycleTest.java index f5be8f6ee970..452c0c510163 100644 --- a/jetty-deploy/src/test/java/org/eclipse/jetty/deploy/AppLifeCycleTest.java +++ b/jetty-deploy/src/test/java/org/eclipse/jetty/deploy/AppLifeCycleTest.java @@ -86,13 +86,13 @@ private void assertPath(String from, String to, List expected) } @Test - public void testFindPath_Deployed_Deployed() + public void testFindPathDeployedDeployed() { assertNoPath("deployed", "deployed"); } @Test - public void testFindPath_Deployed_Started() + public void testFindPathDeployedStarted() { List expected = new ArrayList(); expected.add("deployed"); @@ -102,7 +102,7 @@ public void testFindPath_Deployed_Started() } @Test - public void testFindPath_Deployed_Undeployed() + public void testFindPathDeployedUndeployed() { List expected = new ArrayList(); expected.add("deployed"); @@ -112,7 +112,7 @@ public void testFindPath_Deployed_Undeployed() } @Test - public void testFindPath_Started_Deployed() + public void testFindPathStartedDeployed() { List expected = new ArrayList(); expected.add("started"); @@ -122,13 +122,13 @@ public void testFindPath_Started_Deployed() } @Test - public void testFindPath_Started_Started() + public void testFindPathStartedStarted() { assertNoPath("started", "started"); } @Test - public void testFindPath_Started_Undeployed() + public void testFindPathStartedUndeployed() { List expected = new ArrayList(); expected.add("started"); @@ -140,7 +140,7 @@ public void testFindPath_Started_Undeployed() } @Test - public void testFindPath_Undeployed_Deployed() + public void testFindPathUndeployedDeployed() { List expected = new ArrayList(); expected.add("undeployed"); @@ -150,7 +150,7 @@ public void testFindPath_Undeployed_Deployed() } @Test - public void testFindPath_Undeployed_Started() + public void testFindPathUndeployedStarted() { List expected = new ArrayList(); expected.add("undeployed"); @@ -162,7 +162,7 @@ public void testFindPath_Undeployed_Started() } @Test - public void testFindPath_Undeployed_Uavailable() + public void testFindPathUndeployedUnavailable() { assertNoPath("undeployed", "undeployed"); } diff --git a/jetty-deploy/src/test/java/org/eclipse/jetty/deploy/BadAppDeployTest.java b/jetty-deploy/src/test/java/org/eclipse/jetty/deploy/BadAppDeployTest.java index 06bb0d2a505f..ef0df63f0271 100644 --- a/jetty-deploy/src/test/java/org/eclipse/jetty/deploy/BadAppDeployTest.java +++ b/jetty-deploy/src/test/java/org/eclipse/jetty/deploy/BadAppDeployTest.java @@ -63,7 +63,7 @@ public void stopServer() throws Exception } @Test - public void testBadApp_ThrowOnUnavailableTrue_XmlOrder() throws Exception + public void testBadAppThrowOnUnavailableTrueXmlOrder() throws Exception { /* Non-working Bean Order as reported in Issue #3620 It is important that this Order be maintained for an accurate test case. @@ -116,7 +116,7 @@ public void testBadApp_ThrowOnUnavailableTrue_XmlOrder() throws Exception } @Test - public void testBadApp_ThrowOnUnavailableTrue_EmbeddedOrder() throws Exception + public void testBadAppThrowOnUnavailableTrueEmbeddedOrder() throws Exception { /* Working Bean Order ### BEAN: QueuedThreadPool[qtp1530388690]@5b37e0d2{STOPPED,8<=0<=200,i=0,r=-1,q=0}[NO_TRY] diff --git a/jetty-deploy/src/test/java/org/eclipse/jetty/deploy/DeploymentManagerLifeCyclePathTest.java b/jetty-deploy/src/test/java/org/eclipse/jetty/deploy/DeploymentManagerLifeCyclePathTest.java index 33ee00fc6096..2d15ead35824 100644 --- a/jetty-deploy/src/test/java/org/eclipse/jetty/deploy/DeploymentManagerLifeCyclePathTest.java +++ b/jetty-deploy/src/test/java/org/eclipse/jetty/deploy/DeploymentManagerLifeCyclePathTest.java @@ -31,7 +31,7 @@ public class DeploymentManagerLifeCyclePathTest { @Test - public void testStateTransition_NewToDeployed() throws Exception + public void testStateTransitionNewToDeployed() throws Exception { DeploymentManager depman = new DeploymentManager(); depman.setContexts(new ContextHandlerCollection()); @@ -64,7 +64,7 @@ public void testStateTransition_NewToDeployed() throws Exception } @Test - public void testStateTransition_Receive() throws Exception + public void testStateTransitionReceive() throws Exception { DeploymentManager depman = new DeploymentManager(); depman.setContexts(new ContextHandlerCollection()); @@ -90,7 +90,7 @@ public void testStateTransition_Receive() throws Exception } @Test - public void testStateTransition_DeployedToUndeployed() throws Exception + public void testStateTransitionDeployedToUndeployed() throws Exception { DeploymentManager depman = new DeploymentManager(); depman.setDefaultLifeCycleGoal(null); // no default diff --git a/jetty-fcgi/fcgi-server/src/test/java/org/eclipse/jetty/fcgi/server/HttpClientTest.java b/jetty-fcgi/fcgi-server/src/test/java/org/eclipse/jetty/fcgi/server/HttpClientTest.java index e1720bdf2a5c..79e7859148f3 100644 --- a/jetty-fcgi/fcgi-server/src/test/java/org/eclipse/jetty/fcgi/server/HttpClientTest.java +++ b/jetty-fcgi/fcgi-server/src/test/java/org/eclipse/jetty/fcgi/server/HttpClientTest.java @@ -65,6 +65,8 @@ public class HttpClientTest extends AbstractHttpClientServerTest { + // @checkstyle-disable-check : AvoidEscapedUnicodeCharactersCheck + @Test public void testGETResponseWithoutContent() throws Exception { diff --git a/jetty-fcgi/fcgi-server/src/test/java/org/eclipse/jetty/fcgi/server/proxy/DrupalHTTP2FastCGIProxyServer.java b/jetty-fcgi/fcgi-server/src/test/java/org/eclipse/jetty/fcgi/server/proxy/DrupalHTTP2FastCGIProxyServer.java index e3c22bedceba..f17665192ccf 100644 --- a/jetty-fcgi/fcgi-server/src/test/java/org/eclipse/jetty/fcgi/server/proxy/DrupalHTTP2FastCGIProxyServer.java +++ b/jetty-fcgi/fcgi-server/src/test/java/org/eclipse/jetty/fcgi/server/proxy/DrupalHTTP2FastCGIProxyServer.java @@ -47,11 +47,11 @@ public static void main(String[] args) throws Exception // HTTP(S) Configuration HttpConfiguration config = new HttpConfiguration(); - HttpConfiguration https_config = new HttpConfiguration(config); - https_config.addCustomizer(new SecureRequestCustomizer()); + HttpConfiguration httpsConfig = new HttpConfiguration(config); + httpsConfig.addCustomizer(new SecureRequestCustomizer()); // HTTP2 factory - HTTP2ServerConnectionFactory h2 = new HTTP2ServerConnectionFactory(https_config); + HTTP2ServerConnectionFactory h2 = new HTTP2ServerConnectionFactory(httpsConfig); ALPNServerConnectionFactory alpn = new ALPNServerConnectionFactory(); alpn.setDefaultProtocol(h2.getProtocol()); @@ -60,7 +60,7 @@ public static void main(String[] args) throws Exception // HTTP2 Connector ServerConnector http2Connector = - new ServerConnector(server, ssl, alpn, h2, new HttpConnectionFactory(https_config)); + new ServerConnector(server, ssl, alpn, h2, new HttpConnectionFactory(httpsConfig)); http2Connector.setPort(8443); http2Connector.setIdleTimeout(15000); server.addConnector(http2Connector); diff --git a/jetty-fcgi/fcgi-server/src/test/java/org/eclipse/jetty/fcgi/server/proxy/WordPressHTTP2FastCGIProxyServer.java b/jetty-fcgi/fcgi-server/src/test/java/org/eclipse/jetty/fcgi/server/proxy/WordPressHTTP2FastCGIProxyServer.java index 8b59601b4ef2..238e8d5bd664 100644 --- a/jetty-fcgi/fcgi-server/src/test/java/org/eclipse/jetty/fcgi/server/proxy/WordPressHTTP2FastCGIProxyServer.java +++ b/jetty-fcgi/fcgi-server/src/test/java/org/eclipse/jetty/fcgi/server/proxy/WordPressHTTP2FastCGIProxyServer.java @@ -52,12 +52,12 @@ public static void main(String[] args) throws Exception Server server = new Server(); // HTTP(S) Configuration - HttpConfiguration config = new HttpConfiguration(); - HttpConfiguration https_config = new HttpConfiguration(config); - https_config.addCustomizer(new SecureRequestCustomizer()); + HttpConfiguration httpConfig = new HttpConfiguration(); + HttpConfiguration httpsConfig = new HttpConfiguration(httpConfig); + httpsConfig.addCustomizer(new SecureRequestCustomizer()); // HTTP2 factory - HTTP2ServerConnectionFactory h2 = new HTTP2ServerConnectionFactory(https_config); + HTTP2ServerConnectionFactory h2 = new HTTP2ServerConnectionFactory(httpsConfig); ALPNServerConnectionFactory alpn = new ALPNServerConnectionFactory(); alpn.setDefaultProtocol(h2.getProtocol()); @@ -66,7 +66,7 @@ public static void main(String[] args) throws Exception // HTTP2 Connector ServerConnector http2Connector = - new ServerConnector(server, ssl, alpn, h2, new HttpConnectionFactory(https_config)); + new ServerConnector(server, ssl, alpn, h2, new HttpConnectionFactory(httpsConfig)); http2Connector.setPort(tlsPort); http2Connector.setIdleTimeout(15000); server.addConnector(http2Connector); diff --git a/jetty-http-spi/src/test/java/org/eclipse/jetty/http/spi/TestEndpointMultiplePublishProblem.java b/jetty-http-spi/src/test/java/org/eclipse/jetty/http/spi/TestEndpointMultiplePublishProblem.java index 6acf3de5882f..635991a9ff0c 100644 --- a/jetty-http-spi/src/test/java/org/eclipse/jetty/http/spi/TestEndpointMultiplePublishProblem.java +++ b/jetty-http-spi/src/test/java/org/eclipse/jetty/http/spi/TestEndpointMultiplePublishProblem.java @@ -45,13 +45,13 @@ public class TestEndpointMultiplePublishProblem private static String default_impl = System.getProperty("com.sun.net.httpserver.HttpServerProvider"); @BeforeAll - public static void change_Impl() + public static void changeImpl() { System.setProperty("com.sun.net.httpserver.HttpServerProvider", JettyHttpServerProvider.class.getName()); } @AfterAll - public static void restore_Impl() + public static void restoreImpl() { if (default_impl != null) { diff --git a/jetty-http/src/test/java/org/eclipse/jetty/http/GZIPContentDecoderTest.java b/jetty-http/src/test/java/org/eclipse/jetty/http/GZIPContentDecoderTest.java index 7faa8d19ccab..c28478489e1a 100644 --- a/jetty-http/src/test/java/org/eclipse/jetty/http/GZIPContentDecoderTest.java +++ b/jetty-http/src/test/java/org/eclipse/jetty/http/GZIPContentDecoderTest.java @@ -359,10 +359,10 @@ public void testBigBlockWithExtraBytes() throws Exception } // Signed Integer Max - final long INT_MAX = Integer.MAX_VALUE; + static final long INT_MAX = Integer.MAX_VALUE; // Unsigned Integer Max == 2^32 - final long UINT_MAX = 0xFFFFFFFFL; + static final long UINT_MAX = 0xFFFFFFFFL; @ParameterizedTest @ValueSource(longs = {INT_MAX, INT_MAX + 1, UINT_MAX, UINT_MAX + 1}) diff --git a/jetty-http/src/test/java/org/eclipse/jetty/http/HttpFieldTest.java b/jetty-http/src/test/java/org/eclipse/jetty/http/HttpFieldTest.java index 32d186fbbc2d..ccffa9ca85d9 100644 --- a/jetty-http/src/test/java/org/eclipse/jetty/http/HttpFieldTest.java +++ b/jetty-http/src/test/java/org/eclipse/jetty/http/HttpFieldTest.java @@ -32,9 +32,8 @@ public class HttpFieldTest { - @Test - public void testContainsSimple() throws Exception + public void testContainsSimple() { HttpField field = new HttpField("name", "SomeValue"); assertTrue(field.contains("somevalue")); @@ -50,7 +49,7 @@ public void testContainsSimple() throws Exception } @Test - public void testCaseInsensitiveHashcode_KnownField() throws Exception + public void testCaseInsensitiveHashcodeKnownField() { HttpField fieldFoo1 = new HttpField("Cookie", "foo"); HttpField fieldFoo2 = new HttpField("cookie", "foo"); @@ -59,7 +58,7 @@ public void testCaseInsensitiveHashcode_KnownField() throws Exception } @Test - public void testCaseInsensitiveHashcode_UnknownField() throws Exception + public void testCaseInsensitiveHashcodeUnknownField() { HttpField fieldFoo1 = new HttpField("X-Foo", "bar"); HttpField fieldFoo2 = new HttpField("x-foo", "bar"); @@ -68,7 +67,7 @@ public void testCaseInsensitiveHashcode_UnknownField() throws Exception } @Test - public void testContainsList() throws Exception + public void testContainsList() { HttpField field = new HttpField("name", ",aaa,Bbb,CCC, ddd , e e, \"\\\"f,f\\\"\", "); assertTrue(field.contains("aaa")); @@ -91,7 +90,7 @@ public void testContainsList() throws Exception } @Test - public void testQualityContainsList() throws Exception + public void testQualityContainsList() { HttpField field; diff --git a/jetty-http/src/test/java/org/eclipse/jetty/http/HttpGeneratorServerTest.java b/jetty-http/src/test/java/org/eclipse/jetty/http/HttpGeneratorServerTest.java index 180b945b0d95..5574bcf5b9f0 100644 --- a/jetty-http/src/test/java/org/eclipse/jetty/http/HttpGeneratorServerTest.java +++ b/jetty-http/src/test/java/org/eclipse/jetty/http/HttpGeneratorServerTest.java @@ -36,7 +36,7 @@ public class HttpGeneratorServerTest { @Test - public void test_0_9() throws Exception + public void test09() throws Exception { ByteBuffer header = BufferUtil.allocate(8096); ByteBuffer content = BufferUtil.toBuffer("0123456789"); diff --git a/jetty-http/src/test/java/org/eclipse/jetty/http/HttpParserTest.java b/jetty-http/src/test/java/org/eclipse/jetty/http/HttpParserTest.java index 2f30eeac7c4a..d454d5e49eb8 100644 --- a/jetty-http/src/test/java/org/eclipse/jetty/http/HttpParserTest.java +++ b/jetty-http/src/test/java/org/eclipse/jetty/http/HttpParserTest.java @@ -48,6 +48,8 @@ public class HttpParserTest { + // @checkstyle-disable-check : AvoidEscapedUnicodeCharactersCheck + static { HttpCompliance.CUSTOM0.sections().remove(HttpComplianceSection.NO_WS_AFTER_FIELD_NAME); @@ -72,16 +74,16 @@ public static void parseAll(HttpParser parser, ByteBuffer buffer) int remaining = buffer.remaining(); while (!parser.isState(State.END) && remaining > 0) { - int was_remaining = remaining; + int wasRemaining = remaining; parser.parseNext(buffer); remaining = buffer.remaining(); - if (remaining == was_remaining) + if (remaining == wasRemaining) break; } } @Test - public void HttpMethodTest() + public void httpMethodTest() { assertNull(HttpMethod.lookAheadGet(BufferUtil.toBuffer("Wibble "))); assertNull(HttpMethod.lookAheadGet(BufferUtil.toBuffer("GET"))); @@ -831,8 +833,8 @@ public void testBadHeaderNames() "Foo\"Bar: value\r\n", "Foo/Bar: value\r\n", "Foo]Bar: value\r\n", - "Foo[Bar: value\r\n", - }; + "Foo[Bar: value\r\n" + }; for (String s : bad) { @@ -1558,7 +1560,7 @@ public void testResponse101WithTransferEncoding() } @Test - public void testResponseReasonIso8859_1() + public void testResponseReasonIso88591() { ByteBuffer buffer = BufferUtil.toBuffer( "HTTP/1.1 302 déplacé temporairement\r\n" + diff --git a/jetty-http/src/test/java/org/eclipse/jetty/http/HttpTester.java b/jetty-http/src/test/java/org/eclipse/jetty/http/HttpTester.java index 248ca2f22d10..96a59bc446ba 100644 --- a/jetty-http/src/test/java/org/eclipse/jetty/http/HttpTester.java +++ b/jetty-http/src/test/java/org/eclipse/jetty/http/HttpTester.java @@ -361,8 +361,8 @@ public String getContent() return null; byte[] bytes = _content.toByteArray(); - String content_type = get(HttpHeader.CONTENT_TYPE); - String encoding = MimeTypes.getCharsetFromContentType(content_type); + String contentType = get(HttpHeader.CONTENT_TYPE); + String encoding = MimeTypes.getCharsetFromContentType(contentType); Charset charset = encoding == null ? StandardCharsets.UTF_8 : Charset.forName(encoding); return new String(bytes, charset); diff --git a/jetty-http/src/test/java/org/eclipse/jetty/http/HttpURITest.java b/jetty-http/src/test/java/org/eclipse/jetty/http/HttpURITest.java index cb9d0d2b056f..dda9de72cb63 100644 --- a/jetty-http/src/test/java/org/eclipse/jetty/http/HttpURITest.java +++ b/jetty-http/src/test/java/org/eclipse/jetty/http/HttpURITest.java @@ -102,6 +102,7 @@ public void testParseRequestTarget() @Test public void testExtB() throws Exception { + // @checkstyle-disable-check : AvoidEscapedUnicodeCharactersCheck for (String value : new String[]{"a", "abcdABCD", "\u00C0", "\u697C", "\uD869\uDED5", "\uD840\uDC08"}) { HttpURI uri = new HttpURI("/path?value=" + URLEncoder.encode(value, "UTF-8")); diff --git a/jetty-http/src/test/java/org/eclipse/jetty/http/MimeTypesTest.java b/jetty-http/src/test/java/org/eclipse/jetty/http/MimeTypesTest.java index e7db52c82465..efe578d5a874 100644 --- a/jetty-http/src/test/java/org/eclipse/jetty/http/MimeTypesTest.java +++ b/jetty-http/src/test/java/org/eclipse/jetty/http/MimeTypesTest.java @@ -29,13 +29,13 @@ public class MimeTypesTest { @Test - public void testGetMimeByExtension_Gzip() + public void testGetMimeByExtensionGzip() { assertMimeTypeByExtension("application/gzip", "test.gz"); } @Test - public void testGetMimeByExtension_Png() + public void testGetMimeByExtensionPng() { assertMimeTypeByExtension("image/png", "test.png"); assertMimeTypeByExtension("image/png", "TEST.PNG"); @@ -43,26 +43,26 @@ public void testGetMimeByExtension_Png() } @Test - public void testGetMimeByExtension_Png_MultiDot() + public void testGetMimeByExtensionPngMultiDot() { assertMimeTypeByExtension("image/png", "org.eclipse.jetty.Logo.png"); } @Test - public void testGetMimeByExtension_Png_DeepPath() + public void testGetMimeByExtensionPngDeepPath() { assertMimeTypeByExtension("image/png", "/org/eclipse/jetty/Logo.png"); } @Test - public void testGetMimeByExtension_Text() + public void testGetMimeByExtensionText() { assertMimeTypeByExtension("text/plain", "test.txt"); assertMimeTypeByExtension("text/plain", "TEST.TXT"); } @Test - public void testGetMimeByExtension_NoExtension() + public void testGetMimeByExtensionNoExtension() { MimeTypes mimetypes = new MimeTypes(); String contentType = mimetypes.getMimeByExtension("README"); diff --git a/jetty-http/src/test/java/org/eclipse/jetty/http/MultiPartParserTest.java b/jetty-http/src/test/java/org/eclipse/jetty/http/MultiPartParserTest.java index 44358ebabcdb..ac5f8cbdbce3 100644 --- a/jetty-http/src/test/java/org/eclipse/jetty/http/MultiPartParserTest.java +++ b/jetty-http/src/test/java/org/eclipse/jetty/http/MultiPartParserTest.java @@ -34,6 +34,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; +// @checkstyle-disable-check : AvoidEscapedUnicodeCharactersCheck public class MultiPartParserTest { @@ -174,12 +175,12 @@ public boolean headerComplete() MultiPartParser parser = new MultiPartParser(handler, "BOUNDARY"); ByteBuffer data = BufferUtil.toBuffer("--BOUNDARY\r\n" + - "name0: value0\r\n" + - "name1 :value1 \r\n" + - "name2:value\r\n" + - " 2\r\n" + - "\r\n" + - "Content"); + "name0: value0\r\n" + + "name1 :value1 \r\n" + + "name2:value\r\n" + + " 2\r\n" + + "\r\n" + + "Content"); parser.parse(data, false); assertThat(parser.getState(), is(State.FIRST_OCTETS)); @@ -194,10 +195,10 @@ public void testFirstPartNoContent() MultiPartParser parser = new MultiPartParser(handler, "BOUNDARY"); ByteBuffer data = BufferUtil.toBuffer("--BOUNDARY\r\n" + - "name: value\r\n" + - "\r\n" + - "\r\n" + - "--BOUNDARY"); + "name: value\r\n" + + "\r\n" + + "\r\n" + + "--BOUNDARY"); parser.parse(data, false); assertThat(parser.getState(), is(State.DELIMITER)); assertThat(data.remaining(), is(0)); @@ -212,9 +213,9 @@ public void testFirstPartNoContentNoCRLF() MultiPartParser parser = new MultiPartParser(handler, "BOUNDARY"); ByteBuffer data = BufferUtil.toBuffer("--BOUNDARY\r\n" + - "name: value\r\n" + - "\r\n" + - "--BOUNDARY"); + "name: value\r\n" + + "\r\n" + + "--BOUNDARY"); parser.parse(data, false); assertThat(parser.getState(), is(State.DELIMITER)); assertThat(data.remaining(), is(0)); @@ -229,9 +230,9 @@ public void testFirstPartContentLookingLikeNoCRLF() MultiPartParser parser = new MultiPartParser(handler, "BOUNDARY"); ByteBuffer data = BufferUtil.toBuffer("--BOUNDARY\r\n" + - "name: value\r\n" + - "\r\n" + - "-"); + "name: value\r\n" + + "\r\n" + + "-"); parser.parse(data, false); data = BufferUtil.toBuffer("Content!"); parser.parse(data, false); @@ -249,9 +250,9 @@ public void testFirstPartPartialContent() MultiPartParser parser = new MultiPartParser(handler, "BOUNDARY"); ByteBuffer data = BufferUtil.toBuffer("--BOUNDARY\r\n" + - "name: value\n" + - "\r\n" + - "Hello\r\n"); + "name: value\n" + + "\r\n" + + "Hello\r\n"); parser.parse(data, false); assertThat(parser.getState(), is(State.OCTETS)); assertThat(data.remaining(), is(0)); @@ -260,17 +261,17 @@ public void testFirstPartPartialContent() data = BufferUtil.toBuffer( "Now is the time for all good ment to come to the aid of the party.\r\n" + - "How now brown cow.\r\n" + - "The quick brown fox jumped over the lazy dog.\r\n" + - "this is not a --BOUNDARY\r\n"); + "How now brown cow.\r\n" + + "The quick brown fox jumped over the lazy dog.\r\n" + + "this is not a --BOUNDARY\r\n"); parser.parse(data, false); assertThat(parser.getState(), is(State.OCTETS)); assertThat(data.remaining(), is(0)); assertThat(handler.fields, Matchers.contains("name: value", "<>")); assertThat(handler.content, Matchers.contains("Hello", "\r\n", "Now is the time for all good ment to come to the aid of the party.\r\n" + - "How now brown cow.\r\n" + - "The quick brown fox jumped over the lazy dog.\r\n" + - "this is not a --BOUNDARY")); + "How now brown cow.\r\n" + + "The quick brown fox jumped over the lazy dog.\r\n" + + "this is not a --BOUNDARY")); } @Test @@ -280,10 +281,10 @@ public void testFirstPartShortContent() MultiPartParser parser = new MultiPartParser(handler, "BOUNDARY"); ByteBuffer data = BufferUtil.toBuffer("--BOUNDARY\r\n" + - "name: value\n" + - "\r\n" + - "Hello\r\n" + - "--BOUNDARY"); + "name: value\n" + + "\r\n" + + "Hello\r\n" + + "--BOUNDARY"); parser.parse(data, false); assertThat(parser.getState(), is(State.DELIMITER)); assertThat(data.remaining(), is(0)); @@ -298,20 +299,20 @@ public void testFirstPartLongContent() MultiPartParser parser = new MultiPartParser(handler, "BOUNDARY"); ByteBuffer data = BufferUtil.toBuffer("--BOUNDARY\r\n" + - "name: value\n" + - "\r\n" + - "Now is the time for all good ment to come to the aid of the party.\r\n" + - "How now brown cow.\r\n" + - "The quick brown fox jumped over the lazy dog.\r\n" + - "\r\n" + - "--BOUNDARY"); + "name: value\n" + + "\r\n" + + "Now is the time for all good ment to come to the aid of the party.\r\n" + + "How now brown cow.\r\n" + + "The quick brown fox jumped over the lazy dog.\r\n" + + "\r\n" + + "--BOUNDARY"); parser.parse(data, false); assertThat(parser.getState(), is(State.DELIMITER)); assertThat(data.remaining(), is(0)); assertThat(handler.fields, Matchers.contains("name: value", "<>")); assertThat(handler.content, Matchers.contains("Now is the time for all good ment to come to the aid of the party.\r\n" + - "How now brown cow.\r\n" + - "The quick brown fox jumped over the lazy dog.\r\n", "<>")); + "How now brown cow.\r\n" + + "The quick brown fox jumped over the lazy dog.\r\n", "<>")); } @Test @@ -322,20 +323,20 @@ public void testFirstPartLongContentNoCarriageReturn() //boundary still requires carriage return ByteBuffer data = BufferUtil.toBuffer("--BOUNDARY\n" + - "name: value\n" + - "\n" + - "Now is the time for all good men to come to the aid of the party.\n" + - "How now brown cow.\n" + - "The quick brown fox jumped over the lazy dog.\n" + - "\r\n" + - "--BOUNDARY"); + "name: value\n" + + "\n" + + "Now is the time for all good men to come to the aid of the party.\n" + + "How now brown cow.\n" + + "The quick brown fox jumped over the lazy dog.\n" + + "\r\n" + + "--BOUNDARY"); parser.parse(data, false); assertThat(parser.getState(), is(State.DELIMITER)); assertThat(data.remaining(), is(0)); assertThat(handler.fields, Matchers.contains("name: value", "<>")); assertThat(handler.content, Matchers.contains("Now is the time for all good men to come to the aid of the party.\n" + - "How now brown cow.\n" + - "The quick brown fox jumped over the lazy dog.\n", "<>")); + "How now brown cow.\n" + + "The quick brown fox jumped over the lazy dog.\n", "<>")); } @Test @@ -378,16 +379,16 @@ public void testEpilogue() MultiPartParser parser = new MultiPartParser(handler, "BOUNDARY"); ByteBuffer data = BufferUtil.toBuffer("" + - "--BOUNDARY\r\n" + - "name: value\n" + - "\r\n" + - "Hello\r\n" + - "--BOUNDARY--" + - "epilogue here:" + - "\r\n" + - "--BOUNDARY--" + - "\r\n" + - "--BOUNDARY"); + "--BOUNDARY\r\n" + + "name: value\n" + + "\r\n" + + "Hello\r\n" + + "--BOUNDARY--" + + "epilogue here:" + + "\r\n" + + "--BOUNDARY--" + + "\r\n" + + "--BOUNDARY"); parser.parse(data, false); assertThat(parser.getState(), is(State.DELIMITER)); @@ -405,19 +406,19 @@ public void testMultipleContent() MultiPartParser parser = new MultiPartParser(handler, "BOUNDARY"); ByteBuffer data = BufferUtil.toBuffer("" + - "--BOUNDARY\r\n" + - "name: value\n" + - "\r\n" + - "Hello" + - "\r\n" + - "--BOUNDARY\r\n" + - "powerLevel: 9001\n" + - "\r\n" + - "secondary" + - "\r\n" + - "content" + - "\r\n--BOUNDARY--" + - "epilogue here"); + "--BOUNDARY\r\n" + + "name: value\n" + + "\r\n" + + "Hello" + + "\r\n" + + "--BOUNDARY\r\n" + + "powerLevel: 9001\n" + + "\r\n" + + "secondary" + + "\r\n" + + "content" + + "\r\n--BOUNDARY--" + + "epilogue here"); /* Test First Content Section */ parser.parse(data, false); @@ -613,20 +614,20 @@ public boolean content(ByteBuffer buffer, boolean last) assertThat("Third " + i, parser.parse(dataSeg, true), is(true)); assertThat(handler.fields, Matchers.contains("Content-Disposition: form-data; name=\"text\"", "<>", - "Content-Disposition: form-data; name=\"file1\"; filename=\"a.txt\"", - "Content-Type: text/plain", "<>", - "Content-Disposition: form-data; name=\"file2\"; filename=\"a.html\"", - "Content-Type: text/html", "<>", - "Field1: value1", "Field2: value2", "Field3: value3", - "Field4: value4", "Field5: value5", "Field6: value6", - "Field7: value7", "Field8: value8", "Field9: value 9", "<>", - "Field1: value1", "<>")); + "Content-Disposition: form-data; name=\"file1\"; filename=\"a.txt\"", + "Content-Type: text/plain", "<>", + "Content-Disposition: form-data; name=\"file2\"; filename=\"a.html\"", + "Content-Type: text/html", "<>", + "Field1: value1", "Field2: value2", "Field3: value3", + "Field4: value4", "Field5: value5", "Field6: value6", + "Field7: value7", "Field8: value8", "Field9: value 9", "<>", + "Field1: value1", "<>")); assertThat(handler.contentString(), is("text default" + "<>" + - "Content of a.txt.\n" + "<>" + - "Content of a.html.\n" + "<>" + - "<>" + - "But the amount of denudation which the strata have\n" + + "Content of a.txt.\n" + "<>" + + "Content of a.html.\n" + "<>" + + "<>" + + "But the amount of denudation which the strata have\n" + "in many places suffered, independently of the rate\n" + "of accumulation of the degraded matter, probably\n" + "offers the best evidence of the lapse of time. I remember\n" + @@ -671,17 +672,17 @@ public boolean headerComplete() MultiPartParser parser = new MultiPartParser(handler, "WebKitFormBoundary7MA4YWf7OaKlSxkTrZu0gW"); ByteBuffer data = BufferUtil.toBuffer("" + - "Content-Type: multipart/form-data; boundary=WebKitFormBoundary7MA4YWf7OaKlSxkTrZu0gW\r\n" + - "\r\n" + - "--WebKitFormBoundary7MA4YWf7OaKlSxkTrZu0gW\r\n" + - "Content-Disposition: form-data; name=\"part1\"\r\n" + - "\n" + - "wNfミxVam﾿t\r\n" + - "--WebKitFormBoundary7MA4YWf7OaKlSxkTrZu0gW\n" + - "Content-Disposition: form-data; name=\"part2\"\r\n" + - "\r\n" + - "&ᄈᄎ￙ᅱᅢO\r\n" + - "--WebKitFormBoundary7MA4YWf7OaKlSxkTrZu0gW--"); + "Content-Type: multipart/form-data; boundary=WebKitFormBoundary7MA4YWf7OaKlSxkTrZu0gW\r\n" + + "\r\n" + + "--WebKitFormBoundary7MA4YWf7OaKlSxkTrZu0gW\r\n" + + "Content-Disposition: form-data; name=\"part1\"\r\n" + + "\n" + + "wNfミxVam﾿t\r\n" + + "--WebKitFormBoundary7MA4YWf7OaKlSxkTrZu0gW\n" + + "Content-Disposition: form-data; name=\"part2\"\r\n" + + "\r\n" + + "&ᄈᄎ￙ᅱᅢO\r\n" + + "--WebKitFormBoundary7MA4YWf7OaKlSxkTrZu0gW--"); parser.parse(data, true); assertThat(parser.getState(), is(State.END)); diff --git a/jetty-http/src/test/java/org/eclipse/jetty/http/PathMapTest.java b/jetty-http/src/test/java/org/eclipse/jetty/http/PathMapTest.java index 5062c48b7f16..5f6bdc2da068 100644 --- a/jetty-http/src/test/java/org/eclipse/jetty/http/PathMapTest.java +++ b/jetty-http/src/test/java/org/eclipse/jetty/http/PathMapTest.java @@ -44,6 +44,7 @@ public void testPathMap() throws Exception p.put("/", "8"); p.put("/XXX:/YYY", "9"); p.put("", "10"); + // @checkstyle-disable-check : AvoidEscapedUnicodeCharactersCheck p.put("/\u20ACuro/*", "11"); String[][] tests = { @@ -64,9 +65,10 @@ public void testPathMap() throws Exception {"/suffix/path.gz", "7"}, {"/animal/path.gz", "5"}, {"/Other/path", "8"}, + // @checkstyle-disable-check : AvoidEscapedUnicodeCharactersCheck {"/\u20ACuro/path", "11"}, - {"/", "10"}, - }; + {"/", "10"} + }; for (String[] test : tests) { diff --git a/jetty-http/src/test/java/org/eclipse/jetty/http/QuotedQualityCSVTest.java b/jetty-http/src/test/java/org/eclipse/jetty/http/QuotedQualityCSVTest.java index ee39f91ad497..7bbf6547bb27 100644 --- a/jetty-http/src/test/java/org/eclipse/jetty/http/QuotedQualityCSVTest.java +++ b/jetty-http/src/test/java/org/eclipse/jetty/http/QuotedQualityCSVTest.java @@ -31,7 +31,7 @@ public class QuotedQualityCSVTest { @Test - public void test7231_5_3_2_example1() + public void test7231Sec532Example1() { QuotedQualityCSV values = new QuotedQualityCSV(); values.addValue(" audio/*; q=0.2, audio/basic"); @@ -39,7 +39,7 @@ public void test7231_5_3_2_example1() } @Test - public void test7231_5_3_2_example2() + public void test7231Sec532Example2() { QuotedQualityCSV values = new QuotedQualityCSV(); values.addValue("text/plain; q=0.5, text/html,"); @@ -48,7 +48,7 @@ public void test7231_5_3_2_example2() } @Test - public void test7231_5_3_2_example3() + public void test7231Sec532Example3() { QuotedQualityCSV values = new QuotedQualityCSV(); values.addValue("text/*, text/plain, text/plain;format=flowed, */*"); @@ -58,7 +58,7 @@ public void test7231_5_3_2_example3() } @Test - public void test7231_5_3_2_example3_most_specific() + public void test7231532Example3MostSpecific() { QuotedQualityCSV values = new QuotedQualityCSV(QuotedQualityCSV.MOST_SPECIFIC_MIME_ORDERING); values.addValue("text/*, text/plain, text/plain;format=flowed, */*"); @@ -67,7 +67,7 @@ public void test7231_5_3_2_example3_most_specific() } @Test - public void test7231_5_3_2_example4() + public void test7231Sec532Example4() { QuotedQualityCSV values = new QuotedQualityCSV(); values.addValue("text/*;q=0.3, text/html;q=0.7, text/html;level=1,"); @@ -82,7 +82,7 @@ public void test7231_5_3_2_example4() } @Test - public void test7231_5_3_4_example1() + public void test7231Sec534Example1() { QuotedQualityCSV values = new QuotedQualityCSV(); values.addValue("compress, gzip"); diff --git a/jetty-http/src/test/java/org/eclipse/jetty/http/SyntaxTest.java b/jetty-http/src/test/java/org/eclipse/jetty/http/SyntaxTest.java index 248410df7fbc..52b1a395e910 100644 --- a/jetty-http/src/test/java/org/eclipse/jetty/http/SyntaxTest.java +++ b/jetty-http/src/test/java/org/eclipse/jetty/http/SyntaxTest.java @@ -28,7 +28,7 @@ public class SyntaxTest { @Test - public void testRequireValidRFC2616Token_Good() + public void testRequireValidRFC2616TokenGood() { String[] tokens = { "name", @@ -50,7 +50,7 @@ public void testRequireValidRFC2616Token_Good() } @Test - public void testRequireValidRFC2616Token_Bad() + public void testRequireValidRFC2616TokenBad() { String[] tokens = { "\"name\"", @@ -81,7 +81,7 @@ public void testRequireValidRFC2616Token_Bad() } @Test - public void testRequireValidRFC6265CookieValue_Good() + public void testRequireValidRFC6265CookieValueGood() { String[] values = { "value", @@ -102,7 +102,7 @@ public void testRequireValidRFC6265CookieValue_Good() } @Test - public void testRequireValidRFC6265CookieValue_Bad() + public void testRequireValidRFC6265CookieValueBad() { String[] values = { "va\tlue", diff --git a/jetty-http/src/test/java/org/eclipse/jetty/http/matchers/HttpFieldsMatchersTest.java b/jetty-http/src/test/java/org/eclipse/jetty/http/matchers/HttpFieldsMatchersTest.java index c88246369342..f70dbfa1d052 100644 --- a/jetty-http/src/test/java/org/eclipse/jetty/http/matchers/HttpFieldsMatchersTest.java +++ b/jetty-http/src/test/java/org/eclipse/jetty/http/matchers/HttpFieldsMatchersTest.java @@ -59,7 +59,7 @@ public void testNotContainsHeader() } @Test - public void testContainsHeader_MisMatch() + public void testContainsHeaderMisMatch() { HttpFields fields = new HttpFields(); fields.put("a", "foo"); @@ -75,7 +75,7 @@ public void testContainsHeader_MisMatch() } @Test - public void testContainsHeaderValue_MisMatch_NoSuchHeader() + public void testContainsHeaderValueMisMatchNoSuchHeader() { HttpFields fields = new HttpFields(); fields.put("a", "foo"); @@ -91,7 +91,7 @@ public void testContainsHeaderValue_MisMatch_NoSuchHeader() } @Test - public void testContainsHeaderValue_MisMatch_NoSuchValue() + public void testContainsHeaderValueMisMatchNoSuchValue() { HttpFields fields = new HttpFields(); fields.put("a", "foo"); diff --git a/jetty-http/src/test/java/org/eclipse/jetty/http/pathmap/PathMappingsTest.java b/jetty-http/src/test/java/org/eclipse/jetty/http/pathmap/PathMappingsTest.java index c78e572310a2..7fab063c8903 100644 --- a/jetty-http/src/test/java/org/eclipse/jetty/http/pathmap/PathMappingsTest.java +++ b/jetty-http/src/test/java/org/eclipse/jetty/http/pathmap/PathMappingsTest.java @@ -28,6 +28,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; +// @checkstyle-disable-check : AvoidEscapedUnicodeCharactersCheck public class PathMappingsTest { private void assertMatch(PathMappings pathmap, String path, String expectedValue) diff --git a/jetty-http/src/test/java/org/eclipse/jetty/http/pathmap/ServletPathSpecOrderTest.java b/jetty-http/src/test/java/org/eclipse/jetty/http/pathmap/ServletPathSpecOrderTest.java index c6597af6cc38..7787d667ce3e 100644 --- a/jetty-http/src/test/java/org/eclipse/jetty/http/pathmap/ServletPathSpecOrderTest.java +++ b/jetty-http/src/test/java/org/eclipse/jetty/http/pathmap/ServletPathSpecOrderTest.java @@ -56,6 +56,7 @@ public static Stream data() data.add(Arguments.of("/downloads/script.gz", "gzipped")); data.add(Arguments.of("/animal/arhive.gz", "animals")); data.add(Arguments.of("/Other/path", "default")); + // @checkstyle-disable-check : AvoidEscapedUnicodeCharactersCheck data.add(Arguments.of("/\u20ACuro/path", "money")); data.add(Arguments.of("/", "root")); diff --git a/jetty-http/src/test/java/org/eclipse/jetty/http/pathmap/UriTemplatePathSpecTest.java b/jetty-http/src/test/java/org/eclipse/jetty/http/pathmap/UriTemplatePathSpecTest.java index d8b66ce3f79d..144597165d9c 100644 --- a/jetty-http/src/test/java/org/eclipse/jetty/http/pathmap/UriTemplatePathSpecTest.java +++ b/jetty-http/src/test/java/org/eclipse/jetty/http/pathmap/UriTemplatePathSpecTest.java @@ -87,7 +87,7 @@ public void testExactOnePathSpec() } @Test - public void testExactPathSpec_TestWebapp() + public void testExactPathSpecTestWebapp() { UriTemplatePathSpec spec = new UriTemplatePathSpec("/deep.thought/"); assertEquals("/deep.thought/", spec.getDeclaration(), "Spec.pathSpec"); diff --git a/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/ProxyProtocolTest.java b/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/ProxyProtocolTest.java index c33d59c97c97..12e6d8b1e68d 100644 --- a/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/ProxyProtocolTest.java +++ b/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/ProxyProtocolTest.java @@ -87,7 +87,7 @@ public void dispose() throws Exception } @Test - public void test_PROXY_GET_v1() throws Exception + public void testProxyGetV1() throws Exception { startServer(new AbstractHandler() { @@ -139,7 +139,7 @@ public void onHeaders(Stream stream, HeadersFrame frame) } @Test - public void test_PROXY_GET_v2() throws Exception + public void testProxyGetV2() throws Exception { startServer(new AbstractHandler() { diff --git a/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/SmallThreadPoolLoadTest.java b/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/SmallThreadPoolLoadTest.java index d7f58cad4076..340e9080543e 100644 --- a/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/SmallThreadPoolLoadTest.java +++ b/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/SmallThreadPoolLoadTest.java @@ -213,8 +213,8 @@ protected void service(HttpServletRequest request, HttpServletResponse response) } case "POST": { - int content_length = request.getContentLength(); - ByteArrayOutputStream2 bout = new ByteArrayOutputStream2(content_length > 0 ? content_length : 16 * 1024); + int contentLength = request.getContentLength(); + ByteArrayOutputStream2 bout = new ByteArrayOutputStream2(contentLength > 0 ? contentLength : 16 * 1024); IO.copy(request.getInputStream(), bout); response.getOutputStream().write(bout.getBuf(), 0, bout.getCount()); break; diff --git a/jetty-http2/http2-hpack/src/test/java/org/eclipse/jetty/http2/hpack/HpackDecoderTest.java b/jetty-http2/http2-hpack/src/test/java/org/eclipse/jetty/http2/hpack/HpackDecoderTest.java index f905d4f377c5..5bd553d26e11 100644 --- a/jetty-http2/http2-hpack/src/test/java/org/eclipse/jetty/http2/hpack/HpackDecoderTest.java +++ b/jetty-http2/http2-hpack/src/test/java/org/eclipse/jetty/http2/hpack/HpackDecoderTest.java @@ -60,7 +60,7 @@ public class HpackDecoderTest */ @Test - public void testDecodeD_3() throws Exception + public void testDecodeD3() throws Exception { HpackDecoder decoder = new HpackDecoder(4096, 8192); @@ -108,7 +108,7 @@ public void testDecodeD_3() throws Exception } @Test - public void testDecodeD_4() throws Exception + public void testDecodeD4() throws Exception { HpackDecoder decoder = new HpackDecoder(4096, 8192); @@ -277,7 +277,7 @@ public void testUnknownIndex() throws Exception /* 8.1.2.1. Pseudo-Header Fields */ @Test - public void test8_1_2_1_PsuedoHeaderFields() throws Exception + public void test8121PseudoHeaderFields() throws Exception { // 1:Sends a HEADERS frame that contains a unknown pseudo-header field MetaDataBuilder mdb = new MetaDataBuilder(4096); @@ -329,7 +329,7 @@ public void test8_1_2_1_PsuedoHeaderFields() throws Exception } @Test - public void test8_1_2_2_ConnectionSpecificHeaderFields() throws Exception + public void test8122ConnectionSpecificHeaderFields() throws Exception { MetaDataBuilder mdb; @@ -366,7 +366,7 @@ public void test8_1_2_2_ConnectionSpecificHeaderFields() throws Exception } @Test - public void test8_1_2_3_RequestPseudoHeaderFields() throws Exception + public void test8123RequestPseudoHeaderFields() throws Exception { { MetaDataBuilder mdb = new MetaDataBuilder(4096); diff --git a/jetty-http2/http2-hpack/src/test/java/org/eclipse/jetty/http2/hpack/HpackTest.java b/jetty-http2/http2-hpack/src/test/java/org/eclipse/jetty/http2/hpack/HpackTest.java index ef9dc6497998..acbf1f971938 100644 --- a/jetty-http2/http2-hpack/src/test/java/org/eclipse/jetty/http2/hpack/HpackTest.java +++ b/jetty-http2/http2-hpack/src/test/java/org/eclipse/jetty/http2/hpack/HpackTest.java @@ -145,6 +145,7 @@ public void encodeDecodeNonAscii() throws Exception ByteBuffer buffer = BufferUtil.allocate(16 * 1024); HttpFields fields0 = new HttpFields(); + // @checkstyle-disable-check : AvoidEscapedUnicodeCharactersCheck fields0.add("Cookie", "[\uD842\uDF9F]"); fields0.add("custom-key", "[\uD842\uDF9F]"); Response original0 = new MetaData.Response(HttpVersion.HTTP_2, 200, fields0); diff --git a/jetty-http2/http2-hpack/src/test/java/org/eclipse/jetty/http2/hpack/NBitIntegerTest.java b/jetty-http2/http2-hpack/src/test/java/org/eclipse/jetty/http2/hpack/NBitIntegerTest.java index e1588efcc109..5191eb9ccb2e 100644 --- a/jetty-http2/http2-hpack/src/test/java/org/eclipse/jetty/http2/hpack/NBitIntegerTest.java +++ b/jetty-http2/http2-hpack/src/test/java/org/eclipse/jetty/http2/hpack/NBitIntegerTest.java @@ -131,7 +131,7 @@ public void testDecode(int n, int expected, String encoded) } @Test - public void testEncodeExampleD_1_1() + public void testEncodeExampleD11() { ByteBuffer buf = BufferUtil.allocate(16); int p = BufferUtil.flipToFill(buf); @@ -146,7 +146,7 @@ public void testEncodeExampleD_1_1() } @Test - public void testDecodeExampleD_1_1() + public void testDecodeExampleD11() { ByteBuffer buf = ByteBuffer.wrap(TypeUtil.fromHexString("77EaFF")); buf.position(2); @@ -155,7 +155,7 @@ public void testDecodeExampleD_1_1() } @Test - public void testEncodeExampleD_1_2() + public void testEncodeExampleD12() { ByteBuffer buf = BufferUtil.allocate(16); int p = BufferUtil.flipToFill(buf); @@ -170,7 +170,7 @@ public void testEncodeExampleD_1_2() } @Test - public void testDecodeExampleD_1_2() + public void testDecodeExampleD12() { ByteBuffer buf = ByteBuffer.wrap(TypeUtil.fromHexString("881f9a0aff")); buf.position(2); @@ -179,7 +179,7 @@ public void testDecodeExampleD_1_2() } @Test - public void testEncodeExampleD_1_3() + public void testEncodeExampleD13() { ByteBuffer buf = BufferUtil.allocate(16); int p = BufferUtil.flipToFill(buf); @@ -194,7 +194,7 @@ public void testEncodeExampleD_1_3() } @Test - public void testDecodeExampleD_1_3() + public void testDecodeExampleD13() { ByteBuffer buf = ByteBuffer.wrap(TypeUtil.fromHexString("882aFf")); buf.position(1); diff --git a/jetty-http2/http2-server/src/test/java/org/eclipse/jetty/http2/server/H2SpecServer.java b/jetty-http2/http2-server/src/test/java/org/eclipse/jetty/http2/server/H2SpecServer.java index 3554e71a5dfd..9f5b8fa97e09 100644 --- a/jetty-http2/http2-server/src/test/java/org/eclipse/jetty/http2/server/H2SpecServer.java +++ b/jetty-http2/http2-server/src/test/java/org/eclipse/jetty/http2/server/H2SpecServer.java @@ -34,11 +34,11 @@ public static void main(String[] args) throws Exception Server server = new Server(); - HttpConfiguration http_config = new HttpConfiguration(); - http_config.setRequestHeaderSize(16 * 1024); + HttpConfiguration httpConfig = new HttpConfiguration(); + httpConfig.setRequestHeaderSize(16 * 1024); - HttpConnectionFactory http = new HttpConnectionFactory(http_config); - HTTP2CServerConnectionFactory h2c = new HTTP2CServerConnectionFactory(http_config); + HttpConnectionFactory http = new HttpConnectionFactory(httpConfig); + HTTP2CServerConnectionFactory h2c = new HTTP2CServerConnectionFactory(httpConfig); ServerConnector connector = new ServerConnector(server, http, h2c); connector.setPort(port); server.addConnector(connector); diff --git a/jetty-http2/http2-server/src/test/java/org/eclipse/jetty/http2/server/HTTP2CServerTest.java b/jetty-http2/http2-server/src/test/java/org/eclipse/jetty/http2/server/HTTP2CServerTest.java index 980aa3d36d94..b261aadc6f5d 100644 --- a/jetty-http2/http2-server/src/test/java/org/eclipse/jetty/http2/server/HTTP2CServerTest.java +++ b/jetty-http2/http2-server/src/test/java/org/eclipse/jetty/http2/server/HTTP2CServerTest.java @@ -82,7 +82,7 @@ public void after() throws Exception } @Test - public void testHTTP_1_0_Simple() throws Exception + public void testHTTP10Simple() throws Exception { try (Socket client = new Socket("localhost", connector.getLocalPort())) { @@ -97,7 +97,7 @@ public void testHTTP_1_0_Simple() throws Exception } @Test - public void testHTTP_1_1_Simple() throws Exception + public void testHTTP11Simple() throws Exception { try (Socket client = new Socket("localhost", connector.getLocalPort())) { @@ -115,7 +115,7 @@ public void testHTTP_1_1_Simple() throws Exception } @Test - public void testHTTP_1_1_Upgrade() throws Exception + public void testHTTP11Upgrade() throws Exception { try (Socket client = new Socket("localhost", connector.getLocalPort())) { @@ -223,7 +223,7 @@ public void onData(DataFrame frame) } @Test - public void testHTTP_2_0_Direct() throws Exception + public void testHTTP20Direct() throws Exception { final CountDownLatch latch = new CountDownLatch(3); @@ -290,7 +290,7 @@ public void onData(DataFrame frame) } @Test - public void testHTTP_2_0_DirectWithoutH2C() throws Exception + public void testHTTP20DirectWithoutH2C() throws Exception { AtomicLong fills = new AtomicLong(); // Remove "h2c", leaving only "http/1.1". diff --git a/jetty-http2/http2-server/src/test/java/org/eclipse/jetty/http2/server/HTTP2ServerTest.java b/jetty-http2/http2-server/src/test/java/org/eclipse/jetty/http2/server/HTTP2ServerTest.java index 9e222c4dd0d7..041f54a0e5d0 100644 --- a/jetty-http2/http2-server/src/test/java/org/eclipse/jetty/http2/server/HTTP2ServerTest.java +++ b/jetty-http2/http2-server/src/test/java/org/eclipse/jetty/http2/server/HTTP2ServerTest.java @@ -383,15 +383,15 @@ public void write(Callback callback, ByteBuffer... buffers) throws IllegalStateE @Test public void testNonISOHeader() throws Exception { - try (StacklessLogging stackless = new StacklessLogging(HttpChannel.class)) + try (StacklessLogging ignored = new StacklessLogging(HttpChannel.class)) { startServer(new HttpServlet() { @Override - protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException + protected void service(HttpServletRequest request, HttpServletResponse response) { // Invalid header name, the connection must be closed. - response.setHeader("Euro_(\u20AC)", "42"); + response.setHeader("Euro_(%E2%82%AC)", "42"); } }); diff --git a/jetty-infinispan/infinispan-embedded-query/src/test/java/org/eclipse/jetty/server/session/infinispan/EmbeddedQueryManagerTest.java b/jetty-infinispan/infinispan-embedded-query/src/test/java/org/eclipse/jetty/server/session/infinispan/EmbeddedQueryManagerTest.java index c96d98689160..31eb0084a164 100644 --- a/jetty-infinispan/infinispan-embedded-query/src/test/java/org/eclipse/jetty/server/session/infinispan/EmbeddedQueryManagerTest.java +++ b/jetty-infinispan/infinispan-embedded-query/src/test/java/org/eclipse/jetty/server/session/infinispan/EmbeddedQueryManagerTest.java @@ -47,13 +47,10 @@ public class EmbeddedQueryManagerTest public static final String DEFAULT_CACHE_NAME = "session_test_cache"; @Test - public void test() throws Exception + public void test() { - - String _name = DEFAULT_CACHE_NAME + System.currentTimeMillis(); - EmbeddedCacheManager _manager; - - _manager = new DefaultCacheManager(new GlobalConfigurationBuilder().globalJmxStatistics().allowDuplicateDomains(true).build()); + String name = DEFAULT_CACHE_NAME + System.currentTimeMillis(); + EmbeddedCacheManager cacheManager = new DefaultCacheManager(new GlobalConfigurationBuilder().globalJmxStatistics().allowDuplicateDomains(true).build()); //TODO verify that this is being indexed properly, if you change expiry to something that is not a valid field it still passes the tests SearchMapping mapping = new SearchMapping(); @@ -62,7 +59,7 @@ public void test() throws Exception properties.put(Environment.MODEL_MAPPING, mapping); properties.put("hibernate.search.default.indexBase", MavenTestingUtils.getTargetTestingDir().getAbsolutePath()); - Configuration dcc = _manager.getDefaultCacheConfiguration(); + Configuration dcc = cacheManager.getDefaultCacheConfiguration(); ConfigurationBuilder b = new ConfigurationBuilder(); if (dcc != null) b = b.read(dcc); @@ -70,8 +67,8 @@ public void test() throws Exception b.indexing().index(Index.ALL).addIndexedEntity(SessionData.class).withProperties(properties); Configuration c = b.build(); - _manager.defineConfiguration(_name, c); - Cache _cache = _manager.getCache(_name); + cacheManager.defineConfiguration(name, c); + Cache cache = cacheManager.getCache(name); //put some sessions into the cache int numSessions = 10; @@ -92,11 +89,11 @@ public void test() throws Exception expiredSessions.add("sd" + i); //add to cache - _cache.put("sd" + i, sd); + cache.put("sd" + i, sd); } //run the query - QueryManager qm = new EmbeddedQueryManager(_cache); + QueryManager qm = new EmbeddedQueryManager(cache); Set queryResult = qm.queryExpiredSessions(currentTime); // Check that the result is correct diff --git a/jetty-infinispan/infinispan-remote-query/src/test/java/org/eclipse/jetty/server/session/infinispan/RemoteQueryManagerTest.java b/jetty-infinispan/infinispan-remote-query/src/test/java/org/eclipse/jetty/server/session/infinispan/RemoteQueryManagerTest.java index 3b6b5bcbb3c2..6fd5521e9f05 100644 --- a/jetty-infinispan/infinispan-remote-query/src/test/java/org/eclipse/jetty/server/session/infinispan/RemoteQueryManagerTest.java +++ b/jetty-infinispan/infinispan-remote-query/src/test/java/org/eclipse/jetty/server/session/infinispan/RemoteQueryManagerTest.java @@ -70,7 +70,7 @@ public void test() throws Exception serCtx.registerProtoFiles(fds); serCtx.registerMarshaller(new SessionDataMarshaller()); - RemoteCache _cache = remoteCacheManager.getCache(DEFAULT_CACHE_NAME); + RemoteCache cache = remoteCacheManager.getCache(DEFAULT_CACHE_NAME); ByteArrayOutputStream baos; try (InputStream is = RemoteQueryManagerTest.class.getClassLoader().getResourceAsStream("session.proto")) @@ -106,12 +106,12 @@ public void test() throws Exception expiredSessions.add(id); //add to cache - _cache.put(id, sd); - assertNotNull(_cache.get(id)); + cache.put(id, sd); + assertNotNull(cache.get(id)); } //run the query - QueryManager qm = new RemoteQueryManager(_cache); + QueryManager qm = new RemoteQueryManager(cache); Set queryResult = qm.queryExpiredSessions(currentTime); // Check that the result is correct diff --git a/jetty-io/src/test/java/org/eclipse/jetty/io/CyclicTimeoutTest.java b/jetty-io/src/test/java/org/eclipse/jetty/io/CyclicTimeoutTest.java index 218117bdfe62..0d7c202273a5 100644 --- a/jetty-io/src/test/java/org/eclipse/jetty/io/CyclicTimeoutTest.java +++ b/jetty-io/src/test/java/org/eclipse/jetty/io/CyclicTimeoutTest.java @@ -146,10 +146,10 @@ public void testBusy() throws Exception QueuedThreadPool pool = new QueuedThreadPool(200); pool.start(); - long test_until = System.nanoTime() + TimeUnit.MILLISECONDS.toNanos(1500); + long testUntil = System.nanoTime() + TimeUnit.MILLISECONDS.toNanos(1500); assertTrue(_timeout.schedule(100, TimeUnit.MILLISECONDS)); - while (System.nanoTime() < test_until) + while (System.nanoTime() < testUntil) { CountDownLatch latch = new CountDownLatch(1); pool.execute(() -> diff --git a/jetty-io/src/test/java/org/eclipse/jetty/io/SocketChannelEndPointTest.java b/jetty-io/src/test/java/org/eclipse/jetty/io/SocketChannelEndPointTest.java index f90671ca5262..5454627a1ad0 100644 --- a/jetty-io/src/test/java/org/eclipse/jetty/io/SocketChannelEndPointTest.java +++ b/jetty-io/src/test/java/org/eclipse/jetty/io/SocketChannelEndPointTest.java @@ -744,7 +744,7 @@ public void onFillable() return; } - EndPoint _endp = getEndPoint(); + EndPoint endp = getEndPoint(); try { _last = TimeUnit.NANOSECONDS.toMillis(System.nanoTime()); @@ -757,17 +757,17 @@ public void onFillable() BufferUtil.compact(_in); if (BufferUtil.isFull(_in)) throw new IllegalStateException("FULL " + BufferUtil.toDetailString(_in)); - int filled = _endp.fill(_in); + int filled = endp.fill(_in); if (filled > 0) progress = true; // If the tests wants to block, then block - while (_blockAt.get() > 0 && _endp.isOpen() && _in.remaining() < _blockAt.get()) + while (_blockAt.get() > 0 && endp.isOpen() && _in.remaining() < _blockAt.get()) { FutureCallback future = _blockingRead = new FutureCallback(); fillInterested(); future.get(); - filled = _endp.fill(_in); + filled = endp.fill(_in); progress |= filled > 0; } @@ -783,18 +783,18 @@ public void onFillable() for (int i = 0; i < _writeCount.get(); i++) { FutureCallback blockingWrite = new FutureCallback(); - _endp.write(blockingWrite, out.asReadOnlyBuffer()); + endp.write(blockingWrite, out.asReadOnlyBuffer()); blockingWrite.get(); } progress = true; } // are we done? - if (_endp.isInputShutdown()) - _endp.shutdownOutput(); + if (endp.isInputShutdown()) + endp.shutdownOutput(); } - if (_endp.isOpen()) + if (endp.isOpen()) fillInterested(); } catch (ExecutionException e) @@ -803,9 +803,9 @@ public void onFillable() try { FutureCallback blockingWrite = new FutureCallback(); - _endp.write(blockingWrite, BufferUtil.toBuffer("EE: " + BufferUtil.toString(_in))); + endp.write(blockingWrite, BufferUtil.toBuffer("EE: " + BufferUtil.toString(_in))); blockingWrite.get(); - _endp.shutdownOutput(); + endp.shutdownOutput(); } catch (Exception e2) { diff --git a/jetty-jmh/src/main/java/org/eclipse/jetty/util/StringReplaceBenchmark.java b/jetty-jmh/src/main/java/org/eclipse/jetty/util/StringReplaceBenchmark.java index 42aca5175a60..29d4e6a8a6b0 100644 --- a/jetty-jmh/src/main/java/org/eclipse/jetty/util/StringReplaceBenchmark.java +++ b/jetty-jmh/src/main/java/org/eclipse/jetty/util/StringReplaceBenchmark.java @@ -71,37 +71,37 @@ public void setupTrial() throws Exception } @Benchmark - public void testJavaStringReplace_Growth(Blackhole blackhole) + public void testJavaStringReplaceGrowth(Blackhole blackhole) { blackhole.consume(input.replace("'", "FOOBAR")); } @Benchmark - public void testJavaStringReplace_Same(Blackhole blackhole) + public void testJavaStringReplaceSame(Blackhole blackhole) { blackhole.consume(input.replace("'", "X")); } @Benchmark - public void testJavaStringReplace_Reduce(Blackhole blackhole) + public void testJavaStringReplaceReduce(Blackhole blackhole) { blackhole.consume(input.replace("'", "")); } @Benchmark - public void testJettyStringUtilReplace_Growth(Blackhole blackhole) + public void testJettyStringUtilReplaceGrowth(Blackhole blackhole) { blackhole.consume(StringUtil.replace(input, "'", "FOOBAR")); } @Benchmark - public void testJettyStringUtilReplace_Same(Blackhole blackhole) + public void testJettyStringUtilReplaceSame(Blackhole blackhole) { blackhole.consume(StringUtil.replace(input, "'", "X")); } @Benchmark - public void testJettyStringUtilReplace_Reduce(Blackhole blackhole) + public void testJettyStringUtilReplaceReduce(Blackhole blackhole) { blackhole.consume(StringUtil.replace(input, "'", "")); } diff --git a/jetty-maven-plugin/src/test/java/org/eclipse/jetty/maven/plugin/it/TestGetContent.java b/jetty-maven-plugin/src/test/java/org/eclipse/jetty/maven/plugin/it/TestGetContent.java index c1ce688532f3..6196c7808801 100644 --- a/jetty-maven-plugin/src/test/java/org/eclipse/jetty/maven/plugin/it/TestGetContent.java +++ b/jetty-maven-plugin/src/test/java/org/eclipse/jetty/maven/plugin/it/TestGetContent.java @@ -32,13 +32,10 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; -/** - * - */ public class TestGetContent { @Test - public void get_content_response() + public void getContentResponse() throws Exception { int port = getPort(); diff --git a/jetty-openid/src/test/java/org/eclipse/jetty/security/openid/JwtDecoderTest.java b/jetty-openid/src/test/java/org/eclipse/jetty/security/openid/JwtDecoderTest.java index f93704dfb06f..e0b8fbc5f0dd 100644 --- a/jetty-openid/src/test/java/org/eclipse/jetty/security/openid/JwtDecoderTest.java +++ b/jetty-openid/src/test/java/org/eclipse/jetty/security/openid/JwtDecoderTest.java @@ -46,7 +46,7 @@ public static Stream paddingExamples() Arguments.of("XX==", "XX=="), Arguments.of("XXX=", "XXX="), Arguments.of("", "") - ); + ); } public static Stream badPaddingExamples() @@ -101,17 +101,17 @@ public void testEncodeDecode() public void testDecodeMissingPadding() { // Example given in Issue #4128 which requires the re-adding the B64 padding to decode. - String jwt = "eyJraWQiOiIxNTU1OTM0ODQ3IiwieDV0IjoiOWdCOW9zRldSRHRSMkhtNGNmVnJnWTBGcmZRIiwiYWxnIjoiUlMyNTYifQ" - + ".eyJhdF9oYXNoIjoiQTA0NUoxcE5YRk1nYzlXN2wxSk1fUSIsImRlbGVnYXRpb25faWQiOiJjZTBhNjRlNS0xYWY3LTQ2MzEtOGUz" - + "NC1mNDE5N2JkYzVjZTAiLCJhY3IiOiJ1cm46c2U6Y3VyaXR5OmF1dGhlbnRpY2F0aW9uOmh0bWwtZm9ybTpodG1sLXByaW1hcnkiL" - + "CJzX2hhc2giOiIwc1FtRG9YY3FwcnM4NWUzdy0wbHdBIiwiYXpwIjoiNzZiZTc5Y2ItM2E1Ni00ZTE3LTg3NzYtNDI1Nzc5MjRjYz" - + "c2IiwiYXV0aF90aW1lIjoxNTY5NjU4MDk1LCJleHAiOjE1Njk2NjE5OTUsIm5iZiI6MTU2OTY1ODM5NSwianRpIjoiZjJkNWI2YzE" - + "tNTIxYi00Y2Y5LThlNWEtOTg5NGJhNmE0MzkyIiwiaXNzIjoiaHR0cHM6Ly9ub3JkaWNhcGlzLmN1cml0eS5pby9-IiwiYXVkIjoi" - + "NzZiZTc5Y2ItM2E1Ni00ZTE3LTg3NzYtNDI1Nzc5MjRjYzc2Iiwic3ViIjoibmlrb3MiLCJpYXQiOjE1Njk2NTgzOTUsInB1cnBvc" - + "2UiOiJpZCJ9.Wd458zNmXggpkDN6vbS3-aiajh4-VbkmcStLYUqahYJUp9p-AUI_RZttWvwh3UDMG9rWww_ya8KFK_SkPfKooEaSN" - + "OjOhw0ox4d-9lgti3J49eRyO20RViXvRHyLVtcjv5IaqvMXgwW60Thubv19OION7DstyArffcxNNSpiqDq6wjd0T2DJ3gSXXlJHLT" - + "Wrry3svqu1j_GCbHc04XYGicxsusKgc3n22dh4I6p4trdo0Gu5Un0bZ8Yov7IzWItqTgm9X5r9gZlAOLcAuK1WTwkzAwZJ24HgvxK" - + "muYfV_4ZCg_VPN2Op8YPuRAQOgUERpeTv1RDFTOG9GKZIMBVR0A"; + String jwt = "eyJraWQiOiIxNTU1OTM0ODQ3IiwieDV0IjoiOWdCOW9zRldSRHRSMkhtNGNmVnJnWTBGcmZRIiwiYWxnIjoiUlMyNTYifQ" + + ".eyJhdF9oYXNoIjoiQTA0NUoxcE5YRk1nYzlXN2wxSk1fUSIsImRlbGVnYXRpb25faWQiOiJjZTBhNjRlNS0xYWY3LTQ2MzEtOGUz" + + "NC1mNDE5N2JkYzVjZTAiLCJhY3IiOiJ1cm46c2U6Y3VyaXR5OmF1dGhlbnRpY2F0aW9uOmh0bWwtZm9ybTpodG1sLXByaW1hcnkiL" + + "CJzX2hhc2giOiIwc1FtRG9YY3FwcnM4NWUzdy0wbHdBIiwiYXpwIjoiNzZiZTc5Y2ItM2E1Ni00ZTE3LTg3NzYtNDI1Nzc5MjRjYz" + + "c2IiwiYXV0aF90aW1lIjoxNTY5NjU4MDk1LCJleHAiOjE1Njk2NjE5OTUsIm5iZiI6MTU2OTY1ODM5NSwianRpIjoiZjJkNWI2YzE" + + "tNTIxYi00Y2Y5LThlNWEtOTg5NGJhNmE0MzkyIiwiaXNzIjoiaHR0cHM6Ly9ub3JkaWNhcGlzLmN1cml0eS5pby9-IiwiYXVkIjoi" + + "NzZiZTc5Y2ItM2E1Ni00ZTE3LTg3NzYtNDI1Nzc5MjRjYzc2Iiwic3ViIjoibmlrb3MiLCJpYXQiOjE1Njk2NTgzOTUsInB1cnBvc" + + "2UiOiJpZCJ9.Wd458zNmXggpkDN6vbS3-aiajh4-VbkmcStLYUqahYJUp9p-AUI_RZttWvwh3UDMG9rWww_ya8KFK_SkPfKooEaSN" + + "OjOhw0ox4d-9lgti3J49eRyO20RViXvRHyLVtcjv5IaqvMXgwW60Thubv19OION7DstyArffcxNNSpiqDq6wjd0T2DJ3gSXXlJHLT" + + "Wrry3svqu1j_GCbHc04XYGicxsusKgc3n22dh4I6p4trdo0Gu5Un0bZ8Yov7IzWItqTgm9X5r9gZlAOLcAuK1WTwkzAwZJ24HgvxK" + + "muYfV_4ZCg_VPN2Op8YPuRAQOgUERpeTv1RDFTOG9GKZIMBVR0A"; // Decode the ID Token and verify the claims are the correct. Map decodedClaims = JwtDecoder.decode(jwt); diff --git a/jetty-openid/src/test/java/org/eclipse/jetty/security/openid/OpenIdAuthenticationTest.java b/jetty-openid/src/test/java/org/eclipse/jetty/security/openid/OpenIdAuthenticationTest.java index 2dfa30e1e61e..c5b50298e112 100644 --- a/jetty-openid/src/test/java/org/eclipse/jetty/security/openid/OpenIdAuthenticationTest.java +++ b/jetty-openid/src/test/java/org/eclipse/jetty/security/openid/OpenIdAuthenticationTest.java @@ -110,7 +110,7 @@ public void setup() throws Exception context.setSecurityHandler(securityHandler); server.start(); - String redirectUri = "http://localhost:"+connector.getLocalPort() + "/j_security_check"; + String redirectUri = "http://localhost:" + connector.getLocalPort() + "/j_security_check"; openIdProvider.addRedirectUri(redirectUri); client = new HttpClient(); @@ -127,7 +127,7 @@ public void stop() throws Exception @Test public void testLoginLogout() throws Exception { - String appUriString = "http://localhost:"+connector.getLocalPort(); + String appUriString = "http://localhost:" + connector.getLocalPort(); // Initially not authenticated ContentResponse response = client.GET(appUriString + "/"); diff --git a/jetty-openid/src/test/java/org/eclipse/jetty/security/openid/OpenIdProvider.java b/jetty-openid/src/test/java/org/eclipse/jetty/security/openid/OpenIdProvider.java index 487d35c6b930..da84a291ece2 100644 --- a/jetty-openid/src/test/java/org/eclipse/jetty/security/openid/OpenIdProvider.java +++ b/jetty-openid/src/test/java/org/eclipse/jetty/security/openid/OpenIdProvider.java @@ -142,8 +142,8 @@ protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws Se final Request baseRequest = Request.getBaseRequest(req); final Response baseResponse = baseRequest.getResponse(); redirectUri += "?code=" + authCode + "&state=" + state; - int redirectCode = (baseRequest.getHttpVersion().getVersion() < HttpVersion.HTTP_1_1.getVersion() ? - HttpServletResponse.SC_MOVED_TEMPORARILY : HttpServletResponse.SC_SEE_OTHER); + int redirectCode = (baseRequest.getHttpVersion().getVersion() < HttpVersion.HTTP_1_1.getVersion() + ? HttpServletResponse.SC_MOVED_TEMPORARILY : HttpServletResponse.SC_SEE_OTHER); baseResponse.sendRedirect(redirectCode, resp.encodeRedirectURL(redirectUri)); } } diff --git a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java index e71c1e2ce552..025069dac0fb 100644 --- a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java +++ b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java @@ -24,7 +24,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; - import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; @@ -191,10 +190,10 @@ public static List