You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2016/10/13 12:59:55 UTC
svn commit: r1764663 -
/tomcat/trunk/test/org/apache/coyote/http2/Http2TestBase.java
Author: markt
Date: Thu Oct 13 12:59:55 2016
New Revision: 1764663
URL: http://svn.apache.org/viewvc?rev=1764663&view=rev
Log:
Add some additional hooks/features for some new tests currently being
worked on.
Modified:
tomcat/trunk/test/org/apache/coyote/http2/Http2TestBase.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=1764663&r1=1764662&r2=1764663&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/coyote/http2/Http2TestBase.java (original)
+++ tomcat/trunk/test/org/apache/coyote/http2/Http2TestBase.java Thu Oct 13 12:59:55 2016
@@ -305,11 +305,31 @@ public abstract class Http2TestBase exte
ByteUtil.set31Bits(dataFrameHeader, 5, streamId);
}
+
protected void writeFrame(byte[] header, ByteBuffer payload)
throws IOException {
+ writeFrame(header, payload, 0, payload.limit());
+ }
+
+
+ protected void writeFrame(byte[] header, ByteBuffer payload, int offset, int len)
+ throws IOException {
+ writeFrame(header, payload, offset, len, 0);
+ }
+
+
+ protected void writeFrame(byte[] header, ByteBuffer payload, int offset, int len, int delayms)
+ throws IOException {
os.write(header);
- os.write(payload.array(), payload.arrayOffset(), payload.limit());
+ os.write(payload.array(), payload.arrayOffset() + offset, len);
os.flush();
+ if (delayms > 0) {
+ try {
+ Thread.sleep(delayms);
+ } catch (InterruptedException e) {
+ // Ignore
+ }
+ }
}
@@ -894,6 +914,11 @@ public abstract class Http2TestBase exte
public String getTrace() {
return trace.toString();
}
+
+
+ public int getMaxFrameSize() {
+ return remoteSettings.getMaxFrameSize();
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org