This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 6bfd0f7e73975d4eec87805e3a780ee0ede67f8c Author: Mark Thomas <ma...@apache.org> AuthorDate: Fri Jan 14 19:47:17 2022 +0000 Back-port creation of dedicated test parser --- test/org/apache/coyote/http2/Http2TestBase.java | 4 +-- .../org/apache/coyote/http2/TesterHttp2Parser.java | 34 ++++++++++++++++++++++ 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/test/org/apache/coyote/http2/Http2TestBase.java b/test/org/apache/coyote/http2/Http2TestBase.java index 9437635..9b0a43a 100644 --- a/test/org/apache/coyote/http2/Http2TestBase.java +++ b/test/org/apache/coyote/http2/Http2TestBase.java @@ -94,7 +94,7 @@ public abstract class Http2TestBase extends TomcatBaseTest { protected HpackEncoder hpackEncoder; protected Input input; protected TestOutput output; - protected Http2Parser parser; + protected TesterHttp2Parser parser; protected OutputStream os; // Server @@ -633,7 +633,7 @@ public abstract class Http2TestBase extends TomcatBaseTest { input = new TestInput(is); output = new TestOutput(); - parser = new Http2Parser("-1", input, output); + parser = new TesterHttp2Parser("-1", input, output); hpackEncoder = new HpackEncoder(); } diff --git a/test/org/apache/coyote/http2/TesterHttp2Parser.java b/test/org/apache/coyote/http2/TesterHttp2Parser.java new file mode 100644 index 0000000..9618d6f --- /dev/null +++ b/test/org/apache/coyote/http2/TesterHttp2Parser.java @@ -0,0 +1,34 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.coyote.http2; + +import java.io.IOException; + +/** + * Expose the parser outside of this package for use in other tests. + */ +public class TesterHttp2Parser extends Http2Parser { + + TesterHttp2Parser(String connectionId, Input input, Output output) { + super(connectionId, input, output); + } + + @Override + public boolean readFrame(boolean block) throws Http2Exception, IOException { + return super.readFrame(block); + } +} \ No newline at end of file --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org