Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Erdfelt2015-10-13 11:53:35 -0400
committerJoakim Erdfelt2015-10-13 11:53:35 -0400
commit4dfd68b315c199452e2e4e2c697a0c0b76651cd7 (patch)
tree031f09952a06344d6a65d04b554df4086d0f5612 /jetty-websocket
parent407ca46d94b566822c219fe518b487f16d0becc4 (diff)
parent785167a0104dcefcce0c1a615a053c05b6bcea1b (diff)
downloadorg.eclipse.jetty.project-4dfd68b315c199452e2e4e2c697a0c0b76651cd7.tar.gz
org.eclipse.jetty.project-4dfd68b315c199452e2e4e2c697a0c0b76651cd7.tar.xz
org.eclipse.jetty.project-4dfd68b315c199452e2e4e2c697a0c0b76651cd7.zip
Merge branch 'jetty-9.3.x'
Conflicts: aggregates/jetty-all-compact3/pom.xml aggregates/jetty-all/pom.xml apache-jsp/pom.xml apache-jstl/pom.xml examples/async-rest/async-rest-jar/pom.xml examples/async-rest/async-rest-webapp/pom.xml examples/async-rest/pom.xml examples/embedded/pom.xml examples/pom.xml jetty-alpn/jetty-alpn-client/pom.xml jetty-alpn/jetty-alpn-server/pom.xml jetty-alpn/pom.xml jetty-annotations/pom.xml jetty-ant/pom.xml jetty-cdi/cdi-core/pom.xml jetty-cdi/cdi-full-servlet/pom.xml jetty-cdi/cdi-servlet/pom.xml jetty-cdi/cdi-websocket/pom.xml jetty-cdi/pom.xml jetty-cdi/test-cdi-webapp/pom.xml jetty-client/pom.xml jetty-continuation/pom.xml jetty-deploy/pom.xml jetty-distribution/pom.xml jetty-fcgi/fcgi-client/pom.xml jetty-fcgi/fcgi-server/pom.xml jetty-fcgi/pom.xml jetty-http-spi/pom.xml jetty-http/pom.xml jetty-http2/http2-alpn-tests/pom.xml jetty-http2/http2-client/pom.xml jetty-http2/http2-common/pom.xml jetty-http2/http2-hpack/pom.xml jetty-http2/http2-http-client-transport/pom.xml jetty-http2/http2-server/pom.xml jetty-http2/pom.xml jetty-infinispan/pom.xml jetty-io/pom.xml jetty-jaas/pom.xml jetty-jaspi/pom.xml jetty-jmx/pom.xml jetty-jndi/pom.xml jetty-jspc-maven-plugin/pom.xml jetty-maven-plugin/pom.xml jetty-monitor/pom.xml jetty-nosql/pom.xml jetty-osgi/jetty-osgi-alpn/pom.xml jetty-osgi/jetty-osgi-boot-jsp/pom.xml jetty-osgi/jetty-osgi-boot-warurl/pom.xml jetty-osgi/jetty-osgi-boot/pom.xml jetty-osgi/jetty-osgi-httpservice/pom.xml jetty-osgi/pom.xml jetty-osgi/test-jetty-osgi-context/pom.xml jetty-osgi/test-jetty-osgi-webapp/pom.xml jetty-osgi/test-jetty-osgi/pom.xml jetty-plus/pom.xml jetty-proxy/pom.xml jetty-quickstart/pom.xml jetty-rewrite/pom.xml jetty-runner/pom.xml jetty-security/pom.xml jetty-server/pom.xml jetty-servlet/pom.xml jetty-servlets/pom.xml jetty-spring/pom.xml jetty-start/pom.xml jetty-util-ajax/pom.xml jetty-util/pom.xml jetty-webapp/pom.xml jetty-websocket/javax-websocket-client-impl/pom.xml jetty-websocket/javax-websocket-server-impl/pom.xml jetty-websocket/pom.xml jetty-websocket/websocket-api/pom.xml jetty-websocket/websocket-client/pom.xml jetty-websocket/websocket-common/pom.xml jetty-websocket/websocket-server/pom.xml jetty-websocket/websocket-servlet/pom.xml jetty-xml/pom.xml pom.xml tests/pom.xml tests/test-continuation/pom.xml tests/test-http-client-transport/pom.xml tests/test-integration/pom.xml tests/test-jmx/jmx-webapp-it/pom.xml tests/test-jmx/jmx-webapp/pom.xml tests/test-jmx/pom.xml tests/test-loginservice/pom.xml tests/test-quickstart/pom.xml tests/test-sessions/pom.xml tests/test-sessions/test-hash-sessions/pom.xml tests/test-sessions/test-infinispan-sessions/pom.xml tests/test-sessions/test-jdbc-sessions/pom.xml tests/test-sessions/test-mongodb-sessions/pom.xml tests/test-sessions/test-sessions-common/pom.xml tests/test-webapps/pom.xml tests/test-webapps/test-jaas-webapp/pom.xml tests/test-webapps/test-jetty-webapp/pom.xml tests/test-webapps/test-jndi-webapp/pom.xml tests/test-webapps/test-mock-resources/pom.xml tests/test-webapps/test-proxy-webapp/pom.xml tests/test-webapps/test-servlet-spec/pom.xml tests/test-webapps/test-servlet-spec/test-container-initializer/pom.xml tests/test-webapps/test-servlet-spec/test-spec-webapp/pom.xml tests/test-webapps/test-servlet-spec/test-web-fragment/pom.xml tests/test-webapps/test-webapp-rfc2616/pom.xml
Diffstat (limited to 'jetty-websocket')
-rw-r--r--jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/UpgradeConnection.java1
-rw-r--r--jetty-websocket/websocket-client/src/test/java/org/eclipse/jetty/websocket/client/ClientConnectTest.java20
-rw-r--r--jetty-websocket/websocket-client/src/test/java/org/eclipse/jetty/websocket/client/JettyTrackingSocket.java6
-rw-r--r--jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/ManyConnectionsCleanupTest.java2
4 files changed, 29 insertions, 0 deletions
diff --git a/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/UpgradeConnection.java b/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/UpgradeConnection.java
index 310980c8e2..dbe4faee41 100644
--- a/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/UpgradeConnection.java
+++ b/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/UpgradeConnection.java
@@ -315,6 +315,7 @@ public class UpgradeConnection extends AbstractConnection implements Connection.
SessionFactory sessionFactory = connectPromise.getClient().getSessionFactory();
WebSocketSession session = sessionFactory.createSession(request.getRequestURI(),websocket,connection);
session.setPolicy(policy);
+ session.setUpgradeRequest(request);
session.setUpgradeResponse(response);
connection.addListener(session);
connectPromise.setSession(session);
diff --git a/jetty-websocket/websocket-client/src/test/java/org/eclipse/jetty/websocket/client/ClientConnectTest.java b/jetty-websocket/websocket-client/src/test/java/org/eclipse/jetty/websocket/client/ClientConnectTest.java
index 606b5b9dcf..6f4110ef51 100644
--- a/jetty-websocket/websocket-client/src/test/java/org/eclipse/jetty/websocket/client/ClientConnectTest.java
+++ b/jetty-websocket/websocket-client/src/test/java/org/eclipse/jetty/websocket/client/ClientConnectTest.java
@@ -19,6 +19,7 @@
package org.eclipse.jetty.websocket.client;
import static org.hamcrest.Matchers.*;
+import static org.junit.Assert.*;
import java.io.IOException;
import java.net.ConnectException;
@@ -111,6 +112,25 @@ public class ClientConnectTest
}
@Test
+ public void testUpgradeRequest() throws Exception
+ {
+ JettyTrackingSocket wsocket = new JettyTrackingSocket();
+
+ URI wsUri = server.getWsUri();
+ Future<Session> future = client.connect(wsocket,wsUri);
+
+ IBlockheadServerConnection connection = server.accept();
+ connection.upgrade();
+
+ Session sess = future.get(500,TimeUnit.MILLISECONDS);
+
+ sess.close();
+
+ assertThat("Connect.UpgradeRequest", wsocket.connectUpgradeRequest, notNullValue());
+ assertThat("Connect.UpgradeResponse", wsocket.connectUpgradeResponse, notNullValue());
+ }
+
+ @Test
public void testBadHandshake() throws Exception
{
JettyTrackingSocket wsocket = new JettyTrackingSocket();
diff --git a/jetty-websocket/websocket-client/src/test/java/org/eclipse/jetty/websocket/client/JettyTrackingSocket.java b/jetty-websocket/websocket-client/src/test/java/org/eclipse/jetty/websocket/client/JettyTrackingSocket.java
index cbb5e59786..bb14d87be2 100644
--- a/jetty-websocket/websocket-client/src/test/java/org/eclipse/jetty/websocket/client/JettyTrackingSocket.java
+++ b/jetty-websocket/websocket-client/src/test/java/org/eclipse/jetty/websocket/client/JettyTrackingSocket.java
@@ -30,6 +30,8 @@ import org.eclipse.jetty.toolchain.test.EventQueue;
import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
import org.eclipse.jetty.websocket.api.Session;
+import org.eclipse.jetty.websocket.api.UpgradeRequest;
+import org.eclipse.jetty.websocket.api.UpgradeResponse;
import org.eclipse.jetty.websocket.api.WebSocketAdapter;
import org.junit.Assert;
@@ -42,6 +44,8 @@ public class JettyTrackingSocket extends WebSocketAdapter
public int closeCode = -1;
public Exchanger<String> messageExchanger;
+ public UpgradeRequest connectUpgradeRequest;
+ public UpgradeResponse connectUpgradeResponse;
public StringBuilder closeMessage = new StringBuilder();
public CountDownLatch openLatch = new CountDownLatch(1);
public CountDownLatch closeLatch = new CountDownLatch(1);
@@ -124,6 +128,8 @@ public class JettyTrackingSocket extends WebSocketAdapter
public void onWebSocketConnect(Session session)
{
super.onWebSocketConnect(session);
+ connectUpgradeRequest = session.getUpgradeRequest();
+ connectUpgradeResponse = session.getUpgradeResponse();
openLatch.countDown();
}
diff --git a/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/ManyConnectionsCleanupTest.java b/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/ManyConnectionsCleanupTest.java
index 03a8a7602c..2950c73b60 100644
--- a/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/ManyConnectionsCleanupTest.java
+++ b/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/ManyConnectionsCleanupTest.java
@@ -51,11 +51,13 @@ import org.eclipse.jetty.websocket.servlet.WebSocketServlet;
import org.eclipse.jetty.websocket.servlet.WebSocketServletFactory;
import org.junit.AfterClass;
import org.junit.BeforeClass;
+import org.junit.Ignore;
import org.junit.Test;
/**
* Tests various close scenarios that should result in Open Session cleanup
*/
+@Ignore
public class ManyConnectionsCleanupTest
{
static class AbstractCloseSocket extends WebSocketAdapter

Back to the top