-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add deployment exception for non Jakarta WebSocket endpoints used in …
…ServerEndpointConfig (#11032) * Issue #11009 - add test for bad Jakarta endpoint * Issue #11009 - ensure endpoint deployable before adding ServerEndpointConfig * add same test and fix for ee9 Signed-off-by: Lachlan Roberts <[email protected]>
- Loading branch information
1 parent
fbf8ddd
commit 62210d3
Showing
7 changed files
with
144 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
.../test/java/org/eclipse/jetty/ee10/websocket/jakarta/tests/server/sockets/BadEndpoint.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// | ||
// ======================================================================== | ||
// Copyright (c) 1995 Mort Bay Consulting Pty Ltd and others. | ||
// | ||
// This program and the accompanying materials are made available under the | ||
// terms of the Eclipse Public License v. 2.0 which is available at | ||
// https://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 | ||
// which is available at https://www.apache.org/licenses/LICENSE-2.0. | ||
// | ||
// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 | ||
// ======================================================================== | ||
// | ||
|
||
package org.eclipse.jetty.ee10.websocket.jakarta.tests.server.sockets; | ||
|
||
import jakarta.websocket.EndpointConfig; | ||
import jakarta.websocket.MessageHandler; | ||
|
||
public class BadEndpoint | ||
{ | ||
public void onOpen(jakarta.websocket.Session session, EndpointConfig config) | ||
{ | ||
try | ||
{ | ||
session.addMessageHandler((MessageHandler.Whole<Object>)System.out::println); | ||
System.out.println("server open"); | ||
session.getBasicRemote().sendText("connected"); | ||
} | ||
catch (Throwable t) | ||
{ | ||
t.printStackTrace(System.err); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...tests/src/test/java/org/eclipse/jetty/ee9/websocket/jakarta/tests/server/BadEndpoint.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// | ||
// ======================================================================== | ||
// Copyright (c) 1995 Mort Bay Consulting Pty Ltd and others. | ||
// | ||
// This program and the accompanying materials are made available under the | ||
// terms of the Eclipse Public License v. 2.0 which is available at | ||
// https://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 | ||
// which is available at https://www.apache.org/licenses/LICENSE-2.0. | ||
// | ||
// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 | ||
// ======================================================================== | ||
// | ||
|
||
package org.eclipse.jetty.ee9.websocket.jakarta.tests.server; | ||
|
||
import jakarta.websocket.EndpointConfig; | ||
import jakarta.websocket.MessageHandler; | ||
|
||
public class BadEndpoint | ||
{ | ||
public void onOpen(jakarta.websocket.Session session, EndpointConfig config) | ||
{ | ||
try | ||
{ | ||
session.addMessageHandler((MessageHandler.Whole<Object>)System.out::println); | ||
System.out.println("server open"); | ||
session.getBasicRemote().sendText("connected"); | ||
} | ||
catch (Throwable t) | ||
{ | ||
t.printStackTrace(System.err); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters