Issue #2679 - h2spec compliance.

Integrated h2spec execution in the Maven build.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
Simone Bordet 2018-07-21 15:55:43 +02:00
parent 5e9a45eca1
commit 9a22dd820a
3 changed files with 118 additions and 43 deletions

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.eclipse.jetty.http2</groupId>
<artifactId>http2-parent</artifactId>
@ -16,6 +17,27 @@
<build>
<plugins>
<plugin>
<groupId>com.github.madgnome</groupId>
<artifactId>h2spec-maven-plugin</artifactId>
<configuration>
<mainClass>org.eclipse.jetty.http2.server.H2SpecServer</mainClass>
<skip>${skipTests}</skip>
<!-- TODO: remove the exclusion when upgrading to h2spec 2.1.1+ -->
<excludeSpecs>
<excludeSpec>5.1 - closed: Sends a DATA frame</excludeSpec>
</excludeSpecs>
</configuration>
<executions>
<execution>
<id>h2spec</id>
<phase>test</phase>
<goals>
<goal>h2spec</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

View File

@ -0,0 +1,48 @@
//
// ========================================================================
// Copyright (c) 1995-2018 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
// and Apache License v2.0 which accompanies this distribution.
//
// The Eclipse Public License is available at
// http://www.eclipse.org/legal/epl-v10.html
//
// The Apache License v2.0 is available at
// http://www.opensource.org/licenses/apache2.0.php
//
// You may elect to redistribute this code under either of these licenses.
// ========================================================================
//
package org.eclipse.jetty.http2.server;
import org.eclipse.jetty.server.HttpConfiguration;
import org.eclipse.jetty.server.HttpConnectionFactory;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
/**
* HTTP/2 server to run the 'h2spec' tool against.
*/
public class H2SpecServer
{
public static void main(String[] args) throws Exception
{
int port = Integer.parseInt(args[0]);
Server server = new Server();
HttpConfiguration http_config = new HttpConfiguration();
http_config.setRequestHeaderSize(16 * 1024);
HttpConnectionFactory http = new HttpConnectionFactory(http_config);
HTTP2CServerConnectionFactory h2c = new HTTP2CServerConnectionFactory(http_config);
ServerConnector connector = new ServerConnector(server, http, h2c);
connector.setPort(port);
server.addConnector(connector);
server.start();
}
}

View File

@ -887,6 +887,11 @@
<artifactId>buildnumber-maven-plugin</artifactId>
<version>1.4</version>
</plugin>
<plugin>
<groupId>com.github.madgnome</groupId>
<artifactId>h2spec-maven-plugin</artifactId>
<version>0.3</version>
</plugin>
</plugins>
</pluginManagement>
</build>