tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1687184 - in /tomcat/trunk/test/org/apache/coyote/http2: Http2TestBase.java TestHttp2Section_6_2.java
Date Wed, 24 Jun 2015 07:53:55 GMT
Author: markt
Date: Wed Jun 24 07:53:55 2015
New Revision: 1687184

URL: http://svn.apache.org/r1687184
Log:
Use constants

Modified:
    tomcat/trunk/test/org/apache/coyote/http2/Http2TestBase.java
    tomcat/trunk/test/org/apache/coyote/http2/TestHttp2Section_6_2.java

Modified: tomcat/trunk/test/org/apache/coyote/http2/Http2TestBase.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/coyote/http2/Http2TestBase.java?rev=1687184&r1=1687183&r2=1687184&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/coyote/http2/Http2TestBase.java (original)
+++ tomcat/trunk/test/org/apache/coyote/http2/Http2TestBase.java Wed Jun 24 07:53:55 2015
@@ -158,8 +158,7 @@ public abstract class Http2TestBase exte
         headersPayload.flip();
 
         ByteUtil.setThreeBytes(frameHeader, 0, headersPayload.limit());
-        // Header frame is type 0x01
-        frameHeader[3] = 0x01;
+        frameHeader[3] = FrameType.HEADERS.getIdByte();
         // Flags. end of headers (0x04). end of stream (0x01)
         frameHeader[4] = 0x05;
         if (padding != null) {
@@ -180,8 +179,7 @@ public abstract class Http2TestBase exte
         headersPayload.flip();
 
         ByteUtil.setThreeBytes(frameHeader, 0, headersPayload.limit());
-        // Header frame is type 0x01
-        frameHeader[3] = 0x01;
+        frameHeader[3] = FrameType.HEADERS.getIdByte();
         // Flags. end of stream (0x01)
         frameHeader[4] = 0x01;
         // Stream id
@@ -198,8 +196,7 @@ public abstract class Http2TestBase exte
         headersPayload.flip();
 
         ByteUtil.setThreeBytes(frameHeader, 0, headersPayload.limit());
-        // Continuation frame is type 0x09
-        frameHeader[3] = 0x09;
+        frameHeader[3] = FrameType.CONTINUATION.getIdByte();
         // Flags. end of headers (0x04)
         frameHeader[4] = 0x04;
         // Stream id
@@ -231,8 +228,7 @@ public abstract class Http2TestBase exte
         headersPayload.flip();
 
         ByteUtil.setThreeBytes(headersFrameHeader, 0, headersPayload.limit());
-        // Header frame is type 0x01
-        headersFrameHeader[3] = 0x01;
+        headersFrameHeader[3] = FrameType.HEADERS.getIdByte();
         // Flags. end of headers (0x04)
         headersFrameHeader[4] = 0x04;
         // Stream id
@@ -479,8 +475,7 @@ public abstract class Http2TestBase exte
         byte[] rstFrame = new byte[13];
         // length is always 4
         rstFrame[2] = 0x04;
-        // type is always 3
-        rstFrame[3] = 0x03;
+        rstFrame[3] = FrameType.RST.getIdByte();
         // no flags
         // Stream ID
         ByteUtil.set31Bits(rstFrame, 5, streamId);
@@ -502,8 +497,7 @@ public abstract class Http2TestBase exte
         byte[] updateFrame = new byte[13];
         // length is always 4
         updateFrame[2] = 0x04;
-        // type is always 8
-        updateFrame[3] = 0x08;
+        updateFrame[3] = FrameType.WINDOW_UPDATE.getIdByte();
         // no flags
         // Stream ID
         ByteUtil.set31Bits(updateFrame, 5, streamId);

Modified: tomcat/trunk/test/org/apache/coyote/http2/TestHttp2Section_6_2.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/coyote/http2/TestHttp2Section_6_2.java?rev=1687184&r1=1687183&r2=1687184&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/coyote/http2/TestHttp2Section_6_2.java (original)
+++ tomcat/trunk/test/org/apache/coyote/http2/TestHttp2Section_6_2.java Wed Jun 24 07:53:55
2015
@@ -87,8 +87,7 @@ public class TestHttp2Section_6_2 extend
         // Header
         // length
         ByteUtil.setThreeBytes(headerFrame, 0, 1);
-        // type 1 (headers)
-        headerFrame[3] = 0x01;
+        headerFrame[3] = FrameType.HEADERS.getIdByte();
         // flags 8 (padded)
         headerFrame[4] = 0x08;
         // stream 3



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message