Skip to content

Commit

Permalink
Addressing Checkstyle violations in src/test/java
Browse files Browse the repository at this point in the history
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
  • Loading branch information
joakime committed Jan 14, 2020
1 parent a7b9df9 commit 8c65309
Show file tree
Hide file tree
Showing 221 changed files with 1,792 additions and 1,746 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ public class DemoServer
public static void main(String[] args)
throws Exception
{
String jetty_home = System.getProperty("jetty.home", ".");
String jettyHome = System.getProperty("jetty.home", ".");

Server server = new Server(Integer.getInteger("jetty.http.port", 8080).intValue());

WebAppContext webapp = new WebAppContext();
webapp.setContextPath("/");
webapp.setWar(jetty_home + "/target/async-rest/");
webapp.setWar(jettyHome + "/target/async-rest/");
webapp.setParentLoaderPriority(true);
webapp.setServerClasses(new String[]{});
server.setHandler(webapp);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ public void testJep238MultiReleaseInJar() throws Exception
}

@Test
public void testJep238MultiReleaseInJar_JDK10() throws Exception
public void testJep238MultiReleaseInJarJDK10() throws Exception
{
File jdk10Jar = MavenTestingUtils.getTestResourceFile("jdk10/multirelease-10.jar");
AnnotationParser parser = new AnnotationParser();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import java.nio.ByteBuffer;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import javax.servlet.ServletException;
import javax.servlet.ServletInputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
Expand All @@ -50,13 +49,13 @@ public class ClientConnectionCloseTest extends AbstractHttpClientServerTest
{
@ParameterizedTest
@ArgumentsSource(ScenarioProvider.class)
public void test_ClientConnectionClose_ServerConnectionClose_ClientClosesAfterExchange(Scenario scenario) throws Exception
public void testClientConnectionCloseServerConnectionCloseClientClosesAfterExchange(Scenario scenario) throws Exception
{
byte[] data = new byte[128 * 1024];
start(scenario, new AbstractHandler()
{
@Override
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException
{
baseRequest.setHandled(true);

Expand Down Expand Up @@ -107,12 +106,12 @@ public void handle(String target, Request baseRequest, HttpServletRequest reques

@ParameterizedTest
@ArgumentsSource(ScenarioProvider.class)
public void test_ClientConnectionClose_ServerDoesNotRespond_ClientIdleTimeout(Scenario scenario) throws Exception
public void testClientConnectionCloseServerDoesNotRespondClientIdleTimeout(Scenario scenario) throws Exception
{
start(scenario, new AbstractHandler()
{
@Override
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response)
{
baseRequest.setHandled(true);
request.startAsync();
Expand Down Expand Up @@ -149,13 +148,13 @@ public void handle(String target, Request baseRequest, HttpServletRequest reques

@ParameterizedTest
@ArgumentsSource(ScenarioProvider.class)
public void test_ClientConnectionClose_ServerPartialResponse_ClientIdleTimeout(Scenario scenario) throws Exception
public void testClientConnectionCloseServerPartialResponseClientIdleTimeout(Scenario scenario) throws Exception
{
long idleTimeout = 1000;
start(scenario, new AbstractHandler()
{
@Override
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException
{
baseRequest.setHandled(true);

Expand Down Expand Up @@ -213,12 +212,12 @@ public void handle(String target, Request baseRequest, HttpServletRequest reques

@ParameterizedTest
@ArgumentsSource(ScenarioProvider.class)
public void test_ClientConnectionClose_ServerNoConnectionClose_ClientCloses(Scenario scenario) throws Exception
public void testClientConnectionCloseServerNoConnectionCloseClientCloses(Scenario scenario) throws Exception
{
start(scenario, new AbstractHandler()
{
@Override
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException
{
baseRequest.setHandled(true);
response.setContentLength(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,51 +115,51 @@ private void start(final Scenario scenario, Authenticator authenticator, Handler

@ParameterizedTest
@ArgumentsSource(ScenarioProvider.class)
public void test_BasicAuthentication(Scenario scenario) throws Exception
public void testBasicAuthentication(Scenario scenario) throws Exception
{
startBasic(scenario, new EmptyServerHandler());
URI uri = URI.create(scenario.getScheme() + "://localhost:" + connector.getLocalPort());
test_Authentication(scenario, new BasicAuthentication(uri, realm, "basic", "basic"));
testAuthentication(scenario, new BasicAuthentication(uri, realm, "basic", "basic"));
}

@ParameterizedTest
@ArgumentsSource(ScenarioProvider.class)
public void test_BasicEmptyRealm(Scenario scenario) throws Exception
public void testBasicEmptyRealm(Scenario scenario) throws Exception
{
realm = "";
startBasic(scenario, new EmptyServerHandler());
URI uri = URI.create(scenario.getScheme() + "://localhost:" + connector.getLocalPort());
test_Authentication(scenario, new BasicAuthentication(uri, realm, "basic", "basic"));
testAuthentication(scenario, new BasicAuthentication(uri, realm, "basic", "basic"));
}

@ParameterizedTest
@ArgumentsSource(ScenarioProvider.class)
public void test_BasicAnyRealm(Scenario scenario) throws Exception
public void testBasicAnyRealm(Scenario scenario) throws Exception
{
startBasic(scenario, new EmptyServerHandler());
URI uri = URI.create(scenario.getScheme() + "://localhost:" + connector.getLocalPort());
test_Authentication(scenario, new BasicAuthentication(uri, ANY_REALM, "basic", "basic"));
testAuthentication(scenario, new BasicAuthentication(uri, ANY_REALM, "basic", "basic"));
}

@ParameterizedTest
@ArgumentsSource(ScenarioProvider.class)
public void test_DigestAuthentication(Scenario scenario) throws Exception
public void testDigestAuthentication(Scenario scenario) throws Exception
{
startDigest(scenario, new EmptyServerHandler());
URI uri = URI.create(scenario.getScheme() + "://localhost:" + connector.getLocalPort());
test_Authentication(scenario, new DigestAuthentication(uri, realm, "digest", "digest"));
testAuthentication(scenario, new DigestAuthentication(uri, realm, "digest", "digest"));
}

@ParameterizedTest
@ArgumentsSource(ScenarioProvider.class)
public void test_DigestAnyRealm(Scenario scenario) throws Exception
public void testDigestAnyRealm(Scenario scenario) throws Exception
{
startDigest(scenario, new EmptyServerHandler());
URI uri = URI.create(scenario.getScheme() + "://localhost:" + connector.getLocalPort());
test_Authentication(scenario, new DigestAuthentication(uri, ANY_REALM, "digest", "digest"));
testAuthentication(scenario, new DigestAuthentication(uri, ANY_REALM, "digest", "digest"));
}

private void test_Authentication(final Scenario scenario, Authentication authentication) throws Exception
private void testAuthentication(final Scenario scenario, Authentication authentication) throws Exception
{
AuthenticationStore authenticationStore = client.getAuthenticationStore();

Expand Down Expand Up @@ -226,7 +226,7 @@ public void onSuccess(Request request)

@ParameterizedTest
@ArgumentsSource(ScenarioProvider.class)
public void test_BasicAuthentication_ThenRedirect(Scenario scenario) throws Exception
public void testBasicAuthenticationThenRedirect(Scenario scenario) throws Exception
{
startBasic(scenario, new EmptyServerHandler()
{
Expand Down Expand Up @@ -271,7 +271,7 @@ public void onSuccess(Request request)

@ParameterizedTest
@ArgumentsSource(ScenarioProvider.class)
public void test_Redirect_ThenBasicAuthentication(Scenario scenario) throws Exception
public void testRedirectThenBasicAuthentication(Scenario scenario) throws Exception
{
startBasic(scenario, new EmptyServerHandler()
{
Expand Down Expand Up @@ -310,7 +310,7 @@ public void onSuccess(Request request)

@ParameterizedTest
@ArgumentsSource(ScenarioProvider.class)
public void test_BasicAuthentication_WithAuthenticationRemoved(Scenario scenario) throws Exception
public void testBasicAuthenticationWithAuthenticationRemoved(Scenario scenario) throws Exception
{
startBasic(scenario, new EmptyServerHandler());

Expand Down Expand Up @@ -359,7 +359,7 @@ public void onSuccess(Request request)

@ParameterizedTest
@ArgumentsSource(ScenarioProvider.class)
public void test_BasicAuthentication_WithWrongPassword(Scenario scenario) throws Exception
public void testBasicAuthenticationWithWrongPassword(Scenario scenario) throws Exception
{
startBasic(scenario, new EmptyServerHandler());

Expand All @@ -379,7 +379,7 @@ public void test_BasicAuthentication_WithWrongPassword(Scenario scenario) throws

@ParameterizedTest
@ArgumentsSource(ScenarioProvider.class)
public void test_Authentication_ThrowsException(Scenario scenario) throws Exception
public void testAuthenticationThrowsException(Scenario scenario) throws Exception
{
startBasic(scenario, new EmptyServerHandler());

Expand Down Expand Up @@ -419,7 +419,7 @@ public Result authenticate(Request request, ContentResponse response, HeaderInfo

@ParameterizedTest
@ArgumentsSource(ScenarioProvider.class)
public void test_PreemptedAuthentication(Scenario scenario) throws Exception
public void testPreemptedAuthentication(Scenario scenario) throws Exception
{
startBasic(scenario, new EmptyServerHandler());

Expand Down Expand Up @@ -449,7 +449,7 @@ public void onSuccess(Request request)

@ParameterizedTest
@ArgumentsSource(ScenarioProvider.class)
public void test_NonReproducibleContent(Scenario scenario) throws Exception
public void testNonReproducibleContent(Scenario scenario) throws Exception
{
startBasic(scenario, new EmptyServerHandler());

Expand Down Expand Up @@ -484,7 +484,7 @@ public boolean isReproducible()

@ParameterizedTest
@ArgumentsSource(ScenarioProvider.class)
public void test_RequestFailsAfterResponse(Scenario scenario) throws Exception
public void testRequestFailsAfterResponse(Scenario scenario) throws Exception
{
startBasic(scenario, new EmptyServerHandler()
{
Expand Down Expand Up @@ -576,7 +576,7 @@ public void onComplete(Result result)

@ParameterizedTest
@ArgumentsSource(ScenarioProvider.class)
public void test_InfiniteAuthentication(Scenario scenario) throws Exception
public void testInfiniteAuthentication(Scenario scenario) throws Exception
{
String authType = "Authenticate";
start(scenario, new EmptyServerHandler()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void dispose() throws Exception
}

@Test
public void test_Server_HeadersPauseTerminal_Client_Response() throws Exception
public void testServerHeadersPauseTerminalClientResponse() throws Exception
{
startClient();

Expand Down Expand Up @@ -115,7 +115,7 @@ public void onComplete(Result result)
}

@Test
public void test_Server_ContentTerminal_Client_ContentDelay() throws Exception
public void testServerContentTerminalClientContentDelay() throws Exception
{
startClient();

Expand Down
Loading

0 comments on commit 8c65309

Please sign in to comment.