Merge branch `jetty-9.4.x` into `jetty-10.0.x`

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

# Conflicts:
#	Jenkinsfile
#	examples/async-rest/async-rest-webapp/src/test/java/org/eclipse/jetty/example/asyncrest/DemoServer.java
#	jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientTest.java
#	jetty-http/src/test/java/org/eclipse/jetty/http/HttpParserTest.java
#	jetty-http/src/test/java/org/eclipse/jetty/http/HttpTester.java
#	jetty-http/src/test/java/org/eclipse/jetty/http/MultiPartParserTest.java
#	jetty-http/src/test/java/org/eclipse/jetty/http/PathMapTest.java
#	jetty-http/src/test/java/org/eclipse/jetty/http/matchers/HttpFieldsMatchersTest.java
#	jetty-maven-plugin/src/test/java/org/eclipse/jetty/maven/plugin/it/TestGetContent.java
#	jetty-server/src/test/java/org/eclipse/jetty/server/CookieCutterLenientTest.java
#	jetty-server/src/test/java/org/eclipse/jetty/server/CookieCutterTest.java
#	jetty-server/src/test/java/org/eclipse/jetty/server/PartialRFC2616Test.java
#	jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ServletLifeCycleTest.java
#	jetty-servlets/src/test/java/org/eclipse/jetty/server/handler/gzip/GzipContentLengthTest.java
#	jetty-servlets/src/test/java/org/eclipse/jetty/server/handler/gzip/GzipDefaultNoRecompressTest.java
#	jetty-servlets/src/test/java/org/eclipse/jetty/servlets/MultipartFilterTest.java
#	jetty-unixsocket/src/test/java/org/eclipse/jetty/unixsocket/UnixSocketClient.java
#	jetty-util/src/test/java/org/eclipse/jetty/util/B64CodeTest.java
#	jetty-util/src/test/java/org/eclipse/jetty/util/resource/FileSystemResourceTest.java
#	jetty-util/src/test/java/org/eclipse/jetty/util/ssl/X509Test.java
#	jetty-webapp/src/test/java/org/eclipse/jetty/webapp/ClasspathPatternTest.java
#	jetty-websocket/javax-websocket-client-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/LargeMessageTest.java
#	jetty-websocket/javax-websocket-client-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/endpoints/ClientAnnotatedEndpointScannerGoodSignaturesTest.java
#	jetty-websocket/javax-websocket-client-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/endpoints/ClientAnnotatedEndpointScannerInvalidSignaturesTest.java
#	jetty-websocket/javax-websocket-client-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/metadata/EncoderMetadataSetTest.java
#	jetty-websocket/javax-websocket-client-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/utils/ReflectUtilsTest.java
#	jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/ConfiguratorTest.java
#	jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/DelayedStartClientOnServerTest.java
#	jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/RestartContextTest.java
#	jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/ServerAnnotatedEndpointScannerGoodSignaturesTest.java
#	jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/ServerAnnotatedEndpointScannerInvalidSignaturesTest.java
#	jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/SessionTest.java
#	jetty-websocket/jetty-websocket-tests/src/test/java/org/eclipse/jetty/websocket/tests/ErrorCloseTest.java
#	jetty-websocket/jetty-websocket-tests/src/test/java/org/eclipse/jetty/websocket/tests/client/ClientConnectTest.java
#	jetty-websocket/jetty-websocket-tests/src/test/java/org/eclipse/jetty/websocket/tests/client/ClientSessionsTest.java
#	jetty-websocket/jetty-websocket-tests/src/test/java/org/eclipse/jetty/websocket/tests/client/WebSocketClientTest.java
#	jetty-websocket/jetty-websocket-tests/src/test/java/org/eclipse/jetty/websocket/tests/server/PartialListenerTest.java
#	jetty-websocket/websocket-api/src/test/java/org/eclipse/jetty/websocket/api/extensions/ExtensionConfigTest.java
#	jetty-websocket/websocket-api/src/test/java/org/eclipse/jetty/websocket/api/util/QuoteUtilQuoteTest.java
#	jetty-websocket/websocket-api/src/test/java/org/eclipse/jetty/websocket/api/util/QuoteUtilTest.java
#	jetty-websocket/websocket-client/src/test/java/org/eclipse/jetty/websocket/client/ConnectionManagerTest.java
#	jetty-websocket/websocket-client/src/test/java/org/eclipse/jetty/websocket/client/TomcatServerQuirksTest.java
#	jetty-websocket/websocket-client/src/test/java/org/eclipse/jetty/websocket/client/WebSocketClientInitTest.java
#	jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/GeneratorTest.java
#	jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/ParserTest.java
#	jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/TextPayloadParserTest.java
#	jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/ab/TestABCase11.java
#	jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/ab/TestABCase12.java
#	jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/ab/TestABCase2.java
#	jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/ab/TestABCase4.java
#	jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/ab/TestABCase73.java
#	jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/events/EventDriverTest.java
#	jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/events/JettyAnnotatedScannerTest.java
#	jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/extensions/compress/ByteAccumulatorTest.java
#	jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/extensions/compress/DeflateFrameExtensionTest.java
#	jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/extensions/compress/PerMessageDeflateExtensionTest.java
#	jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/io/ConnectionStateTest.java
#	jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/io/http/HttpResponseHeaderParserTest.java
#	jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/message/MessageDebug.java
#	jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/message/Utf8CharBufferTest.java
#	jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/test/UnitGenerator.java
#	jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/util/Utf8PartialBuilderTest.java
#	jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/RedirectWebSocketClientTest.java
#	jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/SimpleServletServer.java
#	jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/ab/TestABCase1.java
#	jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/ab/TestABCase2.java
#	jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/ab/TestABCase3.java
#	jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/ab/TestABCase4.java
#	jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/ab/TestABCase5.java
#	jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/ab/TestABCase6.java
#	jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/ab/TestABCase6BadUTF.java
#	jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/ab/TestABCase6GoodUTF.java
#	jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/ab/TestABCase7.java
#	jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/ab/TestABCase7BadStatusCodes.java
#	jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/ab/TestABCase7GoodStatusCodes.java
#	jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/ab/TestABCase9.java
#	pom.xml
#	tests/test-continuation/src/test/java/org/eclipse/jetty/continuation/ContinuationsTest.java
#	tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/JdbcTestHelper.java
#	tests/test-webapps/test-jetty-webapp/src/test/java/org/eclipse/jetty/TestServer.java
#	tests/test-webapps/test-proxy-webapp/src/test/java/org/eclipse/jetty/TestTransparentProxyServer.java
This commit is contained in:
Joakim Erdfelt 2020-01-15 12:20:20 -06:00
commit 01a5974f4b
No known key found for this signature in database
GPG Key ID: 2D0E1FB8FE4B68B4
207 changed files with 1532 additions and 1539 deletions

8
Jenkinsfile vendored
View File

@ -11,7 +11,7 @@ pipeline {
agent { node { label 'linux' } }
options { timeout(time: 120, unit: 'MINUTES') }
steps {
mavenBuild("jdk11", "-Pmongodb clean install", "maven3", true) // -Pautobahn
mavenBuild("jdk11", "-T3 -Pmongodb clean install", "maven3", true) // -Pautobahn
// Collect up the jacoco execution results (only on main build)
jacoco inclusionPattern: '**/org/eclipse/jetty/**/*.class',
exclusionPattern: '' +
@ -44,7 +44,7 @@ pipeline {
agent { node { label 'linux' } }
steps {
timeout(time: 120, unit: 'MINUTES') {
mavenBuild("jdk13", "-Pmongodb clean install", "maven3", true)
mavenBuild("jdk13", "-T3 -Pmongodb clean install", "maven3", true)
warnings consoleParsers: [[parserName: 'Maven'], [parserName: 'Java']]
junit testResults: '**/target/surefire-reports/*.xml,**/target/invoker-reports/TEST*.xml'
}
@ -55,7 +55,7 @@ pipeline {
agent { node { label 'linux' } }
steps {
timeout(time: 30, unit: 'MINUTES') {
mavenBuild("jdk11", "install javadoc:javadoc -DskipTests", "maven3", true)
mavenBuild("jdk11", "install javadoc:javadoc javadoc:aggregate-jar -DskipTests -Dpmd.skip=true -Dcheckstyle.skip=true", "maven3", true)
warnings consoleParsers: [[parserName: 'Maven'], [parserName: 'JavaDoc'], [parserName: 'Java']]
}
}
@ -116,7 +116,7 @@ def mavenBuild(jdk, cmdline, mvnName, junitPublishDisabled) {
mavenOpts: mavenOpts,
mavenLocalRepo: localRepo) {
// Some common Maven command line + provided command line
sh "mvn -Pci -V -B -T3 -e -fae -Dmaven.test.failure.ignore=true -Djetty.testtracker.log=true $cmdline -Dunix.socket.tmp=" + env.JENKINS_HOME
sh "mvn -Pci -V -B -e -fae -Dmaven.test.failure.ignore=true -Djetty.testtracker.log=true $cmdline -Dunix.socket.tmp=" + env.JENKINS_HOME
}
}

View File

@ -14,12 +14,6 @@
<property name="fileExtensions" value="java"/>
<!-- reference to suppressions filter for both eclipse and intellij checkstyle plugins -->
<module name="SuppressionFilter">
<property name="file" value="${checkstyle.suppressions.file}"/>
<property name="optional" value="true"/>
</module>
<!-- Excludes all 'module-info.java' files -->
<!-- See https://checkstyle.org/config_filefilters.html -->
<module name="BeforeExecutionExclusionFileFilter">

View File

@ -1,35 +0,0 @@
<?xml version="1.0"?>
<!DOCTYPE suppressions PUBLIC
"-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
"https://checkstyle.org/dtds/suppressions_1_2.dtd">
<suppressions>
<!-- all /target/ directories -->
<suppress checks=".*" files="[/\\]target[/\\]generated-sources[/\\]" />
<!-- General JUnit Test Cases -->
<suppress checks="AbbreviationAsWordInNameCheck"
files="[/\\]src[/\\]test[/\\]java[/\\]" />
<suppress checks="AvoidEscapedUnicodeCharactersCheck"
files="[/\\]src[/\\]test[/\\]java[/\\]" />
<suppress checks="LocalVariableNameCheck"
files="[/\\]src[/\\]test[/\\]java[/\\]" />
<suppress checks="MethodNameCheck"
files="[/\\]src[/\\]test[/\\]java[/\\]" />
<suppress checks="TypeNameCheck"
files="[/\\]src[/\\]test[/\\]java[/\\]" />
<!-- jetty-jmh specific -->
<suppress checks="AbbreviationAsWordInNameCheck"
files="[/\\]jetty-jmh[/\\]src[/\\]main[/\\]java[/\\]" />
<suppress checks="AvoidEscapedUnicodeCharactersCheck"
files="[/\\]jetty-jmh[/\\]src[/\\]main[/\\]java[/\\]" />
<suppress checks="LocalVariableNameCheck"
files="[/\\]jetty-jmh[/\\]src[/\\]main[/\\]java[/\\]" />
<suppress checks="MethodNameCheck"
files="[/\\]jetty-jmh[/\\]src[/\\]main[/\\]java[/\\]" />
<suppress checks="TypeNameCheck"
files="[/\\]jetty-jmh[/\\]src[/\\]main[/\\]java[/\\]" />
</suppressions>

View File

@ -220,7 +220,7 @@ public class TestAnnotationParser
}
@Test
public void testJep238MultiReleaseInJar_JDK10() throws Exception
public void testJep238MultiReleaseInJarJDK10() throws Exception
{
File jdk10Jar = MavenTestingUtils.getTestResourceFile("jdk10/multirelease-10.jar");
AnnotationParser parser = new AnnotationParser();

View File

@ -48,7 +48,7 @@ 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()
@ -106,7 +106,7 @@ public class ClientConnectionCloseTest extends AbstractHttpClientServerTest
@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()
{
@ -149,7 +149,7 @@ public class ClientConnectionCloseTest extends AbstractHttpClientServerTest
@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()
@ -214,7 +214,7 @@ public class ClientConnectionCloseTest extends AbstractHttpClientServerTest
@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()
{

View File

@ -115,51 +115,51 @@ public class HttpClientAuthenticationTest extends AbstractHttpClientServerTest
@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 class HttpClientAuthenticationTest extends AbstractHttpClientServerTest
@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 class HttpClientAuthenticationTest extends AbstractHttpClientServerTest
@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 class HttpClientAuthenticationTest extends AbstractHttpClientServerTest
@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 class HttpClientAuthenticationTest extends AbstractHttpClientServerTest
@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 class HttpClientAuthenticationTest extends AbstractHttpClientServerTest
@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 class HttpClientAuthenticationTest extends AbstractHttpClientServerTest
@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 class HttpClientAuthenticationTest extends AbstractHttpClientServerTest
@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 class HttpClientAuthenticationTest extends AbstractHttpClientServerTest
@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 class HttpClientAuthenticationTest extends AbstractHttpClientServerTest
@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()

View File

@ -63,7 +63,7 @@ public class HttpClientChunkedContentTest
}
@Test
public void test_Server_HeadersPauseTerminal_Client_Response() throws Exception
public void testServerHeadersPauseTerminalClientResponse() throws Exception
{
startClient();
@ -115,7 +115,7 @@ public class HttpClientChunkedContentTest
}
@Test
public void test_Server_ContentTerminal_Client_ContentDelay() throws Exception
public void testServerContentTerminalClientContentDelay() throws Exception
{
startClient();

View File

@ -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 class HttpClientRedirectTest extends AbstractHttpClientServerTest
@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 class HttpClientRedirectTest extends AbstractHttpClientServerTest
@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 class HttpClientRedirectTest extends AbstractHttpClientServerTest
@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 class HttpClientRedirectTest extends AbstractHttpClientServerTest
@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 class HttpClientRedirectTest extends AbstractHttpClientServerTest
@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 class HttpClientRedirectTest extends AbstractHttpClientServerTest
@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 class HttpClientRedirectTest extends AbstractHttpClientServerTest
@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);
}

View File

@ -109,6 +109,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
// @checkstyle-disable-check : AvoidEscapedUnicodeCharactersCheck
@ExtendWith(WorkDirExtension.class)
public class HttpClientTest extends AbstractHttpClientServerTest
{
@ -152,7 +153,7 @@ public class HttpClientTest extends AbstractHttpClientServerTest
@ParameterizedTest
@ArgumentsSource(ScenarioProvider.class)
public void test_DestinationCount(Scenario scenario) throws Exception
public void testDestinationCount(Scenario scenario) throws Exception
{
start(scenario, new EmptyServerHandler());
@ -172,7 +173,7 @@ public class HttpClientTest extends AbstractHttpClientServerTest
@ParameterizedTest
@ArgumentsSource(ScenarioProvider.class)
public void test_GET_ResponseWithoutContent(Scenario scenario) throws Exception
public void testGETResponseWithoutContent(Scenario scenario) throws Exception
{
start(scenario, new EmptyServerHandler());
@ -184,7 +185,7 @@ public class HttpClientTest extends AbstractHttpClientServerTest
@ParameterizedTest
@ArgumentsSource(ScenarioProvider.class)
public void test_GET_ResponseWithContent(Scenario scenario) throws Exception
public void testGETResponseWithContent(Scenario scenario) throws Exception
{
byte[] data = new byte[]{0, 1, 2, 3, 4, 5, 6, 7};
start(scenario, new AbstractHandler()
@ -208,7 +209,7 @@ public class HttpClientTest extends AbstractHttpClientServerTest
@ParameterizedTest
@ArgumentsSource(ScenarioProvider.class)
public void test_GET_WithParameters_ResponseWithContent(Scenario scenario) throws Exception
public void testGETWithParametersResponseWithContent(Scenario scenario) throws Exception
{
String paramName1 = "a";
String paramName2 = "b";
@ -241,7 +242,7 @@ public class HttpClientTest extends AbstractHttpClientServerTest
@ParameterizedTest
@ArgumentsSource(ScenarioProvider.class)
public void test_GET_WithParametersMultiValued_ResponseWithContent(Scenario scenario) throws Exception
public void testGETWithParametersMultiValuedResponseWithContent(Scenario scenario) throws Exception
{
String paramName1 = "a";
String paramName2 = "b";
@ -280,7 +281,7 @@ public class HttpClientTest extends AbstractHttpClientServerTest
@ParameterizedTest
@ArgumentsSource(ScenarioProvider.class)
public void test_POST_WithParameters(Scenario scenario) throws Exception
public void testPOSTWithParameters(Scenario scenario) throws Exception
{
String paramName = "a";
String paramValue = "\u20AC";
@ -312,7 +313,7 @@ public class HttpClientTest extends AbstractHttpClientServerTest
@ParameterizedTest
@ArgumentsSource(ScenarioProvider.class)
public void test_PUT_WithParameters(Scenario scenario) throws Exception
public void testPUTWithParameters(Scenario scenario) throws Exception
{
String paramName = "a";
String paramValue = "\u20AC";
@ -346,7 +347,7 @@ public class HttpClientTest extends AbstractHttpClientServerTest
@ParameterizedTest
@ArgumentsSource(ScenarioProvider.class)
public void test_POST_WithParameters_WithContent(Scenario scenario) throws Exception
public void testPOSTWithParametersWithContent(Scenario scenario) throws Exception
{
byte[] content = {0, 1, 2, 3};
String paramName = "a";
@ -381,7 +382,7 @@ public class HttpClientTest extends AbstractHttpClientServerTest
@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()
{
@ -412,7 +413,7 @@ public class HttpClientTest extends AbstractHttpClientServerTest
@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()
{
@ -444,7 +445,7 @@ public class HttpClientTest extends AbstractHttpClientServerTest
@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());
@ -493,7 +494,7 @@ public class HttpClientTest extends AbstractHttpClientServerTest
@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()
{
@ -534,7 +535,7 @@ public class HttpClientTest extends AbstractHttpClientServerTest
@ParameterizedTest
@ArgumentsSource(ScenarioProvider.class)
public void test_ExchangeIsComplete_OnlyWhenBothRequestAndResponseAreComplete(Scenario scenario) throws Exception
public void testExchangeIsCompleteOnlyWhenBothRequestAndResponseAreComplete(Scenario scenario) throws Exception
{
start(scenario, new AbstractHandler()
{
@ -613,7 +614,7 @@ public class HttpClientTest extends AbstractHttpClientServerTest
@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()
{
@ -676,7 +677,7 @@ public class HttpClientTest extends AbstractHttpClientServerTest
@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());
@ -706,7 +707,7 @@ public class HttpClientTest extends AbstractHttpClientServerTest
@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
{
long idleTimeout = 1000;
start(scenario, new AbstractHandler()
@ -821,7 +822,7 @@ public class HttpClientTest extends AbstractHttpClientServerTest
@ParameterizedTest
@ArgumentsSource(ScenarioProvider.class)
public void test_HEAD_With_ResponseContentLength(Scenario scenario) throws Exception
public void testHEADWithResponseContentLength(Scenario scenario) throws Exception
{
int length = 1024;
start(scenario, new AbstractHandler()
@ -1622,7 +1623,7 @@ public class HttpClientTest extends AbstractHttpClientServerTest
@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()

View File

@ -59,6 +59,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
public class HttpClientURITest extends AbstractHttpClientServerTest
{
// @checkstyle-disable-check : AvoidEscapedUnicodeCharactersCheck
@ParameterizedTest
@ArgumentsSource(ScenarioProvider.class)
public void testIPv6Host(Scenario scenario) throws Exception

View File

@ -59,7 +59,7 @@ public class HttpConnectionLifecycleTest extends AbstractHttpClientServerTest
@ParameterizedTest
@ArgumentsSource(ScenarioProvider.class)
public void test_SuccessfulRequest_ReturnsConnection(Scenario scenario) throws Exception
public void testSuccessfulRequestReturnsConnection(Scenario scenario) throws Exception
{
start(scenario, new EmptyServerHandler());
@ -109,7 +109,7 @@ public class HttpConnectionLifecycleTest extends AbstractHttpClientServerTest
@ParameterizedTest
@ArgumentsSource(ScenarioProvider.class)
public void test_FailedRequest_RemovesConnection(Scenario scenario) throws Exception
public void testFailedRequestRemovesConnection(Scenario scenario) throws Exception
{
start(scenario, new EmptyServerHandler());
@ -163,7 +163,7 @@ public class HttpConnectionLifecycleTest extends AbstractHttpClientServerTest
@ParameterizedTest
@ArgumentsSource(ScenarioProvider.class)
public void test_BadRequest_RemovesConnection(Scenario scenario) throws Exception
public void testBadRequestRemovesConnection(Scenario scenario) throws Exception
{
start(scenario, new EmptyServerHandler());
@ -224,7 +224,7 @@ public class HttpConnectionLifecycleTest extends AbstractHttpClientServerTest
@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());
@ -297,7 +297,7 @@ public class HttpConnectionLifecycleTest extends AbstractHttpClientServerTest
@ParameterizedTest
@ArgumentsSource(ScenarioProvider.class)
public void test_ConnectionFailure_RemovesConnection(Scenario scenario) throws Exception
public void testConnectionFailureRemovesConnection(Scenario scenario) throws Exception
{
start(scenario, new EmptyServerHandler());
@ -331,7 +331,7 @@ public class HttpConnectionLifecycleTest extends AbstractHttpClientServerTest
@ParameterizedTest
@ArgumentsSource(ScenarioProvider.class)
public void test_ResponseWithConnectionCloseHeader_RemovesConnection(Scenario scenario) throws Exception
public void testResponseWithConnectionCloseHeaderRemovesConnection(Scenario scenario) throws Exception
{
start(scenario, new AbstractHandler()
{
@ -376,7 +376,7 @@ public class HttpConnectionLifecycleTest extends AbstractHttpClientServerTest
@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))
{
@ -434,7 +434,7 @@ public class HttpConnectionLifecycleTest extends AbstractHttpClientServerTest
@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());

View File

@ -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.List;
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 @@ public class HttpCookieTest extends AbstractHttpClientServerTest
@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 @@ public class HttpCookieTest extends AbstractHttpClientServerTest
@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 @@ public class HttpCookieTest extends AbstractHttpClientServerTest
@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 @@ public class HttpCookieTest extends AbstractHttpClientServerTest
@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 class HttpCookieTest extends AbstractHttpClientServerTest
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 @@ public class HttpCookieTest extends AbstractHttpClientServerTest
@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 class HttpCookieTest extends AbstractHttpClientServerTest
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 @@ public class HttpCookieTest extends AbstractHttpClientServerTest
@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 class HttpCookieTest extends AbstractHttpClientServerTest
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 @@ public class HttpCookieTest extends AbstractHttpClientServerTest
@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 class HttpCookieTest extends AbstractHttpClientServerTest
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 @@ public class HttpCookieTest extends AbstractHttpClientServerTest
@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 class HttpCookieTest extends AbstractHttpClientServerTest
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 @@ public class HttpCookieTest extends AbstractHttpClientServerTest
@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 class HttpCookieTest extends AbstractHttpClientServerTest
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 @@ public class HttpCookieTest extends AbstractHttpClientServerTest
@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 class HttpCookieTest extends AbstractHttpClientServerTest
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 @@ public class HttpCookieTest extends AbstractHttpClientServerTest
@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 class HttpCookieTest extends AbstractHttpClientServerTest
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)

View File

@ -49,10 +49,11 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
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 class Usage
}
@Test
public void testPOSTWithParams_ShortAPI() throws Exception
public void testPOSTWithParamsShortAPI() throws Exception
{
HttpClient client = new HttpClient();
client.start();

View File

@ -54,7 +54,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());
@ -74,7 +74,7 @@ public class HttpDestinationOverHTTPTest extends AbstractHttpClientServerTest
@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());
@ -98,7 +98,7 @@ public class HttpDestinationOverHTTPTest extends AbstractHttpClientServerTest
@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());
@ -155,7 +155,7 @@ public class HttpDestinationOverHTTPTest extends AbstractHttpClientServerTest
@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());
@ -182,7 +182,7 @@ public class HttpDestinationOverHTTPTest extends AbstractHttpClientServerTest
@ParameterizedTest
@ArgumentsSource(ScenarioProvider.class)
public void test_IdleConnection_IdleTimeout(Scenario scenario) throws Exception
public void testIdleConnectionIdleTimeout(Scenario scenario) throws Exception
{
startServer(scenario, new EmptyServerHandler());
long idleTimeout = 1000;
@ -209,7 +209,7 @@ public class HttpDestinationOverHTTPTest extends AbstractHttpClientServerTest
@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();

View File

@ -63,7 +63,7 @@ public class HttpReceiverOverHTTPTest
private ByteArrayEndPoint endPoint;
private HttpConnectionOverHTTP connection;
public static Stream<Arguments> complianceModes() throws Exception
public static Stream<Arguments> complianceModes()
{
return Stream.of(
HttpCompliance.RFC7230,
@ -106,7 +106,7 @@ public class HttpReceiverOverHTTPTest
@ParameterizedTest
@MethodSource("complianceModes")
public void test_Receive_NoResponseContent(HttpCompliance compliance) throws Exception
public void testReceiveNoResponseContent(HttpCompliance compliance) throws Exception
{
init(compliance);
endPoint.addInput(
@ -130,7 +130,7 @@ public class HttpReceiverOverHTTPTest
@ParameterizedTest
@MethodSource("complianceModes")
public void test_Receive_ResponseContent(HttpCompliance compliance) throws Exception
public void testReceiveResponseContent(HttpCompliance compliance) throws Exception
{
init(compliance);
String content = "0123456789ABCDEF";
@ -158,7 +158,7 @@ public class HttpReceiverOverHTTPTest
@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";
@ -180,7 +180,7 @@ public class HttpReceiverOverHTTPTest
@ParameterizedTest
@MethodSource("complianceModes")
public void test_Receive_ResponseContent_IdleTimeout(HttpCompliance compliance) throws Exception
public void testReceiveResponseContentIdleTimeout(HttpCompliance compliance) throws Exception
{
init(compliance);
endPoint.addInput(
@ -201,7 +201,7 @@ public class HttpReceiverOverHTTPTest
@ParameterizedTest
@MethodSource("complianceModes")
public void test_Receive_BadResponse(HttpCompliance compliance) throws Exception
public void testReceiveBadResponse(HttpCompliance compliance) throws Exception
{
init(compliance);
endPoint.addInput(
@ -220,7 +220,7 @@ public class HttpReceiverOverHTTPTest
@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<>())

View File

@ -63,7 +63,7 @@ public class HttpSenderOverHTTPTest
}
@Test
public void test_Send_NoRequestContent() throws Exception
public void testSendNoRequestContent() throws Exception
{
ByteArrayEndPoint endPoint = new ByteArrayEndPoint();
HttpDestination destination = new DuplexHttpDestination(client, new Origin("http", "localhost", 8080));
@ -97,7 +97,7 @@ public class HttpSenderOverHTTPTest
@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);
HttpDestination destination = new DuplexHttpDestination(client, new Origin("http", "localhost", 8080));
@ -125,7 +125,7 @@ public class HttpSenderOverHTTPTest
}
@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
@ -157,7 +157,7 @@ public class HttpSenderOverHTTPTest
}
@Test
public void test_Send_NoRequestContent_IncompleteFlush_Exception() throws Exception
public void testSendNoRequestContentIncompleteFlushException() throws Exception
{
ByteArrayEndPoint endPoint = new ByteArrayEndPoint("", 16);
HttpDestination destination = new DuplexHttpDestination(client, new Origin("http", "localhost", 8080));
@ -193,7 +193,7 @@ public class HttpSenderOverHTTPTest
}
@Test
public void test_Send_SmallRequestContent_InOneBuffer() throws Exception
public void testSendSmallRequestContentInOneBuffer() throws Exception
{
ByteArrayEndPoint endPoint = new ByteArrayEndPoint();
HttpDestination destination = new DuplexHttpDestination(client, new Origin("http", "localhost", 8080));
@ -228,7 +228,7 @@ public class HttpSenderOverHTTPTest
}
@Test
public void test_Send_SmallRequestContent_InTwoBuffers() throws Exception
public void testSendSmallRequestContentInTwoBuffers() throws Exception
{
ByteArrayEndPoint endPoint = new ByteArrayEndPoint();
HttpDestination destination = new DuplexHttpDestination(client, new Origin("http", "localhost", 8080));
@ -264,7 +264,7 @@ public class HttpSenderOverHTTPTest
}
@Test
public void test_Send_SmallRequestContent_Chunked_InTwoChunks() throws Exception
public void testSendSmallRequestContentChunkedInTwoChunks() throws Exception
{
ByteArrayEndPoint endPoint = new ByteArrayEndPoint();
HttpDestination destination = new DuplexHttpDestination(client, new Origin("http", "localhost", 8080));

View File

@ -62,6 +62,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
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

View File

@ -51,6 +51,7 @@ public class TypedContentProviderTest extends AbstractHttpClientServerTest
final String value1 = "1";
final String name2 = "b";
final String value2 = "2";
// @checkstyle-disable-check : AvoidEscapedUnicodeCharactersCheck
final String value3 = "\u20AC";
start(scenario, new AbstractHandler()

View File

@ -86,13 +86,13 @@ public class AppLifeCycleTest
}
@Test
public void testFindPath_Deployed_Deployed()
public void testFindPathDeployedDeployed()
{
assertNoPath("deployed", "deployed");
}
@Test
public void testFindPath_Deployed_Started()
public void testFindPathDeployedStarted()
{
List<String> expected = new ArrayList<String>();
expected.add("deployed");
@ -102,7 +102,7 @@ public class AppLifeCycleTest
}
@Test
public void testFindPath_Deployed_Undeployed()
public void testFindPathDeployedUndeployed()
{
List<String> expected = new ArrayList<String>();
expected.add("deployed");
@ -112,7 +112,7 @@ public class AppLifeCycleTest
}
@Test
public void testFindPath_Started_Deployed()
public void testFindPathStartedDeployed()
{
List<String> expected = new ArrayList<String>();
expected.add("started");
@ -122,13 +122,13 @@ public class AppLifeCycleTest
}
@Test
public void testFindPath_Started_Started()
public void testFindPathStartedStarted()
{
assertNoPath("started", "started");
}
@Test
public void testFindPath_Started_Undeployed()
public void testFindPathStartedUndeployed()
{
List<String> expected = new ArrayList<String>();
expected.add("started");
@ -140,7 +140,7 @@ public class AppLifeCycleTest
}
@Test
public void testFindPath_Undeployed_Deployed()
public void testFindPathUndeployedDeployed()
{
List<String> expected = new ArrayList<String>();
expected.add("undeployed");
@ -150,7 +150,7 @@ public class AppLifeCycleTest
}
@Test
public void testFindPath_Undeployed_Started()
public void testFindPathUndeployedStarted()
{
List<String> expected = new ArrayList<String>();
expected.add("undeployed");
@ -162,7 +162,7 @@ public class AppLifeCycleTest
}
@Test
public void testFindPath_Undeployed_Uavailable()
public void testFindPathUndeployedUnavailable()
{
assertNoPath("undeployed", "undeployed");
}

View File

@ -63,7 +63,7 @@ public class BadAppDeployTest
}
@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 class BadAppDeployTest
}
@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]

View File

@ -31,7 +31,7 @@ import org.junit.jupiter.api.Test;
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 class DeploymentManagerLifeCyclePathTest
}
@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 class DeploymentManagerLifeCyclePathTest
}
@Test
public void testStateTransition_DeployedToUndeployed() throws Exception
public void testStateTransitionDeployedToUndeployed() throws Exception
{
DeploymentManager depman = new DeploymentManager();
depman.setDefaultLifeCycleGoal(null); // no default

View File

@ -64,6 +64,8 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
public class HttpClientTest extends AbstractHttpClientServerTest
{
// @checkstyle-disable-check : AvoidEscapedUnicodeCharactersCheck
@Test
public void testGETResponseWithoutContent() throws Exception
{

View File

@ -47,11 +47,11 @@ public class DrupalHTTP2FastCGIProxyServer
// 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 class DrupalHTTP2FastCGIProxyServer
// 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);

View File

@ -52,12 +52,12 @@ public class WordPressHTTP2FastCGIProxyServer
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 class WordPressHTTP2FastCGIProxyServer
// 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);

View File

@ -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)
{

View File

@ -55,7 +55,7 @@ public class CookieCutterTest
* Example from RFC2109 and RFC2965
*/
@Test
public void testRFC_Single()
public void testRFCSingle()
{
String rawCookie = "$Version=\"1\"; Customer=\"WILE_E_COYOTE\"; $Path=\"/acme\"";
@ -69,7 +69,7 @@ public class CookieCutterTest
* Example from RFC2109 and RFC2965
*/
@Test
public void testRFC_Double()
public void testRFCDouble()
{
String rawCookie = "$Version=\"1\"; " +
"Customer=\"WILE_E_COYOTE\"; $Path=\"/acme\"; " +
@ -86,7 +86,7 @@ public class CookieCutterTest
* Example from RFC2109 and RFC2965
*/
@Test
public void testRFC_Triple()
public void testRFCTriple()
{
String rawCookie = "$Version=\"1\"; " +
"Customer=\"WILE_E_COYOTE\"; $Path=\"/acme\"; " +
@ -105,7 +105,7 @@ public class CookieCutterTest
* Example from RFC2109 and RFC2965
*/
@Test
public void testRFC_PathExample()
public void testRFCPathExample()
{
String rawCookie = "$Version=\"1\"; " +
"Part_Number=\"Riding_Rocket_0023\"; $Path=\"/acme/ammo\"; " +
@ -122,7 +122,7 @@ public class CookieCutterTest
* Example from RFC2109
*/
@Test
public void testRFC2109_CookieSpoofingExample()
public void testRFC2109CookieSpoofingExample()
{
String rawCookie = "$Version=\"1\"; " +
"session_id=\"1234\"; " +
@ -139,7 +139,7 @@ public class CookieCutterTest
* Example from RFC2965
*/
@Test
public void testRFC2965_CookieSpoofingExample()
public void testRFC2965CookieSpoofingExample()
{
String rawCookie = "$Version=\"1\"; session_id=\"1234\", " +
"$Version=\"1\"; session_id=\"1111\"; $Domain=\".cracker.edu\"";
@ -160,7 +160,7 @@ public class CookieCutterTest
* Example from RFC6265
*/
@Test
public void testRFC6265_SidExample()
public void testRFC6265SidExample()
{
String rawCookie = "SID=31d4d96e407aad42";
@ -174,7 +174,7 @@ public class CookieCutterTest
* Example from RFC6265
*/
@Test
public void testRFC6265_SidLangExample()
public void testRFC6265SidLangExample()
{
String rawCookie = "SID=31d4d96e407aad42; lang=en-US";

View File

@ -32,9 +32,8 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
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 class HttpFieldTest
}
@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 class HttpFieldTest
}
@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 class HttpFieldTest
}
@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 class HttpFieldTest
}
@Test
public void testQualityContainsList() throws Exception
public void testQualityContainsList()
{
HttpField field;

View File

@ -36,7 +36,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
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");

View File

@ -48,6 +48,7 @@ import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertSame;
import static org.junit.jupiter.api.Assertions.assertTrue;
// @checkstyle-disable-check : AvoidEscapedUnicodeCharactersCheck
public class HttpParserTest
{
/**
@ -69,16 +70,16 @@ public class HttpParserTest
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 testHttpMethod()
{
assertNull(HttpMethod.lookAheadGet(BufferUtil.toBuffer("Wibble ")));
assertNull(HttpMethod.lookAheadGet(BufferUtil.toBuffer("GET")));
@ -1488,7 +1489,7 @@ public class HttpParserTest
}
@Test
public void testResponseReasonIso8859_1()
public void testResponseReasonIso88591()
{
ByteBuffer buffer = BufferUtil.toBuffer(
"HTTP/1.1 302 déplacé temporairement\r\n" +

View File

@ -119,6 +119,7 @@ public class HttpURITest
@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"));

View File

@ -29,13 +29,13 @@ import static org.junit.jupiter.api.Assertions.assertNull;
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 class MimeTypesTest
}
@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");

View File

@ -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 class QuotedQualityCSVTest
}
@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 class QuotedQualityCSVTest
}
@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 class QuotedQualityCSVTest
}
@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 class QuotedQualityCSVTest
}
@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 class QuotedQualityCSVTest
}
@Test
public void test7231_5_3_4_example1()
public void test7231Sec534Example1()
{
QuotedQualityCSV values = new QuotedQualityCSV();
values.addValue("compress, gzip");

View File

@ -28,7 +28,7 @@ import static org.junit.jupiter.api.Assertions.fail;
public class SyntaxTest
{
@Test
public void testRequireValidRFC2616Token_Good()
public void testRequireValidRFC2616TokenGood()
{
String[] tokens = {
"name",
@ -50,7 +50,7 @@ public class SyntaxTest
}
@Test
public void testRequireValidRFC2616Token_Bad()
public void testRequireValidRFC2616TokenBad()
{
String[] tokens = {
"\"name\"",
@ -81,7 +81,7 @@ public class SyntaxTest
}
@Test
public void testRequireValidRFC6265CookieValue_Good()
public void testRequireValidRFC6265CookieValueGood()
{
String[] values = {
"value",
@ -102,7 +102,7 @@ public class SyntaxTest
}
@Test
public void testRequireValidRFC6265CookieValue_Bad()
public void testRequireValidRFC6265CookieValueBad()
{
String[] values = {
"va\tlue",

View File

@ -28,6 +28,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
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<String> pathmap, String path, String expectedValue)

View File

@ -56,6 +56,7 @@ public class ServletPathSpecOrderTest
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"));

View File

@ -87,7 +87,7 @@ public class UriTemplatePathSpecTest
}
@Test
public void testExactPathSpec_TestWebapp()
public void testExactPathSpecTestWebapp()
{
UriTemplatePathSpec spec = new UriTemplatePathSpec("/deep.thought/");
assertEquals("/deep.thought/", spec.getDeclaration(), "Spec.pathSpec");

View File

@ -87,7 +87,7 @@ public class ProxyProtocolTest
}
@Test
public void test_PROXY_GET_v1() throws Exception
public void testProxyGetV1() throws Exception
{
startServer(new AbstractHandler()
{
@ -139,7 +139,7 @@ public class ProxyProtocolTest
}
@Test
public void test_PROXY_GET_v2() throws Exception
public void testProxyGetV2() throws Exception
{
startServer(new AbstractHandler()
{

View File

@ -213,8 +213,8 @@ public class SmallThreadPoolLoadTest extends AbstractTest
}
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;

View File

@ -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 class HpackDecoderTest
}
@Test
public void testDecodeD_4() throws Exception
public void testDecodeD4() throws Exception
{
HpackDecoder decoder = new HpackDecoder(4096, 8192);
@ -277,7 +277,7 @@ public class HpackDecoderTest
/* 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 class HpackDecoderTest
}
@Test
public void test8_1_2_2_ConnectionSpecificHeaderFields() throws Exception
public void test8122ConnectionSpecificHeaderFields() throws Exception
{
MetaDataBuilder mdb;
@ -366,7 +366,7 @@ public class HpackDecoderTest
}
@Test
public void test8_1_2_3_RequestPseudoHeaderFields() throws Exception
public void test8123RequestPseudoHeaderFields() throws Exception
{
{
MetaDataBuilder mdb = new MetaDataBuilder(4096);

View File

@ -145,6 +145,7 @@ public class HpackTest
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);

View File

@ -131,7 +131,7 @@ public class NBitIntegerTest
}
@Test
public void testEncodeExampleD_1_1()
public void testEncodeExampleD11()
{
ByteBuffer buf = BufferUtil.allocate(16);
int p = BufferUtil.flipToFill(buf);
@ -146,7 +146,7 @@ public class NBitIntegerTest
}
@Test
public void testDecodeExampleD_1_1()
public void testDecodeExampleD11()
{
ByteBuffer buf = ByteBuffer.wrap(TypeUtil.fromHexString("77EaFF"));
buf.position(2);
@ -155,7 +155,7 @@ public class NBitIntegerTest
}
@Test
public void testEncodeExampleD_1_2()
public void testEncodeExampleD12()
{
ByteBuffer buf = BufferUtil.allocate(16);
int p = BufferUtil.flipToFill(buf);
@ -170,7 +170,7 @@ public class NBitIntegerTest
}
@Test
public void testDecodeExampleD_1_2()
public void testDecodeExampleD12()
{
ByteBuffer buf = ByteBuffer.wrap(TypeUtil.fromHexString("881f9a0aff"));
buf.position(2);
@ -179,7 +179,7 @@ public class NBitIntegerTest
}
@Test
public void testEncodeExampleD_1_3()
public void testEncodeExampleD13()
{
ByteBuffer buf = BufferUtil.allocate(16);
int p = BufferUtil.flipToFill(buf);
@ -194,7 +194,7 @@ public class NBitIntegerTest
}
@Test
public void testDecodeExampleD_1_3()
public void testDecodeExampleD13()
{
ByteBuffer buf = ByteBuffer.wrap(TypeUtil.fromHexString("882aFf"));
buf.position(1);

View File

@ -34,11 +34,11 @@ public class H2SpecServer
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);

View File

@ -82,7 +82,7 @@ public class HTTP2CServerTest extends AbstractServerTest
}
@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 class HTTP2CServerTest extends AbstractServerTest
}
@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 class HTTP2CServerTest extends AbstractServerTest
}
@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 class HTTP2CServerTest extends AbstractServerTest
}
@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 class HTTP2CServerTest extends AbstractServerTest
}
@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".

View File

@ -383,13 +383,14 @@ public class HTTP2ServerTest extends AbstractServerTest
@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)
{
// @checkstyle-disable-check : AvoidEscapedUnicodeCharactersCheck
// Invalid header name, the connection must be closed.
response.setHeader("Euro_(\u20AC)", "42");
}

View File

@ -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 class EmbeddedQueryManagerTest
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 class EmbeddedQueryManagerTest
b.indexing().index(Index.ALL).addIndexedEntity(SessionData.class).withProperties(properties);
Configuration c = b.build();
_manager.defineConfiguration(_name, c);
Cache<String, SessionData> _cache = _manager.getCache(_name);
cacheManager.defineConfiguration(name, c);
Cache<String, SessionData> cache = cacheManager.getCache(name);
//put some sessions into the cache
int numSessions = 10;
@ -92,11 +89,11 @@ public class EmbeddedQueryManagerTest
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<String> queryResult = qm.queryExpiredSessions(currentTime);
// Check that the result is correct

View File

@ -70,7 +70,7 @@ public class RemoteQueryManagerTest
serCtx.registerProtoFiles(fds);
serCtx.registerMarshaller(new SessionDataMarshaller());
RemoteCache<String, SessionData> _cache = remoteCacheManager.getCache(DEFAULT_CACHE_NAME);
RemoteCache<String, SessionData> cache = remoteCacheManager.getCache(DEFAULT_CACHE_NAME);
ByteArrayOutputStream baos;
try (InputStream is = RemoteQueryManagerTest.class.getClassLoader().getResourceAsStream("session.proto"))
@ -106,12 +106,12 @@ public class RemoteQueryManagerTest
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<String> queryResult = qm.queryExpiredSessions(currentTime);
// Check that the result is correct

View File

@ -146,10 +146,10 @@ public class CyclicTimeoutTest
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(() ->

View File

@ -744,7 +744,7 @@ public class SocketChannelEndPointTest
return;
}
EndPoint _endp = getEndPoint();
EndPoint endp = getEndPoint();
try
{
_last = TimeUnit.NANOSECONDS.toMillis(System.nanoTime());
@ -757,17 +757,17 @@ public class SocketChannelEndPointTest
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 class SocketChannelEndPointTest
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 class SocketChannelEndPointTest
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)
{

View File

@ -71,37 +71,37 @@ public class StringReplaceBenchmark
}
@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, "'", ""));
}

View File

@ -32,13 +32,10 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
/**
*
*/
public class IntegrationTestGetContent
{
@Test
public void get_content_response()
public void getContentResponse()
throws Exception
{
int port = getPort();

View File

@ -194,10 +194,10 @@ public class TestOSGiUtil
protected static Bundle getBundle(BundleContext bundleContext, String symbolicName)
{
Map<String, Bundle> _bundles = new HashMap<>();
Map<String, Bundle> bundles = new HashMap<>();
for (Bundle b : bundleContext.getBundles())
{
Bundle prevBundle = _bundles.put(b.getSymbolicName(), b);
Bundle prevBundle = bundles.put(b.getSymbolicName(), b);
String err = prevBundle != null ? "2 versions of the bundle " + b.getSymbolicName() +
" " +
b.getHeaders().get("Bundle-Version") +
@ -205,7 +205,7 @@ public class TestOSGiUtil
prevBundle.getHeaders().get("Bundle-Version") : "";
assertNull(err, prevBundle);
}
return _bundles.get(symbolicName);
return bundles.get(symbolicName);
}
protected static void assertActiveBundle(BundleContext bundleContext, String symbolicName) throws Exception

View File

@ -38,7 +38,7 @@ public class TestConfiguration
@Test
public void testIt() throws Exception
{
ClassLoader old_loader = Thread.currentThread().getContextClassLoader();
ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
try
{
@ -132,7 +132,7 @@ public class TestConfiguration
}
finally
{
Thread.currentThread().setContextClassLoader(old_loader);
Thread.currentThread().setContextClassLoader(oldLoader);
}
}
}

View File

@ -99,27 +99,27 @@ public class ConstraintTest
_config = _connector.getConnectionFactory(HttpConnectionFactory.class).getHttpConfiguration();
_server.setConnectors(new Connector[]{_connector});
ContextHandler _context = new ContextHandler();
SessionHandler _session = new SessionHandler();
ContextHandler contextHandler = new ContextHandler();
SessionHandler sessionHandler = new SessionHandler();
TestLoginService _loginService = new TestLoginService(TEST_REALM);
TestLoginService loginService = new TestLoginService(TEST_REALM);
_loginService.putUser("user0", new Password("password"), new String[]{});
_loginService.putUser("user", new Password("password"), new String[]{"user"});
_loginService.putUser("user2", new Password("password"), new String[]{"user"});
_loginService.putUser("admin", new Password("password"), new String[]{"user", "administrator"});
_loginService.putUser("user3", new Password("password"), new String[]{"foo"});
loginService.putUser("user0", new Password("password"), new String[]{});
loginService.putUser("user", new Password("password"), new String[]{"user"});
loginService.putUser("user2", new Password("password"), new String[]{"user"});
loginService.putUser("admin", new Password("password"), new String[]{"user", "administrator"});
loginService.putUser("user3", new Password("password"), new String[]{"foo"});
_context.setContextPath("/ctx");
_server.setHandler(_context);
_context.setHandler(_session);
contextHandler.setContextPath("/ctx");
_server.setHandler(contextHandler);
contextHandler.setHandler(sessionHandler);
_server.addBean(_loginService);
_server.addBean(loginService);
_security = new ConstraintSecurityHandler();
_session.setHandler(_security);
RequestHandler _handler = new RequestHandler();
_security.setHandler(_handler);
sessionHandler.setHandler(_security);
RequestHandler requestHandler = new RequestHandler();
_security.setHandler(requestHandler);
_security.setConstraintMappings(getConstraintMappings(), getKnownRoles());
}
@ -242,7 +242,7 @@ public class ConstraintTest
* @throws Exception if test fails
*/
@Test
public void testSecurityElementExample13_1() throws Exception
public void testSecurityElementExample131() throws Exception
{
ServletSecurityElement element = new ServletSecurityElement();
List<ConstraintMapping> mappings = ConstraintSecurityHandler.createConstraintsWithMappingsForPath("foo", "/foo/*", element);
@ -256,7 +256,7 @@ public class ConstraintTest
* @throws Exception if test fails
*/
@Test
public void testSecurityElementExample13_2() throws Exception
public void testSecurityElementExample132() throws Exception
{
HttpConstraintElement httpConstraintElement = new HttpConstraintElement(TransportGuarantee.CONFIDENTIAL);
ServletSecurityElement element = new ServletSecurityElement(httpConstraintElement);
@ -274,7 +274,7 @@ public class ConstraintTest
* @ServletSecurity(@HttpConstraint(EmptyRoleSemantic.DENY))
*/
@Test
public void testSecurityElementExample13_3() throws Exception
public void testSecurityElementExample133() throws Exception
{
HttpConstraintElement httpConstraintElement = new HttpConstraintElement(EmptyRoleSemantic.DENY);
ServletSecurityElement element = new ServletSecurityElement(httpConstraintElement);
@ -292,7 +292,7 @@ public class ConstraintTest
* @ServletSecurity(@HttpConstraint(rolesAllowed = "R1"))
*/
@Test
public void testSecurityElementExample13_4() throws Exception
public void testSecurityElementExample134() throws Exception
{
HttpConstraintElement httpConstraintElement = new HttpConstraintElement(TransportGuarantee.NONE, "R1");
ServletSecurityElement element = new ServletSecurityElement(httpConstraintElement);
@ -317,7 +317,7 @@ public class ConstraintTest
* transportGuarantee = TransportGuarantee.CONFIDENTIAL)})
*/
@Test
public void testSecurityElementExample13_5() throws Exception
public void testSecurityElementExample135() throws Exception
{
List<HttpMethodConstraintElement> methodElements = new ArrayList<HttpMethodConstraintElement>();
methodElements.add(new HttpMethodConstraintElement("GET", new HttpConstraintElement(TransportGuarantee.NONE, "R1")));
@ -343,7 +343,7 @@ public class ConstraintTest
* @ServletSecurity(value = @HttpConstraint(rolesAllowed = "R1"), httpMethodConstraints = @HttpMethodConstraint("GET"))
*/
@Test
public void testSecurityElementExample13_6() throws Exception
public void testSecurityElementExample136() throws Exception
{
List<HttpMethodConstraintElement> methodElements = new ArrayList<HttpMethodConstraintElement>();
methodElements.add(new HttpMethodConstraintElement("GET"));
@ -370,7 +370,7 @@ public class ConstraintTest
* emptyRoleSemantic = EmptyRoleSemantic.DENY))
*/
@Test
public void testSecurityElementExample13_7() throws Exception
public void testSecurityElementExample137() throws Exception
{
List<HttpMethodConstraintElement> methodElements = new ArrayList<HttpMethodConstraintElement>();
methodElements.add(new HttpMethodConstraintElement("TRACE", new HttpConstraintElement(EmptyRoleSemantic.DENY)));

View File

@ -79,12 +79,12 @@ public class DataConstraintsTest
_connectorS = new LocalConnector(_server, https);
_server.setConnectors(new Connector[]{_connector, _connectorS});
ContextHandler _context = new ContextHandler();
ContextHandler contextHandler = new ContextHandler();
_session = new SessionHandler();
_context.setContextPath("/ctx");
_server.setHandler(_context);
_context.setHandler(_session);
contextHandler.setContextPath("/ctx");
_server.setHandler(contextHandler);
contextHandler.setHandler(_session);
_security = new ConstraintSecurityHandler();
_session.setHandler(_security);

View File

@ -67,21 +67,21 @@ public class SpecExampleConstraintTest
_connector = new LocalConnector(_server);
_server.setConnectors(new Connector[]{_connector});
ContextHandler _context = new ContextHandler();
ContextHandler context = new ContextHandler();
_session = new SessionHandler();
TestLoginService _loginService = new TestLoginService(TEST_REALM);
TestLoginService loginService = new TestLoginService(TEST_REALM);
_loginService.putUser("fred", new Password("password"), IdentityService.NO_ROLES);
_loginService.putUser("harry", new Password("password"), new String[]{"HOMEOWNER"});
_loginService.putUser("chris", new Password("password"), new String[]{"CONTRACTOR"});
_loginService.putUser("steven", new Password("password"), new String[]{"SALESCLERK"});
loginService.putUser("fred", new Password("password"), IdentityService.NO_ROLES);
loginService.putUser("harry", new Password("password"), new String[]{"HOMEOWNER"});
loginService.putUser("chris", new Password("password"), new String[]{"CONTRACTOR"});
loginService.putUser("steven", new Password("password"), new String[]{"SALESCLERK"});
_context.setContextPath("/ctx");
_server.setHandler(_context);
_context.setHandler(_session);
context.setContextPath("/ctx");
_server.setHandler(context);
context.setHandler(_session);
_server.addBean(_loginService);
_server.addBean(loginService);
}
@BeforeEach
@ -89,8 +89,8 @@ public class SpecExampleConstraintTest
{
_security = new ConstraintSecurityHandler();
_session.setHandler(_security);
RequestHandler _handler = new RequestHandler();
_security.setHandler(_handler);
RequestHandler handler = new RequestHandler();
_security.setHandler(handler);
/*

View File

@ -113,10 +113,10 @@ public class SpnegoAuthenticatorTest
};
Request req = channel.getRequest();
Response res = channel.getResponse();
HttpFields http_fields = new HttpFields();
HttpFields httpFields = new HttpFields();
// Create a bogus Authorization header. We don't care about the actual credentials.
http_fields.add(HttpHeader.AUTHORIZATION, "Basic asdf");
MetaData.Request metadata = new MetaData.Request(http_fields);
httpFields.add(HttpHeader.AUTHORIZATION, "Basic asdf");
MetaData.Request metadata = new MetaData.Request(httpFields);
metadata.setURI(new HttpURI("http://localhost"));
req.setMetaData(metadata);

View File

@ -55,9 +55,6 @@ public abstract class AbstractHandler extends ContainerLifeCycle implements Hand
private Server _server;
/**
*
*/
public AbstractHandler()
{
}

View File

@ -188,33 +188,33 @@ public class AsyncStressTest
@Override
public void handle(String target, final Request baseRequest, final HttpServletRequest request, final HttpServletResponse response) throws IOException, ServletException
{
int read_before = 0;
long sleep_for = -1;
long suspend_for = -1;
long resume_after = -1;
long complete_after = -1;
int readBefore = 0;
long sleepFor = -1;
long suspendFor = -1;
long resumeAfter = -1;
long completeAfter = -1;
final String uri = baseRequest.getHttpURI().toString();
if (request.getParameter("read") != null)
read_before = Integer.parseInt(request.getParameter("read"));
readBefore = Integer.parseInt(request.getParameter("read"));
if (request.getParameter("sleep") != null)
sleep_for = Integer.parseInt(request.getParameter("sleep"));
sleepFor = Integer.parseInt(request.getParameter("sleep"));
if (request.getParameter("suspend") != null)
suspend_for = Integer.parseInt(request.getParameter("suspend"));
suspendFor = Integer.parseInt(request.getParameter("suspend"));
if (request.getParameter("resume") != null)
resume_after = Integer.parseInt(request.getParameter("resume"));
resumeAfter = Integer.parseInt(request.getParameter("resume"));
if (request.getParameter("complete") != null)
complete_after = Integer.parseInt(request.getParameter("complete"));
completeAfter = Integer.parseInt(request.getParameter("complete"));
if (DispatcherType.REQUEST.equals(baseRequest.getDispatcherType()))
{
if (read_before > 0)
if (readBefore > 0)
{
byte[] buf = new byte[read_before];
byte[] buf = new byte[readBefore];
request.getInputStream().read(buf);
}
else if (read_before < 0)
else if (readBefore < 0)
{
InputStream in = request.getInputStream();
int b = in.read();
@ -224,13 +224,13 @@ public class AsyncStressTest
}
}
if (suspend_for >= 0)
if (suspendFor >= 0)
{
final AsyncContext asyncContext = baseRequest.startAsync();
asyncContext.addListener(__asyncListener);
if (suspend_for > 0)
asyncContext.setTimeout(suspend_for);
if (complete_after > 0)
if (suspendFor > 0)
asyncContext.setTimeout(suspendFor);
if (completeAfter > 0)
{
TimerTask complete = new TimerTask()
{
@ -259,17 +259,17 @@ public class AsyncStressTest
};
synchronized (_timer)
{
_timer.schedule(complete, complete_after);
_timer.schedule(complete, completeAfter);
}
}
else if (complete_after == 0)
else if (completeAfter == 0)
{
response.setStatus(200);
response.getOutputStream().println("COMPLETED " + request.getHeader("result"));
baseRequest.setHandled(true);
asyncContext.complete();
}
else if (resume_after > 0)
else if (resumeAfter > 0)
{
TimerTask resume = new TimerTask()
{
@ -281,19 +281,19 @@ public class AsyncStressTest
};
synchronized (_timer)
{
_timer.schedule(resume, resume_after);
_timer.schedule(resume, resumeAfter);
}
}
else if (resume_after == 0)
else if (resumeAfter == 0)
{
asyncContext.dispatch();
}
}
else if (sleep_for >= 0)
else if (sleepFor >= 0)
{
try
{
Thread.sleep(sleep_for);
Thread.sleep(sleepFor);
}
catch (InterruptedException e)
{

View File

@ -81,6 +81,7 @@ public class DelayedServerTest extends HttpServerTestBase
}
catch (InterruptedException ignored)
{
// ignored
}
finally
{
@ -100,6 +101,7 @@ public class DelayedServerTest extends HttpServerTestBase
}
catch (InterruptedException ignored)
{
// ignored
}
finally
{

View File

@ -154,17 +154,17 @@ public class DumpHandler extends AbstractHandler
}
}
String cookie_name = request.getParameter("CookieName");
if (cookie_name != null && cookie_name.trim().length() > 0)
String cookieName = request.getParameter("CookieName");
if (cookieName != null && cookieName.trim().length() > 0)
{
String cookie_action = request.getParameter("Button");
String cookieAction = request.getParameter("Button");
try
{
String val = request.getParameter("CookieVal");
val = val.replaceAll("[ \n\r=<>]", "?");
Cookie cookie =
new Cookie(cookie_name.trim(), val);
if ("Clear Cookie".equals(cookie_action))
new Cookie(cookieName.trim(), val);
if ("Clear Cookie".equals(cookieAction))
cookie.setMaxAge(0);
response.addCookie(cookie);
}

View File

@ -119,7 +119,9 @@ public class ErrorHandlerTest
// produce an exception with a UTF-8 cause message
if (target.startsWith("/utf8message/"))
{
// @checkstyle-disable-check : AvoidEscapedUnicodeCharacters
String message = "Euro is &euro; and \u20AC and %E2%82%AC";
// @checkstyle-enable-check : AvoidEscapedUnicodeCharacters
throw new ServletException(new RuntimeException(message));
}
}
@ -455,8 +457,10 @@ public class ErrorHandlerTest
if (path.startsWith("/utf8"))
{
// @checkstyle-disable-check : AvoidEscapedUnicodeCharacters
// we are Not expecting UTF-8 output, look for mangled ISO-8859-1 version
assertThat("content", content, containsString("Euro is &amp;euro; and \u20AC and %E2%82%AC"));
// @checkstyle-enabled-check : AvoidEscapedUnicodeCharacters
}
}
@ -555,8 +559,10 @@ public class ErrorHandlerTest
if (path.startsWith("/utf8"))
{
// @checkstyle-disable-check : AvoidEscapedUnicodeCharacters
// we are expecting UTF-8 output, look for it.
assertThat("content", content, containsString("Euro is &amp;euro; and \u20AC and %E2%82%AC"));
// @checkstyle-enable-check : AvoidEscapedUnicodeCharacters
}
}
}

View File

@ -840,7 +840,7 @@ public class GracefulStopTest
int c = 0;
try
{
int content_length = request.getContentLength();
int contentLength = request.getContentLength();
InputStream in = request.getInputStream();
while (true)
@ -852,7 +852,7 @@ public class GracefulStopTest
baseRequest.setHandled(true);
response.setStatus(200);
response.getWriter().printf("read %d/%d%n", c, content_length);
response.getWriter().printf("read %d/%d%n", c, contentLength);
}
catch (Throwable th)
{

View File

@ -878,6 +878,7 @@ public class HttpOutputTest
response.setCharacterEncoding("UTF8");
HttpOutput out = (HttpOutput)response.getOutputStream();
// @checkstyle-disable-check : AvoidEscapedUnicodeCharactersCheck
exp.print("\u20AC\u0939\uD55C");
out.print("\u20AC\u0939\uD55C");
exp.print("zero");

View File

@ -513,7 +513,7 @@ public abstract class HttpServerTestBase extends HttpServerTestFixture
"\r\n" +
"ABCDE\r\n" +
"\r\n"
//@checkstyle-enable-check : IllegalTokenText
//@checkstyle-enable-check : IllegalTokenText
).getBytes());
os.flush();
@ -1200,7 +1200,7 @@ public abstract class HttpServerTestBase extends HttpServerTestFixture
"Connection: close\r\n" +
"\r\n" +
"abcdefghi\n"
//@checkstyle-enable-check : IllegalTokenText
//@checkstyle-enable-check : IllegalTokenText
).getBytes(StandardCharsets.ISO_8859_1));
String in = IO.toString(is);
@ -1865,7 +1865,7 @@ public abstract class HttpServerTestBase extends HttpServerTestFixture
public SendAsyncContentHandler(int size)
{
content = BufferUtil.allocate(size);
Arrays.fill(content.array(),0,size,(byte)'X');
Arrays.fill(content.array(), 0, size, (byte)'X');
content.position(0);
content.limit(size);
}

View File

@ -40,6 +40,8 @@ import org.junit.jupiter.api.BeforeEach;
public class HttpServerTestFixture
{
// @checkstyle-disable-check : AvoidEscapedUnicodeCharactersCheck
// Useful constants
protected static final long PAUSE = 10L;
protected static final int LOOPS = 50;

View File

@ -35,6 +35,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
public class HttpWriterTest
{
// @checkstyle-disable-check : AvoidEscapedUnicodeCharactersCheck
private HttpOutput _httpOut;
private ByteBuffer _bytes;
@ -67,33 +68,33 @@ public class HttpWriterTest
@Test
public void testSimpleUTF8() throws Exception
{
HttpWriter _writer = new Utf8HttpWriter(_httpOut);
_writer.write("Now is the time");
HttpWriter writer = new Utf8HttpWriter(_httpOut);
writer.write("Now is the time");
assertArrayEquals("Now is the time".getBytes(StandardCharsets.UTF_8), BufferUtil.toArray(_bytes));
}
@Test
public void testUTF8() throws Exception
{
HttpWriter _writer = new Utf8HttpWriter(_httpOut);
_writer.write("How now \uFF22rown cow");
HttpWriter writer = new Utf8HttpWriter(_httpOut);
writer.write("How now \uFF22rown cow");
assertArrayEquals("How now \uFF22rown cow".getBytes(StandardCharsets.UTF_8), BufferUtil.toArray(_bytes));
}
@Test
public void testUTF16() throws Exception
{
HttpWriter _writer = new EncodingHttpWriter(_httpOut, StringUtil.__UTF16);
_writer.write("How now \uFF22rown cow");
HttpWriter writer = new EncodingHttpWriter(_httpOut, StringUtil.__UTF16);
writer.write("How now \uFF22rown cow");
assertArrayEquals("How now \uFF22rown cow".getBytes(StandardCharsets.UTF_16), BufferUtil.toArray(_bytes));
}
@Test
public void testNotCESU8() throws Exception
{
HttpWriter _writer = new Utf8HttpWriter(_httpOut);
HttpWriter writer = new Utf8HttpWriter(_httpOut);
String data = "xxx\uD801\uDC00xxx";
_writer.write(data);
writer.write(data);
assertEquals("787878F0909080787878", TypeUtil.toHexString(BufferUtil.toArray(_bytes)));
assertArrayEquals(data.getBytes(StandardCharsets.UTF_8), BufferUtil.toArray(_bytes));
assertEquals(3 + 4 + 3, _bytes.remaining());
@ -106,7 +107,7 @@ public class HttpWriterTest
@Test
public void testMultiByteOverflowUTF8() throws Exception
{
HttpWriter _writer = new Utf8HttpWriter(_httpOut);
HttpWriter writer = new Utf8HttpWriter(_httpOut);
final String singleByteStr = "a";
final String multiByteDuplicateStr = "\uFF22";
int remainSize = 1;
@ -127,7 +128,7 @@ public class HttpWriterTest
int length = HttpWriter.MAX_OUTPUT_CHARS - multiByteStrByteLength + remainSize + 1;
sb.toString().getChars(0, length, buf, 0);
_writer.write(buf, 0, length);
writer.write(buf, 0, length);
assertEquals(sb.toString(), new String(BufferUtil.toArray(_bytes), StandardCharsets.UTF_8));
}
@ -135,20 +136,20 @@ public class HttpWriterTest
@Test
public void testISO8859() throws Exception
{
HttpWriter _writer = new Iso88591HttpWriter(_httpOut);
_writer.write("How now \uFF22rown cow");
HttpWriter writer = new Iso88591HttpWriter(_httpOut);
writer.write("How now \uFF22rown cow");
assertEquals(new String(BufferUtil.toArray(_bytes), StandardCharsets.ISO_8859_1), "How now ?rown cow");
}
@Test
public void testUTF16x2() throws Exception
{
HttpWriter _writer = new Utf8HttpWriter(_httpOut);
HttpWriter writer = new Utf8HttpWriter(_httpOut);
String source = "\uD842\uDF9F";
byte[] bytes = source.getBytes(StandardCharsets.UTF_8);
_writer.write(source.toCharArray(), 0, source.toCharArray().length);
writer.write(source.toCharArray(), 0, source.toCharArray().length);
java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream();
java.io.OutputStreamWriter osw = new java.io.OutputStreamWriter(baos, StandardCharsets.UTF_8);
@ -166,7 +167,7 @@ public class HttpWriterTest
@Test
public void testMultiByteOverflowUTF16x2() throws Exception
{
HttpWriter _writer = new Utf8HttpWriter(_httpOut);
HttpWriter writer = new Utf8HttpWriter(_httpOut);
final String singleByteStr = "a";
int remainSize = 1;
@ -186,7 +187,7 @@ public class HttpWriterTest
String source = sb.toString();
byte[] bytes = source.getBytes(StandardCharsets.UTF_8);
_writer.write(source.toCharArray(), 0, source.toCharArray().length);
writer.write(source.toCharArray(), 0, source.toCharArray().length);
java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream();
java.io.OutputStreamWriter osw = new java.io.OutputStreamWriter(baos, StandardCharsets.UTF_8);
@ -202,9 +203,9 @@ public class HttpWriterTest
}
@Test
public void testMultiByteOverflowUTF16x2_2() throws Exception
public void testMultiByteOverflowUTF16X22() throws Exception
{
HttpWriter _writer = new Utf8HttpWriter(_httpOut);
HttpWriter writer = new Utf8HttpWriter(_httpOut);
final String singleByteStr = "a";
int remainSize = 1;
@ -224,7 +225,7 @@ public class HttpWriterTest
String source = sb.toString();
byte[] bytes = source.getBytes(StandardCharsets.UTF_8);
_writer.write(source.toCharArray(), 0, source.toCharArray().length);
writer.write(source.toCharArray(), 0, source.toCharArray().length);
java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream();
java.io.OutputStreamWriter osw = new java.io.OutputStreamWriter(baos, StandardCharsets.UTF_8);

View File

@ -252,7 +252,7 @@ public class InclusiveByteRangeTest
}
@Test
public void testRange_OpenEnded()
public void testRangeOpenEnded()
{
assertSimpleRange(50, 499, "bytes=50-", 500);
}
@ -281,75 +281,75 @@ public class InclusiveByteRangeTest
@Test
@Disabled
public void testBadRange_SetPartiallyBad()
public void testBadRangeSetPartiallyBad()
{
assertBadRangeList(500, "bytes=1-50,1-b,a-50");
}
@Test
public void testBadRange_NoNumbers()
public void testBadRangeNoNumbers()
{
assertBadRangeList(500, "bytes=a-b");
}
@Test
public void testBadRange_Empty()
public void testBadRangeEmpty()
{
assertBadRangeList(500, "bytes=");
}
@Test
@Disabled
public void testBadRange_ZeroPrefixed()
public void testBadRangeZeroPrefixed()
{
assertBadRangeList(500, "bytes=01-050");
}
@Test
public void testBadRange_Hex()
public void testBadRangeHex()
{
assertBadRangeList(500, "bytes=0F-FF");
}
@Test
@Disabled
public void testBadRange_TabWhitespace()
public void testBadRangeTabWhitespace()
{
assertBadRangeList(500, "bytes=\t1\t-\t50");
}
@Test
public void testBadRange_TabDelim()
public void testBadRangeTabDelim()
{
assertBadRangeList(500, "bytes=1-50\t90-101\t200-250");
}
@Test
public void testBadRange_SemiColonDelim()
public void testBadRangeSemiColonDelim()
{
assertBadRangeList(500, "bytes=1-50;90-101;200-250");
}
@Test
public void testBadRange_NegativeSize()
public void testBadRangeNegativeSize()
{
assertBadRangeList(500, "bytes=50-1");
}
@Test
public void testBadRange_DoubleDash()
public void testBadRangeDoubleDash()
{
assertBadRangeList(500, "bytes=1--20");
}
@Test
public void testBadRange_TrippleDash()
public void testBadRangeTrippleDash()
{
assertBadRangeList(500, "bytes=1---");
}
@Test
public void testBadRange_ZeroedNegativeSize()
public void testBadRangeZeroedNegativeSize()
{
assertBadRangeList(500, "bytes=050-001");
}

View File

@ -98,7 +98,7 @@ public class LocalConnectorTest
}
@Test
public void testOneResponse_10() throws Exception
public void testOneResponse10() throws Exception
{
String response = _connector.getResponse("GET /R1 HTTP/1.0\r\n\r\n");
assertThat(response, containsString("HTTP/1.1 200 OK"));
@ -106,7 +106,7 @@ public class LocalConnectorTest
}
@Test
public void testOneResponse_10_keep_alive() throws Exception
public void testOneResponse10KeepAlive() throws Exception
{
String response = _connector.getResponse(
"GET /R1 HTTP/1.0\r\n" +
@ -117,7 +117,7 @@ public class LocalConnectorTest
}
@Test
public void testOneResponse_10_keep_alive_empty() throws Exception
public void testOneResponse10KeepAliveEmpty() throws Exception
{
String response = _connector.getResponse(
"GET /R1?empty=true HTTP/1.0\r\n" +
@ -128,7 +128,7 @@ public class LocalConnectorTest
}
@Test
public void testOneResponse_11() throws Exception
public void testOneResponse11() throws Exception
{
String response = _connector.getResponse(
"GET /R1 HTTP/1.1\r\n" +
@ -139,7 +139,7 @@ public class LocalConnectorTest
}
@Test
public void testOneResponse_11_close() throws Exception
public void testOneResponse11close() throws Exception
{
String response = _connector.getResponse(
"GET /R1 HTTP/1.1\r\n" +
@ -151,7 +151,7 @@ public class LocalConnectorTest
}
@Test
public void testOneResponse_11_empty() throws Exception
public void testOneResponse11empty() throws Exception
{
String response = _connector.getResponse(
"GET /R1?empty=true HTTP/1.1\r\n" +
@ -163,7 +163,7 @@ public class LocalConnectorTest
}
@Test
public void testOneResponse_11_chunked() throws Exception
public void testOneResponse11chunked() throws Exception
{
String response = _connector.getResponse(
"GET /R1?flush=true HTTP/1.1\r\n" +
@ -175,7 +175,7 @@ public class LocalConnectorTest
}
@Test
public void testThreeResponsePipeline_11() throws Exception
public void testThreeResponsePipeline11() throws Exception
{
LocalEndPoint endp = _connector.connect();
endp.addInput(
@ -201,7 +201,7 @@ public class LocalConnectorTest
}
@Test
public void testThreeResponse_11() throws Exception
public void testThreeResponse11() throws Exception
{
LocalEndPoint endp = _connector.connect();
endp.addInput(
@ -234,7 +234,7 @@ public class LocalConnectorTest
}
@Test
public void testThreeResponseClosed_11() throws Exception
public void testThreeResponseClosed11() throws Exception
{
LocalEndPoint endp = _connector.connect();
endp.addInput(

View File

@ -491,6 +491,7 @@ public class MultiPartParserTest
"Foo/Bar: value\r\n",
"Foo]Bar: value\r\n",
"Foo[Bar: value\r\n",
// @checkstyle-disable-check : AvoidEscapedUnicodeCharactersCheck
"\u0192\u00f8\u00f8\u00df\u00e5\u00ae: value\r\n"
};

View File

@ -81,7 +81,7 @@ public class PartialRFC2616Test
}
@Test
public void test3_3()
public void test33()
{
try
{
@ -108,7 +108,7 @@ public class PartialRFC2616Test
}
@Test
public void test3_3_2()
public void test332()
{
try
{
@ -133,7 +133,7 @@ public class PartialRFC2616Test
}
@Test
public void test3_6_a() throws Exception
public void test36a() throws Exception
{
int offset = 0;
// Chunk last
@ -150,7 +150,7 @@ public class PartialRFC2616Test
}
@Test
public void test3_6_b() throws Exception
public void test36b() throws Exception
{
String response;
int offset = 0;
@ -196,7 +196,7 @@ public class PartialRFC2616Test
}
@Test
public void test3_6_c() throws Exception
public void test36c() throws Exception
{
String response;
int offset = 0;
@ -244,7 +244,7 @@ public class PartialRFC2616Test
}
@Test
public void test3_6_d() throws Exception
public void test36d() throws Exception
{
String response;
int offset = 0;
@ -276,7 +276,7 @@ public class PartialRFC2616Test
}
@Test
public void test3_9() throws Exception
public void test39() throws Exception
{
HttpFields fields = new HttpFields();
@ -291,7 +291,7 @@ public class PartialRFC2616Test
}
@Test
public void test4_1() throws Exception
public void test41() throws Exception
{
int offset = 0;
@ -330,7 +330,7 @@ public class PartialRFC2616Test
}
@Test
public void test4_4_2() throws Exception
public void test442() throws Exception
{
String response;
int offset = 0;
@ -357,7 +357,7 @@ public class PartialRFC2616Test
}
@Test
public void test4_4_3() throws Exception
public void test443() throws Exception
{
// Due to smuggling concerns, handling has been changed to
// treat content length and chunking as a bad request.
@ -390,7 +390,7 @@ public class PartialRFC2616Test
}
@Test
public void test4_4_4() throws Exception
public void test444() throws Exception
{
// No _content length
assertTrue(true, "Skip 411 checks as IE breaks this rule");
@ -414,7 +414,7 @@ public class PartialRFC2616Test
}
@Test
public void test5_2_1() throws Exception
public void test521() throws Exception
{
// Default Host
int offset = 0;
@ -426,7 +426,7 @@ public class PartialRFC2616Test
}
@Test
public void test5_2_2() throws Exception
public void test522() throws Exception
{
// Default Host
int offset = 0;
@ -444,7 +444,7 @@ public class PartialRFC2616Test
}
@Test
public void test5_2() throws Exception
public void test52() throws Exception
{
// Virtual Host
int offset = 0;
@ -467,7 +467,7 @@ public class PartialRFC2616Test
}
@Test
public void test8_1() throws Exception
public void test81() throws Exception
{
int offset = 0;
String response = connector.getResponse("GET /R1 HTTP/1.1\n" + "Host: localhost\n" + "\n", 250, TimeUnit.MILLISECONDS);
@ -494,7 +494,7 @@ public class PartialRFC2616Test
}
@Test
public void test10_4_18() throws Exception
public void test10418() throws Exception
{
// Expect Failure
int offset = 0;
@ -509,7 +509,7 @@ public class PartialRFC2616Test
}
@Test
public void test8_2_3_dash5() throws Exception
public void test823dash5() throws Exception
{
// Expect with body: client sends the content right away, we should not send 100-Continue
int offset = 0;
@ -527,7 +527,7 @@ public class PartialRFC2616Test
}
@Test
public void test8_2_3() throws Exception
public void test823() throws Exception
{
int offset = 0;
// Expect 100
@ -549,7 +549,7 @@ public class PartialRFC2616Test
}
@Test
public void test8_2_4() throws Exception
public void test824() throws Exception
{
// Expect 100 not sent
int offset = 0;
@ -565,7 +565,7 @@ public class PartialRFC2616Test
}
@Test
public void test9_2() throws Exception
public void test92() throws Exception
{
int offset = 0;
@ -584,7 +584,7 @@ public class PartialRFC2616Test
}
@Test
public void test9_4()
public void test94()
{
try
{
@ -607,7 +607,7 @@ public class PartialRFC2616Test
}
@Test
public void test14_23() throws Exception
public void test1423() throws Exception
{
try (StacklessLogging stackless = new StacklessLogging(HttpParser.class))
{
@ -630,7 +630,7 @@ public class PartialRFC2616Test
}
@Test
public void test19_6()
public void test196()
{
try
{

View File

@ -81,6 +81,7 @@ import static org.junit.jupiter.api.Assertions.assertTimeoutPreemptively;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
// @checkstyle-disable-check : AvoidEscapedUnicodeCharactersCheck
public class RequestTest
{
private static final Logger LOG = Log.getLogger(RequestTest.class);
@ -154,7 +155,7 @@ public class RequestTest
}
@Test
public void testParamExtraction_BadSequence() throws Exception
public void testParamExtractionBadSequence() throws Exception
{
_handler._checker = new RequestTester()
{
@ -180,7 +181,7 @@ public class RequestTest
}
@Test
public void testParamExtraction_Timeout() throws Exception
public void testParamExtractionTimeout() throws Exception
{
_handler._checker = new RequestTester()
{
@ -516,17 +517,17 @@ public class RequestTest
final long HUGE_LENGTH = (long)Integer.MAX_VALUE * 10L;
_handler._checker = (request, response) ->
request.getContentLength() == (-1) && // per HttpServletRequest javadoc this must return (-1);
request.getContentLength() == (-1) && // per HttpServletRequest javadoc this must return (-1);
request.getContentLengthLong() == HUGE_LENGTH;
//Send a request with encoded form content
String request = "POST / HTTP/1.1\r\n" +
"Host: whatever\r\n" +
"Content-Type: application/octet-stream\n" +
"Content-Length: " + HUGE_LENGTH + "\n" +
"Connection: close\n" +
"\n" +
"<insert huge amount of content here>\n";
"Host: whatever\r\n" +
"Content-Type: application/octet-stream\n" +
"Content-Length: " + HUGE_LENGTH + "\n" +
"Connection: close\n" +
"\n" +
"<insert huge amount of content here>\n";
System.out.println(request);
@ -544,8 +545,8 @@ public class RequestTest
_handler._checker = (request, response) ->
request.getHeader("Content-Length").equals(hugeLength) &&
request.getContentLength() == (-1) && // per HttpServletRequest javadoc this must return (-1);
request.getContentLengthLong() == (-1); // exact behavior here not specified in Servlet javadoc
request.getContentLength() == (-1) && // per HttpServletRequest javadoc this must return (-1);
request.getContentLengthLong() == (-1); // exact behavior here not specified in Servlet javadoc
//Send a request with encoded form content
String request = "POST / HTTP/1.1\r\n" +
@ -1748,8 +1749,8 @@ public class RequestTest
((Request)request).setHandled(true);
if (request.getContentLength() > 0 &&
!request.getContentType().startsWith(MimeTypes.Type.FORM_ENCODED.asString()) &&
!request.getContentType().startsWith("multipart/form-data"))
!request.getContentType().startsWith(MimeTypes.Type.FORM_ENCODED.asString()) &&
!request.getContentType().startsWith("multipart/form-data"))
_content = IO.toString(request.getInputStream());
if (_checker != null && _checker.check(request, response))

View File

@ -89,6 +89,7 @@ import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
// @checkstyle-disable-check : AvoidEscapedUnicodeCharactersCheck
public class ResponseTest
{
@ -121,14 +122,14 @@ public class ResponseTest
BufferUtil.clear(_content);
_server = new Server();
Scheduler _scheduler = new TimerScheduler();
Scheduler scheduler = new TimerScheduler();
HttpConfiguration config = new HttpConfiguration();
LocalConnector connector = new LocalConnector(_server, null, _scheduler, null, 1, new HttpConnectionFactory(config));
LocalConnector connector = new LocalConnector(_server, null, scheduler, null, 1, new HttpConnectionFactory(config));
_server.addConnector(connector);
_server.setHandler(new DumpHandler());
_server.start();
AbstractEndPoint endp = new ByteArrayEndPoint(_scheduler, 5000)
AbstractEndPoint endp = new ByteArrayEndPoint(scheduler, 5000)
{
@Override
public InetSocketAddress getLocalAddress()
@ -509,20 +510,20 @@ public class ResponseTest
Response response = getResponse();
Request request = response.getHttpChannel().getRequest();
SessionHandler session_handler = new SessionHandler();
session_handler.setServer(_server);
session_handler.setUsingCookies(true);
session_handler.start();
request.setSessionHandler(session_handler);
SessionHandler sessionHandler = new SessionHandler();
sessionHandler.setServer(_server);
sessionHandler.setUsingCookies(true);
sessionHandler.start();
request.setSessionHandler(sessionHandler);
HttpSession session = request.getSession(true);
assertThat(session, not(nullValue()));
assertTrue(session.isNew());
HttpField set_cookie = response.getHttpFields().getField(HttpHeader.SET_COOKIE);
assertThat(set_cookie, not(nullValue()));
assertThat(set_cookie.getValue(), startsWith("JSESSIONID"));
assertThat(set_cookie.getValue(), containsString(session.getId()));
HttpField setCookie = response.getHttpFields().getField(HttpHeader.SET_COOKIE);
assertThat(setCookie, not(nullValue()));
assertThat(setCookie.getValue(), startsWith("JSESSIONID"));
assertThat(setCookie.getValue(), containsString(session.getId()));
response.setHeader("Some", "Header");
response.addCookie(new Cookie("Some", "Cookie"));
response.getOutputStream().print("X");
@ -530,10 +531,10 @@ public class ResponseTest
response.reset();
set_cookie = response.getHttpFields().getField(HttpHeader.SET_COOKIE);
assertThat(set_cookie, not(nullValue()));
assertThat(set_cookie.getValue(), startsWith("JSESSIONID"));
assertThat(set_cookie.getValue(), containsString(session.getId()));
setCookie = response.getHttpFields().getField(HttpHeader.SET_COOKIE);
assertThat(setCookie, not(nullValue()));
assertThat(setCookie.getValue(), startsWith("JSESSIONID"));
assertThat(setCookie.getValue(), containsString(session.getId()));
assertThat(response.getHttpFields().size(), is(2));
response.getWriter();
}
@ -567,7 +568,7 @@ public class ResponseTest
}
@Test
public void testPrint_Empty() throws Exception
public void testPrintEmpty() throws Exception
{
Response response = getResponse();
response.setCharacterEncoding(UTF_8.name());
@ -977,7 +978,7 @@ public class ResponseTest
* https://bugs.chromium.org/p/chromium/issues/detail?id=700618
*/
@Test
public void testAddCookie_JavaxServletHttp() throws Exception
public void testAddCookieJavaxServletHttp() throws Exception
{
Response response = getResponse();
@ -996,7 +997,7 @@ public class ResponseTest
* https://bugs.chromium.org/p/chromium/issues/detail?id=700618
*/
@Test
public void testAddCookie_JavaNet() throws Exception
public void testAddCookieJavaNet() throws Exception
{
java.net.HttpCookie cookie = new java.net.HttpCookie("foo", URLEncoder.encode("bar;baz", UTF_8.toString()));
cookie.setPath("/secure");

View File

@ -119,7 +119,7 @@ public class ServerConnectorTest
}
@Test
public void testReuseAddress_Default() throws Exception
public void testReuseAddressDefault() throws Exception
{
Server server = new Server();
ServerConnector connector = new ServerConnector(server);
@ -154,7 +154,7 @@ public class ServerConnectorTest
}
@Test
public void testReuseAddress_True() throws Exception
public void testReuseAddressTrue() throws Exception
{
Server server = new Server();
ServerConnector connector = new ServerConnector(server);
@ -190,7 +190,7 @@ public class ServerConnectorTest
}
@Test
public void testReuseAddress_False() throws Exception
public void testReuseAddressFalse() throws Exception
{
Server server = new Server();
ServerConnector connector = new ServerConnector(server);

View File

@ -70,14 +70,14 @@ public class ServerConnectorTimeoutTest extends ConnectorTimeoutTest
public void testIdleTimeoutAfterSuspend() throws Exception
{
_server.stop();
SuspendHandler _handler = new SuspendHandler();
SuspendHandler handler = new SuspendHandler();
SessionHandler session = new SessionHandler();
session.setHandler(_handler);
session.setHandler(handler);
_server.setHandler(session);
_server.start();
_handler.setSuspendFor(100);
_handler.setResumeAfter(25);
handler.setSuspendFor(100);
handler.setResumeAfter(25);
assertTimeoutPreemptively(ofSeconds(10), () ->
{
String process = process(null).toUpperCase(Locale.ENGLISH);
@ -88,14 +88,14 @@ public class ServerConnectorTimeoutTest extends ConnectorTimeoutTest
@Test
public void testIdleTimeoutAfterTimeout() throws Exception
{
SuspendHandler _handler = new SuspendHandler();
SuspendHandler handler = new SuspendHandler();
_server.stop();
SessionHandler session = new SessionHandler();
session.setHandler(_handler);
session.setHandler(handler);
_server.setHandler(session);
_server.start();
_handler.setSuspendFor(50);
handler.setSuspendFor(50);
assertTimeoutPreemptively(ofSeconds(10), () ->
{
String process = process(null).toUpperCase(Locale.ENGLISH);
@ -106,15 +106,15 @@ public class ServerConnectorTimeoutTest extends ConnectorTimeoutTest
@Test
public void testIdleTimeoutAfterComplete() throws Exception
{
SuspendHandler _handler = new SuspendHandler();
SuspendHandler handler = new SuspendHandler();
_server.stop();
SessionHandler session = new SessionHandler();
session.setHandler(_handler);
session.setHandler(handler);
_server.setHandler(session);
_server.start();
_handler.setSuspendFor(100);
_handler.setCompleteAfter(25);
handler.setSuspendFor(100);
handler.setCompleteAfter(25);
assertTimeoutPreemptively(ofSeconds(10), () ->
{
String process = process(null).toUpperCase(Locale.ENGLISH);

View File

@ -104,8 +104,8 @@ public class StressTest
_connector.setIdleTimeout(30000);
_server.addConnector(_connector);
TestHandler _handler = new TestHandler();
_server.setHandler(_handler);
TestHandler handler = new TestHandler();
_server.setHandler(handler);
_server.start();
}
@ -256,9 +256,9 @@ public class StressTest
throw throwable;
}
for (ConcurrentLinkedQueue _latency : _latencies)
for (ConcurrentLinkedQueue latency : _latencies)
{
assertEquals(_handled.get(), _latency.size());
assertEquals(_handled.get(), latency.size());
}
}
finally

View File

@ -27,7 +27,6 @@ import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@ -545,7 +544,7 @@ public class ContextHandlerTest
}
@Test
public void testVirtualHostManagement() throws Exception
public void testVirtualHostManagement()
{
ContextHandler context = new ContextHandler("/");
@ -659,7 +658,7 @@ public class ContextHandlerTest
}
@Test
public void testLogNameFromContextPath_Deep() throws Exception
public void testLogNameFromContextPathDeep() throws Exception
{
ContextHandler handler = new ContextHandler();
handler.setServer(new Server());
@ -676,7 +675,7 @@ public class ContextHandlerTest
}
@Test
public void testLogNameFromContextPath_Root() throws Exception
public void testLogNameFromContextPathRoot() throws Exception
{
ContextHandler handler = new ContextHandler();
handler.setServer(new Server());
@ -693,7 +692,7 @@ public class ContextHandlerTest
}
@Test
public void testLogNameFromContextPath_Undefined() throws Exception
public void testLogNameFromContextPathUndefined() throws Exception
{
ContextHandler handler = new ContextHandler();
handler.setServer(new Server());
@ -709,7 +708,7 @@ public class ContextHandlerTest
}
@Test
public void testLogNameFromContextPath_Empty() throws Exception
public void testLogNameFromContextPathEmpty() throws Exception
{
ContextHandler handler = new ContextHandler();
handler.setServer(new Server());
@ -726,7 +725,7 @@ public class ContextHandlerTest
}
@Test
public void testClassPath_WithSpaces() throws IOException
public void testClassPathWithSpaces() throws IOException
{
ContextHandler handler = new ContextHandler();
handler.setServer(new Server());
@ -815,7 +814,7 @@ public class ContextHandlerTest
}
@Override
public void handle(String s, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
public void handle(String s, Request baseRequest, HttpServletRequest request, HttpServletResponse response)
{
baseRequest.setHandled(true);
this.handled = true;
@ -830,7 +829,7 @@ public class ContextHandlerTest
private static final class ContextPathHandler extends AbstractHandler
{
@Override
public void handle(String s, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
public void handle(String s, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException
{
baseRequest.setHandled(true);

View File

@ -195,11 +195,11 @@ public class ResourceHandlerTest
assertThat(response.getStatus(), equalTo(200));
assertThat(response.get(LAST_MODIFIED), Matchers.notNullValue());
assertThat(response.getContent(), containsString("simple text"));
String last_modified = response.get(LAST_MODIFIED);
String lastModified = response.get(LAST_MODIFIED);
response = HttpTester.parseResponse(_local.getResponse(
"GET /resource/simple.txt HTTP/1.0\r\n" +
"If-Modified-Since: " + last_modified + "\r\n" +
"If-Modified-Since: " + lastModified + "\r\n" +
"\r\n"));
assertThat(response.getStatus(), equalTo(304));

View File

@ -127,7 +127,7 @@ public class RangeWriterTest
@ParameterizedTest(name = "[{index}] {0}")
@MethodSource("impls")
public void testSameRange_MultipleTimes(String description, RangeWriter rangeWriter) throws IOException
public void testSameRangeMultipleTimes(String description, RangeWriter rangeWriter) throws IOException
{
ByteArrayOutputStream outputStream;
@ -142,7 +142,7 @@ public class RangeWriterTest
@ParameterizedTest(name = "[{index}] {0}")
@MethodSource("impls")
public void testMultipleRanges_Ordered(String description, RangeWriter rangeWriter) throws IOException
public void testMultipleRangesOrdered(String description, RangeWriter rangeWriter) throws IOException
{
ByteArrayOutputStream outputStream;
@ -161,7 +161,7 @@ public class RangeWriterTest
@ParameterizedTest(name = "[{index}] {0}")
@MethodSource("impls")
public void testMultipleRanges_Overlapping(String description, RangeWriter rangeWriter) throws IOException
public void testMultipleRangesOverlapping(String description, RangeWriter rangeWriter) throws IOException
{
ByteArrayOutputStream outputStream;
@ -180,7 +180,7 @@ public class RangeWriterTest
@ParameterizedTest(name = "[{index}] {0}")
@MethodSource("impls")
public void testMultipleRanges_ReverseOrder(String description, RangeWriter rangeWriter) throws IOException
public void testMultipleRangesReverseOrder(String description, RangeWriter rangeWriter) throws IOException
{
ByteArrayOutputStream outputStream;

View File

@ -369,8 +369,8 @@ public class SSLEngineTest
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{
// System.err.println("HANDLE "+request.getRequestURI());
String ssl_id = (String)request.getAttribute("javax.servlet.request.ssl_session_id");
assertNotNull(ssl_id);
String sslId = (String)request.getAttribute("javax.servlet.request.ssl_session_id");
assertNotNull(sslId);
if (request.getParameter("dump") != null)
{

View File

@ -77,12 +77,12 @@ public class SslConnectionFactoryTest
_server = new Server();
HttpConfiguration http_config = new HttpConfiguration();
http_config.setSecureScheme("https");
http_config.setSecurePort(8443);
http_config.setOutputBufferSize(32768);
HttpConfiguration https_config = new HttpConfiguration(http_config);
https_config.addCustomizer(new SecureRequestCustomizer());
HttpConfiguration httpConfig = new HttpConfiguration();
httpConfig.setSecureScheme("https");
httpConfig.setSecurePort(8443);
httpConfig.setOutputBufferSize(32768);
HttpConfiguration httpsConfig = new HttpConfiguration(httpConfig);
httpsConfig.addCustomizer(new SecureRequestCustomizer());
SslContextFactory.Server sslContextFactory = new SslContextFactory.Server();
sslContextFactory.setKeyStorePath(keystoreFile.getAbsolutePath());
@ -91,7 +91,7 @@ public class SslConnectionFactoryTest
ServerConnector https = _connector = new ServerConnector(_server,
new SslConnectionFactory(sslContextFactory, HttpVersion.HTTP_1_1.asString()),
new HttpConnectionFactory(https_config));
new HttpConnectionFactory(httpsConfig));
https.setPort(0);
https.setIdleTimeout(30000);

View File

@ -93,10 +93,10 @@ public class AsyncContextTest
_contextHandler.addServlet(new ServletHolder(new BadExpireServlet()), "/badexpire/*");
_contextHandler.addServlet(new ServletHolder(new ErrorServlet()), "/error/*");
ErrorPageErrorHandler error_handler = new ErrorPageErrorHandler();
_contextHandler.setErrorHandler(error_handler);
error_handler.addErrorPage(500, "/error/500");
error_handler.addErrorPage(IOException.class.getName(), "/error/IOE");
ErrorPageErrorHandler errorHandler = new ErrorPageErrorHandler();
_contextHandler.setErrorHandler(errorHandler);
errorHandler.addErrorPage(500, "/error/500");
errorHandler.addErrorPage(IOException.class.getName(), "/error/IOE");
HandlerList handlers = new HandlerList();
handlers.setHandlers(new Handler[]
@ -227,7 +227,7 @@ public class AsyncContextTest
}
@Test
public void testDispatchAsyncContext_EncodedUrl() throws Exception
public void testDispatchAsyncContextEncodedUrl() throws Exception
{
String request = "GET /ctx/test/hello%2fthere?dispatch=true HTTP/1.1\r\n" +
"Host: localhost\r\n" +
@ -260,7 +260,7 @@ public class AsyncContextTest
}
@Test
public void testDispatchAsyncContext_SelfEncodedUrl() throws Exception
public void testDispatchAsyncContextSelfEncodedUrl() throws Exception
{
String request = "GET /ctx/self/hello%2fthere?dispatch=true HTTP/1.1\r\n" +
"Host: localhost\r\n" +

View File

@ -70,9 +70,9 @@ public class AsyncListenerTest
}
@Test
public void test_StartAsync_Throw_OnError_Dispatch() throws Exception
public void testStartAsyncThrowOnErrorDispatch() throws Exception
{
test_StartAsync_Throw_OnError(event -> event.getAsyncContext().dispatch("/dispatch"));
testStartAsyncThrowOnError(event -> event.getAsyncContext().dispatch("/dispatch"));
String httpResponse = connector.getResponse(
"GET /ctx/path HTTP/1.1\r\n" +
"Host: localhost\r\n" +
@ -82,9 +82,9 @@ public class AsyncListenerTest
}
@Test
public void test_StartAsync_Throw_OnError_Complete() throws Exception
public void testStartAsyncThrowOnErrorComplete() throws Exception
{
test_StartAsync_Throw_OnError(event ->
testStartAsyncThrowOnError(event ->
{
HttpServletResponse response = (HttpServletResponse)event.getAsyncContext().getResponse();
response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR_500);
@ -106,9 +106,9 @@ public class AsyncListenerTest
}
@Test
public void test_StartAsync_Throw_OnError_Throw() throws Exception
public void testStartAsyncThrowOnErrorThrow() throws Exception
{
test_StartAsync_Throw_OnError(event ->
testStartAsyncThrowOnError(event ->
{
throw new IOException();
});
@ -122,9 +122,9 @@ public class AsyncListenerTest
}
@Test
public void test_StartAsync_Throw_OnError_Nothing() throws Exception
public void testStartAsyncThrowOnErrorNothing() throws Exception
{
test_StartAsync_Throw_OnError(event ->
testStartAsyncThrowOnError(event ->
{
});
String httpResponse = connector.getResponse(
@ -137,9 +137,9 @@ public class AsyncListenerTest
}
@Test
public void test_StartAsync_Throw_OnError_SendError() throws Exception
public void testStartAsyncThrowOnErrorSendError() throws Exception
{
test_StartAsync_Throw_OnError(event ->
testStartAsyncThrowOnError(event ->
{
HttpServletResponse response = (HttpServletResponse)event.getAsyncContext().getResponse();
response.sendError(HttpStatus.BAD_GATEWAY_502, "Message!!!");
@ -155,9 +155,9 @@ public class AsyncListenerTest
}
@Test
public void test_StartAsync_Throw_OnError_SendError_CustomErrorPage() throws Exception
public void testStartAsyncThrowOnErrorSendErrorCustomErrorPage() throws Exception
{
test_StartAsync_Throw_OnError(event ->
testStartAsyncThrowOnError(event ->
{
HttpServletResponse response = (HttpServletResponse)event.getAsyncContext().getResponse();
response.sendError(HttpStatus.BAD_GATEWAY_502);
@ -184,14 +184,14 @@ public class AsyncListenerTest
assertThat(httpResponse, containsString("CUSTOM"));
}
private void test_StartAsync_Throw_OnError(IOConsumer<AsyncEvent> consumer) throws Exception
private void testStartAsyncThrowOnError(IOConsumer<AsyncEvent> consumer) throws Exception
{
ServletContextHandler context = new ServletContextHandler();
context.setContextPath("/ctx");
context.addServlet(new ServletHolder(new HttpServlet()
{
@Override
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException
{
AsyncContext asyncContext = request.startAsync();
asyncContext.setTimeout(10000);
@ -209,7 +209,7 @@ public class AsyncListenerTest
context.addServlet(new ServletHolder(new HttpServlet()
{
@Override
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
protected void service(HttpServletRequest request, HttpServletResponse response)
{
response.setStatus(HttpStatus.OK_200);
}
@ -217,7 +217,7 @@ public class AsyncListenerTest
context.addServlet(new ServletHolder(new HttpServlet()
{
@Override
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
protected void service(HttpServletRequest request, HttpServletResponse response) throws IOException
{
response.getOutputStream().print("CUSTOM");
}
@ -227,9 +227,9 @@ public class AsyncListenerTest
}
@Test
public void test_StartAsync_OnTimeout_Dispatch() throws Exception
public void testStartAsyncOnTimeoutDispatch() throws Exception
{
test_StartAsync_OnTimeout(500, event -> event.getAsyncContext().dispatch("/dispatch"));
testStartAsyncOnTimeout(500, event -> event.getAsyncContext().dispatch("/dispatch"));
String httpResponse = connector.getResponse(
"GET / HTTP/1.1\r\n" +
"Host: localhost\r\n" +
@ -239,9 +239,9 @@ public class AsyncListenerTest
}
@Test
public void test_StartAsync_OnTimeout_Complete() throws Exception
public void testStartAsyncOnTimeoutComplete() throws Exception
{
test_StartAsync_OnTimeout(500, event ->
testStartAsyncOnTimeout(500, event ->
{
HttpServletResponse response = (HttpServletResponse)event.getAsyncContext().getResponse();
response.setStatus(HttpStatus.OK_200);
@ -259,9 +259,9 @@ public class AsyncListenerTest
}
@Test
public void test_StartAsync_OnTimeout_Throw() throws Exception
public void testStartAsyncOnTimeoutThrow() throws Exception
{
test_StartAsync_OnTimeout(500, event ->
testStartAsyncOnTimeout(500, event ->
{
throw new TestRuntimeException();
});
@ -276,9 +276,9 @@ public class AsyncListenerTest
}
@Test
public void test_StartAsync_OnTimeout_Nothing() throws Exception
public void testStartAsyncOnTimeoutNothing() throws Exception
{
test_StartAsync_OnTimeout(500, event ->
testStartAsyncOnTimeout(500, event ->
{
});
String httpResponse = connector.getResponse(
@ -290,9 +290,9 @@ public class AsyncListenerTest
}
@Test
public void test_StartAsync_OnTimeout_SendError() throws Exception
public void testStartAsyncOnTimeoutSendError() throws Exception
{
test_StartAsync_OnTimeout(500, event ->
testStartAsyncOnTimeout(500, event ->
{
HttpServletResponse response = (HttpServletResponse)event.getAsyncContext().getResponse();
response.sendError(HttpStatus.BAD_GATEWAY_502);
@ -307,9 +307,9 @@ public class AsyncListenerTest
}
@Test
public void test_StartAsync_OnTimeout_SendError_CustomErrorPage() throws Exception
public void testStartAsyncOnTimeoutSendErrorCustomErrorPage() throws Exception
{
test_StartAsync_OnTimeout(500, event ->
testStartAsyncOnTimeout(500, event ->
{
AsyncContext asyncContext = event.getAsyncContext();
HttpServletResponse response = (HttpServletResponse)asyncContext.getResponse();
@ -339,13 +339,13 @@ public class AsyncListenerTest
assertThat(httpResponse, containsString("CUSTOM"));
}
private void test_StartAsync_OnTimeout(long timeout, IOConsumer<AsyncEvent> consumer) throws Exception
private void testStartAsyncOnTimeout(long timeout, IOConsumer<AsyncEvent> consumer) throws Exception
{
ServletContextHandler context = new ServletContextHandler();
context.addServlet(new ServletHolder(new HttpServlet()
{
@Override
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
protected void service(HttpServletRequest request, HttpServletResponse response)
{
AsyncContext asyncContext = request.startAsync();
asyncContext.setTimeout(timeout);
@ -362,7 +362,7 @@ public class AsyncListenerTest
context.addServlet(new ServletHolder(new HttpServlet()
{
@Override
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
protected void service(HttpServletRequest request, HttpServletResponse response)
{
response.setStatus(HttpStatus.OK_200);
}
@ -370,7 +370,7 @@ public class AsyncListenerTest
context.addServlet(new ServletHolder(new HttpServlet()
{
@Override
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
protected void service(HttpServletRequest request, HttpServletResponse response) throws IOException
{
response.getOutputStream().print("CUSTOM");
}
@ -380,20 +380,20 @@ public class AsyncListenerTest
}
@Test
public void test_StartAsync_OnComplete_Throw() throws Exception
public void testStartAsyncOnCompleteThrow() throws Exception
{
ServletContextHandler context = new ServletContextHandler();
context.addServlet(new ServletHolder(new HttpServlet()
{
@Override
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
protected void service(HttpServletRequest request, HttpServletResponse response) throws IOException
{
AsyncContext asyncContext = request.startAsync();
asyncContext.setTimeout(10000);
asyncContext.addListener(new AsyncListenerAdapter()
{
@Override
public void onComplete(AsyncEvent event) throws IOException
public void onComplete(AsyncEvent event)
{
throw new TestRuntimeException();
}
@ -415,7 +415,7 @@ public class AsyncListenerTest
}
@Test
public void test_StartAsync_OnTimeout_CalledBy_PooledThread() throws Exception
public void testStartAsyncOnTimeoutCalledByPooledThread() throws Exception
{
String threadNamePrefix = "async_listener";
threadPool = new QueuedThreadPool();
@ -424,14 +424,14 @@ public class AsyncListenerTest
context.addServlet(new ServletHolder(new HttpServlet()
{
@Override
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
protected void service(HttpServletRequest request, HttpServletResponse response)
{
AsyncContext asyncContext = request.startAsync();
asyncContext.setTimeout(1000);
asyncContext.addListener(new AsyncListenerAdapter()
{
@Override
public void onTimeout(AsyncEvent event) throws IOException
public void onTimeout(AsyncEvent event)
{
if (Thread.currentThread().getName().startsWith(threadNamePrefix))
response.setStatus(HttpStatus.OK_200);
@ -459,7 +459,7 @@ public class AsyncListenerTest
public static class AsyncListenerAdapter implements AsyncListener
{
@Override
public void onComplete(AsyncEvent event) throws IOException
public void onComplete(AsyncEvent event)
{
}
@ -474,7 +474,7 @@ public class AsyncListenerTest
}
@Override
public void onStartAsync(AsyncEvent event) throws IOException
public void onStartAsync(AsyncEvent event)
{
}
}

View File

@ -93,9 +93,9 @@ public class AsyncServletIOTest
_wQTP = new WrappingQTP();
_server = new Server(_wQTP);
HttpConfiguration http_config = new HttpConfiguration();
http_config.setOutputBufferSize(4096);
_connector = new ServerConnector(_server, new HttpConnectionFactory(http_config));
HttpConfiguration httpConfig = new HttpConfiguration();
httpConfig.setOutputBufferSize(4096);
_connector = new ServerConnector(_server, new HttpConnectionFactory(httpConfig));
_server.setConnectors(new Connector[]{_connector});
ServletContextHandler context = new ServletContextHandler();

View File

@ -716,43 +716,43 @@ public class AsyncServletTest
historyAdd("wrapped" + ((request instanceof ServletRequestWrapper) ? " REQ" : "") + ((response instanceof ServletResponseWrapper) ? " RSP" : ""));
boolean wrap = "true".equals(request.getParameter("wrap"));
int read_before = 0;
long sleep_for = -1;
long start_for = -1;
long start2_for = -1;
long dispatch_after = -1;
long dispatch2_after = -1;
long complete_after = -1;
long complete2_after = -1;
int readBefore = 0;
long sleepFor = -1;
long startFor = -1;
long start2For = -1;
long dispatchAfter = -1;
long dispatch2After = -1;
long completeAfter = -1;
long complete2After = -1;
if (request.getParameter("read") != null)
read_before = Integer.parseInt(request.getParameter("read"));
readBefore = Integer.parseInt(request.getParameter("read"));
if (request.getParameter("sleep") != null)
sleep_for = Integer.parseInt(request.getParameter("sleep"));
sleepFor = Integer.parseInt(request.getParameter("sleep"));
if (request.getParameter("start") != null)
start_for = Integer.parseInt(request.getParameter("start"));
startFor = Integer.parseInt(request.getParameter("start"));
if (request.getParameter("start2") != null)
start2_for = Integer.parseInt(request.getParameter("start2"));
start2For = Integer.parseInt(request.getParameter("start2"));
if (request.getParameter("dispatch") != null)
dispatch_after = Integer.parseInt(request.getParameter("dispatch"));
dispatchAfter = Integer.parseInt(request.getParameter("dispatch"));
final String path = request.getParameter("path");
if (request.getParameter("dispatch2") != null)
dispatch2_after = Integer.parseInt(request.getParameter("dispatch2"));
dispatch2After = Integer.parseInt(request.getParameter("dispatch2"));
if (request.getParameter("complete") != null)
complete_after = Integer.parseInt(request.getParameter("complete"));
completeAfter = Integer.parseInt(request.getParameter("complete"));
if (request.getParameter("complete2") != null)
complete2_after = Integer.parseInt(request.getParameter("complete2"));
complete2After = Integer.parseInt(request.getParameter("complete2"));
if (request.getAttribute("State") == null)
{
request.setAttribute("State", 1);
historyAdd("initial");
if (read_before > 0)
if (readBefore > 0)
{
byte[] buf = new byte[read_before];
byte[] buf = new byte[readBefore];
request.getInputStream().read(buf);
}
else if (read_before < 0)
else if (readBefore < 0)
{
InputStream in = request.getInputStream();
int b = in.read();
@ -788,18 +788,18 @@ public class AsyncServletTest
}.start();
}
if (start_for >= 0)
if (startFor >= 0)
{
final AsyncContext async = wrap ? request.startAsync(new HttpServletRequestWrapper(request), new HttpServletResponseWrapper(response)) : request.startAsync();
if (start_for > 0)
async.setTimeout(start_for);
if (startFor > 0)
async.setTimeout(startFor);
async.addListener(__listener);
historyAdd("start");
if ("1".equals(request.getParameter("throw")))
throw new QuietServletException(new Exception("test throw in async 1"));
if (complete_after > 0)
if (completeAfter > 0)
{
TimerTask complete = new TimerTask()
{
@ -821,17 +821,17 @@ public class AsyncServletTest
};
synchronized (_timer)
{
_timer.schedule(complete, complete_after);
_timer.schedule(complete, completeAfter);
}
}
else if (complete_after == 0)
else if (completeAfter == 0)
{
response.setStatus(200);
response.getOutputStream().println("COMPLETED\n");
historyAdd("complete");
async.complete();
}
else if (dispatch_after > 0)
else if (dispatchAfter > 0)
{
TimerTask dispatch = new TimerTask()
{
@ -853,10 +853,10 @@ public class AsyncServletTest
};
synchronized (_timer)
{
_timer.schedule(dispatch, dispatch_after);
_timer.schedule(dispatch, dispatchAfter);
}
}
else if (dispatch_after == 0)
else if (dispatchAfter == 0)
{
historyAdd("dispatch");
if (path != null)
@ -865,11 +865,11 @@ public class AsyncServletTest
async.dispatch();
}
}
else if (sleep_for >= 0)
else if (sleepFor >= 0)
{
try
{
Thread.sleep(sleep_for);
Thread.sleep(sleepFor);
}
catch (InterruptedException e)
{
@ -888,22 +888,22 @@ public class AsyncServletTest
{
historyAdd("!initial");
if (start2_for >= 0 && request.getAttribute("2nd") == null)
if (start2For >= 0 && request.getAttribute("2nd") == null)
{
final AsyncContext async = wrap ? request.startAsync(new HttpServletRequestWrapper(request), new HttpServletResponseWrapper(response)) : request.startAsync();
async.addListener(__listener);
request.setAttribute("2nd", "cycle");
if (start2_for > 0)
if (start2For > 0)
{
async.setTimeout(start2_for);
async.setTimeout(start2For);
}
historyAdd("start");
if ("2".equals(request.getParameter("throw")))
throw new QuietServletException(new Exception("test throw in async 2"));
if (complete2_after > 0)
if (complete2After > 0)
{
TimerTask complete = new TimerTask()
{
@ -925,17 +925,17 @@ public class AsyncServletTest
};
synchronized (_timer)
{
_timer.schedule(complete, complete2_after);
_timer.schedule(complete, complete2After);
}
}
else if (complete2_after == 0)
else if (complete2After == 0)
{
response.setStatus(200);
response.getOutputStream().println("COMPLETED\n");
historyAdd("complete");
async.complete();
}
else if (dispatch2_after > 0)
else if (dispatch2After > 0)
{
TimerTask dispatch = new TimerTask()
{
@ -948,10 +948,10 @@ public class AsyncServletTest
};
synchronized (_timer)
{
_timer.schedule(dispatch, dispatch2_after);
_timer.schedule(dispatch, dispatch2After);
}
}
else if (dispatch2_after == 0)
else if (dispatch2After == 0)
{
historyAdd("dispatch");
async.dispatch();

View File

@ -135,7 +135,7 @@ public class ComplianceViolations2616Test
}
@Test
public void testNoColonHeader_Middle() throws Exception
public void testNoColonHeaderMiddle() throws Exception
{
StringBuffer req1 = new StringBuffer();
req1.append("GET /dump/ HTTP/1.1\r\n");
@ -152,7 +152,7 @@ public class ComplianceViolations2616Test
}
@Test
public void testNoColonHeader_End() throws Exception
public void testNoColonHeaderEnd() throws Exception
{
StringBuffer req1 = new StringBuffer();
req1.append("GET /dump/ HTTP/1.1\r\n");

View File

@ -272,7 +272,7 @@ public class DefaultServletTest
* This test ensures that this behavior will not arise again.
*/
@Test
public void testListingFilenamesOnly_UrlResource() throws Exception
public void testListingFilenamesOnlyUrlResource() throws Exception
{
URL extraResource = context.getClassLoader().getResource("rez/one");
assertNotNull(extraResource, "Must have extra jar resource in classloader");
@ -873,7 +873,7 @@ public class DefaultServletTest
* Ensure that oddball directory names are served with proper escaping
*/
@Test
public void testWelcomeRedirect_DirWithQuestion() throws Exception
public void testWelcomeRedirectDirWithQuestion() throws Exception
{
FS.ensureDirExists(docRoot);
context.setBaseResource(new PathResource(docRoot));
@ -907,7 +907,7 @@ public class DefaultServletTest
* Ensure that oddball directory names are served with proper escaping
*/
@Test
public void testWelcomeRedirect_DirWithSemicolon() throws Exception
public void testWelcomeRedirectDirWithSemicolon() throws Exception
{
FS.ensureDirExists(docRoot);
context.setBaseResource(new PathResource(docRoot));
@ -1499,7 +1499,7 @@ public class DefaultServletTest
body = response.getContent();
assertThat(body, containsString("Hello Text 0"));
String etag = response.get(HttpHeader.ETAG);
String etag_gzip = etag.replaceFirst("([^\"]*)\"(.*)\"", "$1\"$2--gzip\"");
String etagGzip = etag.replaceFirst("([^\"]*)\"(.*)\"", "$1\"$2--gzip\"");
rawResponse = connector.getResponse("GET /context/data0.txt HTTP/1.0\r\nHost:localhost:8080\r\nAccept-Encoding:gzip\r\n\r\n");
response = HttpTester.parseResponse(rawResponse);
@ -1508,7 +1508,7 @@ public class DefaultServletTest
assertThat(response, containsHeaderValue(HttpHeader.CONTENT_TYPE, "text/plain"));
assertThat(response, containsHeaderValue(HttpHeader.VARY, "Accept-Encoding"));
assertThat(response, containsHeaderValue(HttpHeader.CONTENT_ENCODING, "gzip"));
assertThat(response, containsHeaderValue(HttpHeader.ETAG, etag_gzip));
assertThat(response, containsHeaderValue(HttpHeader.ETAG, etagGzip));
body = response.getContent();
assertThat(body, containsString("fake gzip"));
@ -1519,7 +1519,7 @@ public class DefaultServletTest
assertThat(response, containsHeaderValue(HttpHeader.CONTENT_TYPE, "application/gzip"));
assertThat(response, not(containsHeader(HttpHeader.VARY)));
assertThat(response, not(containsHeader(HttpHeader.CONTENT_ENCODING)));
assertThat("Should not contain gzip variant", response, not(containsHeaderValue(HttpHeader.ETAG, etag_gzip)));
assertThat("Should not contain gzip variant", response, not(containsHeaderValue(HttpHeader.ETAG, etagGzip)));
assertThat("Should have a different ETag", response, containsHeader(HttpHeader.ETAG));
body = response.getContent();
assertThat(body, containsString("fake gzip"));
@ -1531,30 +1531,30 @@ public class DefaultServletTest
assertThat(response, containsHeaderValue(HttpHeader.CONTENT_TYPE, "application/gzip"));
assertThat(response, not(containsHeader(HttpHeader.VARY)));
assertThat(response, not(containsHeader(HttpHeader.CONTENT_ENCODING)));
assertThat("Should not contain gzip variant", response, not(containsHeaderValue(HttpHeader.ETAG, etag_gzip)));
assertThat("Should not contain gzip variant", response, not(containsHeaderValue(HttpHeader.ETAG, etagGzip)));
assertThat("Should have a different ETag", response, containsHeader(HttpHeader.ETAG));
body = response.getContent();
assertThat(body, containsString("fake gzip"));
String bad_etag_gzip = etag.replaceFirst("([^\"]*)\"(.*)\"", "$1\"$2X--gzip\"");
rawResponse = connector.getResponse("GET /context/data0.txt HTTP/1.0\r\nHost:localhost:8080\r\nAccept-Encoding:gzip\r\nIf-None-Match: " + bad_etag_gzip + "\r\n\r\n");
String badEtagGzip = etag.replaceFirst("([^\"]*)\"(.*)\"", "$1\"$2X--gzip\"");
rawResponse = connector.getResponse("GET /context/data0.txt HTTP/1.0\r\nHost:localhost:8080\r\nAccept-Encoding:gzip\r\nIf-None-Match: " + badEtagGzip + "\r\n\r\n");
response = HttpTester.parseResponse(rawResponse);
assertThat(response.toString(), response.getStatus(), is(not(HttpStatus.NOT_MODIFIED_304)));
rawResponse = connector.getResponse("GET /context/data0.txt HTTP/1.0\r\nHost:localhost:8080\r\nAccept-Encoding:gzip\r\nIf-None-Match: " + etag_gzip + "\r\n\r\n");
rawResponse = connector.getResponse("GET /context/data0.txt HTTP/1.0\r\nHost:localhost:8080\r\nAccept-Encoding:gzip\r\nIf-None-Match: " + etagGzip + "\r\n\r\n");
response = HttpTester.parseResponse(rawResponse);
assertThat(response.toString(), response.getStatus(), is(HttpStatus.NOT_MODIFIED_304));
assertThat(response, containsHeaderValue(HttpHeader.ETAG, etag_gzip));
assertThat(response, containsHeaderValue(HttpHeader.ETAG, etagGzip));
rawResponse = connector.getResponse("GET /context/data0.txt HTTP/1.0\r\nHost:localhost:8080\r\nAccept-Encoding:gzip\r\nIf-None-Match: " + etag + "\r\n\r\n");
response = HttpTester.parseResponse(rawResponse);
assertThat(response.toString(), response.getStatus(), is(HttpStatus.NOT_MODIFIED_304));
assertThat(response, containsHeaderValue(HttpHeader.ETAG, etag));
rawResponse = connector.getResponse("GET /context/data0.txt HTTP/1.0\r\nHost:localhost:8080\r\nAccept-Encoding:gzip\r\nIf-None-Match: W/\"foobar\"," + etag_gzip + "\r\n\r\n");
rawResponse = connector.getResponse("GET /context/data0.txt HTTP/1.0\r\nHost:localhost:8080\r\nAccept-Encoding:gzip\r\nIf-None-Match: W/\"foobar\"," + etagGzip + "\r\n\r\n");
response = HttpTester.parseResponse(rawResponse);
assertThat(response.toString(), response.getStatus(), is(HttpStatus.NOT_MODIFIED_304));
assertThat(response, containsHeaderValue(HttpHeader.ETAG, etag_gzip));
assertThat(response, containsHeaderValue(HttpHeader.ETAG, etagGzip));
rawResponse = connector.getResponse("GET /context/data0.txt HTTP/1.0\r\nHost:localhost:8080\r\nAccept-Encoding:gzip\r\nIf-None-Match: W/\"foobar\"," + etag + "\r\n\r\n");
response = HttpTester.parseResponse(rawResponse);
@ -1598,7 +1598,7 @@ public class DefaultServletTest
assertThat(body, containsString("Hello Text 0"));
String etag = response.get(HttpHeader.ETAG);
String etag_gzip = etag.replaceFirst("([^\"]*)\"(.*)\"", "$1\"$2--gzip\"");
String etagGzip = etag.replaceFirst("([^\"]*)\"(.*)\"", "$1\"$2--gzip\"");
rawResponse = connector.getResponse("GET /context/data0.txt HTTP/1.0\r\nHost:localhost:8080\r\nAccept-Encoding:gzip\r\n\r\n");
response = HttpTester.parseResponse(rawResponse);
@ -1607,7 +1607,7 @@ public class DefaultServletTest
assertThat(response, containsHeaderValue(HttpHeader.CONTENT_TYPE, "text/plain"));
assertThat(response, containsHeaderValue(HttpHeader.VARY, "Accept-Encoding"));
assertThat(response, containsHeaderValue(HttpHeader.CONTENT_ENCODING, "gzip"));
assertThat(response, containsHeaderValue(HttpHeader.ETAG, etag_gzip));
assertThat(response, containsHeaderValue(HttpHeader.ETAG, etagGzip));
body = response.getContent();
assertThat(body, containsString("fake gzip"));
@ -1618,25 +1618,25 @@ public class DefaultServletTest
assertThat(response, containsHeaderValue(HttpHeader.CONTENT_TYPE, "application/gzip"));
assertThat(response, not(containsHeader(HttpHeader.VARY)));
assertThat(response, not(containsHeader(HttpHeader.CONTENT_ENCODING)));
assertThat("Should not contain gzip variant", response, not(containsHeaderValue(HttpHeader.ETAG, etag_gzip)));
assertThat("Should not contain gzip variant", response, not(containsHeaderValue(HttpHeader.ETAG, etagGzip)));
assertThat("Should have a different ETag", response, containsHeader(HttpHeader.ETAG));
body = response.getContent();
assertThat(body, containsString("fake gzip"));
rawResponse = connector.getResponse("GET /context/data0.txt HTTP/1.0\r\nHost:localhost:8080\r\nAccept-Encoding:gzip\r\nIf-None-Match: " + etag_gzip + "\r\n\r\n");
rawResponse = connector.getResponse("GET /context/data0.txt HTTP/1.0\r\nHost:localhost:8080\r\nAccept-Encoding:gzip\r\nIf-None-Match: " + etagGzip + "\r\n\r\n");
response = HttpTester.parseResponse(rawResponse);
assertThat(response.toString(), response.getStatus(), is(HttpStatus.NOT_MODIFIED_304));
assertThat(response, containsHeaderValue(HttpHeader.ETAG, etag_gzip));
assertThat(response, containsHeaderValue(HttpHeader.ETAG, etagGzip));
rawResponse = connector.getResponse("GET /context/data0.txt HTTP/1.0\r\nHost:localhost:8080\r\nAccept-Encoding:gzip\r\nIf-None-Match: " + etag + "\r\n\r\n");
response = HttpTester.parseResponse(rawResponse);
assertThat(response.toString(), response.getStatus(), is(HttpStatus.NOT_MODIFIED_304));
assertThat(response, containsHeaderValue(HttpHeader.ETAG, etag));
rawResponse = connector.getResponse("GET /context/data0.txt HTTP/1.0\r\nHost:localhost:8080\r\nAccept-Encoding:gzip\r\nIf-None-Match: W/\"foobar\"," + etag_gzip + "\r\n\r\n");
rawResponse = connector.getResponse("GET /context/data0.txt HTTP/1.0\r\nHost:localhost:8080\r\nAccept-Encoding:gzip\r\nIf-None-Match: W/\"foobar\"," + etagGzip + "\r\n\r\n");
response = HttpTester.parseResponse(rawResponse);
assertThat(response.toString(), response.getStatus(), is(HttpStatus.NOT_MODIFIED_304));
assertThat(response, containsHeaderValue(HttpHeader.ETAG, etag_gzip));
assertThat(response, containsHeaderValue(HttpHeader.ETAG, etagGzip));
rawResponse = connector.getResponse("GET /context/data0.txt HTTP/1.0\r\nHost:localhost:8080\r\nAccept-Encoding:gzip\r\nIf-None-Match: W/\"foobar\"," + etag + "\r\n\r\n");
response = HttpTester.parseResponse(rawResponse);
@ -1673,7 +1673,7 @@ public class DefaultServletTest
assertThat(body, containsString("Hello Text 0"));
String etag = response.get(HttpHeader.ETAG);
String etag_br = etag.replaceFirst("([^\"]*)\"(.*)\"", "$1\"$2--br\"");
String etagBr = etag.replaceFirst("([^\"]*)\"(.*)\"", "$1\"$2--br\"");
rawResponse = connector.getResponse("GET /context/data0.txt HTTP/1.0\r\nHost:localhost:8080\r\nAccept-Encoding:gzip;q=0.9,br\r\n\r\n");
response = HttpTester.parseResponse(rawResponse);
@ -1682,7 +1682,7 @@ public class DefaultServletTest
assertThat(response, containsHeaderValue(HttpHeader.CONTENT_TYPE, "text/plain"));
assertThat(response, containsHeaderValue(HttpHeader.VARY, "Accept-Encoding"));
assertThat(response, containsHeaderValue(HttpHeader.CONTENT_ENCODING, "br"));
assertThat(response, containsHeaderValue(HttpHeader.ETAG, etag_br));
assertThat(response, containsHeaderValue(HttpHeader.ETAG, etagBr));
body = response.getContent();
assertThat(body, containsString("fake br"));
@ -1693,7 +1693,7 @@ public class DefaultServletTest
assertThat(response, containsHeaderValue(HttpHeader.CONTENT_TYPE, "application/brotli"));
assertThat(response, not(containsHeader(HttpHeader.VARY)));
assertThat(response, not(containsHeader(HttpHeader.CONTENT_ENCODING)));
assertThat("Should not contain br variant", response, not(containsHeaderValue(HttpHeader.ETAG, etag_br)));
assertThat("Should not contain br variant", response, not(containsHeaderValue(HttpHeader.ETAG, etagBr)));
assertThat("Should have a different ETag", response, containsHeader(HttpHeader.ETAG));
body = response.getContent();
assertThat(body, containsString("fake br"));
@ -1705,25 +1705,25 @@ public class DefaultServletTest
assertThat(response, containsHeaderValue(HttpHeader.CONTENT_TYPE, "application/brotli"));
assertThat(response, not(containsHeader(HttpHeader.VARY)));
assertThat(response, not(containsHeader(HttpHeader.CONTENT_ENCODING)));
assertThat("Should not contain br variant", response, not(containsHeaderValue(HttpHeader.ETAG, etag_br)));
assertThat("Should not contain br variant", response, not(containsHeaderValue(HttpHeader.ETAG, etagBr)));
assertThat("Should have a different ETag", response, containsHeader(HttpHeader.ETAG));
body = response.getContent();
assertThat(body, containsString("fake br"));
rawResponse = connector.getResponse("GET /context/data0.txt HTTP/1.0\r\nHost:localhost:8080\r\nAccept-Encoding:br\r\nIf-None-Match: " + etag_br + "\r\n\r\n");
rawResponse = connector.getResponse("GET /context/data0.txt HTTP/1.0\r\nHost:localhost:8080\r\nAccept-Encoding:br\r\nIf-None-Match: " + etagBr + "\r\n\r\n");
response = HttpTester.parseResponse(rawResponse);
assertThat(response.toString(), response.getStatus(), is(HttpStatus.NOT_MODIFIED_304));
assertThat(response, containsHeaderValue(HttpHeader.ETAG, etag_br));
assertThat(response, containsHeaderValue(HttpHeader.ETAG, etagBr));
rawResponse = connector.getResponse("GET /context/data0.txt HTTP/1.0\r\nHost:localhost:8080\r\nAccept-Encoding:br\r\nIf-None-Match: " + etag + "\r\n\r\n");
response = HttpTester.parseResponse(rawResponse);
assertThat(response.toString(), response.getStatus(), is(HttpStatus.NOT_MODIFIED_304));
assertThat(response, containsHeaderValue(HttpHeader.ETAG, etag));
rawResponse = connector.getResponse("GET /context/data0.txt HTTP/1.0\r\nHost:localhost:8080\r\nAccept-Encoding:br\r\nIf-None-Match: W/\"foobar\"," + etag_br + "\r\n\r\n");
rawResponse = connector.getResponse("GET /context/data0.txt HTTP/1.0\r\nHost:localhost:8080\r\nAccept-Encoding:br\r\nIf-None-Match: W/\"foobar\"," + etagBr + "\r\n\r\n");
response = HttpTester.parseResponse(rawResponse);
assertThat(response.toString(), response.getStatus(), is(HttpStatus.NOT_MODIFIED_304));
assertThat(response, containsHeaderValue(HttpHeader.ETAG, etag_br));
assertThat(response, containsHeaderValue(HttpHeader.ETAG, etagBr));
rawResponse = connector.getResponse("GET /context/data0.txt HTTP/1.0\r\nHost:localhost:8080\r\nAccept-Encoding:br\r\nIf-None-Match: W/\"foobar\"," + etag + "\r\n\r\n");
response = HttpTester.parseResponse(rawResponse);
@ -1764,7 +1764,7 @@ public class DefaultServletTest
assertThat(body, containsString("Hello Text 0"));
String etag = response.get(HttpHeader.ETAG);
String etag_br = etag.replaceFirst("([^\"]*)\"(.*)\"", "$1\"$2--br\"");
String etagBr = etag.replaceFirst("([^\"]*)\"(.*)\"", "$1\"$2--br\"");
rawResponse = connector.getResponse("GET /context/data0.txt HTTP/1.0\r\nHost:localhost:8080\r\nAccept-Encoding:br\r\n\r\n");
response = HttpTester.parseResponse(rawResponse);
@ -1773,7 +1773,7 @@ public class DefaultServletTest
assertThat(response, containsHeaderValue(HttpHeader.CONTENT_TYPE, "text/plain"));
assertThat(response, containsHeaderValue(HttpHeader.VARY, "Accept-Encoding"));
assertThat(response, containsHeaderValue(HttpHeader.CONTENT_ENCODING, "br"));
assertThat(response, containsHeaderValue(HttpHeader.ETAG, etag_br));
assertThat(response, containsHeaderValue(HttpHeader.ETAG, etagBr));
body = response.getContent();
assertThat(body, containsString("fake brotli"));
@ -1784,25 +1784,25 @@ public class DefaultServletTest
assertThat(response, containsHeaderValue(HttpHeader.CONTENT_TYPE, "application/brotli"));
assertThat(response, not(containsHeader(HttpHeader.VARY)));
assertThat(response, not(containsHeader(HttpHeader.CONTENT_ENCODING)));
assertThat("Should not contain br variant", response, not(containsHeaderValue(HttpHeader.ETAG, etag_br)));
assertThat("Should not contain br variant", response, not(containsHeaderValue(HttpHeader.ETAG, etagBr)));
assertThat("Should have a different ETag", response, containsHeader(HttpHeader.ETAG));
body = response.getContent();
assertThat(body, containsString("fake brotli"));
rawResponse = connector.getResponse("GET /context/data0.txt HTTP/1.0\r\nHost:localhost:8080\r\nAccept-Encoding:br\r\nIf-None-Match: " + etag_br + "\r\n\r\n");
rawResponse = connector.getResponse("GET /context/data0.txt HTTP/1.0\r\nHost:localhost:8080\r\nAccept-Encoding:br\r\nIf-None-Match: " + etagBr + "\r\n\r\n");
response = HttpTester.parseResponse(rawResponse);
assertThat(response.toString(), response.getStatus(), is(HttpStatus.NOT_MODIFIED_304));
assertThat(response, containsHeaderValue(HttpHeader.ETAG, etag_br));
assertThat(response, containsHeaderValue(HttpHeader.ETAG, etagBr));
rawResponse = connector.getResponse("GET /context/data0.txt HTTP/1.0\r\nHost:localhost:8080\r\nAccept-Encoding:br\r\nIf-None-Match: " + etag + "\r\n\r\n");
response = HttpTester.parseResponse(rawResponse);
assertThat(response.toString(), response.getStatus(), is(HttpStatus.NOT_MODIFIED_304));
assertThat(response, containsHeaderValue(HttpHeader.ETAG, etag));
rawResponse = connector.getResponse("GET /context/data0.txt HTTP/1.0\r\nHost:localhost:8080\r\nAccept-Encoding:br\r\nIf-None-Match: W/\"foobar\"," + etag_br + "\r\n\r\n");
rawResponse = connector.getResponse("GET /context/data0.txt HTTP/1.0\r\nHost:localhost:8080\r\nAccept-Encoding:br\r\nIf-None-Match: W/\"foobar\"," + etagBr + "\r\n\r\n");
response = HttpTester.parseResponse(rawResponse);
assertThat(response.toString(), response.getStatus(), is(HttpStatus.NOT_MODIFIED_304));
assertThat(response, containsHeaderValue(HttpHeader.ETAG, etag_br));
assertThat(response, containsHeaderValue(HttpHeader.ETAG, etagBr));
rawResponse = connector.getResponse("GET /context/data0.txt HTTP/1.0\r\nHost:localhost:8080\r\nAccept-Encoding:br\r\nIf-None-Match: W/\"foobar\"," + etag + "\r\n\r\n");
response = HttpTester.parseResponse(rawResponse);
@ -1930,9 +1930,9 @@ public class DefaultServletTest
assertThat(response.toString(), response.getStatus(), is(HttpStatus.OK_200));
assertThat(response, containsHeader(HttpHeader.LAST_MODIFIED));
String last_modified = response.get(HttpHeader.LAST_MODIFIED);
String lastModified = response.get(HttpHeader.LAST_MODIFIED);
rawResponse = connector.getResponse("GET /context/file.txt HTTP/1.1\r\nHost:test\r\nConnection:close\r\nIf-Modified-Since: " + last_modified + "\r\n\r\n");
rawResponse = connector.getResponse("GET /context/file.txt HTTP/1.1\r\nHost:test\r\nConnection:close\r\nIf-Modified-Since: " + lastModified + "\r\n\r\n");
response = HttpTester.parseResponse(rawResponse);
assertThat(response.toString(), response.getStatus(), is(HttpStatus.NOT_MODIFIED_304));

View File

@ -657,8 +657,8 @@ public class DispatcherTest
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
byte[] cp1251_bytes = TypeUtil.fromHexString("d2e5ecefe5f0e0f2f3f0e0");
String expectedCP1251String = new String(cp1251_bytes, "cp1251");
byte[] cp1251Bytes = TypeUtil.fromHexString("d2e5ecefe5f0e0f2f3f0e0");
String expectedCP1251String = new String(cp1251Bytes, "cp1251");
assertEquals("/context/ForwardServlet", request.getAttribute(Dispatcher.FORWARD_REQUEST_URI));
assertEquals("/context", request.getAttribute(Dispatcher.FORWARD_CONTEXT_PATH));

View File

@ -183,7 +183,7 @@ public class ErrorPageTest
}
@Test
public void testGenerateAcceptableResponse_noAcceptHeader() throws Exception
public void testGenerateAcceptableResponseNoAcceptHeader() throws Exception
{
// no global error page here
_errorPageErrorHandler.getErrorPages().remove(ErrorPageErrorHandler.GLOBAL_ERROR_PAGE);
@ -196,7 +196,7 @@ public class ErrorPageTest
}
@Test
public void testGenerateAcceptableResponse_htmlAcceptHeader() throws Exception
public void testGenerateAcceptableResponseHtmlAcceptHeader() throws Exception
{
// no global error page here
_errorPageErrorHandler.getErrorPages().remove(ErrorPageErrorHandler.GLOBAL_ERROR_PAGE);
@ -211,7 +211,7 @@ public class ErrorPageTest
}
@Test
public void testGenerateAcceptableResponse_noHtmlAcceptHeader() throws Exception
public void testGenerateAcceptableResponseNoHtmlAcceptHeader() throws Exception
{
// no global error page here
_errorPageErrorHandler.getErrorPages().remove(ErrorPageErrorHandler.GLOBAL_ERROR_PAGE);

View File

@ -183,7 +183,7 @@ public class RequestURITest
@ParameterizedTest
@MethodSource("data")
public void testGetRequestURI_HTTP10(String rawpath, String expectedReqUri, String expectedQuery) throws Exception
public void testGetRequestURIHTTP10(String rawpath, String expectedReqUri, String expectedQuery) throws Exception
{
try (Socket client = newSocket(serverURI.getHost(), serverURI.getPort()))
{
@ -205,7 +205,7 @@ public class RequestURITest
@ParameterizedTest
@MethodSource("data")
public void testGetRequestURI_HTTP11(String rawpath, String expectedReqUri, String expectedQuery) throws Exception
public void testGetRequestURIHTTP11(String rawpath, String expectedReqUri, String expectedQuery) throws Exception
{
try (Socket client = newSocket(serverURI.getHost(), serverURI.getPort()))
{

View File

@ -102,7 +102,7 @@ public class ServletContextResourcesTest
}
@Test
public void testGetResourceAsStream_Root() throws Exception
public void testGetResourceAsStreamRoot() throws Exception
{
context.addServlet(ResourceAsStreamServlet.class, "/*");
@ -117,7 +117,7 @@ public class ServletContextResourcesTest
}
@Test
public void testGetResourceAsStream_Content() throws Exception
public void testGetResourceAsStreamContent() throws Exception
{
context.addServlet(ResourceAsStreamServlet.class, "/*");

View File

@ -379,7 +379,7 @@ public class ServletRequestLogTest
*/
@ParameterizedTest
@MethodSource("data")
public void testLogHandlerCollection_ErrorHandler_ServerBean(Servlet testServlet, String requestPath, String expectedLogEntry) throws Exception
public void testLogHandlerCollectionErrorHandlerServerBean(Servlet testServlet, String requestPath, String expectedLogEntry) throws Exception
{
Server server = new Server();
ServerConnector connector = new ServerConnector(server);
@ -470,7 +470,7 @@ public class ServletRequestLogTest
*/
@ParameterizedTest
@MethodSource("data")
public void testLogHandlerCollection_SimpleErrorPageMapping(Servlet testServlet, String requestPath, String expectedLogEntry) throws Exception
public void testLogHandlerCollectionSimpleErrorPageMapping(Servlet testServlet, String requestPath, String expectedLogEntry) throws Exception
{
Server server = new Server();
ServerConnector connector = new ServerConnector(server);

View File

@ -91,7 +91,7 @@ public class DoSFilterTest extends AbstractDoSFilterTest
}
@Test
public void testRemotePortLoadIdCreation_ipv6() throws ServletException
public void testRemotePortLoadIdCreationIpv6() throws ServletException
{
final ServletRequest request = new RemoteAddressRequest("::192.9.5.5", 12345);
DoSFilter doSFilter = new DoSFilter();
@ -114,7 +114,7 @@ public class DoSFilterTest extends AbstractDoSFilterTest
}
@Test
public void testRemotePortLoadIdCreation_ipv4() throws ServletException
public void testRemotePortLoadIdCreationIpv4() throws ServletException
{
final ServletRequest request = new RemoteAddressRequest("127.0.0.1", 12345);
DoSFilter doSFilter = new DoSFilter();

View File

@ -194,7 +194,7 @@ public class EventSourceServletTest
public void testEncoding() throws Exception
{
// The EURO symbol
final String data = "\u20AC";
final String data = "%E2%82%AC";
class S extends EventSourceServlet
{
@Override

View File

@ -127,7 +127,7 @@ public class GzipContentLengthTest
*/
@ParameterizedTest
@MethodSource("scenarios")
public void testAsyncTimeoutCompleteWrite_Default(Scenario scenario) throws Exception
public void testAsyncTimeoutCompleteWriteDefault(Scenario scenario) throws Exception
{
testWithGzip(scenario, AsyncTimeoutCompleteWrite.Default.class);
}
@ -140,7 +140,7 @@ public class GzipContentLengthTest
*/
@ParameterizedTest
@MethodSource("scenarios")
public void testAsyncTimeoutCompleteWrite_Passed(Scenario scenario) throws Exception
public void testAsyncTimeoutCompleteWritePassed(Scenario scenario) throws Exception
{
testWithGzip(scenario, AsyncTimeoutCompleteWrite.Passed.class);
}
@ -153,7 +153,7 @@ public class GzipContentLengthTest
*/
@ParameterizedTest
@MethodSource("scenarios")
public void testAsyncTimeoutDispatchWrite_Default(Scenario scenario) throws Exception
public void testAsyncTimeoutDispatchWriteDefault(Scenario scenario) throws Exception
{
testWithGzip(scenario, AsyncTimeoutDispatchWrite.Default.class);
}
@ -166,7 +166,7 @@ public class GzipContentLengthTest
*/
@ParameterizedTest
@MethodSource("scenarios")
public void testAsyncTimeoutDispatchWrite_Passed(Scenario scenario) throws Exception
public void testAsyncTimeoutDispatchWritePassed(Scenario scenario) throws Exception
{
testWithGzip(scenario, AsyncTimeoutDispatchWrite.Passed.class);
}
@ -179,7 +179,7 @@ public class GzipContentLengthTest
*/
@ParameterizedTest
@MethodSource("scenarios")
public void testAsyncScheduledDispatchWrite_Default(Scenario scenario) throws Exception
public void testAsyncScheduledDispatchWriteDefault(Scenario scenario) throws Exception
{
testWithGzip(scenario, AsyncScheduledDispatchWrite.Default.class);
}
@ -192,7 +192,7 @@ public class GzipContentLengthTest
*/
@ParameterizedTest
@MethodSource("scenarios")
public void testAsyncScheduledDispatchWrite_Passed(Scenario scenario) throws Exception
public void testAsyncScheduledDispatchWritePassed(Scenario scenario) throws Exception
{
testWithGzip(scenario, AsyncScheduledDispatchWrite.Passed.class);
}

View File

@ -72,7 +72,7 @@ public class GzipDefaultNoRecompressTest
@ParameterizedTest
@MethodSource("data")
public void testNotGzipHandlered_Default_AlreadyCompressed(String alreadyCompressedFilename, String expectedContentType, String compressionType) throws Exception
public void testNotGzipHandleredDefaultAlreadyCompressed(String alreadyCompressedFilename, String expectedContentType, String compressionType) throws Exception
{
GzipTester tester = new GzipTester(testingdir.getEmptyPathDir(), compressionType);

View File

@ -322,12 +322,12 @@ public class IncludeExcludeBasedFilterTest
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException
{
HttpServletRequest http_request = (HttpServletRequest)request;
HttpServletResponse http_response = (HttpServletResponse)response;
HttpServletRequest httpRequest = (HttpServletRequest)request;
HttpServletResponse httpResponse = (HttpServletResponse)response;
if (super.shouldFilter(http_request, http_response))
if (super.shouldFilter(httpRequest, httpResponse))
{
http_response.setHeader("X-Custom-Value", "1");
httpResponse.setHeader("X-Custom-Value", "1");
}
chain.doFilter(request, response);

View File

@ -135,15 +135,15 @@ public class PutFilterTest
request.setHeader("Content-Type", "text/plain");
String data2 = "Blah blah blah Blah blah";
request.setContent(data2);
String to_send = BufferUtil.toString(request.generate());
String toSend = BufferUtil.toString(request.generate());
URL url = new URL(tester.createConnector(true));
Socket socket = new Socket(url.getHost(), url.getPort());
OutputStream out = socket.getOutputStream();
int l = to_send.length();
out.write(to_send.substring(0, l - 10).getBytes());
int l = toSend.length();
out.write(toSend.substring(0, l - 10).getBytes());
out.flush();
Thread.sleep(100);
out.write(to_send.substring(l - 10, l - 5).getBytes());
out.write(toSend.substring(l - 10, l - 5).getBytes());
out.flush();
// loop until the resource is hidden (ie the PUT is starting to
@ -162,7 +162,7 @@ public class PutFilterTest
while (response.getStatus() == 200);
assertEquals(HttpServletResponse.SC_NOT_FOUND, response.getStatus());
out.write(to_send.substring(l - 5).getBytes());
out.write(toSend.substring(l - 5).getBytes());
out.flush();
String in = IO.toString(socket.getInputStream());
@ -247,8 +247,8 @@ public class PutFilterTest
assertTrue(!file.exists());
File n_file = new File(_dir, "blah.txt");
assertTrue(n_file.exists());
File nFile = new File(_dir, "blah.txt");
assertTrue(nFile.exists());
}
@Test

View File

@ -156,7 +156,7 @@ public class SpringXmlConfigurationTest
}
@Test
public void XmlConfigurationMain() throws Exception
public void xmlConfigurationMain() throws Exception
{
XmlConfiguration.main("src/test/resources/org/eclipse/jetty/spring/jetty.xml");
}

View File

@ -98,7 +98,7 @@ public class BaseHomeTest
}
@Test
public void testGetPath_OnlyHome() throws IOException
public void testGetPathOnlyHome() throws IOException
{
File homeDir = MavenTestingUtils.getTestResourceDir("hb.1/home");
@ -116,7 +116,7 @@ public class BaseHomeTest
}
@Test
public void testGetPaths_OnlyHome() throws IOException
public void testGetPathsOnlyHome() throws IOException
{
File homeDir = MavenTestingUtils.getTestResourceDir("hb.1/home");
@ -138,7 +138,7 @@ public class BaseHomeTest
}
@Test
public void testGetPaths_OnlyHome_InisOnly() throws IOException
public void testGetPathsOnlyHomeInisOnly() throws IOException
{
File homeDir = MavenTestingUtils.getTestResourceDir("hb.1/home");
@ -160,7 +160,7 @@ public class BaseHomeTest
}
@Test
public void testGetPaths_Both() throws IOException
public void testGetPathsBoth() throws IOException
{
File homeDir = MavenTestingUtils.getTestResourceDir("hb.1/home");
File baseDir = MavenTestingUtils.getTestResourceDir("hb.1/base");
@ -193,7 +193,7 @@ public class BaseHomeTest
}
@Test
public void testGetPath_Both() throws IOException
public void testGetPathBoth() throws IOException
{
File homeDir = MavenTestingUtils.getTestResourceDir("hb.1/home");
File baseDir = MavenTestingUtils.getTestResourceDir("hb.1/base");

View File

@ -37,7 +37,7 @@ public class FSTest
}
@Test
public void testCanReadDirectory_NotDir()
public void testCanReadDirectoryNotDir()
{
File bogusFile = MavenTestingUtils.getTestResourceFile("bogus.xml");
assertFalse(FS.canReadDirectory(bogusFile.toPath()), "Can read dir: " + bogusFile);

Some files were not shown because too many files have changed in this diff Show More