Skip to content

Commit

Permalink
Merge test classes for consistency
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1683554 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
markt-asf committed Jun 4, 2015
1 parent c0799e8 commit cbb11fe
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 83 deletions.
66 changes: 64 additions & 2 deletions test/org/apache/coyote/http2/TestHttp2Section_3_2.java
Expand Up @@ -30,8 +30,8 @@
*/ */
public class TestHttp2Section_3_2 extends Http2TestBase { public class TestHttp2Section_3_2 extends Http2TestBase {


// Note: Tests for zero/multiple HTTP2-Settings fields can be found in // Note: Tests for zero/multiple HTTP2-Settings fields can be found below
// TestHttp2Section_3_2_1 // in the tests for section 3.2.1


// TODO: Test initial requests with bodies of various sizes // TODO: Test initial requests with bodies of various sizes


Expand Down Expand Up @@ -115,4 +115,66 @@ private void setupAsFarAsUpgrade() throws Exception {
openClientConnection(); openClientConnection();
doHttpUpgrade(); doHttpUpgrade();
} }


//------------------------------------------------------------ Section 3.2.1

@Test
public void testZeroHttp2Settings() throws Exception {
enableHttp2();
configureAndStartWebApplication();
openClientConnection();
doHttpUpgrade(Http2TestBase.DEFAULT_CONNECTION_HEADER_VALUE, "h2c", "", false);
parseHttp11Response();
}


@Test
public void testMultipleHttp2Settings() throws Exception {
enableHttp2();
configureAndStartWebApplication();
openClientConnection();
doHttpUpgrade(Http2TestBase.DEFAULT_CONNECTION_HEADER_VALUE, "h2c",
Http2TestBase.EMPTY_HTTP2_SETTINGS_HEADER +
Http2TestBase.EMPTY_HTTP2_SETTINGS_HEADER, false);
parseHttp11Response();
}


@Test
public void testMissingConnectionValue() throws Exception {
enableHttp2();
configureAndStartWebApplication();
openClientConnection();
doHttpUpgrade("Upgrade", "h2c", Http2TestBase.EMPTY_HTTP2_SETTINGS_HEADER, false);
parseHttp11Response();
}


@Test
public void testSplitConnectionValue01() throws Exception {
enableHttp2();
configureAndStartWebApplication();
openClientConnection();
doHttpUpgrade("Upgrade\r\nConnection: HTTP2-Settings", "h2c",
Http2TestBase.EMPTY_HTTP2_SETTINGS_HEADER, true);
sendClientPreface();
validateHttp2InitialResponse();
}


@Test
public void testSplitConnectionValue02() throws Exception {
enableHttp2();
configureAndStartWebApplication();
openClientConnection();
doHttpUpgrade("HTTP2-Settings\r\nConnection: Upgrade", "h2c",
Http2TestBase.EMPTY_HTTP2_SETTINGS_HEADER, true);
sendClientPreface();
validateHttp2InitialResponse();
}

// No need to test how trailing '=' are handled here. HTTP2Settings payloads
// are always a multiple of 6 long which means valid payloads never end in
// '='. Invalid payloads will be rejected anyway.
} }
81 changes: 0 additions & 81 deletions test/org/apache/coyote/http2/TestHttp2Section_3_2_1.java

This file was deleted.

0 comments on commit cbb11fe

Please sign in to comment.