Skip to content

Commit

Permalink
New subproject htmlunit-websocket-client. For the start this is a sha…
Browse files Browse the repository at this point in the history
…ded version of the lastes Jetty 9 websocket-client (issue #704)
  • Loading branch information
rbri committed Feb 10, 2024
1 parent fac0ac1 commit 902ca00
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 13 deletions.
17 changes: 9 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@
<htmlunitneko.version>3.11.2</htmlunitneko.version>
<htmlunitxpath.version>3.11.0</htmlunitxpath.version>
<htmlunitcorejs.version>3.11.0</htmlunitcorejs.version>
<htmlunitwebsocketclient.version>3.12.0-SNAPSHOT</htmlunitwebsocketclient.version>

<httpcomponents.version>4.5.14</httpcomponents.version>

<htmlunitdriver.version>4.17.0</htmlunitdriver.version>
<selenium.version>4.17.0</selenium.version>

<httpcomponents.version>4.5.14</httpcomponents.version>
<jetty.version>9.4.53.v20231009</jetty.version>
<log4j.version>2.22.1</log4j.version>

Expand Down Expand Up @@ -1164,6 +1166,12 @@
<artifactId>htmlunit-csp</artifactId>
<version>${htmlunitcsp.version}</version>
</dependency>
<dependency>
<groupId>org.htmlunit</groupId>
<artifactId>htmlunit-websocket-client</artifactId>
<version>${htmlunitwebsocketclient.version}</version>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
Expand Down Expand Up @@ -1206,13 +1214,6 @@
<version>0.1.2</version>
</dependency>

<!-- Jetty -->
<dependency>
<groupId>org.eclipse.jetty.websocket</groupId>
<artifactId>websocket-client</artifactId>
<version>${jetty.version}</version>
</dependency>

<!-- Test dependencies. -->
<dependency>
<groupId>junit</groupId>
Expand Down
7 changes: 7 additions & 0 deletions src/changes/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
</properties>

<body>
<release version="3.12.0" date="March xx, 2024" description="htmlunit-websocket-client, Bugfixes">
<action type="add" dev="rbri">
New subproject htmlunit-websocket-client. For the start this is a shaded version of the lastes
Jetty 9 websocket-client.
</action>
</release>

<release version="3.11.0" date="February 10, 2024" description="Chrome/Edge 121, Firefox 122, many Neko improvements, Bugfixes">
<action type="fix" dev="rbri">
Fix NPE when defining a javascript constructor alias for a non existing constructor.
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/org/htmlunit/websocket/JettyWebSocketAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
import java.nio.ByteBuffer;
import java.util.concurrent.Future;

import org.eclipse.jetty.util.ssl.SslContextFactory;
import org.eclipse.jetty.websocket.api.Session;
import org.eclipse.jetty.websocket.api.WebSocketPolicy;
import org.eclipse.jetty.websocket.client.WebSocketClient;
import org.htmlunit.jetty.util.ssl.SslContextFactory;
import org.htmlunit.jetty.websocket.api.Session;
import org.htmlunit.jetty.websocket.api.WebSocketPolicy;
import org.htmlunit.jetty.websocket.client.WebSocketClient;
import org.htmlunit.WebClient;
import org.htmlunit.WebClientOptions;
import org.htmlunit.corejs.javascript.typedarrays.NativeArrayBuffer;
Expand Down Expand Up @@ -142,7 +142,7 @@ public void closeClient() throws Exception {
}
}

private class JettyWebSocketAdapterImpl extends org.eclipse.jetty.websocket.api.WebSocketAdapter {
private class JettyWebSocketAdapterImpl extends org.htmlunit.jetty.websocket.api.WebSocketAdapter {

JettyWebSocketAdapterImpl() {
}
Expand Down
12 changes: 12 additions & 0 deletions src/test/java/org/htmlunit/archunit/ArchitectureTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ public class ArchitectureTest {

.and().doNotHaveFullyQualifiedName("org.htmlunit.csp.Utils")

.and().resideOutsideOfPackage("org.htmlunit.jetty..")

.should().resideInAPackage("org.htmlunit.util");

/**
Expand All @@ -79,6 +81,7 @@ public class ArchitectureTest {
.doNotHaveFullyQualifiedName("org.htmlunit.html.applets.AppletContextImpl")
.and().resideOutsideOfPackage("org.htmlunit.platform..")
.and().resideOutsideOfPackage("org.htmlunit.corejs.javascript.tools..")
.and().resideOutsideOfPackage("org.htmlunit.jetty..")
.should().dependOnClassesThat().resideInAnyPackage("java.awt..");

/**
Expand Down Expand Up @@ -308,6 +311,8 @@ public void check(final JavaMethod method, final ConditionEvents events) {
.that()
.doNotHaveFullyQualifiedName("org.htmlunit.platform.image.ImageIOImageData")
.and().doNotHaveFullyQualifiedName("org.htmlunit.platform.canvas.rendering.AwtRenderingBackend")
.and().doNotHaveFullyQualifiedName("org.htmlunit.platform.canvas.rendering.AwtRenderingBackend")
.and().resideOutsideOfPackage("org.htmlunit.jetty..")
.should().dependOnClassesThat().resideInAnyPackage("javax.imageio..");

/**
Expand Down Expand Up @@ -367,4 +372,11 @@ public void check(final JavaMethod method, final ConditionEvents events) {

.and().resideOutsideOfPackage("org.htmlunit.corejs..")
.should().dependOnClassesThat().resideInAnyPackage("org.htmlunit.corejs..");

/**
* Do not use jetty.
*/
@ArchTest
public static final ArchRule jettyPackageRule = noClasses()
.should().dependOnClassesThat().resideInAnyPackage("org.eclipse.jetty..");
}

0 comments on commit 902ca00

Please sign in to comment.