[Git][java-team/netty-reactive-streams][upstream] New upstream version 2.0.6
Emmanuel Bourg (@ebourg)
gitlab at salsa.debian.org
Tue May 3 13:49:59 BST 2022
Emmanuel Bourg pushed to branch upstream at Debian Java Maintainers / netty-reactive-streams
Commits:
b13985e8 by Emmanuel Bourg at 2022-05-03T14:47:16+02:00
New upstream version 2.0.6
- - - - -
9 changed files:
- + .github/dependabot.yml
- + .github/workflows/ci.yml
- + .github/workflows/release-drafter.yml
- − .travis.yml
- README.md
- netty-reactive-streams-http/pom.xml
- netty-reactive-streams-http/src/test/java/com/typesafe/netty/http/WebSocketsTest.java
- netty-reactive-streams/pom.xml
- pom.xml
Changes:
=====================================
.github/dependabot.yml
=====================================
@@ -0,0 +1,10 @@
+version: 2
+updates:
+ - package-ecosystem: "maven"
+ directory: "/"
+ schedule:
+ interval: "monthly"
+ - package-ecosystem: "github-actions"
+ directory: "/"
+ schedule:
+ interval: "monthly"
=====================================
.github/workflows/ci.yml
=====================================
@@ -0,0 +1,27 @@
+name: CI
+
+on:
+ pull_request:
+ branches:
+ - 2.0.x
+ push:
+ branches:
+ - 2.0.x
+
+jobs:
+ build:
+ strategy:
+ matrix:
+ java: [ '8', '11', '17' ]
+ os: [ 'ubuntu-latest' ]
+ runs-on: ${{ matrix.os }}
+ steps:
+ - uses: actions/checkout at v3
+ - name: Set up JDK
+ uses: actions/setup-java at v3
+ with:
+ java-version: ${{ matrix.java }}
+ distribution: 'temurin'
+ cache: 'maven'
+ - name: Build
+ run: mvn --no-transfer-progress -B clean package
=====================================
.github/workflows/release-drafter.yml
=====================================
@@ -0,0 +1,18 @@
+name: Release Drafter
+
+on:
+ push:
+ branches:
+ - 2.0.x
+
+jobs:
+ update_release_draft:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: release-drafter/release-drafter at v5
+ with:
+ name: "Netty Reactive Streams $RESOLVED_VERSION"
+ config-name: release-drafts/increasing-patch-version.yml # located in .github/ in the default branch within this or the .github repo
+ commitish: ${{ github.ref_name }}
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
=====================================
.travis.yml deleted
=====================================
@@ -1,13 +0,0 @@
-language: java
-
-env:
- - TRAVIS_JDK=8
- - TRAVIS_JDK=11
-
-before_install: curl -Ls https://git.io/jabba | bash && . ~/.jabba/jabba.sh
-install: jabba install "adopt@~1.$TRAVIS_JDK.0-0" && jabba use "$_" && java -Xmx32m -version
-
-cache:
- directories:
- - $HOME/.jabba/jdk
- - $HOME/.m2
=====================================
README.md
=====================================
@@ -1,6 +1,6 @@
# Netty Reactive Streams
-[](https://travis-ci.org/playframework/netty-reactive-streams)
+[](https://travis-ci.org/playframework/netty-reactive-streams)
This provides a reactive streams implementation for Netty. Essentially it comes in the form of two channel handlers, one that publishes inbound messages received on a channel to a `Publisher`, and another that writes messages received by a `Subscriber` outbound.
=====================================
netty-reactive-streams-http/pom.xml
=====================================
@@ -5,7 +5,7 @@
<parent>
<groupId>com.typesafe.netty</groupId>
<artifactId>netty-reactive-streams-parent</artifactId>
- <version>2.0.5</version>
+ <version>2.0.6</version>
</parent>
<artifactId>netty-reactive-streams-http</artifactId>
=====================================
netty-reactive-streams-http/src/test/java/com/typesafe/netty/http/WebSocketsTest.java
=====================================
@@ -15,6 +15,8 @@ import io.netty.channel.socket.nio.NioServerSocketChannel;
import io.netty.channel.socket.nio.NioSocketChannel;
import io.netty.handler.codec.http.*;
import io.netty.handler.codec.http.websocketx.*;
+import io.netty.handler.codec.http.websocketx.extensions.compression.WebSocketClientCompressionHandler;
+import io.netty.handler.codec.http.websocketx.extensions.compression.WebSocketServerCompressionHandler;
import io.netty.util.ReferenceCountUtil;
import org.reactivestreams.Processor;
import org.testng.annotations.AfterClass;
@@ -41,8 +43,12 @@ public class WebSocketsTest {
private BlockingQueue<Object> clientEvents = new LinkedBlockingQueue<>();
private int port;
- @Test
- public void simpleWebSocket() throws Exception {
+ /**
+ * Note: withCompression and withoutExtensions will not work as compression requires Extensions.
+ * @param withCompression Enable Compression for this test
+ * @param withExtensions Enable WebSocket Extensions on the handshaker
+ */
+ private void simpleWebSocket(final boolean withCompression, final boolean withExtensions) throws Exception {
start(new AutoReadHandler() {
@Override
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
@@ -68,13 +74,13 @@ public class WebSocketsTest {
ctx.writeAndFlush(new DefaultWebSocketHttpResponse(request.protocolVersion(),
HttpResponseStatus.valueOf(200), processor,
- new WebSocketServerHandshakerFactory("ws://127.0.0.1/" + port + "/", null, false)
+ new WebSocketServerHandshakerFactory("ws://127.0.0.1/" + port + "/", null, withExtensions)
));
}
}
- });
+ }, withCompression);
- makeWebSocketRequest();
+ makeWebSocketRequest(withCompression, withExtensions);
assertNoMessages();
client.writeAndFlush(new TextWebSocketFrame("hello"));
assertEquals(readTextFrame(), "echo hello");
@@ -106,6 +112,21 @@ public class WebSocketsTest {
assertNoMessages();
}
+ @Test
+ public void simpleWebSocketWithCompressionAndExtensions() throws Exception {
+ simpleWebSocket(true, true);
+ }
+
+ @Test
+ public void simpleWebSocketWithoutCompressionWithoutExtensions() throws Exception {
+ simpleWebSocket(false, false);
+ }
+
+ @Test
+ public void simpleWebSocketWithoutCompressionWithExtensions() throws Exception {
+ simpleWebSocket(false, true);
+ }
+
@Test
public void rejectWebSocket() throws Exception {
start(new AutoReadHandler() {
@@ -166,6 +187,10 @@ public class WebSocketsTest {
}
private void start(final ChannelHandler handler) throws InterruptedException {
+ start(handler, false);
+ }
+
+ private void start(final ChannelHandler handler, final boolean enableCompression) throws InterruptedException {
ServerBootstrap bootstrap = new ServerBootstrap();
bootstrap.group(eventLoop)
.channel(NioServerSocketChannel.class)
@@ -179,8 +204,14 @@ public class WebSocketsTest {
pipeline.addLast(
new HttpRequestDecoder(),
new HttpResponseEncoder()
- ).addLast("serverStreamsHandler", new HttpStreamsServerHandler())
- .addLast(handler);
+ );
+
+ if (enableCompression) {
+ pipeline.addLast(new WebSocketServerCompressionHandler());
+ }
+ pipeline
+ .addLast("serverStreamsHandler", new HttpStreamsServerHandler())
+ .addLast(handler);
}
});
@@ -197,8 +228,11 @@ public class WebSocketsTest {
protected void initChannel(SocketChannel ch) throws Exception {
final ChannelPipeline pipeline = ch.pipeline();
- pipeline.addLast(new HttpClientCodec(), new HttpObjectAggregator(8192))
- .addLast(new AutoReadHandler() {
+ pipeline.addLast(new HttpClientCodec(), new HttpObjectAggregator(8192));
+
+ if (enableCompression) pipeline.addLast(WebSocketClientCompressionHandler.INSTANCE);
+
+ pipeline.addLast(new AutoReadHandler() {
// Store a reference to the current client events
BlockingQueue<Object> events = clientEvents;
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
@@ -211,12 +245,20 @@ public class WebSocketsTest {
this.client = client.remoteAddress(serverBindChannel.localAddress()).connect().await().channel();
}
- private void makeWebSocketRequest() throws InterruptedException {
+ private void makeWebSocketRequest(final boolean withCompression, final boolean withExtensions) throws InterruptedException {
WebSocketClientHandshaker handshaker = WebSocketClientHandshakerFactory.newHandshaker(
URI.create("ws://127.0.0.1:" + port + "/"),
- WebSocketVersion.V13, null, false, new DefaultHttpHeaders());
+ WebSocketVersion.V13, null, withExtensions, new DefaultHttpHeaders());
handshaker.handshake(client);
FullHttpResponse response = receiveFullResponse();
+ HttpHeaders headers = response.headers();
+ if (withCompression) {
+ assertTrue(headers.contains("sec-websocket-extensions"));
+ assertEquals(headers.get("sec-websocket-extensions"), "permessage-deflate");
+ } else {
+ assertTrue(!headers.contains("sec-websocket-extensions") ||
+ !headers.get("sec-websocket-extensions").contains("permessage-deflate"));
+ }
handshaker.finishHandshake(client, response);
}
=====================================
netty-reactive-streams/pom.xml
=====================================
@@ -5,7 +5,7 @@
<parent>
<groupId>com.typesafe.netty</groupId>
<artifactId>netty-reactive-streams-parent</artifactId>
- <version>2.0.5</version>
+ <version>2.0.6</version>
</parent>
<artifactId>netty-reactive-streams</artifactId>
=====================================
pom.xml
=====================================
@@ -4,7 +4,7 @@
<groupId>com.typesafe.netty</groupId>
<artifactId>netty-reactive-streams-parent</artifactId>
- <version>2.0.5</version>
+ <version>2.0.6</version>
<name>Netty Reactive Streams Parent POM</name>
<description>Reactive streams implementation for Netty.</description>
@@ -71,7 +71,7 @@
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
- <version>7.0.0</version>
+ <version>7.5</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -84,11 +84,11 @@
</dependencyManagement>
<properties>
- <netty.version>4.1.52.Final</netty.version>
+ <netty.version>4.1.75.Final</netty.version>
<reactive-streams.version>1.0.3</reactive-streams.version>
- <akka-stream.version>2.6.10</akka-stream.version>
- <maven-bundle-plugin.version>3.5.1</maven-bundle-plugin.version>
- <maven-jar-plugin.version>3.1.0</maven-jar-plugin.version>
+ <akka-stream.version>2.6.19</akka-stream.version>
+ <maven-bundle-plugin.version>5.1.4</maven-bundle-plugin.version>
+ <maven-jar-plugin.version>3.2.2</maven-jar-plugin.version>
</properties>
<build>
@@ -96,7 +96,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>3.8.1</version>
+ <version>3.10.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
@@ -105,7 +105,7 @@
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
- <version>1.6.7</version>
+ <version>1.6.12</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
@@ -116,7 +116,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
- <version>2.5</version>
+ <version>2.5.3</version>
<configuration>
<autoVersionSubmodules>true</autoVersionSubmodules>
<useReleaseProfile>false</useReleaseProfile>
@@ -159,7 +159,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
- <version>3.0.1</version>
+ <version>3.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
@@ -172,7 +172,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
- <version>2.9.1</version>
+ <version>3.3.2</version>
<executions>
<execution>
<id>attach-javadocs</id>
@@ -185,7 +185,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
- <version>1.6</version>
+ <version>3.0.1</version>
<executions>
<execution>
<id>sign-artifacts</id>
@@ -205,7 +205,7 @@
<connection>scm:git:https://github.com/playframework/netty-reactive-streams.git</connection>
<developerConnection>scm:git:git at github.com:playframework/netty-reactive-streams.git</developerConnection>
<url>https://github.com/playframework/netty-reactive-streams</url>
- <tag>netty-reactive-streams-parent-2.0.5</tag>
+ <tag>netty-reactive-streams-parent-2.0.6</tag>
</scm>
<distributionManagement>
View it on GitLab: https://salsa.debian.org/java-team/netty-reactive-streams/-/commit/b13985e8b17a75faeff597857f6326610ee2def0
--
View it on GitLab: https://salsa.debian.org/java-team/netty-reactive-streams/-/commit/b13985e8b17a75faeff597857f6326610ee2def0
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20220503/005729c3/attachment.htm>
More information about the pkg-java-commits
mailing list