diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 126d4929..d6e44661 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -28,11 +28,11 @@ jobs: steps: - name: Checkout for build - uses: actions/checkout@v2.3.4 + uses: actions/checkout@v3 with: fetch-depth: 0 - name: Set up JDK - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: distribution: 'zulu' java-version: ${{ matrix.java_version }} diff --git a/.gitignore b/.gitignore index b8b5ee03..9f7d5b94 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,32 @@ -# Maven -**/target/ +# maven noise +target/ +target-*/ -# IntelliJ +# gradle noise +.gradle + +# osx noise +.DS_Store +profile + +# IntelliJ Idea noise .idea +*.iws +*.ipr *.iml +*.releaseBackup +atlassian-ide-plugin.xml -# Eclipse +# NB noise +nbactions.xml +nb-configuration.xml + +# Eclipse noise +.settings +.settings/* .project .classpath -**/.settings/ + +# Maven plugins noise +dependency-reduced-pom.xml +pom.xml.versionsBackup diff --git a/.travis.yml b/.travis.yml index 02d14505..67378f68 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,4 +15,4 @@ cache: install: true script: - - mvn -U -C -Dtyrus.test.container.client=org.glassfish.tyrus.container.grizzly.client.GrizzlyClientContainer -Pbundles clean install -Dmaven.javadoc.skip=true + - bash etc/travis/travis.sh diff --git a/archetypes/echo/pom.xml b/archetypes/echo/pom.xml index f3b17ae1..63249323 100644 --- a/archetypes/echo/pom.xml +++ b/archetypes/echo/pom.xml @@ -1,7 +1,7 @@ diff --git a/archetypes/echo/src/main/resources/archetype-resources/src/main/java/EchoEndpoint.java b/archetypes/echo/src/main/resources/archetype-resources/src/main/java/EchoEndpoint.java index 7c90d40d..97e657fc 100644 --- a/archetypes/echo/src/main/resources/archetype-resources/src/main/java/EchoEndpoint.java +++ b/archetypes/echo/src/main/resources/archetype-resources/src/main/java/EchoEndpoint.java @@ -1,8 +1,8 @@ package $package; -import javax.websocket.OnMessage; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.OnMessage; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; /** * Server endpoint "listening" on path "/echo". @@ -17,8 +17,8 @@ public class EchoEndpoint { * * @param message received message. * @return returned value will be sent back to client. You can also declare this method to not return anything. In - * that case, you would need to obtain {@link javax.websocket.Session} object and call - * {@link javax.websocket.Session#getBasicRemote()#sendText();} i order to send message. + * that case, you would need to obtain {@link jakarta.websocket.Session} object and call + * {@link jakarta.websocket.Session#getBasicRemote()#sendText();} i order to send message. */ @OnMessage public String echo(String message) { diff --git a/archetypes/echo/src/main/resources/archetype-resources/src/test/java/EchoTest.java b/archetypes/echo/src/main/resources/archetype-resources/src/test/java/EchoTest.java index 218d7c48..8075eb4f 100644 --- a/archetypes/echo/src/main/resources/archetype-resources/src/test/java/EchoTest.java +++ b/archetypes/echo/src/main/resources/archetype-resources/src/test/java/EchoTest.java @@ -4,12 +4,12 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.DeploymentException; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.MessageHandler; -import javax.websocket.Session; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.Session; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.server.Server; diff --git a/archetypes/pom.xml b/archetypes/pom.xml index bfbcc85c..dcf95b9c 100644 --- a/archetypes/pom.xml +++ b/archetypes/pom.xml @@ -1,7 +1,7 @@ + * diff --git a/bundles/websocket-risrc-licensee/pom.xml b/bundles/websocket-risrc-licensee/pom.xml index 68a4302b..fdfec9a4 100755 --- a/bundles/websocket-risrc-licensee/pom.xml +++ b/bundles/websocket-risrc-licensee/pom.xml @@ -1,7 +1,7 @@ true diff --git a/client/src/main/java/module-info.java b/client/src/main/java/module-info.java new file mode 100644 index 00000000..1eb023ed --- /dev/null +++ b/client/src/main/java/module-info.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0, which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the + * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + * version 2 with the GNU Classpath Exception, which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + */ + +/** + * Tyrus Client Module + */ + +module org.glassfish.tyrus.client { + requires java.logging; + requires jakarta.websocket; + requires org.glassfish.tyrus.core; + requires org.glassfish.tyrus.spi; + + exports org.glassfish.tyrus.client; + exports org.glassfish.tyrus.client.auth; +} \ No newline at end of file diff --git a/client/src/main/java/org/glassfish/tyrus/client/ClientManager.java b/client/src/main/java/org/glassfish/tyrus/client/ClientManager.java index 4201a0db..b854523f 100755 --- a/client/src/main/java/org/glassfish/tyrus/client/ClientManager.java +++ b/client/src/main/java/org/glassfish/tyrus/client/ClientManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -33,14 +33,14 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.logging.Logger; -import javax.websocket.ClientEndpoint; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.CloseReason; -import javax.websocket.DeploymentException; -import javax.websocket.Endpoint; -import javax.websocket.Extension; -import javax.websocket.Session; -import javax.websocket.WebSocketContainer; +import jakarta.websocket.ClientEndpoint; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.CloseReason; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.Extension; +import jakarta.websocket.Session; +import jakarta.websocket.WebSocketContainer; import org.glassfish.tyrus.core.AnnotatedEndpoint; import org.glassfish.tyrus.core.BaseContainer; @@ -59,8 +59,8 @@ /** * ClientManager implementation. * - * @author Stepan Kopriva (stepan.kopriva at oracle.com) - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Stepan Kopriva + * @author Pavel Bucek */ public class ClientManager extends BaseContainer implements WebSocketContainer { @@ -94,7 +94,7 @@ public class ClientManager extends BaseContainer implements WebSocketContainer { * client.connectToServer(...); * * - * @see javax.websocket.ClientEndpointConfig#getUserProperties() + * @see jakarta.websocket.ClientEndpointConfig#getUserProperties() * @deprecated please use {@link org.glassfish.tyrus.client.ClientProperties#PROXY_URI}. */ @SuppressWarnings("UnusedDeclaration") @@ -118,9 +118,9 @@ public class ClientManager extends BaseContainer implements WebSocketContainer { * * Please note that these headers will be used only when establishing proxy connection, for modifying * WebSocket handshake headers, see {@link - * javax.websocket.ClientEndpointConfig.Configurator#beforeRequest(java.util.Map)}. + * jakarta.websocket.ClientEndpointConfig.Configurator#beforeRequest(java.util.Map)}. * - * @see javax.websocket.ClientEndpointConfig#getUserProperties() + * @see jakarta.websocket.ClientEndpointConfig#getUserProperties() * @deprecated please use {@link org.glassfish.tyrus.client.ClientProperties#PROXY_HEADERS}. */ @SuppressWarnings("UnusedDeclaration") @@ -389,7 +389,7 @@ public Future asyncConnectToServer(Class annotatedEndpointClass, URI } /** - * Non-blocking version of {@link WebSocketContainer#connectToServer(Class, javax.websocket.ClientEndpointConfig, + * Non-blocking version of {@link WebSocketContainer#connectToServer(Class, jakarta.websocket.ClientEndpointConfig, * java.net.URI)}. *

* Only simple checks are performed in the main thread; client container is created in different thread, same @@ -400,7 +400,7 @@ public Future asyncConnectToServer(Class annotatedEndpointClass, URI * @param cec the configuration used to configure the programmatic endpoint. * @return the Session created if the connection is successful. * @throws DeploymentException if the configuration is not valid - * @see WebSocketContainer#connectToServer(Class, javax.websocket.ClientEndpointConfig, java.net.URI) + * @see WebSocketContainer#connectToServer(Class, jakarta.websocket.ClientEndpointConfig, java.net.URI) */ public Future asyncConnectToServer(Class endpointClass, ClientEndpointConfig cec, URI path) throws DeploymentException { @@ -408,8 +408,8 @@ public Future asyncConnectToServer(Class endpointCl } /** - * Non-blocking version of {@link WebSocketContainer#connectToServer(javax.websocket.Endpoint, - * javax.websocket.ClientEndpointConfig, java.net.URI)}. + * Non-blocking version of {@link WebSocketContainer#connectToServer(jakarta.websocket.Endpoint, + * jakarta.websocket.ClientEndpointConfig, java.net.URI)}. *

* Only simple checks are performed in the main thread; client container is created in different thread, same * applies to connecting etc. @@ -419,7 +419,7 @@ public Future asyncConnectToServer(Class endpointCl * @param cec the configuration used to configure the programmatic endpoint. * @return the Session created if the connection is successful. * @throws DeploymentException if the configuration is not valid - * @see WebSocketContainer#connectToServer(javax.websocket.Endpoint, javax.websocket.ClientEndpointConfig, + * @see WebSocketContainer#connectToServer(jakarta.websocket.Endpoint, jakarta.websocket.ClientEndpointConfig, * java.net.URI) */ public Future asyncConnectToServer(Endpoint endpointInstance, ClientEndpointConfig cec, URI path) throws @@ -854,15 +854,15 @@ public void execute(Runnable command) { * Reconnect handler. *

* When implementing, be sure that you do have enough logic behind cancelling reconnect feature - even {@link - * javax.websocket.Session#close()} call will be treated just like any other disconnect resulting in reconnect. + * jakarta.websocket.Session#close()} call will be treated just like any other disconnect resulting in reconnect. */ public static class ReconnectHandler { private static final long RECONNECT_DELAY = 5L; /** - * Called after {@link javax.websocket.OnClose} annotated method (or {@link - * Endpoint#onClose(javax.websocket.Session, javax.websocket.CloseReason)} is invoked. + * Called after {@link jakarta.websocket.OnClose} annotated method (or {@link + * Endpoint#onClose(jakarta.websocket.Session, jakarta.websocket.CloseReason)} is invoked. * * @param closeReason close reason passed to onClose method. * @return When {@code true} is returned, client container will reconnect. diff --git a/client/src/main/java/org/glassfish/tyrus/client/ClientProperties.java b/client/src/main/java/org/glassfish/tyrus/client/ClientProperties.java index cf84f8ad..67ef1680 100644 --- a/client/src/main/java/org/glassfish/tyrus/client/ClientProperties.java +++ b/client/src/main/java/org/glassfish/tyrus/client/ClientProperties.java @@ -59,7 +59,7 @@ public final class ClientProperties { * client.connectToServer(...); * * - * @see javax.websocket.ClientEndpointConfig#getUserProperties() + * @see jakarta.websocket.ClientEndpointConfig#getUserProperties() */ public static final String PROXY_URI = "org.glassfish.tyrus.client.proxy"; @@ -81,9 +81,9 @@ public final class ClientProperties { * * Please note that these headers will be used only when establishing proxy connection, for modifying * WebSocket handshake headers, see - * {@link javax.websocket.ClientEndpointConfig.Configurator#beforeRequest(java.util.Map)}. + * {@link jakarta.websocket.ClientEndpointConfig.Configurator#beforeRequest(java.util.Map)}. * - * @see javax.websocket.ClientEndpointConfig#getUserProperties() + * @see jakarta.websocket.ClientEndpointConfig#getUserProperties() */ public static final String PROXY_HEADERS = "org.glassfish.tyrus.client.proxy.headers"; @@ -118,7 +118,7 @@ public final class ClientProperties { * Property name for maximal incoming buffer size. *

* Can be set in properties map (see {@link - * org.glassfish.tyrus.spi.ClientContainer#openClientSocket(javax.websocket.ClientEndpointConfig, java.util.Map, + * org.glassfish.tyrus.spi.ClientContainer#openClientSocket(jakarta.websocket.ClientEndpointConfig, java.util.Map, * org.glassfish.tyrus.spi.ClientEngine)}. */ public static final String INCOMING_BUFFER_SIZE = "org.glassfish.tyrus.incomingBufferSize"; diff --git a/client/src/main/java/org/glassfish/tyrus/client/RedirectException.java b/client/src/main/java/org/glassfish/tyrus/client/RedirectException.java index 06d070f8..c90a26e2 100644 --- a/client/src/main/java/org/glassfish/tyrus/client/RedirectException.java +++ b/client/src/main/java/org/glassfish/tyrus/client/RedirectException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -18,8 +18,8 @@ import java.net.URI; -import javax.websocket.DeploymentException; -import javax.websocket.WebSocketContainer; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.WebSocketContainer; import org.glassfish.tyrus.core.HandshakeException; import org.glassfish.tyrus.spi.UpgradeResponse; @@ -44,7 +44,7 @@ * * * - * @author Ondrej Kosatka (ondrej.kosatka at oracle.com) + * @author Ondrej Kosatka * @see ClientProperties#REDIRECT_ENABLED * @see ClientProperties#REDIRECT_THRESHOLD */ diff --git a/client/src/main/java/org/glassfish/tyrus/client/RetryAfterException.java b/client/src/main/java/org/glassfish/tyrus/client/RetryAfterException.java index b3e51f46..61c17871 100644 --- a/client/src/main/java/org/glassfish/tyrus/client/RetryAfterException.java +++ b/client/src/main/java/org/glassfish/tyrus/client/RetryAfterException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,8 +16,8 @@ package org.glassfish.tyrus.client; -import javax.websocket.DeploymentException; -import javax.websocket.WebSocketContainer; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.WebSocketContainer; import org.glassfish.tyrus.core.HandshakeException; import org.glassfish.tyrus.spi.UpgradeResponse; @@ -27,7 +27,7 @@ * WebSocketContainer}.connectToServer(...) when HTTP response status code {@code 503 - Service Unavailable} is * received. * - * @author Ondrej Kosatka (ondrej.kosatka at oracle.com) + * @author Ondrej Kosatka * @see ClientManager.ReconnectHandler * @see ClientProperties#RETRY_AFTER_SERVICE_UNAVAILABLE */ diff --git a/client/src/main/java/org/glassfish/tyrus/client/SslContextConfigurator.java b/client/src/main/java/org/glassfish/tyrus/client/SslContextConfigurator.java index bd68ca99..2d79f40f 100644 --- a/client/src/main/java/org/glassfish/tyrus/client/SslContextConfigurator.java +++ b/client/src/main/java/org/glassfish/tyrus/client/SslContextConfigurator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -57,7 +57,7 @@ * @author Alexey Stashok * @author Hubert Iwaniuk * @author Bruno Harbulot - * @author Marek Potociar (marek.potociar at oracle.com) + * @author Marek Potociar */ public class SslContextConfigurator { /** @@ -67,7 +67,7 @@ public class SslContextConfigurator { *

* No default value is set. *

- * The name of the configuration property is {@value}. + * The name of the configuration property is {@value}. */ public static final String TRUST_STORE_PROVIDER = "javax.net.ssl.trustStoreProvider"; /** @@ -77,7 +77,7 @@ public class SslContextConfigurator { *

* No default value is set. *

- * The name of the configuration property is {@value}. + * The name of the configuration property is {@value}. */ public static final String KEY_STORE_PROVIDER = "javax.net.ssl.keyStoreProvider"; /** @@ -87,7 +87,7 @@ public class SslContextConfigurator { *

* No default value is set. *

- * The name of the configuration property is {@value}. + * The name of the configuration property is {@value}. */ public static final String TRUST_STORE_FILE = "javax.net.ssl.trustStore"; /** @@ -97,7 +97,7 @@ public class SslContextConfigurator { *

* No default value is set. *

- * The name of the configuration property is {@value}. + * The name of the configuration property is {@value}. */ public static final String KEY_STORE_FILE = "javax.net.ssl.keyStore"; /** @@ -107,7 +107,7 @@ public class SslContextConfigurator { *

* No default value is set. *

- * The name of the configuration property is {@value}. + * The name of the configuration property is {@value}. */ public static final String TRUST_STORE_PASSWORD = "javax.net.ssl.trustStorePassword"; /** @@ -117,7 +117,7 @@ public class SslContextConfigurator { *

* No default value is set. *

- * The name of the configuration property is {@value}. + * The name of the configuration property is {@value}. */ public static final String KEY_STORE_PASSWORD = "javax.net.ssl.keyStorePassword"; /** @@ -127,7 +127,7 @@ public class SslContextConfigurator { *

* No default value is set. *

- * The name of the configuration property is {@value}. + * The name of the configuration property is {@value}. */ public static final String TRUST_STORE_TYPE = "javax.net.ssl.trustStoreType"; /** @@ -137,7 +137,7 @@ public class SslContextConfigurator { *

* No default value is set. *

- * The name of the configuration property is {@value}. + * The name of the configuration property is {@value}. */ public static final String KEY_STORE_TYPE = "javax.net.ssl.keyStoreType"; /** @@ -147,7 +147,7 @@ public class SslContextConfigurator { *

* No default value is set. *

- * The name of the configuration property is {@value}. + * The name of the configuration property is {@value}. */ public static final String KEY_FACTORY_MANAGER_ALGORITHM = "ssl.KeyManagerFactory.algorithm"; /** @@ -157,7 +157,7 @@ public class SslContextConfigurator { *

* No default value is set. *

- * The name of the configuration property is {@value}. + * The name of the configuration property is {@value}. */ public static final String TRUST_FACTORY_MANAGER_ALGORITHM = "ssl.TrustManagerFactory.algorithm"; diff --git a/client/src/main/java/org/glassfish/tyrus/client/SslEngineConfigurator.java b/client/src/main/java/org/glassfish/tyrus/client/SslEngineConfigurator.java index bb3a792c..9b1361fc 100644 --- a/client/src/main/java/org/glassfish/tyrus/client/SslEngineConfigurator.java +++ b/client/src/main/java/org/glassfish/tyrus/client/SslEngineConfigurator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -239,8 +239,8 @@ public SSLEngine configure(final SSLEngine sslEngine) { /** * Will {@link SSLEngine} be configured to work in client mode. * - * @return true, if {@link SSLEngine} will be configured to work - * in client mode, or false for server mode. + * @return true, if {@link SSLEngine} will be configured to work + * in client mode, or false for server mode. */ public boolean isClientMode() { return clientMode; @@ -249,8 +249,8 @@ public boolean isClientMode() { /** * Set {@link SSLEngine} to be configured to work in client mode. * - * @param clientMode true, if {@link SSLEngine} will be configured - * to work in client mode, or false for server + * @param clientMode true, if {@link SSLEngine} will be configured + * to work in client mode, or false for server * mode. * @return updated {@link SslEngineConfigurator}. */ diff --git a/client/src/main/java/org/glassfish/tyrus/client/ThreadPoolConfig.java b/client/src/main/java/org/glassfish/tyrus/client/ThreadPoolConfig.java index ddb865d1..d31d83ee 100644 --- a/client/src/main/java/org/glassfish/tyrus/client/ThreadPoolConfig.java +++ b/client/src/main/java/org/glassfish/tyrus/client/ThreadPoolConfig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -23,10 +23,10 @@ /** * Client thread pool configuration, which might be used to customize client thread pool. *

- * One can get a default ThreadPoolConfig using {@link ThreadPoolConfig#defaultConfig()} + * One can get a default ThreadPoolConfig using {@link ThreadPoolConfig#defaultConfig()} * and customize it according to the application specific requirements. *

- * A ThreadPoolConfig object might be customized in a "Builder"-like fashion: + * A ThreadPoolConfig object might be customized in a "Builder"-like fashion: *

  *      ThreadPoolConfig.defaultConfig()
  *               .setPoolName("App1Pool")
@@ -53,7 +53,7 @@ public final class ThreadPoolConfig {
             null, Thread.NORM_PRIORITY, true, null);
 
     /**
-     * Create new client thread pool configuration instance. The returned ThreadPoolConfig instance will be
+     * Create new client thread pool configuration instance. The returned ThreadPoolConfig instance will be
      * pre-configured with a default values.
      *
      * @return client thread pool configuration instance.
@@ -295,7 +295,7 @@ public int getQueueLimit() {
      * 

* Value less than 0 means unlimited queue. The default is -1. * - * @param queueLimit the thread pool queue limit. The queueLimit value less than 0 means unlimited queue. + * @param queueLimit the thread pool queue limit. The queueLimit value less than 0 means unlimited queue. * @return the {@link ThreadPoolConfig} with the new queue limit. */ public ThreadPoolConfig setQueueLimit(int queueLimit) { diff --git a/client/src/main/java/org/glassfish/tyrus/client/TyrusClientEngine.java b/client/src/main/java/org/glassfish/tyrus/client/TyrusClientEngine.java index 0a5bae98..a0556dda 100644 --- a/client/src/main/java/org/glassfish/tyrus/client/TyrusClientEngine.java +++ b/client/src/main/java/org/glassfish/tyrus/client/TyrusClientEngine.java @@ -19,6 +19,7 @@ import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; +import java.nio.Buffer; import java.nio.ByteBuffer; import java.text.ParseException; import java.util.ArrayList; @@ -32,12 +33,12 @@ import java.util.logging.Level; import java.util.logging.Logger; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.CloseReason; -import javax.websocket.Extension; -import javax.websocket.Session; -import javax.websocket.WebSocketContainer; -import javax.websocket.server.HandshakeRequest; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.CloseReason; +import jakarta.websocket.Extension; +import jakarta.websocket.Session; +import jakarta.websocket.WebSocketContainer; +import jakarta.websocket.server.HandshakeRequest; import org.glassfish.tyrus.client.auth.AuthConfig; import org.glassfish.tyrus.client.auth.AuthenticationException; @@ -71,7 +72,7 @@ /** * Tyrus {@link ClientEngine} implementation. * - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public class TyrusClientEngine implements ClientEngine { @@ -109,10 +110,10 @@ public class TyrusClientEngine implements ClientEngine { * * @param endpointWrapper wrapped client endpoint. * @param listener used for reporting back the outcome of handshake. {@link - * ClientHandshakeListener#onSessionCreated(javax.websocket.Session)} is invoked if + * ClientHandshakeListener#onSessionCreated(jakarta.websocket.Session)} is invoked if * handshake is completed and provided {@link Session} is open and ready to be * returned from {@link WebSocketContainer#connectToServer(Class, - * javax.websocket.ClientEndpointConfig, java.net.URI)} (and alternatives) call. + * jakarta.websocket.ClientEndpointConfig, java.net.URI)} (and alternatives) call. * @param properties passed container properties, see {@link org.glassfish.tyrus.client * * .ClientManager#getProperties()}. * @param connectToServerUriParam to which the client is connecting. @@ -642,7 +643,7 @@ public static interface ClientHandshakeListener { /** * Invoked when handshake is completed and provided {@link Session} is open and ready to be returned from * {@link - * WebSocketContainer#connectToServer(Class, javax.websocket.ClientEndpointConfig, java.net.URI)} (and + * WebSocketContainer#connectToServer(Class, jakarta.websocket.ClientEndpointConfig, java.net.URI)} (and * alternatives) call. * * @param session opened client session. @@ -695,7 +696,7 @@ public void handle(ByteBuffer data) { + 1) * BUFFER_STEP_SIZE : newSize; final ByteBuffer result = ByteBuffer.allocate(roundedSize > incomingBufferSize ? newSize : roundedSize); - result.flip(); + ((Buffer) result).flip(); data = Utils.appendBuffers(result, data, incomingBufferSize, BUFFER_STEP_SIZE); } } diff --git a/client/src/main/java/org/glassfish/tyrus/client/auth/AuthConfig.java b/client/src/main/java/org/glassfish/tyrus/client/auth/AuthConfig.java index 88ae3966..3b239eb0 100644 --- a/client/src/main/java/org/glassfish/tyrus/client/auth/AuthConfig.java +++ b/client/src/main/java/org/glassfish/tyrus/client/auth/AuthConfig.java @@ -30,7 +30,7 @@ * An instance of this class can be created by {@link AuthConfig} and it must be registered to property bag in {@link * ClientManager}. * - * @author Ondrej Kosatka (ondrej.kosatka at oracle.com) + * @author Ondrej Kosatka * @see Authenticator * @see ClientManager#getProperties() */ diff --git a/client/src/main/java/org/glassfish/tyrus/client/auth/AuthenticationException.java b/client/src/main/java/org/glassfish/tyrus/client/auth/AuthenticationException.java index 6b1dbe86..fafafae0 100644 --- a/client/src/main/java/org/glassfish/tyrus/client/auth/AuthenticationException.java +++ b/client/src/main/java/org/glassfish/tyrus/client/auth/AuthenticationException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -18,8 +18,8 @@ import java.net.URI; -import javax.websocket.DeploymentException; -import javax.websocket.WebSocketContainer; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.WebSocketContainer; import org.glassfish.tyrus.client.ClientProperties; import org.glassfish.tyrus.core.Beta; @@ -51,7 +51,7 @@ *

* {@link #getHttpStatusCode()} returns always {@code 401}. * - * @author Ondrej Kosatka (ondrej.kosatka at oracle.com) + * @author Ondrej Kosatka * @see Authenticator#generateAuthorizationHeader(URI, String, Credentials) * @see AuthConfig */ diff --git a/client/src/main/java/org/glassfish/tyrus/client/auth/Authenticator.java b/client/src/main/java/org/glassfish/tyrus/client/auth/Authenticator.java index 1de0c272..f5cc2e95 100644 --- a/client/src/main/java/org/glassfish/tyrus/client/auth/Authenticator.java +++ b/client/src/main/java/org/glassfish/tyrus/client/auth/Authenticator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -18,8 +18,8 @@ import java.net.URI; -import javax.websocket.DeploymentException; -import javax.websocket.WebSocketContainer; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.WebSocketContainer; import org.glassfish.tyrus.client.ClientProperties; import org.glassfish.tyrus.core.Beta; @@ -32,7 +32,7 @@ * Authenticator is called when server-side returns HTTP 401 as a reply to handshake response. Tyrus client then looks * for authenticator instance registered to authentication scheme provided by server. * - * @author Ondrej Kosatka (ondrej.kosatka at oracle.com) + * @author Ondrej Kosatka * @see AuthConfig.Builder#registerAuthProvider(String, Authenticator) * @see ClientProperties#AUTH_CONFIG * @see ClientProperties#CREDENTIALS diff --git a/client/src/main/java/org/glassfish/tyrus/client/auth/BasicAuthenticator.java b/client/src/main/java/org/glassfish/tyrus/client/auth/BasicAuthenticator.java index fbaef482..02699f24 100644 --- a/client/src/main/java/org/glassfish/tyrus/client/auth/BasicAuthenticator.java +++ b/client/src/main/java/org/glassfish/tyrus/client/auth/BasicAuthenticator.java @@ -24,7 +24,7 @@ /** * Generates a value of {@code Authorization} header of HTTP request for Basic Http Authentication scheme. * - * @author Ondrej Kosatka (ondrej.kosatka at oracle.com) + * @author Ondrej Kosatka */ final class BasicAuthenticator extends Authenticator { diff --git a/client/src/main/java/org/glassfish/tyrus/client/auth/Credentials.java b/client/src/main/java/org/glassfish/tyrus/client/auth/Credentials.java index 667eef3b..ea486595 100644 --- a/client/src/main/java/org/glassfish/tyrus/client/auth/Credentials.java +++ b/client/src/main/java/org/glassfish/tyrus/client/auth/Credentials.java @@ -23,7 +23,7 @@ /** * Credentials can be used when configuring authentication properties used during client handshake. * - * @author Ondrej Kosatka (ondrej.kosatka at oracle.com) + * @author Ondrej Kosatka * @see ClientProperties#CREDENTIALS */ @Beta diff --git a/client/src/main/java/org/glassfish/tyrus/client/auth/DigestAuthenticator.java b/client/src/main/java/org/glassfish/tyrus/client/auth/DigestAuthenticator.java index 28791f06..6a65c0f5 100644 --- a/client/src/main/java/org/glassfish/tyrus/client/auth/DigestAuthenticator.java +++ b/client/src/main/java/org/glassfish/tyrus/client/auth/DigestAuthenticator.java @@ -32,8 +32,8 @@ * * @author raphael.jolivet@gmail.com * @author Stefan Katerkamp (stefan@katerkamp.de) - * @author Miroslav Fuksa (miroslav.fuksa at oracle.com) - * @author Ondrej Kosatka (ondrej.kosatka at oracle.com) + * @author Miroslav Fuksa + * @author Ondrej Kosatka */ final class DigestAuthenticator extends Authenticator { private static final Logger logger = Logger.getLogger(DigestAuthenticator.class.getName()); diff --git a/client/src/test/java/org/glassfish/tyrus/client/ClientManagerTest.java b/client/src/test/java/org/glassfish/tyrus/client/ClientManagerTest.java index eff93cd3..309986f4 100644 --- a/client/src/test/java/org/glassfish/tyrus/client/ClientManagerTest.java +++ b/client/src/test/java/org/glassfish/tyrus/client/ClientManagerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -19,8 +19,8 @@ import java.io.IOException; import java.util.Map; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.DeploymentException; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.DeploymentException; import org.glassfish.tyrus.spi.ClientContainer; import org.glassfish.tyrus.spi.ClientEngine; @@ -29,7 +29,7 @@ import static org.junit.Assert.assertEquals; /** - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public class ClientManagerTest { diff --git a/client/src/test/java/org/glassfish/tyrus/client/TyrusClientEngineTest.java b/client/src/test/java/org/glassfish/tyrus/client/TyrusClientEngineTest.java index d0672304..78d8a8c3 100644 --- a/client/src/test/java/org/glassfish/tyrus/client/TyrusClientEngineTest.java +++ b/client/src/test/java/org/glassfish/tyrus/client/TyrusClientEngineTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -26,13 +26,13 @@ import java.util.List; import java.util.Map; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.DeploymentException; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.HandshakeResponse; -import javax.websocket.Session; -import javax.websocket.server.HandshakeRequest; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.HandshakeResponse; +import jakarta.websocket.Session; +import jakarta.websocket.server.HandshakeRequest; import org.glassfish.tyrus.client.auth.Credentials; import org.glassfish.tyrus.core.DebugContext; @@ -50,7 +50,7 @@ import static org.junit.Assert.fail; /** - * @author Ondrej Kosatka (ondrej.kosatka at oracle.com) + * @author Ondrej Kosatka */ public class TyrusClientEngineTest { diff --git a/client/src/test/java/org/glassfish/tyrus/client/auth/AuthConfigTest.java b/client/src/test/java/org/glassfish/tyrus/client/auth/AuthConfigTest.java index 13823cd7..1feb05c7 100644 --- a/client/src/test/java/org/glassfish/tyrus/client/auth/AuthConfigTest.java +++ b/client/src/test/java/org/glassfish/tyrus/client/auth/AuthConfigTest.java @@ -23,7 +23,7 @@ /** - * @author Ondrej Kosatka (ondrej.kosatka at oracle.com) + * @author Ondrej Kosatka */ public class AuthConfigTest { diff --git a/client/src/test/java/org/glassfish/tyrus/client/auth/CredentialsTest.java b/client/src/test/java/org/glassfish/tyrus/client/auth/CredentialsTest.java index b21b30b2..05d2572b 100644 --- a/client/src/test/java/org/glassfish/tyrus/client/auth/CredentialsTest.java +++ b/client/src/test/java/org/glassfish/tyrus/client/auth/CredentialsTest.java @@ -21,7 +21,7 @@ import static org.junit.Assert.assertEquals; /** - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public class CredentialsTest { diff --git a/containers/glassfish/cdi/pom.xml b/containers/glassfish/cdi/pom.xml index 2deb57ce..0bf6ffe1 100755 --- a/containers/glassfish/cdi/pom.xml +++ b/containers/glassfish/cdi/pom.xml @@ -1,6 +1,6 @@ + + jakarta.xml.bind.*;version="[3.0,5)", + javax.naming,* true @@ -107,30 +110,20 @@ - - - jdk9+ - - [9,) - - - - jakarta.xml.bind - jakarta.xml.bind-api - - - com.sun.xml.bind - jaxb-osgi - test - - - - org.glassfish.tyrus tyrus-spi + + jakarta.xml.bind + jakarta.xml.bind-api + + + com.sun.xml.bind + jaxb-osgi + test + org.osgi org.osgi.core diff --git a/core/src/main/java/module-info.java b/core/src/main/java/module-info.java new file mode 100644 index 00000000..feb3cb3c --- /dev/null +++ b/core/src/main/java/module-info.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0, which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the + * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + * version 2 with the GNU Classpath Exception, which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + */ + +/** + * Tyrus Core Module + */ +module org.glassfish.tyrus.core { + requires java.logging; + + requires static jakarta.xml.bind; + requires transitive jakarta.websocket; + + requires static org.osgi.core; + + requires org.glassfish.tyrus.spi; + + exports org.glassfish.tyrus.core; + exports org.glassfish.tyrus.core.cluster; + exports org.glassfish.tyrus.core.coder; + exports org.glassfish.tyrus.core.extension; + exports org.glassfish.tyrus.core.frame; + exports org.glassfish.tyrus.core.l10n; + exports org.glassfish.tyrus.core.monitoring; + exports org.glassfish.tyrus.core.uri; + exports org.glassfish.tyrus.core.uri.internal; + exports org.glassfish.tyrus.core.wsadl.model; + + uses org.glassfish.tyrus.core.ComponentProvider; + + provides jakarta.websocket.server.ServerEndpointConfig.Configurator with org.glassfish.tyrus.core.TyrusServerEndpointConfigurator; +} \ No newline at end of file diff --git a/core/src/main/java/org/glassfish/tyrus/core/AnnotatedClassValidityChecker.java b/core/src/main/java/org/glassfish/tyrus/core/AnnotatedClassValidityChecker.java index 52e20ecd..a0277538 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/AnnotatedClassValidityChecker.java +++ b/core/src/main/java/org/glassfish/tyrus/core/AnnotatedClassValidityChecker.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -21,19 +21,19 @@ import java.util.List; import java.util.Map; -import javax.websocket.CloseReason; -import javax.websocket.Decoder; -import javax.websocket.DeploymentException; -import javax.websocket.Encoder; -import javax.websocket.EndpointConfig; -import javax.websocket.MessageHandler; +import jakarta.websocket.CloseReason; +import jakarta.websocket.Decoder; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Encoder; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.MessageHandler; import org.glassfish.tyrus.core.l10n.LocalizationMessages; /** * Used when processing a class annotated with {@link @ServerEndpoint} to check that it complies with specification. * - * @author Stepan Kopriva (stepan.kopriva at oracle.com) + * @author Stepan Kopriva */ class AnnotatedClassValidityChecker { @@ -56,11 +56,11 @@ public AnnotatedClassValidityChecker(Class annotatedClass, List - * Voluntary parameters of type {@link javax.websocket.Session} and parameters annotated with {@link - * javax.websocket.server.PathParam} are checked in advance in {@link AnnotatedEndpoint}. + * Voluntary parameters of type {@link jakarta.websocket.Session} and parameters annotated with {@link + * jakarta.websocket.server.PathParam} are checked in advance in {@link AnnotatedEndpoint}. */ public void checkOnMessageParams(Method method, MessageHandler handler) { try { @@ -87,10 +87,10 @@ private void checkOnMessageReturnType(Method method) { } /** - * Checks whether the params of method annotated with {@link javax.websocket.OnOpen} comply with the specification. + * Checks whether the params of method annotated with {@link jakarta.websocket.OnOpen} comply with the specification. *

- * Voluntary parameters of type {@link javax.websocket.Session} and parameters annotated with {@link - * javax.websocket.server.PathParam} are checked in advance in {@link AnnotatedEndpoint}. + * Voluntary parameters of type {@link jakarta.websocket.Session} and parameters annotated with {@link + * jakarta.websocket.server.PathParam} are checked in advance in {@link AnnotatedEndpoint}. * * @param params to be checked. */ @@ -105,7 +105,7 @@ public void checkOnOpenParams(Method method, Map> params) { } /** - * Checks whether the params of method annotated with {@link javax.websocket.OnClose} comply with the + * Checks whether the params of method annotated with {@link jakarta.websocket.OnClose} comply with the * specification. * * @param params unknown params of the method. @@ -121,7 +121,7 @@ public void checkOnCloseParams(Method method, Map> params) { } /** - * Checks whether the params of method annotated with {@link javax.websocket.OnError} comply with the + * Checks whether the params of method annotated with {@link jakarta.websocket.OnError} comply with the * specification. * * @param params unknown params of the method. diff --git a/core/src/main/java/org/glassfish/tyrus/core/AnnotatedEndpoint.java b/core/src/main/java/org/glassfish/tyrus/core/AnnotatedEndpoint.java index 8ae82b0e..87f14aa3 100755 --- a/core/src/main/java/org/glassfish/tyrus/core/AnnotatedEndpoint.java +++ b/core/src/main/java/org/glassfish/tyrus/core/AnnotatedEndpoint.java @@ -31,25 +31,26 @@ import java.util.logging.Level; import java.util.logging.Logger; -import javax.websocket.ClientEndpoint; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.CloseReason; -import javax.websocket.DecodeException; -import javax.websocket.Decoder; -import javax.websocket.DeploymentException; -import javax.websocket.Encoder; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.Extension; -import javax.websocket.MessageHandler; -import javax.websocket.OnClose; -import javax.websocket.OnError; -import javax.websocket.OnMessage; -import javax.websocket.OnOpen; -import javax.websocket.Session; -import javax.websocket.server.PathParam; -import javax.websocket.server.ServerEndpoint; -import javax.websocket.server.ServerEndpointConfig; +import jakarta.websocket.ClientEndpoint; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.CloseReason; +import jakarta.websocket.DecodeException; +import jakarta.websocket.Decoder; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Encoder; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.Extension; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.OnClose; +import jakarta.websocket.OnError; +import jakarta.websocket.OnMessage; +import jakarta.websocket.OnOpen; +import jakarta.websocket.Session; +import jakarta.websocket.server.PathParam; +import jakarta.websocket.server.ServerEndpoint; +import jakarta.websocket.server.ServerEndpointConfig; + import org.glassfish.tyrus.core.coder.PrimitiveDecoders; import org.glassfish.tyrus.core.l10n.LocalizationMessages; @@ -58,9 +59,9 @@ /** * {@link Endpoint} descendant which represents deployed annotated endpoint. * - * @author Martin Matula (martin.matula at oracle.com) - * @author Stepan Kopriva (stepan.kopriva at oracle.com) - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Martin Matula + * @author Stepan Kopriva + * @author Pavel Bucek */ public class AnnotatedEndpoint extends Endpoint { private static final Logger LOGGER = Logger.getLogger(AnnotatedEndpoint.class.getName()); diff --git a/core/src/main/java/org/glassfish/tyrus/core/AsyncMessageHandler.java b/core/src/main/java/org/glassfish/tyrus/core/AsyncMessageHandler.java index dd9b8e53..125eb394 100755 --- a/core/src/main/java/org/glassfish/tyrus/core/AsyncMessageHandler.java +++ b/core/src/main/java/org/glassfish/tyrus/core/AsyncMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,12 +16,12 @@ package org.glassfish.tyrus.core; -import javax.websocket.MessageHandler; +import jakarta.websocket.MessageHandler; /** * Asynchonous message handler with added getType method. * - * @author Martin Matula (martin.matula at oracle.com) + * @author Martin Matula */ interface AsyncMessageHandler extends MessageHandler.Partial { @@ -36,7 +36,7 @@ interface AsyncMessageHandler extends MessageHandler.Partial { * Get max message size allowed for this message handler. * * @return max message size. - * @see javax.websocket.OnMessage#maxMessageSize() + * @see jakarta.websocket.OnMessage#maxMessageSize() */ long getMaxMessageSize(); } diff --git a/core/src/main/java/org/glassfish/tyrus/core/BaseContainer.java b/core/src/main/java/org/glassfish/tyrus/core/BaseContainer.java index b2cda50d..663c74b6 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/BaseContainer.java +++ b/core/src/main/java/org/glassfish/tyrus/core/BaseContainer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -25,7 +25,7 @@ import java.util.logging.Level; import java.util.logging.Logger; -import javax.websocket.WebSocketContainer; +import jakarta.websocket.WebSocketContainer; /** * Base WebSocket container. diff --git a/core/src/main/java/org/glassfish/tyrus/core/BasicMessageHandler.java b/core/src/main/java/org/glassfish/tyrus/core/BasicMessageHandler.java index 693a26a6..8be7731f 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/BasicMessageHandler.java +++ b/core/src/main/java/org/glassfish/tyrus/core/BasicMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,12 +16,12 @@ package org.glassfish.tyrus.core; -import javax.websocket.MessageHandler; +import jakarta.websocket.MessageHandler; /** * Synchronous message handler with added getType method. * - * @author Martin Matula (martin.matula at oracle.com) + * @author Martin Matula */ interface BasicMessageHandler extends MessageHandler.Whole { @@ -36,7 +36,7 @@ interface BasicMessageHandler extends MessageHandler.Whole { * Get max message size allowed for this message handler. * * @return max message size. - * @see javax.websocket.OnMessage#maxMessageSize() + * @see jakarta.websocket.OnMessage#maxMessageSize() */ long getMaxMessageSize(); } diff --git a/core/src/main/java/org/glassfish/tyrus/core/Beta.java b/core/src/main/java/org/glassfish/tyrus/core/Beta.java index 319a913b..124d97c3 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/Beta.java +++ b/core/src/main/java/org/glassfish/tyrus/core/Beta.java @@ -44,7 +44,7 @@ * Once a {@code @Beta}-annotated Tyrus API reaches the desired maturity, the {@code @Beta} annotation * will be removed from such API and the API will become part of a stable public Tyrus API. * - * @author Marek Potociar (marek.potociar at oracle.com) + * @author Marek Potociar */ @Retention(RetentionPolicy.CLASS) @Documented diff --git a/core/src/main/java/org/glassfish/tyrus/core/BinaryBuffer.java b/core/src/main/java/org/glassfish/tyrus/core/BinaryBuffer.java index a2b460ae..5fc7b36a 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/BinaryBuffer.java +++ b/core/src/main/java/org/glassfish/tyrus/core/BinaryBuffer.java @@ -16,6 +16,7 @@ package org.glassfish.tyrus.core; +import java.nio.Buffer; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.List; @@ -27,8 +28,8 @@ /** * Save received partial messages to a list and concatenate them. * - * @author Stepan Kopriva (stepan.kopriva at oracle.com) - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Stepan Kopriva + * @author Pavel Bucek */ class BinaryBuffer { private final List list = new ArrayList(); @@ -68,7 +69,7 @@ ByteBuffer getBufferedContent() { b.put(buffered); } - b.flip(); + ((Buffer) b).flip(); resetBuffer(0); return b; } diff --git a/core/src/main/java/org/glassfish/tyrus/core/BufferedInputStream.java b/core/src/main/java/org/glassfish/tyrus/core/BufferedInputStream.java index 0e306316..aeedd59b 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/BufferedInputStream.java +++ b/core/src/main/java/org/glassfish/tyrus/core/BufferedInputStream.java @@ -22,8 +22,8 @@ /** * Passed to the (@link MessageHandler.Whole} in case that partial messages are being received. * - * @author Danny Coward (danny.coward at oracle.com) - * @author Stepan Kopriva (stepan.kopriva at oracle.com) + * @author Danny Coward + * @author Stepan Kopriva */ class BufferedInputStream extends InputStream { private final InputStreamBuffer buffer; diff --git a/core/src/main/java/org/glassfish/tyrus/core/BufferedStringReader.java b/core/src/main/java/org/glassfish/tyrus/core/BufferedStringReader.java index e0d48d6c..da043756 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/BufferedStringReader.java +++ b/core/src/main/java/org/glassfish/tyrus/core/BufferedStringReader.java @@ -22,8 +22,8 @@ /** * Passed to the (@link MessageHandler.Whole} in case that partial messages are being received. * - * @author Danny Coward (danny.coward at oracle.com) - * @author Stepan Kopriva (stepan.kopriva at oracle.com) + * @author Danny Coward + * @author Stepan Kopriva */ class BufferedStringReader extends Reader { private final ReaderBuffer readerBuffer; diff --git a/core/src/main/java/org/glassfish/tyrus/core/CloseReasons.java b/core/src/main/java/org/glassfish/tyrus/core/CloseReasons.java index 95055e87..26845aab 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/CloseReasons.java +++ b/core/src/main/java/org/glassfish/tyrus/core/CloseReasons.java @@ -16,15 +16,15 @@ package org.glassfish.tyrus.core; -import javax.websocket.CloseReason; +import jakarta.websocket.CloseReason; + import java.io.UnsupportedEncodingException; -import java.nio.charset.Charset; /** * Enum containing standard CloseReasons defined in RFC 6455, see chapter * 7.4.1 Defined Status Codes. * - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public enum CloseReasons { diff --git a/core/src/main/java/org/glassfish/tyrus/core/ComponentProvider.java b/core/src/main/java/org/glassfish/tyrus/core/ComponentProvider.java index 7b31146f..b417a90f 100755 --- a/core/src/main/java/org/glassfish/tyrus/core/ComponentProvider.java +++ b/core/src/main/java/org/glassfish/tyrus/core/ComponentProvider.java @@ -24,9 +24,9 @@ * Method {@link #isApplicable(Class)} is called first to check whether the provider is able to provide the given * {@link Class}. Method {@link #create(Class)} is called to get the instance. * - * @author Stepan Kopriva (stepan.kopriva at oracle.com) - * @author Martin Matula (martin.matula at oracle.com) - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Stepan Kopriva + * @author Martin Matula + * @author Pavel Bucek */ public abstract class ComponentProvider { /** diff --git a/core/src/main/java/org/glassfish/tyrus/core/ComponentProviderService.java b/core/src/main/java/org/glassfish/tyrus/core/ComponentProviderService.java index 89126cc0..bcbf7c3e 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/ComponentProviderService.java +++ b/core/src/main/java/org/glassfish/tyrus/core/ComponentProviderService.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -25,11 +25,11 @@ import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import javax.websocket.Decoder; -import javax.websocket.DeploymentException; -import javax.websocket.Encoder; -import javax.websocket.EndpointConfig; -import javax.websocket.Session; +import jakarta.websocket.Decoder; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Encoder; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.Session; import org.glassfish.tyrus.core.l10n.LocalizationMessages; @@ -37,9 +37,9 @@ * Provides an instance of component. Searches for registered {@link ComponentProvider}s which are used to provide * instances. * - * @author Martin Matula (martin.matula at oracle.com) - * @author Stepan Kopriva (stepan.kopriva at oracle.com) - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Martin Matula + * @author Stepan Kopriva + * @author Pavel Bucek */ public class ComponentProviderService { @@ -140,20 +140,20 @@ public Object getInstance(Class c, Session session, ErrorCollector collec } /** - * Provide an instance of {@link javax.websocket.Encoder} or {@link javax.websocket.Decoder} descendant which is + * Provide an instance of {@link jakarta.websocket.Encoder} or {@link jakarta.websocket.Decoder} descendant which is * coupled to {@link Session}. *

* The first time the method is called the provider creates an instance, calls {@link - * javax.websocket.Encoder#init(javax.websocket.EndpointConfig)} - * or {@link javax.websocket.Decoder#init(javax.websocket.EndpointConfig)} and caches it. + * jakarta.websocket.Encoder#init(jakarta.websocket.EndpointConfig)} + * or {@link jakarta.websocket.Decoder#init(jakarta.websocket.EndpointConfig)} and caches it. * Next time the method is called the cached instance is returned. * * @param c {@link Class} whose instance will be provided. * @param session session to which the instance belongs (think of this as a scope). * @param collector error collector. * @param endpointConfig configuration corresponding to current context. Used for - * {@link javax.websocket.Encoder#init(javax.websocket.EndpointConfig)} and - * {@link javax.websocket.Decoder#init(javax.websocket.EndpointConfig)} + * {@link jakarta.websocket.Encoder#init(jakarta.websocket.EndpointConfig)} and + * {@link jakarta.websocket.Decoder#init(jakarta.websocket.EndpointConfig)} * @param type of the provided instance. * @return instance */ @@ -273,7 +273,7 @@ public void removeSession(Session session) { * interactions from a new client. * @throws InstantiationException if there was an error producing the * endpoint instance. - * @see javax.websocket.server.ServerEndpointConfig.Configurator#getEndpointInstance(Class) + * @see jakarta.websocket.server.ServerEndpointConfig.Configurator#getEndpointInstance(Class) */ public Object getEndpointInstance(Class endpointClass) throws InstantiationException { return getInstance(endpointClass); diff --git a/core/src/main/java/org/glassfish/tyrus/core/DefaultComponentProvider.java b/core/src/main/java/org/glassfish/tyrus/core/DefaultComponentProvider.java index e36de917..e1476539 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/DefaultComponentProvider.java +++ b/core/src/main/java/org/glassfish/tyrus/core/DefaultComponentProvider.java @@ -21,7 +21,7 @@ /** * Provides instances using reflection. * - * @author Stepan Kopriva (stepan.kopriva at oracle.com) + * @author Stepan Kopriva */ public class DefaultComponentProvider extends ComponentProvider { diff --git a/core/src/main/java/org/glassfish/tyrus/core/DefaultTyrusServerEndpointConfig.java b/core/src/main/java/org/glassfish/tyrus/core/DefaultTyrusServerEndpointConfig.java index 53b4231b..978fefcd 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/DefaultTyrusServerEndpointConfig.java +++ b/core/src/main/java/org/glassfish/tyrus/core/DefaultTyrusServerEndpointConfig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -19,15 +19,15 @@ import java.util.List; import java.util.Map; -import javax.websocket.Decoder; -import javax.websocket.Encoder; -import javax.websocket.Extension; -import javax.websocket.server.ServerEndpointConfig; +import jakarta.websocket.Decoder; +import jakarta.websocket.Encoder; +import jakarta.websocket.Extension; +import jakarta.websocket.server.ServerEndpointConfig; /** * Default tyrus-specific implementation of {@code TyrusServerEndpointConfig}. * - * @author Ondrej Kosatka (ondrej.kosatka at oracle.com) + * @author Ondrej Kosatka */ final class DefaultTyrusServerEndpointConfig implements TyrusServerEndpointConfig { diff --git a/core/src/main/java/org/glassfish/tyrus/core/ErrorCollector.java b/core/src/main/java/org/glassfish/tyrus/core/ErrorCollector.java index 1bcb507f..e031e47f 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/ErrorCollector.java +++ b/core/src/main/java/org/glassfish/tyrus/core/ErrorCollector.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -21,12 +21,12 @@ import java.util.logging.Level; import java.util.logging.Logger; -import javax.websocket.DeploymentException; +import jakarta.websocket.DeploymentException; /** * Used to collect deployment errors to present these to the user together. * - * @author Stepan Kopriva (stepan.kopriva at oracle.com) + * @author Stepan Kopriva */ public class ErrorCollector { diff --git a/core/src/main/java/org/glassfish/tyrus/core/ExecutorServiceProvider.java b/core/src/main/java/org/glassfish/tyrus/core/ExecutorServiceProvider.java index ee07f075..d2b49c21 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/ExecutorServiceProvider.java +++ b/core/src/main/java/org/glassfish/tyrus/core/ExecutorServiceProvider.java @@ -20,7 +20,7 @@ import java.util.concurrent.ScheduledExecutorService; /** - * @author Stepan Kopriva (stepan.kopriva at oracle.com) + * @author Stepan Kopriva */ public abstract class ExecutorServiceProvider { diff --git a/core/src/main/java/org/glassfish/tyrus/core/Handshake.java b/core/src/main/java/org/glassfish/tyrus/core/Handshake.java index 29ed623b..5a0a4e34 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/Handshake.java +++ b/core/src/main/java/org/glassfish/tyrus/core/Handshake.java @@ -23,9 +23,9 @@ import java.util.List; import java.util.Map; -import javax.websocket.Extension; -import javax.websocket.HandshakeResponse; -import javax.websocket.server.HandshakeRequest; +import jakarta.websocket.Extension; +import jakarta.websocket.HandshakeResponse; +import jakarta.websocket.server.HandshakeRequest; import org.glassfish.tyrus.core.extension.ExtendedExtension; import org.glassfish.tyrus.core.l10n.LocalizationMessages; @@ -36,7 +36,7 @@ * Class responsible for performing and validating handshake. * * @author Justin Lee - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public final class Handshake { diff --git a/core/src/main/java/org/glassfish/tyrus/core/HandshakeException.java b/core/src/main/java/org/glassfish/tyrus/core/HandshakeException.java index 5fb2d6b8..ae93e55f 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/HandshakeException.java +++ b/core/src/main/java/org/glassfish/tyrus/core/HandshakeException.java @@ -20,7 +20,7 @@ * {@link Exception}, which describes the error, occurred during the handshake phase. * * @author Alexey Stashok - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public class HandshakeException extends Exception { diff --git a/core/src/main/java/org/glassfish/tyrus/core/InputStreamBuffer.java b/core/src/main/java/org/glassfish/tyrus/core/InputStreamBuffer.java index 5280ae75..2723d616 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/InputStreamBuffer.java +++ b/core/src/main/java/org/glassfish/tyrus/core/InputStreamBuffer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -27,7 +27,7 @@ import java.util.logging.Level; import java.util.logging.Logger; -import javax.websocket.MessageHandler; +import jakarta.websocket.MessageHandler; import org.glassfish.tyrus.core.l10n.LocalizationMessages; @@ -37,9 +37,9 @@ * For the first received message {@link MessageHandler.Whole#onMessage(Object)} is called in a new {@link Thread} to * allow blocking reading of passed {@link java.io.InputStream}. * - * @author Danny Coward (danny.coward at oracle.com) - * @author Stepan Kopriva (stepan.kopriva at oracle.com) - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Danny Coward + * @author Stepan Kopriva + * @author Pavel Bucek */ class InputStreamBuffer { diff --git a/core/src/main/java/org/glassfish/tyrus/core/MaxSessions.java b/core/src/main/java/org/glassfish/tyrus/core/MaxSessions.java index 64ce498e..62439297 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/MaxSessions.java +++ b/core/src/main/java/org/glassfish/tyrus/core/MaxSessions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -23,9 +23,9 @@ /** * This annotation may be used to annotate server endpoints as a optional annotation - * to {@link javax.websocket.server.ServerEndpoint}. When number of maximal open + * to {@link jakarta.websocket.server.ServerEndpoint}. When number of maximal open * sessions is exceeded every new attempt to open session is closed with - * {@link javax.websocket.CloseReason.CloseCodes#TRY_AGAIN_LATER}. + * {@link jakarta.websocket.CloseReason.CloseCodes#TRY_AGAIN_LATER}. * If value less then 1 is specified, no limit will be applied. * Annotation example: *


@@ -39,7 +39,7 @@
  * using {@link org.glassfish.tyrus.core.TyrusServerEndpointConfig.Builder#maxSessions(int)}.
  * 

* - * @author Ondrej Kosatka (ondrej.kosatka at oracle.com) + * @author Ondrej Kosatka */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) diff --git a/core/src/main/java/org/glassfish/tyrus/core/MessageHandlerManager.java b/core/src/main/java/org/glassfish/tyrus/core/MessageHandlerManager.java index 5335708f..00a6eb75 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/MessageHandlerManager.java +++ b/core/src/main/java/org/glassfish/tyrus/core/MessageHandlerManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -31,9 +31,9 @@ import java.util.Map; import java.util.Set; -import javax.websocket.Decoder; -import javax.websocket.MessageHandler; -import javax.websocket.PongMessage; +import jakarta.websocket.Decoder; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.PongMessage; import org.glassfish.tyrus.core.coder.CoderWrapper; import org.glassfish.tyrus.core.l10n.LocalizationMessages; @@ -41,10 +41,10 @@ /** * Manages registered {@link MessageHandler}s and checks whether the new ones may be registered. * - * @author Stepan Kopriva (stepan.kopriva at oracle.com) - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Stepan Kopriva + * @author Pavel Bucek * @see MessageHandler - * @see javax.websocket.OnMessage + * @see jakarta.websocket.OnMessage */ public class MessageHandlerManager { diff --git a/core/src/main/java/org/glassfish/tyrus/core/MessageTooBigException.java b/core/src/main/java/org/glassfish/tyrus/core/MessageTooBigException.java index 1d308148..20cc3884 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/MessageTooBigException.java +++ b/core/src/main/java/org/glassfish/tyrus/core/MessageTooBigException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,17 +16,17 @@ package org.glassfish.tyrus.core; -import javax.websocket.CloseReason; +import jakarta.websocket.CloseReason; /** - * Thrown when {@link javax.websocket.OnMessage#maxMessageSize()} is smaller than received message size. + * Thrown when {@link jakarta.websocket.OnMessage#maxMessageSize()} is smaller than received message size. *

- * Underlying web socket connection will be closed with {@link javax.websocket.CloseReason.CloseCode} - * {@link javax.websocket.CloseReason.CloseCodes#TOO_BIG} and {@link javax.websocket.OnError} annotated method (or - * {@link javax.websocket.Endpoint#onError(javax.websocket.Session, Throwable)} will be called with instance of this + * Underlying web socket connection will be closed with {@link jakarta.websocket.CloseReason.CloseCode} + * {@link jakarta.websocket.CloseReason.CloseCodes#TOO_BIG} and {@link jakarta.websocket.OnError} annotated method (or + * {@link jakarta.websocket.Endpoint#onError(jakarta.websocket.Session, Throwable)} will be called with instance of this * class as {@link Throwable} parameter. * - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ class MessageTooBigException extends WebSocketException { diff --git a/core/src/main/java/org/glassfish/tyrus/core/OsgiRegistry.java b/core/src/main/java/org/glassfish/tyrus/core/OsgiRegistry.java index eaf74bfe..0434a13f 100755 --- a/core/src/main/java/org/glassfish/tyrus/core/OsgiRegistry.java +++ b/core/src/main/java/org/glassfish/tyrus/core/OsgiRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -62,7 +62,7 @@ * via the OSGi Bundle API as direct ClassLoader#getResource() method invocation * does not work in this case within OSGi. * - * @author Jakub Podlesak (jakub.podlesak at oracle.com) + * @author Jakub Podlesak */ public final class OsgiRegistry implements SynchronousBundleListener { diff --git a/core/src/main/java/org/glassfish/tyrus/core/OutputStreamToAsyncBinaryAdapter.java b/core/src/main/java/org/glassfish/tyrus/core/OutputStreamToAsyncBinaryAdapter.java index e8de9776..5eb85ef6 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/OutputStreamToAsyncBinaryAdapter.java +++ b/core/src/main/java/org/glassfish/tyrus/core/OutputStreamToAsyncBinaryAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -26,7 +26,7 @@ /** * Simple Writer that writes its data to an async sink. * - * @author Danny Coward (danny.coward at oracle.com) + * @author Danny Coward */ class OutputStreamToAsyncBinaryAdapter extends OutputStream { private final TyrusWebSocket socket; diff --git a/core/src/main/java/org/glassfish/tyrus/core/PrimitivesToWrappers.java b/core/src/main/java/org/glassfish/tyrus/core/PrimitivesToWrappers.java index 585e4f22..916d8d52 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/PrimitivesToWrappers.java +++ b/core/src/main/java/org/glassfish/tyrus/core/PrimitivesToWrappers.java @@ -19,7 +19,7 @@ import java.util.HashMap; /** - * @author Stepan Kopriva (stepan.kopriva at oracle.com) + * @author Stepan Kopriva */ class PrimitivesToWrappers { diff --git a/core/src/main/java/org/glassfish/tyrus/core/ProtocolException.java b/core/src/main/java/org/glassfish/tyrus/core/ProtocolException.java index c9a8493c..ac6cf1e0 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/ProtocolException.java +++ b/core/src/main/java/org/glassfish/tyrus/core/ProtocolException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,12 +16,12 @@ package org.glassfish.tyrus.core; -import javax.websocket.CloseReason; +import jakarta.websocket.CloseReason; /** * Represents issue with parsing or producing websocket frame. * - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public class ProtocolException extends WebSocketException { diff --git a/core/src/main/java/org/glassfish/tyrus/core/ProtocolHandler.java b/core/src/main/java/org/glassfish/tyrus/core/ProtocolHandler.java index 7c067202..41d34366 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/ProtocolHandler.java +++ b/core/src/main/java/org/glassfish/tyrus/core/ProtocolHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -30,11 +30,11 @@ import java.util.logging.Level; import java.util.logging.Logger; -import javax.websocket.CloseReason; -import javax.websocket.Extension; -import javax.websocket.SendHandler; -import javax.websocket.SendResult; -import javax.websocket.server.HandshakeRequest; +import jakarta.websocket.CloseReason; +import jakarta.websocket.Extension; +import jakarta.websocket.SendHandler; +import jakarta.websocket.SendResult; +import jakarta.websocket.server.HandshakeRequest; import org.glassfish.tyrus.core.extension.ExtendedExtension; import org.glassfish.tyrus.core.frame.BinaryFrame; @@ -476,7 +476,14 @@ public synchronized Future close(final int code, final String reason) { outgoingCloseFrame = new CloseFrame(closeReason); } - final Future send = send(outgoingCloseFrame, null, CLOSE, false); + Future send; + try { + send = send(outgoingCloseFrame, null, CLOSE, false); + } catch (Exception e) { + send = new TyrusFuture<>(); + ((TyrusFuture) send).setFailure(e); + LOGGER.warning(LocalizationMessages.EXCEPTION_CLOSE(e.getMessage())); + } webSocket.onClose(new CloseFrame(closeReason)); diff --git a/core/src/main/java/org/glassfish/tyrus/core/ReaderBuffer.java b/core/src/main/java/org/glassfish/tyrus/core/ReaderBuffer.java index d2814e52..f4062d86 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/ReaderBuffer.java +++ b/core/src/main/java/org/glassfish/tyrus/core/ReaderBuffer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -25,7 +25,7 @@ import java.util.logging.Level; import java.util.logging.Logger; -import javax.websocket.MessageHandler; +import jakarta.websocket.MessageHandler; import org.glassfish.tyrus.core.l10n.LocalizationMessages; @@ -35,9 +35,9 @@ * For the first received message {@link MessageHandler.Whole#onMessage(Object)} is called within a new executor to * allow blocking reading of passed {@link Reader}. * - * @author Danny Coward (danny.coward at oracle.com) - * @author Stepan Kopriva (stepan.kopriva at oracle.com) - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Danny Coward + * @author Stepan Kopriva + * @author Pavel Bucek */ class ReaderBuffer { diff --git a/core/src/main/java/org/glassfish/tyrus/core/ReflectionHelper.java b/core/src/main/java/org/glassfish/tyrus/core/ReflectionHelper.java index 119e1e47..7186fc77 100755 --- a/core/src/main/java/org/glassfish/tyrus/core/ReflectionHelper.java +++ b/core/src/main/java/org/glassfish/tyrus/core/ReflectionHelper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2020 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -32,7 +32,7 @@ import java.util.HashMap; import java.util.Map; -import javax.websocket.DeploymentException; +import jakarta.websocket.DeploymentException; import org.glassfish.tyrus.core.l10n.LocalizationMessages; diff --git a/core/src/main/java/org/glassfish/tyrus/core/RequestContext.java b/core/src/main/java/org/glassfish/tyrus/core/RequestContext.java index 38619632..945067f8 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/RequestContext.java +++ b/core/src/main/java/org/glassfish/tyrus/core/RequestContext.java @@ -30,7 +30,7 @@ /** * Implementation of all possible request interfaces. Should be the only point of truth. * - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public final class RequestContext extends UpgradeRequest { @@ -233,7 +233,7 @@ public Builder queryString(String queryString) { /** * Set http session. * - * @param httpSession {@code javax.servlet.http.HttpSession} session to be set. + * @param httpSession {@code jakarta.servlet.http.HttpSession} session to be set. * @return updated {@link RequestContext.Builder} instance. */ public Builder httpSession(Object httpSession) { diff --git a/core/src/main/java/org/glassfish/tyrus/core/ServiceConfigurationError.java b/core/src/main/java/org/glassfish/tyrus/core/ServiceConfigurationError.java index cbab10d8..7936c0fb 100755 --- a/core/src/main/java/org/glassfish/tyrus/core/ServiceConfigurationError.java +++ b/core/src/main/java/org/glassfish/tyrus/core/ServiceConfigurationError.java @@ -27,7 +27,7 @@ * * * @author Mark Reinhold - * @author Marek Potociar (marek.potociar at oracle.com) + * @author Marek Potociar */ public class ServiceConfigurationError extends Error { diff --git a/core/src/main/java/org/glassfish/tyrus/core/ServiceFinder.java b/core/src/main/java/org/glassfish/tyrus/core/ServiceFinder.java index 320b98a1..f43af5c1 100755 --- a/core/src/main/java/org/glassfish/tyrus/core/ServiceFinder.java +++ b/core/src/main/java/org/glassfish/tyrus/core/ServiceFinder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -63,18 +63,18 @@ * zero-argument constructor so that they may be instantiated during lookup. *

* The default service provider registration/lookup mechanism based - * on META-INF/services files is described below. + * on META-INF/services files is described below. * For environments, where the basic mechanism is not suitable, clients - * can enforce a different approach by setting their custom ServiceIteratorProvider - * by calling setIteratorProvider. The call must be made prior to any lookup attempts. + * can enforce a different approach by setting their custom ServiceIteratorProvider + * by calling setIteratorProvider. The call must be made prior to any lookup attempts. *

* A service provider identifies itself by placing a provider-configuration - * file in the resource directory META-INF/services. The file's name + * file in the resource directory META-INF/services. The file's name * should consist of the fully-qualified name of the abstract service class. * The file should contain a list of fully-qualified concrete provider-class * names, one per line. Space and tab characters surrounding each name, as - * well as blank lines, are ignored. The comment character is '#' - * (0x23); on each line all characters following the first comment + * well as blank lines, are ignored. The comment character is '#' + * (0x23); on each line all characters following the first comment * character are ignored. The file must be encoded in UTF-8. *

* If a particular concrete provider class is named in more than one @@ -86,19 +86,19 @@ * note that this is not necessarily the class loader that found the file. *

* Example: Suppose we have a service class named - * java.io.spi.CharCodec. It has two abstract methods: + * java.io.spi.CharCodec. It has two abstract methods: *

  *   public abstract CharEncoder getEncoder(String encodingName);
  *   public abstract CharDecoder getDecoder(String encodingName);
  * 
*

- * Each method returns an appropriate object or null if it cannot - * translate the given encoding. Typical CharCodec providers will + * Each method returns an appropriate object or null if it cannot + * translate the given encoding. Typical CharCodec providers will * support more than one encoding. *

- * If sun.io.StandardCodec is a provider of the CharCodec + * If sun.io.StandardCodec is a provider of the CharCodec * service then its jar file would contain the file - * META-INF/services/java.io.spi.CharCodec. This file would contain + * META-INF/services/java.io.spi.CharCodec. This file would contain * the single line: *

  *   sun.io.StandardCodec    # Standard codecs for the platform
@@ -178,7 +178,7 @@ private static ClassLoader _getContextClassLoader() {
      * 

* This method transforms the name of the given service class into a * provider-configuration filename as described above and then uses the - * getResources method of the given class loader to find all + * getResources method of the given class loader to find all * available files with that name. These files are then read and parsed to * produce a list of provider-class names. The iterator that is returned * uses the given class loader to lookup and then instantiate each element @@ -190,7 +190,7 @@ private static ClassLoader _getContextClassLoader() { * * @param service The service's abstract service class * @param loader The class loader to be used to load provider-configuration files - * and instantiate provider classes, or null if the system + * and instantiate provider classes, or null if the system * class loader (or, failing that the bootstrap class loader) is to * be used * @param the type of the service instance. @@ -212,7 +212,7 @@ public static ServiceFinder find(Class service, ClassLoader loader) *

* This method transforms the name of the given service class into a * provider-configuration filename as described above and then uses the - * getResources method of the given class loader to find all + * getResources method of the given class loader to find all * available files with that name. These files are then read and parsed to * produce a list of provider-class names. The iterator that is returned * uses the given class loader to lookup and then instantiate each element @@ -224,7 +224,7 @@ public static ServiceFinder find(Class service, ClassLoader loader) * * @param service The service's abstract service class * @param loader The class loader to be used to load provider-configuration files - * and instantiate provider classes, or null if the system + * and instantiate provider classes, or null if the system * class loader (or, failing that the bootstrap class loader) is to * be used * @param ignoreOnClassNotFound If a provider cannot be loaded by the class loader @@ -345,9 +345,9 @@ private ServiceFinder( /** * Returns discovered objects incrementally. * - * @return An Iterator that yields provider objects for the given + * @return An Iterator that yields provider objects for the given * service, in some arbitrary order. The iterator will throw a - * ServiceConfigurationError if a provider-configuration + * ServiceConfigurationError if a provider-configuration * file violates the specified format or if a provider class cannot * be found and instantiated. */ @@ -458,8 +458,8 @@ private static int parseLine(String serviceName, URL u, BufferedReader r, int lc * @param u The URL naming the configuration file to be parsed * @param returned A Set containing the names of provider classes that have already * been returned. This set will be updated to contain the names - * that will be yielded from the returned Iterator. - * @return A (possibly empty) Iterator that will yield the + * that will be yielded from the returned Iterator. + * @return A (possibly empty) Iterator that will yield the * provider-class names in the given configuration file that are * not yet members of the returned set * @throws ServiceConfigurationError If an I/O error occurs while reading from the given URL, or diff --git a/core/src/main/java/org/glassfish/tyrus/core/StrictUtf8.java b/core/src/main/java/org/glassfish/tyrus/core/StrictUtf8.java index ceeddce3..05dcf470 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/StrictUtf8.java +++ b/core/src/main/java/org/glassfish/tyrus/core/StrictUtf8.java @@ -79,13 +79,13 @@ private static char lowSurrogate(int codePoint) { } private static void updatePositions(ByteBuffer src, int sp, CharBuffer dst, int dp) { - src.position(sp - src.arrayOffset()); - dst.position(dp - dst.arrayOffset()); + ((Buffer) src).position(sp - src.arrayOffset()); + ((Buffer) dst).position(dp - dst.arrayOffset()); } private static void updatePositions(CharBuffer src, int sp, ByteBuffer dst, int dp) { - src.position(sp - src.arrayOffset()); - dst.position(dp - dst.arrayOffset()); + ((Buffer) src).position(sp - src.arrayOffset()); + ((Buffer) dst).position(dp - dst.arrayOffset()); } private static class Decoder extends CharsetDecoder { @@ -166,7 +166,7 @@ private static CoderResult malformedN(ByteBuffer src, int nb) { } private static CoderResult malformed(ByteBuffer src, int sp, CharBuffer dst, int dp, int nb) { - src.position(sp - src.arrayOffset()); + ((Buffer) src).position(sp - src.arrayOffset()); CoderResult cr = malformedN(src, nb); updatePositions(src, sp, dst, dp); return cr; @@ -174,9 +174,9 @@ private static CoderResult malformed(ByteBuffer src, int sp, CharBuffer dst, int private static CoderResult malformed(ByteBuffer src, int mark, int nb) { - src.position(mark); + ((Buffer) src).position(mark); CoderResult cr = malformedN(src, nb); - src.position(mark); + ((Buffer) src).position(mark); return cr; } @@ -186,7 +186,7 @@ private static CoderResult malformedForLength(ByteBuffer src, int sp, CharBuffer } private static CoderResult malformedForLength(ByteBuffer src, int mark, int malformedNB) { - src.position(mark); + ((Buffer) src).position(mark); return CoderResult.malformedForLength(malformedNB); } @@ -197,7 +197,7 @@ private static CoderResult xflow(ByteBuffer src, int sp, int sl, CharBuffer dst, } private static CoderResult xflow(Buffer src, int mark, int nb) { - src.position(mark); + ((Buffer) src).position(mark); return (nb == 0 || src.remaining() < nb) ? CoderResult.UNDERFLOW : CoderResult.OVERFLOW; } @@ -378,7 +378,7 @@ private static ByteBuffer getByteBuffer(ByteBuffer bb, byte[] ba, int sp) { if (bb == null) { bb = ByteBuffer.wrap(ba); } - bb.position(sp); + ((Buffer) bb).position(sp); return bb; } @@ -529,7 +529,7 @@ private static CoderResult overflow(CharBuffer src, int sp, ByteBuffer dst, int } private static CoderResult overflow(CharBuffer src, int mark) { - src.position(mark); + ((Buffer) src).position(mark); return CoderResult.OVERFLOW; } @@ -621,7 +621,7 @@ private CoderResult encodeBufferLoop(CharBuffer src, ByteBuffer dst) { } int uc = sgp.parse(c, src); if (uc < 0) { - src.position(mark); + ((Buffer) src).position(mark); return sgp.error(); } if (dst.remaining() < 4) { @@ -643,7 +643,7 @@ private CoderResult encodeBufferLoop(CharBuffer src, ByteBuffer dst) { } mark++; } - src.position(mark); + ((Buffer) src).position(mark); return CoderResult.UNDERFLOW; } diff --git a/core/src/main/java/org/glassfish/tyrus/core/TextBuffer.java b/core/src/main/java/org/glassfish/tyrus/core/TextBuffer.java index b65bc260..8e3316f0 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/TextBuffer.java +++ b/core/src/main/java/org/glassfish/tyrus/core/TextBuffer.java @@ -22,7 +22,7 @@ import org.glassfish.tyrus.core.l10n.LocalizationMessages; /** - * @author Stepan Kopriva (stepan.kopriva at oracle.com) + * @author Stepan Kopriva */ class TextBuffer { private StringBuffer buffer; diff --git a/core/src/main/java/org/glassfish/tyrus/core/TyrusEndpointWrapper.java b/core/src/main/java/org/glassfish/tyrus/core/TyrusEndpointWrapper.java index de2296fe..c08cb07d 100755 --- a/core/src/main/java/org/glassfish/tyrus/core/TyrusEndpointWrapper.java +++ b/core/src/main/java/org/glassfish/tyrus/core/TyrusEndpointWrapper.java @@ -44,22 +44,22 @@ import java.util.logging.Level; import java.util.logging.Logger; -import javax.websocket.CloseReason; -import javax.websocket.DecodeException; -import javax.websocket.Decoder; -import javax.websocket.DeploymentException; -import javax.websocket.EncodeException; -import javax.websocket.Encoder; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.Extension; -import javax.websocket.MessageHandler; -import javax.websocket.PongMessage; -import javax.websocket.RemoteEndpoint; -import javax.websocket.Session; -import javax.websocket.WebSocketContainer; -import javax.websocket.server.HandshakeRequest; -import javax.websocket.server.ServerEndpointConfig; +import jakarta.websocket.CloseReason; +import jakarta.websocket.DecodeException; +import jakarta.websocket.Decoder; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.EncodeException; +import jakarta.websocket.Encoder; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.Extension; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.PongMessage; +import jakarta.websocket.RemoteEndpoint; +import jakarta.websocket.Session; +import jakarta.websocket.WebSocketContainer; +import jakarta.websocket.server.HandshakeRequest; +import jakarta.websocket.server.ServerEndpointConfig; import org.glassfish.tyrus.core.cluster.BroadcastListener; import org.glassfish.tyrus.core.cluster.ClusterContext; @@ -549,13 +549,13 @@ public String getEndpointPath() { /** * Server-side; Get server endpoint path. *

- * In this context, server endpoint path is exactly what is present in {@link javax.websocket.server.ServerEndpoint} - * annotation or returned from {@link javax.websocket.server.ServerEndpointConfig#getPath()} method call. Context + * In this context, server endpoint path is exactly what is present in {@link jakarta.websocket.server.ServerEndpoint} + * annotation or returned from {@link jakarta.websocket.server.ServerEndpointConfig#getPath()} method call. Context * path is not included. * * @return server endpoint path. - * @see javax.websocket.server.ServerEndpoint#value() - * @see javax.websocket.server.ServerEndpointConfig#getPath() + * @see jakarta.websocket.server.ServerEndpoint#value() + * @see jakarta.websocket.server.ServerEndpointConfig#getPath() */ String getServerEndpointPath() { return serverEndpointPath; @@ -1089,7 +1089,7 @@ void onPartialMessage(TyrusWebSocket socket, ByteBuffer partialBytes, boolean la } /** - * Check {@link Throwable} produced during {@link javax.websocket.OnMessage} annotated method call. + * Check {@link Throwable} produced during {@link jakarta.websocket.OnMessage} annotated method call. * * @param throwable thrown {@link Throwable}. * @param session {@link Session} related to {@link Throwable}. @@ -1711,8 +1711,8 @@ public enum OnOpenResult { } /** - * Invoked before {@link javax.websocket.OnOpen} annotated method - * or {@link Endpoint#onOpen(javax.websocket.Session, javax.websocket.EndpointConfig)} is invoked. + * Invoked before {@link jakarta.websocket.OnOpen} annotated method + * or {@link Endpoint#onOpen(jakarta.websocket.Session, jakarta.websocket.EndpointConfig)} is invoked. *

* Default implementation always returns {@link * org.glassfish.tyrus.core.TyrusEndpointWrapper.SessionListener.OnOpenResult#SESSION_ALLOWED}. @@ -1726,8 +1726,8 @@ public OnOpenResult onOpen(final TyrusSession session) { } /** - * Invoked after {@link javax.websocket.OnClose} annotated method - * or {@link Endpoint#onClose(javax.websocket.Session, javax.websocket.CloseReason)} execution. + * Invoked after {@link jakarta.websocket.OnClose} annotated method + * or {@link Endpoint#onClose(jakarta.websocket.Session, jakarta.websocket.CloseReason)} execution. * * @param session closed session. * @param closeReason close reason. diff --git a/core/src/main/java/org/glassfish/tyrus/core/TyrusExtension.java b/core/src/main/java/org/glassfish/tyrus/core/TyrusExtension.java index 976ead16..7d847cb8 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/TyrusExtension.java +++ b/core/src/main/java/org/glassfish/tyrus/core/TyrusExtension.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -22,12 +22,12 @@ import java.util.List; import java.util.logging.Logger; -import javax.websocket.Extension; +import jakarta.websocket.Extension; /** * WebSocket {@link Extension} implementation. * - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public class TyrusExtension implements Extension, Serializable { diff --git a/core/src/main/java/org/glassfish/tyrus/core/TyrusFuture.java b/core/src/main/java/org/glassfish/tyrus/core/TyrusFuture.java index ec05b724..483b6f78 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/TyrusFuture.java +++ b/core/src/main/java/org/glassfish/tyrus/core/TyrusFuture.java @@ -25,7 +25,7 @@ /** * Simple {@link Future} implementation. * - * @author Stepan Kopriva (stepan.kopriva at oracle.com) + * @author Stepan Kopriva */ public class TyrusFuture implements Future { diff --git a/core/src/main/java/org/glassfish/tyrus/core/TyrusRemoteEndpoint.java b/core/src/main/java/org/glassfish/tyrus/core/TyrusRemoteEndpoint.java index 1f0182ba..a556510d 100755 --- a/core/src/main/java/org/glassfish/tyrus/core/TyrusRemoteEndpoint.java +++ b/core/src/main/java/org/glassfish/tyrus/core/TyrusRemoteEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -29,10 +29,10 @@ import java.util.logging.Level; import java.util.logging.Logger; -import javax.websocket.CloseReason; -import javax.websocket.EncodeException; -import javax.websocket.SendHandler; -import javax.websocket.SendResult; +import jakarta.websocket.CloseReason; +import jakarta.websocket.EncodeException; +import jakarta.websocket.SendHandler; +import jakarta.websocket.SendResult; import org.glassfish.tyrus.core.l10n.LocalizationMessages; import org.glassfish.tyrus.spi.WriterInfo; @@ -42,14 +42,14 @@ import static org.glassfish.tyrus.core.Utils.checkNotNull; /** - * Wraps the {@link javax.websocket.RemoteEndpoint} and represents the other side of the websocket connection. + * Wraps the {@link jakarta.websocket.RemoteEndpoint} and represents the other side of the websocket connection. * - * @author Danny Coward (danny.coward at oracle.com) - * @author Martin Matula (martin.matula at oracle.com) - * @author Stepan Kopriva (stepan.kopriva at oracle.com) - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Danny Coward + * @author Martin Matula + * @author Stepan Kopriva + * @author Pavel Bucek */ -public abstract class TyrusRemoteEndpoint implements javax.websocket.RemoteEndpoint { +public abstract class TyrusRemoteEndpoint implements jakarta.websocket.RemoteEndpoint { final TyrusSession session; final TyrusWebSocket webSocket; @@ -64,7 +64,7 @@ private TyrusRemoteEndpoint(TyrusSession session, TyrusWebSocket socket, TyrusEn this.session = session; } - static class Basic extends TyrusRemoteEndpoint implements javax.websocket.RemoteEndpoint.Basic { + static class Basic extends TyrusRemoteEndpoint implements jakarta.websocket.RemoteEndpoint.Basic { Basic(TyrusSession session, TyrusWebSocket socket, TyrusEndpointWrapper endpointWrapper) { super(session, socket, endpointWrapper); @@ -189,7 +189,7 @@ public Writer getSendWriter() throws IOException { } } - static class Async extends TyrusRemoteEndpoint implements javax.websocket.RemoteEndpoint.Async { + static class Async extends TyrusRemoteEndpoint implements jakarta.websocket.RemoteEndpoint.Async { private long sendTimeout; Async(TyrusSession session, TyrusWebSocket socket, TyrusEndpointWrapper endpointWrapper) { diff --git a/core/src/main/java/org/glassfish/tyrus/core/TyrusServerEndpointConfig.java b/core/src/main/java/org/glassfish/tyrus/core/TyrusServerEndpointConfig.java index 547862ce..ec828607 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/TyrusServerEndpointConfig.java +++ b/core/src/main/java/org/glassfish/tyrus/core/TyrusServerEndpointConfig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -20,18 +20,18 @@ import java.util.Collections; import java.util.List; -import javax.websocket.Decoder; -import javax.websocket.Encoder; -import javax.websocket.Extension; -import javax.websocket.server.ServerEndpointConfig; +import jakarta.websocket.Decoder; +import jakarta.websocket.Encoder; +import jakarta.websocket.Extension; +import jakarta.websocket.server.ServerEndpointConfig; /** - * Configuration {@link javax.websocket.server.ServerEndpointConfig} enhanced + * Configuration {@link jakarta.websocket.server.ServerEndpointConfig} enhanced * to offer tyrus specific attributes like maxSessions. * Declarative way to define maxSessions is also available using * annotation {@link MaxSessions}. * - * @author Ondrej Kosatka (ondrej.kosatka at oracle.com) + * @author Ondrej Kosatka * @see MaxSessions */ public interface TyrusServerEndpointConfig extends ServerEndpointConfig { diff --git a/core/src/main/java/org/glassfish/tyrus/core/TyrusServerEndpointConfigurator.java b/core/src/main/java/org/glassfish/tyrus/core/TyrusServerEndpointConfigurator.java index f89c1daf..dbe69d7d 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/TyrusServerEndpointConfigurator.java +++ b/core/src/main/java/org/glassfish/tyrus/core/TyrusServerEndpointConfigurator.java @@ -22,10 +22,10 @@ import java.util.ArrayList; import java.util.List; -import javax.websocket.Extension; -import javax.websocket.HandshakeResponse; -import javax.websocket.server.HandshakeRequest; -import javax.websocket.server.ServerEndpointConfig; +import jakarta.websocket.Extension; +import jakarta.websocket.HandshakeResponse; +import jakarta.websocket.server.HandshakeRequest; +import jakarta.websocket.server.ServerEndpointConfig; import org.glassfish.tyrus.core.collection.LazyValue; import org.glassfish.tyrus.core.collection.Values; diff --git a/core/src/main/java/org/glassfish/tyrus/core/TyrusSession.java b/core/src/main/java/org/glassfish/tyrus/core/TyrusSession.java index a7e2df5e..0d2c75e7 100755 --- a/core/src/main/java/org/glassfish/tyrus/core/TyrusSession.java +++ b/core/src/main/java/org/glassfish/tyrus/core/TyrusSession.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -38,14 +38,14 @@ import java.util.logging.Level; import java.util.logging.Logger; -import javax.websocket.CloseReason; -import javax.websocket.DecodeException; -import javax.websocket.Decoder; -import javax.websocket.Extension; -import javax.websocket.MessageHandler; -import javax.websocket.PongMessage; -import javax.websocket.Session; -import javax.websocket.WebSocketContainer; +import jakarta.websocket.CloseReason; +import jakarta.websocket.DecodeException; +import jakarta.websocket.Decoder; +import jakarta.websocket.Extension; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.PongMessage; +import jakarta.websocket.Session; +import jakarta.websocket.WebSocketContainer; import org.glassfish.tyrus.core.cluster.ClusterContext; import org.glassfish.tyrus.core.cluster.DistributedSession; @@ -57,10 +57,10 @@ /** * Implementation of the {@link Session}. * - * @author Danny Coward (danny.coward at oracle.com) - * @author Stepan Kopriva (stepan.kopriva at oracle.com) - * @author Martin Matula (martin.matula at oracle.com) - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Danny Coward + * @author Stepan Kopriva + * @author Martin Matula + * @author Pavel Bucek */ public class TyrusSession implements DistributedSession { @@ -180,13 +180,13 @@ public String getNegotiatedSubprotocol() { } @Override - public javax.websocket.RemoteEndpoint.Async getAsyncRemote() { + public jakarta.websocket.RemoteEndpoint.Async getAsyncRemote() { checkConnectionState(State.CLOSED); return asyncRemote; } @Override - public javax.websocket.RemoteEndpoint.Basic getBasicRemote() { + public jakarta.websocket.RemoteEndpoint.Basic getBasicRemote() { checkConnectionState(State.CLOSED); return basicRemote; } @@ -310,8 +310,8 @@ public WebSocketContainer getContainer() { /** * {@inheritDoc} * - * @deprecated please use {@link #addMessageHandler(Class, javax.websocket.MessageHandler.Whole)} or {@link - * #addMessageHandler(Class, javax.websocket.MessageHandler.Partial)} + * @deprecated please use {@link #addMessageHandler(Class, jakarta.websocket.MessageHandler.Whole)} or {@link + * #addMessageHandler(Class, jakarta.websocket.MessageHandler.Partial)} */ @Override public void addMessageHandler(MessageHandler handler) { @@ -330,7 +330,7 @@ public void addMessageHandler(MessageHandler handler) { * message types please see {@link MessageHandler.Whole} and {@link MessageHandler.Partial}. * Adding more than one of any one type will result in a runtime exception. *

- * See {@link javax.websocket.Endpoint} for a usage example. + * See {@link jakarta.websocket.Endpoint} for a usage example. * * @param clazz type of the message processed by message handler to be registered. * @param handler the MessageHandler to be added. @@ -354,7 +354,7 @@ public void addMessageHandler(Class clazz, MessageHandler.Whole handle * message types please see {@link MessageHandler.Whole} and {@link MessageHandler.Partial}. * Adding more than one of any one type will result in a runtime exception. *

- * See {@link javax.websocket.Endpoint} for a usage example. + * See {@link jakarta.websocket.Endpoint} for a usage example. * * @param clazz type of the message processed by message handler to be registered. * @param handler the MessageHandler to be added. @@ -482,9 +482,8 @@ public void setHeartbeatInterval(long heartbeatInterval) { } void restartIdleTimeoutExecutor() { - cancelIdleTimeoutExecutor(); - synchronized (idleTimeoutLock) { + cancelIdleTimeoutExecutor(); idleTimeoutFuture = service.schedule(new IdleTimeoutCommand(), this.getMaxIdleTimeout(), TimeUnit.MILLISECONDS); } diff --git a/core/src/main/java/org/glassfish/tyrus/core/TyrusUpgradeResponse.java b/core/src/main/java/org/glassfish/tyrus/core/TyrusUpgradeResponse.java index 5222361c..90dd8880 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/TyrusUpgradeResponse.java +++ b/core/src/main/java/org/glassfish/tyrus/core/TyrusUpgradeResponse.java @@ -26,7 +26,7 @@ /** * HTTP response representation. * - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public class TyrusUpgradeResponse extends UpgradeResponse { diff --git a/core/src/main/java/org/glassfish/tyrus/core/TyrusWebSocket.java b/core/src/main/java/org/glassfish/tyrus/core/TyrusWebSocket.java index 65e97258..5737ce60 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/TyrusWebSocket.java +++ b/core/src/main/java/org/glassfish/tyrus/core/TyrusWebSocket.java @@ -25,9 +25,9 @@ import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; -import javax.websocket.CloseReason; -import javax.websocket.Extension; -import javax.websocket.SendHandler; +import jakarta.websocket.CloseReason; +import jakarta.websocket.Extension; +import jakarta.websocket.SendHandler; import org.glassfish.tyrus.core.frame.BinaryFrame; import org.glassfish.tyrus.core.frame.CloseFrame; @@ -246,7 +246,7 @@ public void close(int code, String reason) { } /** - * Closes this {@link TyrusWebSocket} using the {@link javax.websocket.CloseReason}. + * Closes this {@link TyrusWebSocket} using the {@link jakarta.websocket.CloseReason}. * * @param closeReason the close reason. */ @@ -282,7 +282,7 @@ public Future sendBinary(byte[] data, WriterInfo writerInfo) { * Send a binary frame to the remote endpoint. * * @param data data to be sent. - * @param handler {@link SendHandler#onResult(javax.websocket.SendResult)} will be called when sending is complete. + * @param handler {@link SendHandler#onResult(jakarta.websocket.SendResult)} will be called when sending is complete. */ @Deprecated public void sendBinary(byte[] data, SendHandler handler) { @@ -295,7 +295,7 @@ public void sendBinary(byte[] data, SendHandler handler) { * * @param data data to be sent. * @param writerInfo information about the outbound message. - * @param handler {@link SendHandler#onResult(javax.websocket.SendResult)} will be called when sending is complete. + * @param handler {@link SendHandler#onResult(jakarta.websocket.SendResult)} will be called when sending is complete. */ public void sendBinary(byte[] data, SendHandler handler, WriterInfo writerInfo) { checkConnectedState(); @@ -330,7 +330,7 @@ public Future sendText(String data, WriterInfo writerInfo) { * Send a text frame to the remote endpoint. * * @param data data to be sent. - * @param handler {@link SendHandler#onResult(javax.websocket.SendResult)} will be called when sending is complete. + * @param handler {@link SendHandler#onResult(jakarta.websocket.SendResult)} will be called when sending is complete. */ @Deprecated public void sendText(String data, SendHandler handler) { @@ -343,7 +343,7 @@ public void sendText(String data, SendHandler handler) { * * @param data data to be sent. * @param writerInfo information about the outbound message. - * @param handler {@link SendHandler#onResult(javax.websocket.SendResult)} will be called when sending is complete. + * @param handler {@link SendHandler#onResult(jakarta.websocket.SendResult)} will be called when sending is complete. */ public void sendText(String data, SendHandler handler, WriterInfo writerInfo) { checkConnectedState(); diff --git a/core/src/main/java/org/glassfish/tyrus/core/TyrusWebSocketEngine.java b/core/src/main/java/org/glassfish/tyrus/core/TyrusWebSocketEngine.java index 7533735b..4b3a49a3 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/TyrusWebSocketEngine.java +++ b/core/src/main/java/org/glassfish/tyrus/core/TyrusWebSocketEngine.java @@ -16,8 +16,8 @@ package org.glassfish.tyrus.core; +import java.nio.Buffer; import java.nio.ByteBuffer; -import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; @@ -29,13 +29,13 @@ import java.util.logging.Level; import java.util.logging.Logger; -import javax.websocket.CloseReason; -import javax.websocket.DeploymentException; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.Extension; -import javax.websocket.WebSocketContainer; -import javax.websocket.server.ServerEndpointConfig; +import jakarta.websocket.CloseReason; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.Extension; +import jakarta.websocket.WebSocketContainer; +import jakarta.websocket.server.ServerEndpointConfig; import org.glassfish.tyrus.core.cluster.ClusterContext; import org.glassfish.tyrus.core.extension.ExtendedExtension; @@ -58,7 +58,7 @@ * {@link WebSocketEngine} implementation, which handles server-side handshake, validation and data processing. * * @author Alexey Stashok - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek * @see org.glassfish.tyrus.core.TyrusWebSocket * @see org.glassfish.tyrus.core.TyrusEndpointWrapper */ @@ -507,7 +507,7 @@ public void handle(ByteBuffer data) { ? ((newSize / BUFFER_STEP_SIZE) + 1) * BUFFER_STEP_SIZE : newSize; final ByteBuffer result = ByteBuffer.allocate(roundedSize > incomingBufferSize ? newSize : roundedSize); - result.flip(); + ((Buffer) result).flip(); data = Utils.appendBuffers(result, data, incomingBufferSize, BUFFER_STEP_SIZE); } } @@ -628,7 +628,7 @@ public void register(ServerEndpointConfig serverConfig, String contextPath) thro EndpointEventListenerWrapper endpointEventListenerWrapper = new EndpointEventListenerWrapper(); if (isEndpointClass) { - // we are pretty sure that endpoint class is javax.websocket.Endpoint descendant. + // we are pretty sure that endpoint class is jakarta.websocket.Endpoint descendant. //noinspection unchecked endpointWrapper = new TyrusEndpointWrapper((Class) endpointClass, serverConfig, componentProviderService, diff --git a/core/src/main/java/org/glassfish/tyrus/core/Utf8DecodingException.java b/core/src/main/java/org/glassfish/tyrus/core/Utf8DecodingException.java index 1b2da493..bbf00345 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/Utf8DecodingException.java +++ b/core/src/main/java/org/glassfish/tyrus/core/Utf8DecodingException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2020 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,7 +16,7 @@ package org.glassfish.tyrus.core; -import javax.websocket.CloseReason; +import jakarta.websocket.CloseReason; import org.glassfish.tyrus.core.l10n.LocalizationMessages; diff --git a/core/src/main/java/org/glassfish/tyrus/core/Utils.java b/core/src/main/java/org/glassfish/tyrus/core/Utils.java index b066c10e..f3bf43fb 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/Utils.java +++ b/core/src/main/java/org/glassfish/tyrus/core/Utils.java @@ -17,6 +17,7 @@ package org.glassfish.tyrus.core; import java.net.URI; +import java.nio.Buffer; import java.nio.ByteBuffer; import java.text.ParseException; import java.text.SimpleDateFormat; @@ -37,7 +38,7 @@ /** * Utility methods shared among Tyrus modules. * - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public class Utils { @@ -303,18 +304,18 @@ public static ByteBuffer appendBuffers(ByteBuffer buffer, ByteBuffer buffer1, in // buffer1 will be appended to buffer if (len < (capacity - limit)) { - buffer.mark(); - buffer.position(limit); - buffer.limit(capacity); + ((Buffer) buffer).mark(); + ((Buffer) buffer).position(limit); + ((Buffer) buffer).limit(capacity); buffer.put(buffer1); - buffer.limit(limit + len); - buffer.reset(); + ((Buffer) buffer).limit(limit + len); + ((Buffer) buffer).reset(); return buffer; // Remaining data is moved to left. Then new data is appended } else if (remaining + len < capacity) { buffer.compact(); buffer.put(buffer1); - buffer.flip(); + ((Buffer) buffer).flip(); return buffer; // create new buffer } else { @@ -328,7 +329,7 @@ public static ByteBuffer appendBuffers(ByteBuffer buffer, ByteBuffer buffer1, in final ByteBuffer result = ByteBuffer.allocate(roundedSize > incomingBufferSize ? newSize : roundedSize); result.put(buffer); result.put(buffer1); - result.flip(); + ((Buffer) result).flip(); return result; } } diff --git a/core/src/main/java/org/glassfish/tyrus/core/WebSocketException.java b/core/src/main/java/org/glassfish/tyrus/core/WebSocketException.java index 17ca35b6..445cb9c8 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/WebSocketException.java +++ b/core/src/main/java/org/glassfish/tyrus/core/WebSocketException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2020 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,7 +16,7 @@ package org.glassfish.tyrus.core; -import javax.websocket.CloseReason; +import jakarta.websocket.CloseReason; /** * WebSocketException can be thrown during runtime (after handshake). diff --git a/core/src/main/java/org/glassfish/tyrus/core/WriterToAsyncTextAdapter.java b/core/src/main/java/org/glassfish/tyrus/core/WriterToAsyncTextAdapter.java index b006fa00..5835a801 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/WriterToAsyncTextAdapter.java +++ b/core/src/main/java/org/glassfish/tyrus/core/WriterToAsyncTextAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -24,7 +24,7 @@ /** * Simple Writer that writes its data to an async sink. * - * @author Danny Coward (danny.coward at oracle.com) + * @author Danny Coward */ class WriterToAsyncTextAdapter extends Writer { private final TyrusWebSocket socket; diff --git a/core/src/main/java/org/glassfish/tyrus/core/cluster/BroadcastListener.java b/core/src/main/java/org/glassfish/tyrus/core/cluster/BroadcastListener.java index e78416df..937c8bd1 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/cluster/BroadcastListener.java +++ b/core/src/main/java/org/glassfish/tyrus/core/cluster/BroadcastListener.java @@ -19,7 +19,7 @@ /** * Broadcast listener. * - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public interface BroadcastListener { diff --git a/core/src/main/java/org/glassfish/tyrus/core/cluster/ClusterContext.java b/core/src/main/java/org/glassfish/tyrus/core/cluster/ClusterContext.java index 98c8afed..2beedb37 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/cluster/ClusterContext.java +++ b/core/src/main/java/org/glassfish/tyrus/core/cluster/ClusterContext.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -20,15 +20,15 @@ import java.util.Set; import java.util.concurrent.Future; -import javax.websocket.CloseReason; -import javax.websocket.SendHandler; +import jakarta.websocket.CloseReason; +import jakarta.websocket.SendHandler; /** * Cluster related context. *

* There is exactly one instance per cluster node and all communication is realized using this instance. * - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public abstract class ClusterContext { @@ -109,24 +109,24 @@ public abstract class ClusterContext { public abstract Future sendPong(String sessionId, byte[] data); /** - * Send text message with {@link javax.websocket.SendHandler}. + * Send text message with {@link jakarta.websocket.SendHandler}. * * @param sessionId remote session id. * @param text text to be sent. * @param sendHandler sendhandler instance on which - * {@link javax.websocket.SendHandler#onResult(javax.websocket.SendResult)} will be invoked. - * @see javax.websocket.SendHandler + * {@link jakarta.websocket.SendHandler#onResult(jakarta.websocket.SendResult)} will be invoked. + * @see jakarta.websocket.SendHandler */ public abstract void sendText(String sessionId, String text, SendHandler sendHandler); /** - * Send binary message with {@link javax.websocket.SendHandler}. + * Send binary message with {@link jakarta.websocket.SendHandler}. * * @param sessionId remote session id. * @param data data to be sent. * @param sendHandler sendhandler instance on which - * {@link javax.websocket.SendHandler#onResult(javax.websocket.SendResult)} will be invoked. - * @see javax.websocket.SendHandler + * {@link jakarta.websocket.SendHandler#onResult(jakarta.websocket.SendResult)} will be invoked. + * @see jakarta.websocket.SendHandler */ public abstract void sendBinary(String sessionId, byte[] data, SendHandler sendHandler); @@ -152,7 +152,7 @@ public abstract class ClusterContext { * @param sessionId remote session id. * @param endpointPath endpoint path identifying sessions alignment to the endpoint. * @return {@code true} when session is opened, {@code false} otherwise. - * @see javax.websocket.Session#isOpen() + * @see jakarta.websocket.Session#isOpen() */ public abstract boolean isSessionOpen(String sessionId, String endpointPath); @@ -168,7 +168,7 @@ public abstract class ClusterContext { public abstract Future close(String sessionId); /** - * Close remote session with custom {@link javax.websocket.CloseReason}. + * Close remote session with custom {@link jakarta.websocket.CloseReason}. * * @param sessionId remote session id. * @param closeReason custom close reason. diff --git a/core/src/main/java/org/glassfish/tyrus/core/cluster/DistributedSession.java b/core/src/main/java/org/glassfish/tyrus/core/cluster/DistributedSession.java index 1adc82c4..e4234dbf 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/cluster/DistributedSession.java +++ b/core/src/main/java/org/glassfish/tyrus/core/cluster/DistributedSession.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -19,14 +19,14 @@ import java.io.Serializable; import java.util.Map; -import javax.websocket.Session; +import jakarta.websocket.Session; import org.glassfish.tyrus.core.TyrusSession; /** * Extended {@link Session} which adds distributed properties. * - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public interface DistributedSession extends Session { diff --git a/core/src/main/java/org/glassfish/tyrus/core/cluster/RemoteSession.java b/core/src/main/java/org/glassfish/tyrus/core/cluster/RemoteSession.java index c977bff4..57a43176 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/cluster/RemoteSession.java +++ b/core/src/main/java/org/glassfish/tyrus/core/cluster/RemoteSession.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -33,15 +33,15 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; -import javax.websocket.CloseReason; -import javax.websocket.EncodeException; -import javax.websocket.Extension; -import javax.websocket.MessageHandler; -import javax.websocket.RemoteEndpoint; -import javax.websocket.SendHandler; -import javax.websocket.SendResult; -import javax.websocket.Session; -import javax.websocket.WebSocketContainer; +import jakarta.websocket.CloseReason; +import jakarta.websocket.EncodeException; +import jakarta.websocket.Extension; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.RemoteEndpoint; +import jakarta.websocket.SendHandler; +import jakarta.websocket.SendResult; +import jakarta.websocket.Session; +import jakarta.websocket.WebSocketContainer; import org.glassfish.tyrus.core.TyrusEndpointWrapper; import org.glassfish.tyrus.core.Utils; @@ -51,7 +51,7 @@ /** * Remote session represents session originating from another node. * - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public class RemoteSession implements Session, DistributedSession { @@ -71,7 +71,7 @@ public static enum DistributedMapKey implements Serializable { *

* Value must be {@link String}. * - * @see javax.websocket.Session#getNegotiatedSubprotocol() + * @see jakarta.websocket.Session#getNegotiatedSubprotocol() */ NEGOTIATED_SUBPROTOCOL("negotiatedSubprotocol"), /** @@ -79,7 +79,7 @@ public static enum DistributedMapKey implements Serializable { *

* Value must be {@link List}<{@link Extension}>. * - * @see javax.websocket.Session#getNegotiatedExtensions() + * @see jakarta.websocket.Session#getNegotiatedExtensions() */ NEGOTIATED_EXTENSIONS("negotiatedExtensions"), /** @@ -87,7 +87,7 @@ public static enum DistributedMapKey implements Serializable { *

* Value must be {@code boolean} or {@link java.lang.Boolean}. * - * @see javax.websocket.Session#isSecure() + * @see jakarta.websocket.Session#isSecure() */ SECURE("secure"), /** @@ -95,7 +95,7 @@ public static enum DistributedMapKey implements Serializable { *

* Value must be {@code long} or {@link java.lang.Long}. * - * @see javax.websocket.Session#getMaxIdleTimeout() + * @see jakarta.websocket.Session#getMaxIdleTimeout() */ MAX_IDLE_TIMEOUT("maxIdleTimeout"), /** @@ -103,7 +103,7 @@ public static enum DistributedMapKey implements Serializable { *

* Value must be {@code int} or {@link java.lang.Integer}. * - * @see javax.websocket.Session#getMaxBinaryMessageBufferSize() + * @see jakarta.websocket.Session#getMaxBinaryMessageBufferSize() */ MAX_BINARY_MESSAGE_BUFFER_SIZE("maxBinaryBufferSize"), /** @@ -111,7 +111,7 @@ public static enum DistributedMapKey implements Serializable { *

* Value must be {@code int} or {@link java.lang.Integer}. * - * @see javax.websocket.Session#getMaxTextMessageBufferSize() + * @see jakarta.websocket.Session#getMaxTextMessageBufferSize() */ MAX_TEXT_MESSAGE_BUFFER_SIZE("maxTextBufferSize"), /** @@ -119,7 +119,7 @@ public static enum DistributedMapKey implements Serializable { *

* Value must be {@link URI}. * - * @see javax.websocket.Session#getRequestURI() + * @see jakarta.websocket.Session#getRequestURI() */ REQUEST_URI("requestURI"), /** @@ -127,7 +127,7 @@ public static enum DistributedMapKey implements Serializable { *

* Value must be {@link java.util.Map}<{@link String}, {@link java.util.List}<{@link String}>>. * - * @see javax.websocket.Session#getRequestParameterMap() + * @see jakarta.websocket.Session#getRequestParameterMap() */ REQUEST_PARAMETER_MAP("requestParameterMap"), /** @@ -135,7 +135,7 @@ public static enum DistributedMapKey implements Serializable { *

* Value must be {@link String}. * - * @see javax.websocket.Session#getQueryString() + * @see jakarta.websocket.Session#getQueryString() */ QUERY_STRING("queryString"), /** @@ -143,7 +143,7 @@ public static enum DistributedMapKey implements Serializable { *

* Value must be {@link java.util.Map}<{@link String}, {@link String}>. * - * @see javax.websocket.Session#getPathParameters() + * @see jakarta.websocket.Session#getPathParameters() */ PATH_PARAMETERS("pathParameters"), /** @@ -151,7 +151,7 @@ public static enum DistributedMapKey implements Serializable { *

* Value must be {@link java.security.Principal}. * - * @see javax.websocket.Session#getUserPrincipal() + * @see jakarta.websocket.Session#getUserPrincipal() */ USER_PRINCIPAL("userPrincipal"), /** diff --git a/core/src/main/java/org/glassfish/tyrus/core/cluster/SessionEventListener.java b/core/src/main/java/org/glassfish/tyrus/core/cluster/SessionEventListener.java index 2bcb2cbb..e76e7400 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/cluster/SessionEventListener.java +++ b/core/src/main/java/org/glassfish/tyrus/core/cluster/SessionEventListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -19,13 +19,13 @@ import java.io.IOException; import java.nio.ByteBuffer; -import javax.websocket.CloseReason; -import javax.websocket.Session; +import jakarta.websocket.CloseReason; +import jakarta.websocket.Session; /** * Session event listener. * - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public class SessionEventListener { diff --git a/core/src/main/java/org/glassfish/tyrus/core/cluster/SessionListener.java b/core/src/main/java/org/glassfish/tyrus/core/cluster/SessionListener.java index 32dc0082..cd3a51e8 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/cluster/SessionListener.java +++ b/core/src/main/java/org/glassfish/tyrus/core/cluster/SessionListener.java @@ -21,7 +21,7 @@ *

* Allows to keep track of opened/closed sessions. * - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public interface SessionListener { diff --git a/core/src/main/java/org/glassfish/tyrus/core/coder/CoderAdapter.java b/core/src/main/java/org/glassfish/tyrus/core/coder/CoderAdapter.java index 8f67635a..8efe493e 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/coder/CoderAdapter.java +++ b/core/src/main/java/org/glassfish/tyrus/core/coder/CoderAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,13 +16,13 @@ package org.glassfish.tyrus.core.coder; -import javax.websocket.EndpointConfig; +import jakarta.websocket.EndpointConfig; /** - * Adapter for {@link javax.websocket.Encoder} and {@link javax.websocket.Decoder} which implements lifecycle + * Adapter for {@link jakarta.websocket.Encoder} and {@link jakarta.websocket.Decoder} which implements lifecycle * methods. * - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public abstract class CoderAdapter { diff --git a/core/src/main/java/org/glassfish/tyrus/core/coder/CoderWrapper.java b/core/src/main/java/org/glassfish/tyrus/core/coder/CoderWrapper.java index c142d155..f43f6f72 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/coder/CoderWrapper.java +++ b/core/src/main/java/org/glassfish/tyrus/core/coder/CoderWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,15 +16,15 @@ package org.glassfish.tyrus.core.coder; -import javax.websocket.Decoder; -import javax.websocket.Encoder; +import jakarta.websocket.Decoder; +import jakarta.websocket.Encoder; /** * Wrapper of coders storing the coder coder class (and optionally coder instance), return type of the encode / decode * method and coder class. * - * @author Stepan Kopriva (stepan.kopriva at oracle.com) - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Stepan Kopriva + * @author Pavel Bucek */ public class CoderWrapper extends CoderAdapter implements Decoder, Encoder { diff --git a/core/src/main/java/org/glassfish/tyrus/core/coder/InputStreamDecoder.java b/core/src/main/java/org/glassfish/tyrus/core/coder/InputStreamDecoder.java index 100d170e..990117dc 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/coder/InputStreamDecoder.java +++ b/core/src/main/java/org/glassfish/tyrus/core/coder/InputStreamDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -20,13 +20,13 @@ import java.io.InputStream; import java.nio.ByteBuffer; -import javax.websocket.DecodeException; -import javax.websocket.Decoder; +import jakarta.websocket.DecodeException; +import jakarta.websocket.Decoder; /** * Built in {@link Decoder} for {@link java.io.InputStream}. * - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public class InputStreamDecoder extends CoderAdapter implements Decoder.Binary { @Override diff --git a/core/src/main/java/org/glassfish/tyrus/core/coder/NoOpByteArrayCoder.java b/core/src/main/java/org/glassfish/tyrus/core/coder/NoOpByteArrayCoder.java index 2c98f817..63439113 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/coder/NoOpByteArrayCoder.java +++ b/core/src/main/java/org/glassfish/tyrus/core/coder/NoOpByteArrayCoder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -18,15 +18,15 @@ import java.nio.ByteBuffer; -import javax.websocket.DecodeException; -import javax.websocket.Decoder; -import javax.websocket.EncodeException; -import javax.websocket.Encoder; +import jakarta.websocket.DecodeException; +import jakarta.websocket.Decoder; +import jakarta.websocket.EncodeException; +import jakarta.websocket.Encoder; /** * {@link Encoder} and {@link Decoder} implementation for byte array. * - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public class NoOpByteArrayCoder extends CoderAdapter implements Decoder.Binary, Encoder.Binary { @Override diff --git a/core/src/main/java/org/glassfish/tyrus/core/coder/NoOpByteBufferCoder.java b/core/src/main/java/org/glassfish/tyrus/core/coder/NoOpByteBufferCoder.java index 67f2fc82..8c6861bc 100755 --- a/core/src/main/java/org/glassfish/tyrus/core/coder/NoOpByteBufferCoder.java +++ b/core/src/main/java/org/glassfish/tyrus/core/coder/NoOpByteBufferCoder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -18,15 +18,15 @@ import java.nio.ByteBuffer; -import javax.websocket.DecodeException; -import javax.websocket.Decoder; -import javax.websocket.EncodeException; -import javax.websocket.Encoder; +import jakarta.websocket.DecodeException; +import jakarta.websocket.Decoder; +import jakarta.websocket.EncodeException; +import jakarta.websocket.Encoder; /** * {@link Encoder} and {@link Decoder} implementation for {@link ByteBuffer}. * - * @author Stepan Kopriva (stepan.kopriva at oracle.com) + * @author Stepan Kopriva */ public class NoOpByteBufferCoder extends CoderAdapter implements Decoder.Binary, Encoder.Binary { diff --git a/core/src/main/java/org/glassfish/tyrus/core/coder/NoOpTextCoder.java b/core/src/main/java/org/glassfish/tyrus/core/coder/NoOpTextCoder.java index f17e843e..954914e8 100755 --- a/core/src/main/java/org/glassfish/tyrus/core/coder/NoOpTextCoder.java +++ b/core/src/main/java/org/glassfish/tyrus/core/coder/NoOpTextCoder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,13 +16,13 @@ package org.glassfish.tyrus.core.coder; -import javax.websocket.DecodeException; -import javax.websocket.Decoder; -import javax.websocket.EncodeException; -import javax.websocket.Encoder; +import jakarta.websocket.DecodeException; +import jakarta.websocket.Decoder; +import jakarta.websocket.EncodeException; +import jakarta.websocket.Encoder; /** - * @author Stepan Kopriva (stepan.kopriva at oracle.com) + * @author Stepan Kopriva */ public class NoOpTextCoder extends CoderAdapter implements Decoder.Text, Encoder.Text { @Override diff --git a/core/src/main/java/org/glassfish/tyrus/core/coder/PrimitiveDecoders.java b/core/src/main/java/org/glassfish/tyrus/core/coder/PrimitiveDecoders.java index 01696afa..9a3b4e0a 100755 --- a/core/src/main/java/org/glassfish/tyrus/core/coder/PrimitiveDecoders.java +++ b/core/src/main/java/org/glassfish/tyrus/core/coder/PrimitiveDecoders.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -24,17 +24,17 @@ import java.util.logging.Level; import java.util.logging.Logger; -import javax.websocket.DecodeException; -import javax.websocket.Decoder; +import jakarta.websocket.DecodeException; +import jakarta.websocket.Decoder; import org.glassfish.tyrus.core.ReflectionHelper; /** * Collection of decoders for all primitive types. * - * @author Martin Matula (martin.matula at oracle.com) - * @author Danny Coward (danny.coward at oracle.com) - * @author Stepan Kopriva (stepan.kopriva at oracle.com) + * @author Martin Matula + * @author Danny Coward + * @author Stepan Kopriva */ public abstract class PrimitiveDecoders extends CoderAdapter implements Decoder.Text { public static final List> ALL; diff --git a/core/src/main/java/org/glassfish/tyrus/core/coder/ReaderDecoder.java b/core/src/main/java/org/glassfish/tyrus/core/coder/ReaderDecoder.java index 98e2f14f..4ab3faa4 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/coder/ReaderDecoder.java +++ b/core/src/main/java/org/glassfish/tyrus/core/coder/ReaderDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -19,13 +19,13 @@ import java.io.Reader; import java.io.StringReader; -import javax.websocket.DecodeException; -import javax.websocket.Decoder; +import jakarta.websocket.DecodeException; +import jakarta.websocket.Decoder; /** * Built in {@link Decoder} for {@link Reader}. * - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public class ReaderDecoder extends CoderAdapter implements Decoder.Text { diff --git a/core/src/main/java/org/glassfish/tyrus/core/coder/ToStringEncoder.java b/core/src/main/java/org/glassfish/tyrus/core/coder/ToStringEncoder.java index 6eec63db..40ec1173 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/coder/ToStringEncoder.java +++ b/core/src/main/java/org/glassfish/tyrus/core/coder/ToStringEncoder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,13 +16,13 @@ package org.glassfish.tyrus.core.coder; -import javax.websocket.EncodeException; -import javax.websocket.Encoder; +import jakarta.websocket.EncodeException; +import jakarta.websocket.Encoder; /** * Fall-back encoder - encoders any object to string using {@link Object#toString()} method. * - * @author Martin Matula (martin.matula at oracle.com) + * @author Martin Matula */ public class ToStringEncoder extends CoderAdapter implements Encoder.Text { @Override diff --git a/core/src/main/java/org/glassfish/tyrus/core/extension/ExtendedExtension.java b/core/src/main/java/org/glassfish/tyrus/core/extension/ExtendedExtension.java index 7af5d8fe..15ad316d 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/extension/ExtendedExtension.java +++ b/core/src/main/java/org/glassfish/tyrus/core/extension/ExtendedExtension.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -19,7 +19,7 @@ import java.util.List; import java.util.Map; -import javax.websocket.Extension; +import jakarta.websocket.Extension; import org.glassfish.tyrus.core.frame.Frame; @@ -50,7 +50,7 @@ * *

* Any exception thrown from processIncoming or processOutgoing will be logged. Rest of extension chain will be invoked - * without any modifications done in "faulty" extension. {@link javax.websocket.OnError} won't be triggered. (this + * without any modifications done in "faulty" extension. {@link jakarta.websocket.OnError} won't be triggered. (this * might * change). *

TODO:\
@@ -63,7 +63,7 @@
  * - negotiation exception handling (onExtensionNegotiation)
  * 
* - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public interface ExtendedExtension extends Extension { diff --git a/core/src/main/java/org/glassfish/tyrus/core/frame/CloseFrame.java b/core/src/main/java/org/glassfish/tyrus/core/frame/CloseFrame.java index 64a0f03d..ab51a718 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/frame/CloseFrame.java +++ b/core/src/main/java/org/glassfish/tyrus/core/frame/CloseFrame.java @@ -16,13 +16,14 @@ package org.glassfish.tyrus.core.frame; +import java.nio.Buffer; import java.nio.ByteBuffer; import java.nio.CharBuffer; import java.nio.charset.Charset; import java.nio.charset.CharsetDecoder; import java.nio.charset.CoderResult; -import javax.websocket.CloseReason; +import jakarta.websocket.CloseReason; import org.glassfish.tyrus.core.CloseReasons; import org.glassfish.tyrus.core.ProtocolException; @@ -34,7 +35,7 @@ /** * Close frame representation. * - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public class CloseFrame extends TyrusFrame { @@ -123,13 +124,13 @@ private String utf8Decode(byte[] data) { CoderResult result = decoder.decode(b, cb, true); if (result.isUnderflow()) { decoder.flush(cb); - cb.flip(); + ((Buffer) cb).flip(); reason = cb.toString(); break; } if (result.isOverflow()) { CharBuffer tmp = CharBuffer.allocate(2 * n + 1); - cb.flip(); + ((Buffer) cb).flip(); tmp.put(cb); cb = tmp; continue; diff --git a/core/src/main/java/org/glassfish/tyrus/core/frame/Frame.java b/core/src/main/java/org/glassfish/tyrus/core/frame/Frame.java index d50fbdb8..29cdee7e 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/frame/Frame.java +++ b/core/src/main/java/org/glassfish/tyrus/core/frame/Frame.java @@ -23,7 +23,7 @@ * - validation * - payloadLength is limited to int * - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public class Frame { diff --git a/core/src/main/java/org/glassfish/tyrus/core/frame/TextFrame.java b/core/src/main/java/org/glassfish/tyrus/core/frame/TextFrame.java index c603508e..6833e45f 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/frame/TextFrame.java +++ b/core/src/main/java/org/glassfish/tyrus/core/frame/TextFrame.java @@ -16,6 +16,7 @@ package org.glassfish.tyrus.core.frame; +import java.nio.Buffer; import java.nio.ByteBuffer; import java.nio.CharBuffer; import java.nio.charset.CharacterCodingException; @@ -31,7 +32,7 @@ /** * Text frame representation. * - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public class TextFrame extends TyrusFrame { @@ -140,13 +141,13 @@ private String utf8Decode(boolean finalFragment, byte[] data, ByteBuffer remaind this.remainder = b; } } - cb.flip(); + ((Buffer) cb).flip(); res = cb.toString(); break; } if (result.isOverflow()) { CharBuffer tmp = CharBuffer.allocate(2 * n + 1); - cb.flip(); + ((Buffer) cb).flip(); tmp.put(cb); cb = tmp; continue; diff --git a/core/src/main/java/org/glassfish/tyrus/core/frame/TyrusFrame.java b/core/src/main/java/org/glassfish/tyrus/core/frame/TyrusFrame.java index 1f253683..d94241dd 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/frame/TyrusFrame.java +++ b/core/src/main/java/org/glassfish/tyrus/core/frame/TyrusFrame.java @@ -27,7 +27,7 @@ *

* Enriched {@link Frame} representation. * - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public abstract class TyrusFrame extends Frame { diff --git a/core/src/main/java/org/glassfish/tyrus/core/monitoring/EndpointEventListener.java b/core/src/main/java/org/glassfish/tyrus/core/monitoring/EndpointEventListener.java index d2940918..6b00d923 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/monitoring/EndpointEventListener.java +++ b/core/src/main/java/org/glassfish/tyrus/core/monitoring/EndpointEventListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -44,11 +44,11 @@ public interface EndpointEventListener { /** * Called when an error has occurred. *

- * Errors that occur either during {@link javax.websocket.Endpoint#onOpen(javax.websocket.Session, - * javax.websocket.EndpointConfig)}, {@link javax.websocket.Endpoint#onClose(javax.websocket.Session, - * javax.websocket.CloseReason)} and their annotated equivalent or when handling an incoming message, cause this - * listener to be called. It corresponds to the event of invocation of {@link javax.websocket.Endpoint#onError - * (javax.websocket.Session, Throwable)} and its annotated equivalent. + * Errors that occur either during {@link jakarta.websocket.Endpoint#onOpen(jakarta.websocket.Session, + * jakarta.websocket.EndpointConfig)}, {@link jakarta.websocket.Endpoint#onClose(jakarta.websocket.Session, + * jakarta.websocket.CloseReason)} and their annotated equivalent or when handling an incoming message, cause this + * listener to be called. It corresponds to the event of invocation of {@link jakarta.websocket.Endpoint#onError + * (jakarta.websocket.Session, Throwable)} and its annotated equivalent. * * @param sessionId an ID of the session on which the error occurred. * @param t throwable that has been thrown. diff --git a/core/src/main/java/org/glassfish/tyrus/core/uri/internal/CharacterIterator.java b/core/src/main/java/org/glassfish/tyrus/core/uri/internal/CharacterIterator.java index 39475c59..6da2f211 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/uri/internal/CharacterIterator.java +++ b/core/src/main/java/org/glassfish/tyrus/core/uri/internal/CharacterIterator.java @@ -21,7 +21,7 @@ /** * Iterator which iterates through the input string and returns characters from that string. * - * @author Miroslav Fuksa (miroslav.fuksa at oracle.com) + * @author Miroslav Fuksa */ final class CharacterIterator { private int pos; diff --git a/core/src/main/java/org/glassfish/tyrus/core/uri/internal/MultivaluedHashMap.java b/core/src/main/java/org/glassfish/tyrus/core/uri/internal/MultivaluedHashMap.java index d250998e..bc8a8518 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/uri/internal/MultivaluedHashMap.java +++ b/core/src/main/java/org/glassfish/tyrus/core/uri/internal/MultivaluedHashMap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -34,7 +34,7 @@ * {@link #addFirstNull(List) addFirstNull(...)} methods. *

* This implementation provides constant-time performance for the basic - * operations (get and put), assuming the hash function + * operations (get and put), assuming the hash function * disperses the elements properly among the buckets. Iteration over * collection views requires time proportional to the "capacity" of the * map instance (the number of buckets) plus its size (the number @@ -42,7 +42,7 @@ * capacity too high (or the load factor too low) if iteration performance is * important. *

- * An instance of MultivaluedHashMap has two parameters that affect its + * An instance of MultivaluedHashMap has two parameters that affect its * performance: initial capacity and load factor. The capacity * is the number of buckets in the hash table, and the initial capacity is simply * the capacity at the time the hash table is created. The load factor is @@ -55,14 +55,14 @@ * As a general rule, the default load factor (.75) offers a good tradeoff * between time and space costs. Higher values decrease the space overhead * but increase the lookup cost (reflected in most of the operations of the - * HashMap class, including get and put). The + * HashMap class, including get and put). The * expected number of entries in the map and its load factor should be taken * into account when setting its initial capacity, so as to minimize the * number of rehash operations. If the initial capacity is greater * than the maximum number of entries divided by the load factor, no * rehash operations will ever occur. *

- * If many mappings are to be stored in a MultivaluedHashMap instance, + * If many mappings are to be stored in a MultivaluedHashMap instance, * creating it with a sufficiently large capacity will allow the mappings to * be stored more efficiently than letting it perform automatic rehashing as * needed to grow the table. @@ -79,7 +79,7 @@ * The iterators returned by all of this class's "collection view methods" * are fail-fast: if the map is structurally modified at any time after * the iterator is created, in any way except through the iterator's own - * remove method, the iterator will throw a {@link java.util.ConcurrentModificationException}. + * remove method, the iterator will throw a {@link java.util.ConcurrentModificationException}. * Thus, in the face of concurrent modification, the iterator fails quickly and * cleanly, rather than risking arbitrary, non-deterministic behavior at an * undetermined time in the future. @@ -87,7 +87,7 @@ * Note that the fail-fast behavior of an iterator cannot be guaranteed * as it is, generally speaking, impossible to make any hard guarantees in the * presence of unsynchronized concurrent modification. Fail-fast iterators - * throw ConcurrentModificationException on a best-effort basis. + * throw ConcurrentModificationException on a best-effort basis. * Therefore, it would be wrong to write a program that depended on this * exception for its correctness: the fail-fast behavior of iterators * should be used only to detect bugs. diff --git a/core/src/main/java/org/glassfish/tyrus/core/uri/internal/MultivaluedStringMap.java b/core/src/main/java/org/glassfish/tyrus/core/uri/internal/MultivaluedStringMap.java index e2ed38b6..1fc53c75 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/uri/internal/MultivaluedStringMap.java +++ b/core/src/main/java/org/glassfish/tyrus/core/uri/internal/MultivaluedStringMap.java @@ -27,7 +27,7 @@ * individual string values as a constructor parameters. * * @author Paul Sandoz - * @author Marek Potociar (marek.potociar at oracle.com) + * @author Marek Potociar */ public class MultivaluedStringMap extends MultivaluedHashMap { diff --git a/core/src/main/java/org/glassfish/tyrus/core/uri/internal/PathSegment.java b/core/src/main/java/org/glassfish/tyrus/core/uri/internal/PathSegment.java index 9172e68d..cd4a49e6 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/uri/internal/PathSegment.java +++ b/core/src/main/java/org/glassfish/tyrus/core/uri/internal/PathSegment.java @@ -18,9 +18,9 @@ /** * Represents a URI path segment and any associated matrix parameters. When an - * instance of this type is injected with {@code javax.ws.rs.PathParam}, the + * instance of this type is injected with {@code jakarta.ws.rs.PathParam}, the * value of the annotation identifies which path segment is selected and the - * presence of an {@code javax.ws.rs.Encoded} annotation will result in an + * presence of an {@code jakarta.ws.rs.Encoded} annotation will result in an * instance that supplies the path and matrix parameter values in * URI encoded form. * diff --git a/core/src/main/java/org/glassfish/tyrus/core/uri/internal/PatternWithGroups.java b/core/src/main/java/org/glassfish/tyrus/core/uri/internal/PatternWithGroups.java index 83897c0e..620dfdc4 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/uri/internal/PatternWithGroups.java +++ b/core/src/main/java/org/glassfish/tyrus/core/uri/internal/PatternWithGroups.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at diff --git a/core/src/main/java/org/glassfish/tyrus/core/uri/internal/UriComponent.java b/core/src/main/java/org/glassfish/tyrus/core/uri/internal/UriComponent.java index 85c80b87..4d960291 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/uri/internal/UriComponent.java +++ b/core/src/main/java/org/glassfish/tyrus/core/uri/internal/UriComponent.java @@ -19,6 +19,7 @@ import java.io.UnsupportedEncodingException; import java.net.URI; import java.net.URLDecoder; +import java.nio.Buffer; import java.nio.ByteBuffer; import java.nio.CharBuffer; import java.nio.charset.Charset; @@ -34,7 +35,7 @@ * of a URI. * * @author Paul Sandoz - * @author Marek Potociar (marek.potociar at oracle.com) + * @author Marek Potociar */ public class UriComponent { @@ -775,7 +776,7 @@ private static ByteBuffer decodePercentEncodedOctets(final String s, int i, Byte if (bb == null) { bb = ByteBuffer.allocate(1); } else { - bb.clear(); + ((Buffer) bb).clear(); } while (true) { @@ -794,7 +795,7 @@ private static ByteBuffer decodePercentEncodedOctets(final String s, int i, Byte // Check if the byte buffer needs to be increased in size if (bb.position() == bb.capacity()) { - bb.flip(); + ((Buffer) bb).flip(); // Create a new byte buffer with the maximum number of possible // octets, hence resize should only occur once final ByteBuffer bb_new = ByteBuffer.allocate(s.length() / 3); @@ -803,7 +804,7 @@ private static ByteBuffer decodePercentEncodedOctets(final String s, int i, Byte } } - bb.flip(); + ((Buffer) bb).flip(); return bb; } diff --git a/core/src/main/java/org/glassfish/tyrus/core/uri/internal/UriParser.java b/core/src/main/java/org/glassfish/tyrus/core/uri/internal/UriParser.java index 94de741c..6ec892e3 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/uri/internal/UriParser.java +++ b/core/src/main/java/org/glassfish/tyrus/core/uri/internal/UriParser.java @@ -22,7 +22,7 @@ * The parser is not thread safe. * * @author Paul Sandoz - * @author Marek Potociar (marek.potociar at oracle.com) + * @author Marek Potociar */ class UriParser { private static final String ERROR_STATE = "The parser was not executed yet. Call the parse() method first."; diff --git a/core/src/main/java/org/glassfish/tyrus/core/uri/internal/UriTemplate.java b/core/src/main/java/org/glassfish/tyrus/core/uri/internal/UriTemplate.java index 1f92b667..604c6847 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/uri/internal/UriTemplate.java +++ b/core/src/main/java/org/glassfish/tyrus/core/uri/internal/UriTemplate.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -32,7 +32,7 @@ * A URI template. * * @author Paul Sandoz - * @author Martin Matula (martin.matula at oracle.com) + * @author Martin Matula * @author Gerard Davison (gerard.davison at oracle.com) */ public class UriTemplate { diff --git a/core/src/main/java/org/glassfish/tyrus/core/uri/internal/UriTemplateParser.java b/core/src/main/java/org/glassfish/tyrus/core/uri/internal/UriTemplateParser.java index 832e3c2b..b7a1f3d0 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/uri/internal/UriTemplateParser.java +++ b/core/src/main/java/org/glassfish/tyrus/core/uri/internal/UriTemplateParser.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at diff --git a/core/src/main/resources/META-INF/services/javax.websocket.server.ServerEndpointConfig$Configurator b/core/src/main/resources/META-INF/services/jakarta.websocket.server.ServerEndpointConfig$Configurator similarity index 100% rename from core/src/main/resources/META-INF/services/javax.websocket.server.ServerEndpointConfig$Configurator rename to core/src/main/resources/META-INF/services/jakarta.websocket.server.ServerEndpointConfig$Configurator diff --git a/core/src/main/resources/org/glassfish/tyrus/core/l10n/localization.properties b/core/src/main/resources/org/glassfish/tyrus/core/l10n/localization.properties index 5ce39ebd..2a234e11 100644 --- a/core/src/main/resources/org/glassfish/tyrus/core/l10n/localization.properties +++ b/core/src/main/resources/org/glassfish/tyrus/core/l10n/localization.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2012, 2017 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2012, 2023 Oracle and/or its affiliates. All rights reserved. # # This program and the accompanying materials are made available under the # terms of the Eclipse Public License v. 2.0, which is available at @@ -93,6 +93,7 @@ message.handler.illegal.argument=Illegal MessageHandler argument value: {0}. connection.null=Connection is null. send.message.infragment=Attempting to send a message while sending fragments of another. ioexception.close=IOException thrown when closing connection. +exception.close=Exception thrown when closing connection with message: {0} extension.exception=Extension ''{0}'' threw an exception during processOutgoing method invocation: "{1}". control.frame.fragmented=Fragmented control frame. control.frame.length=Control frame payloads must be no greater than 125 bytes. diff --git a/core/src/test/java/org/glassfish/tyrus/core/CloseReasonsTest.java b/core/src/test/java/org/glassfish/tyrus/core/CloseReasonsTest.java index c13236f0..84b21517 100644 --- a/core/src/test/java/org/glassfish/tyrus/core/CloseReasonsTest.java +++ b/core/src/test/java/org/glassfish/tyrus/core/CloseReasonsTest.java @@ -16,7 +16,7 @@ package org.glassfish.tyrus.core; -import javax.websocket.CloseReason; +import jakarta.websocket.CloseReason; import org.junit.Assert; import org.junit.Test; diff --git a/core/src/test/java/org/glassfish/tyrus/core/FrameTest.java b/core/src/test/java/org/glassfish/tyrus/core/FrameTest.java index a4e75f0c..4b2010d3 100644 --- a/core/src/test/java/org/glassfish/tyrus/core/FrameTest.java +++ b/core/src/test/java/org/glassfish/tyrus/core/FrameTest.java @@ -25,7 +25,7 @@ import static org.junit.Assert.assertTrue; /** - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public class FrameTest { @Test diff --git a/core/src/test/java/org/glassfish/tyrus/core/MessageHandlerManagerTest.java b/core/src/test/java/org/glassfish/tyrus/core/MessageHandlerManagerTest.java index dfdc4ea0..ebface4a 100644 --- a/core/src/test/java/org/glassfish/tyrus/core/MessageHandlerManagerTest.java +++ b/core/src/test/java/org/glassfish/tyrus/core/MessageHandlerManagerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -22,10 +22,10 @@ import java.util.Arrays; import java.util.Collections; -import javax.websocket.DecodeException; -import javax.websocket.Decoder; -import javax.websocket.MessageHandler; -import javax.websocket.PongMessage; +import jakarta.websocket.DecodeException; +import jakarta.websocket.Decoder; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.PongMessage; import org.glassfish.tyrus.core.coder.CoderAdapter; import org.glassfish.tyrus.core.coder.CoderWrapper; @@ -38,8 +38,8 @@ import static org.junit.Assert.fail; /** - * @author Pavel Bucek (pavel.bucek at oracle.com) - * @author Stepan Kopriva (stepan.kopriva at oracle.com) + * @author Pavel Bucek + * @author Stepan Kopriva */ public class MessageHandlerManagerTest { @Test diff --git a/core/src/test/java/org/glassfish/tyrus/core/ProtocolHandlerTest.java b/core/src/test/java/org/glassfish/tyrus/core/ProtocolHandlerTest.java new file mode 100644 index 00000000..a8d1fdd3 --- /dev/null +++ b/core/src/test/java/org/glassfish/tyrus/core/ProtocolHandlerTest.java @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2023 Oracle and/or its affiliates. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0, which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the + * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + * version 2 with the GNU Classpath Exception, which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + */ + +package org.glassfish.tyrus.core; + +import org.glassfish.tyrus.spi.CompletionHandler; +import org.glassfish.tyrus.spi.Writer; +import org.glassfish.tyrus.spi.WriterInfo; +import org.junit.Assert; +import org.junit.Test; + +import jakarta.websocket.CloseReason; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.Session; +import java.io.IOException; +import java.io.UncheckedIOException; +import java.net.SocketException; +import java.nio.ByteBuffer; +import java.util.Collections; +import java.util.concurrent.CountDownLatch; + +public class ProtocolHandlerTest { + + public static class ProtocolHandlerOnCloseEndpoint extends Endpoint { + CountDownLatch onCloseLatch = new CountDownLatch(1); + + public void onClose(Session session, CloseReason closeReason) { + onCloseLatch.countDown(); + } + + @Override + public void onOpen(Session session, EndpointConfig config) { + + } + } + + @Test + public void testOnCloseIsCalledWhenCloseThrowsError() throws DeploymentException { + ProtocolHandler handler = new ProtocolHandler(false, null); + handler.setWriter(new Writer() { + @Override + public void write(ByteBuffer buffer, CompletionHandler completionHandler) { + throw new IllegalStateException("Not Expected"); + } + + @Override + public void write(ByteBuffer buffer, CompletionHandler completionHandler, WriterInfo writerInfo) { + if (writerInfo.getMessageType() == WriterInfo.MessageType.CLOSE) { + throw new UncheckedIOException(new SocketException("Connection reset")); + } + } + + @Override + public void close() throws IOException { + } + }); + + ProtocolHandlerOnCloseEndpoint endpoint = new ProtocolHandlerOnCloseEndpoint(); + TyrusEndpointWrapper endpointWrapper = new TyrusEndpointWrapper( + endpoint, null, ComponentProviderService.create(), null, "path", + null, new TyrusEndpointWrapper.SessionListener() {}, null, null, null); + + TyrusWebSocket tyrusWebSocket = new TyrusWebSocket(handler, endpointWrapper); + handler.setWebSocket(tyrusWebSocket); + endpointWrapper.createSessionForRemoteEndpoint(tyrusWebSocket, null, Collections.emptyList(), new DebugContext()); + handler.close(1000, "TEST"); + Assert.assertEquals(0, endpoint.onCloseLatch.getCount()); + } +} diff --git a/core/src/test/java/org/glassfish/tyrus/core/TestContainer.java b/core/src/test/java/org/glassfish/tyrus/core/TestContainer.java index 6b4a0e80..765a300d 100644 --- a/core/src/test/java/org/glassfish/tyrus/core/TestContainer.java +++ b/core/src/test/java/org/glassfish/tyrus/core/TestContainer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2020 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,11 +16,11 @@ package org.glassfish.tyrus.core; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.DeploymentException; -import javax.websocket.Endpoint; -import javax.websocket.Extension; -import javax.websocket.Session; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.Extension; +import jakarta.websocket.Session; import java.io.IOException; import java.net.URI; import java.util.Collections; diff --git a/core/src/test/java/org/glassfish/tyrus/core/TyrusExtensionTest.java b/core/src/test/java/org/glassfish/tyrus/core/TyrusExtensionTest.java index bb485392..2d2888c9 100644 --- a/core/src/test/java/org/glassfish/tyrus/core/TyrusExtensionTest.java +++ b/core/src/test/java/org/glassfish/tyrus/core/TyrusExtensionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -20,7 +20,7 @@ import java.util.Arrays; import java.util.List; -import javax.websocket.Extension; +import jakarta.websocket.Extension; import org.junit.Test; import static org.junit.Assert.assertEquals; @@ -28,7 +28,7 @@ import static org.junit.Assert.assertTrue; /** - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public class TyrusExtensionTest { diff --git a/core/src/test/java/org/glassfish/tyrus/core/TyrusFutureTest.java b/core/src/test/java/org/glassfish/tyrus/core/TyrusFutureTest.java index 2a14144d..07cd6565 100644 --- a/core/src/test/java/org/glassfish/tyrus/core/TyrusFutureTest.java +++ b/core/src/test/java/org/glassfish/tyrus/core/TyrusFutureTest.java @@ -28,7 +28,7 @@ /** * Sanity tests for TyrusFuture. * - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public class TyrusFutureTest { diff --git a/core/src/test/java/org/glassfish/tyrus/core/TyrusRemoteEndpointTest.java b/core/src/test/java/org/glassfish/tyrus/core/TyrusRemoteEndpointTest.java index 702fabd8..ba243e08 100644 --- a/core/src/test/java/org/glassfish/tyrus/core/TyrusRemoteEndpointTest.java +++ b/core/src/test/java/org/glassfish/tyrus/core/TyrusRemoteEndpointTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -30,16 +30,16 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; -import javax.websocket.DeploymentException; -import javax.websocket.EncodeException; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.MessageHandler; -import javax.websocket.OnMessage; -import javax.websocket.SendHandler; -import javax.websocket.SendResult; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.EncodeException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.OnMessage; +import jakarta.websocket.SendHandler; +import jakarta.websocket.SendResult; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; import org.glassfish.tyrus.core.frame.Frame; @@ -50,7 +50,7 @@ /** * Tests the RemoteEndpointWrapper. * - * @author Stepan Kopriva (stepan.kopriva at oracle.com) + * @author Stepan Kopriva */ public class TyrusRemoteEndpointTest { diff --git a/core/src/test/java/org/glassfish/tyrus/core/TyrusServerEndpointConfiguratorTest.java b/core/src/test/java/org/glassfish/tyrus/core/TyrusServerEndpointConfiguratorTest.java index a3dde2aa..9db61aeb 100644 --- a/core/src/test/java/org/glassfish/tyrus/core/TyrusServerEndpointConfiguratorTest.java +++ b/core/src/test/java/org/glassfish/tyrus/core/TyrusServerEndpointConfiguratorTest.java @@ -19,9 +19,9 @@ import org.junit.Assert; import org.junit.Test; -import javax.websocket.HandshakeResponse; -import javax.websocket.server.HandshakeRequest; -import javax.websocket.server.ServerEndpointConfig; +import jakarta.websocket.HandshakeResponse; +import jakarta.websocket.server.HandshakeRequest; +import jakarta.websocket.server.ServerEndpointConfig; public class TyrusServerEndpointConfiguratorTest { @Test diff --git a/core/src/test/java/org/glassfish/tyrus/core/TyrusSessionTest.java b/core/src/test/java/org/glassfish/tyrus/core/TyrusSessionTest.java index b0c387ad..4e8b05fd 100644 --- a/core/src/test/java/org/glassfish/tyrus/core/TyrusSessionTest.java +++ b/core/src/test/java/org/glassfish/tyrus/core/TyrusSessionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -28,15 +28,15 @@ import java.util.concurrent.ScheduledFuture; import java.util.concurrent.atomic.AtomicBoolean; -import javax.websocket.DeploymentException; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.MessageHandler; -import javax.websocket.OnMessage; -import javax.websocket.PongMessage; -import javax.websocket.Session; -import javax.websocket.WebSocketContainer; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.OnMessage; +import jakarta.websocket.PongMessage; +import jakarta.websocket.Session; +import jakarta.websocket.WebSocketContainer; +import jakarta.websocket.server.ServerEndpoint; import org.junit.Test; import static org.junit.Assert.assertFalse; @@ -45,8 +45,8 @@ import static org.junit.Assert.assertTrue; /** - * @author Pavel Bucek (pavel.bucek at oracle.com) - * @author Stepan Kopriva (stepan.kopriva at oracle.com) + * @author Pavel Bucek + * @author Stepan Kopriva */ public class TyrusSessionTest { private TyrusEndpointWrapper endpointWrapper; diff --git a/core/src/test/java/org/glassfish/tyrus/core/UtilsPropertiesTest.java b/core/src/test/java/org/glassfish/tyrus/core/UtilsPropertiesTest.java index 84538c0e..22063223 100644 --- a/core/src/test/java/org/glassfish/tyrus/core/UtilsPropertiesTest.java +++ b/core/src/test/java/org/glassfish/tyrus/core/UtilsPropertiesTest.java @@ -26,7 +26,7 @@ /** * Tests {@link org.glassfish.tyrus.core.Utils} properties methods. * - * @author Ondrej Kosatka (ondrej.kosatka at oracle.com) + * @author Ondrej Kosatka */ public class UtilsPropertiesTest { diff --git a/core/src/test/java/org/glassfish/tyrus/core/UtilsTest.java b/core/src/test/java/org/glassfish/tyrus/core/UtilsTest.java index fc4fb4c9..85b4a8cc 100644 --- a/core/src/test/java/org/glassfish/tyrus/core/UtilsTest.java +++ b/core/src/test/java/org/glassfish/tyrus/core/UtilsTest.java @@ -26,7 +26,7 @@ /** * Tests Utils * - * @author Ondrej Kosatka (ondrej.kosatka at oracle.com) + * @author Ondrej Kosatka */ public class UtilsTest { diff --git a/core/src/test/java/org/glassfish/tyrus/core/WriterInfoTest.java b/core/src/test/java/org/glassfish/tyrus/core/WriterInfoTest.java index cad23390..58b3769b 100644 --- a/core/src/test/java/org/glassfish/tyrus/core/WriterInfoTest.java +++ b/core/src/test/java/org/glassfish/tyrus/core/WriterInfoTest.java @@ -23,14 +23,14 @@ import org.junit.Before; import org.junit.Test; -import javax.websocket.DeploymentException; -import javax.websocket.EncodeException; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.SendHandler; -import javax.websocket.SendResult; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.EncodeException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.SendHandler; +import jakarta.websocket.SendResult; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; import java.io.IOException; import java.nio.ByteBuffer; import java.util.HashMap; diff --git a/core/src/test/java/org/glassfish/tyrus/core/uri/BestMatchTest.java b/core/src/test/java/org/glassfish/tyrus/core/uri/BestMatchTest.java index 57cb486d..97e57222 100644 --- a/core/src/test/java/org/glassfish/tyrus/core/uri/BestMatchTest.java +++ b/core/src/test/java/org/glassfish/tyrus/core/uri/BestMatchTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -22,10 +22,10 @@ import java.util.List; import java.util.Set; -import javax.websocket.DeploymentException; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.Session; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.Session; import org.glassfish.tyrus.core.ComponentProviderService; import org.glassfish.tyrus.core.DebugContext; diff --git a/docs/jsr/websocket-jsr-proposal.html b/docs/jsr/websocket-jsr-proposal.html index 04775e71..07bb4172 100644 --- a/docs/jsr/websocket-jsr-proposal.html +++ b/docs/jsr/websocket-jsr-proposal.html @@ -145,7 +145,7 @@

2.7 Please give a short description of the underlying technology

2.8 Is there a proposed package name for the API Specification? (i.e., javapi.something, org.something, etc.)

-

Possibly: javax.websocket.* or under java.net.websocket.
+

Possibly: jakarta.websocket.* or under java.net.websocket.

2.9 Does the proposed specification have any dependencies on specific operating systems, CPUs, or I/O devices that you know of?

diff --git a/docs/pom.xml b/docs/pom.xml index 4a258ee3..a46e5806 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -1,7 +1,7 @@ + + + diff --git a/etc/config/checkstyle.xml b/etc/config/checkstyle.xml index 65da5162..927764b6 100644 --- a/etc/config/checkstyle.xml +++ b/etc/config/checkstyle.xml @@ -1,7 +1,7 @@ @@ -134,10 +140,10 @@ - - - - + + + + diff --git a/etc/config/copyright-exclude b/etc/config/copyright-exclude index 6e2601c9..e18880a7 100755 --- a/etc/config/copyright-exclude +++ b/etc/config/copyright-exclude @@ -29,6 +29,7 @@ nbactions.xml /META-INF/services/ /etc/config/copyright-exclude /etc/config/copyright.txt +/etc/config/travis/ /LICENSE.html /LICENSE.txt README.txt diff --git a/etc/jenkins/Jenkinsfile_ci_build b/etc/jenkins/Jenkinsfile_ci_build index 2ac02633..f1cb6244 100644 --- a/etc/jenkins/Jenkinsfile_ci_build +++ b/etc/jenkins/Jenkinsfile_ci_build @@ -8,12 +8,12 @@ pipeline { stages { stage('Jersey build') { parallel { - stage('JDK 8 ') { + stage('JDK 11 ') { agent { label 'centos-7' } tools { - jdk 'oracle-jdk8-latest' + jdk 'openjdk-jdk11-latest' maven 'apache-maven-latest' } steps { diff --git a/etc/travis/README b/etc/travis/README new file mode 100644 index 00000000..3b11b8f8 --- /dev/null +++ b/etc/travis/README @@ -0,0 +1 @@ +Folder containing all Travis scripts. diff --git a/etc/travis/travis.sh b/etc/travis/travis.sh new file mode 100644 index 00000000..9eb12440 --- /dev/null +++ b/etc/travis/travis.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# Abort on Error +set -e + +export PING_SLEEP=30s +export WORKDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +export BUILD_OUTPUT=$WORKDIR/build.out + +touch $BUILD_OUTPUT + +dump_output() { + echo Tailing the last 2000 lines of output: + tail -2000 $BUILD_OUTPUT +} +error_handler() { + echo ERROR: An error was encountered with the build. + dump_output + exit 1 +} +# If an error occurs, run our error handler to output a tail of the build +trap 'error_handler' ERR + +# Set up a repeating loop to send some output to Travis. + +bash -c "while true; do tail -5 $BUILD_OUTPUT; sleep $PING_SLEEP; done" & +PING_LOOP_PID=$! + +mvn -version + +if [ "$1" = "glassfish-copyright:copyright" ]; then + mvn glassfish-copyright:copyright +else + mvn -e -U -B -C -Dtyrus.test.container.client=org.glassfish.tyrus.container.grizzly.client.GrizzlyClientContainer -Pstaging -Pbundles clean install -Dmaven.javadoc.skip=true $1 >> $BUILD_OUTPUT 2>&1 +fi + +# The build finished without returning an error so dump a tail of the output +dump_output + +# nicely terminate the ping output loop +kill $PING_LOOP_PID \ No newline at end of file diff --git a/ext/client-cli/pom.xml b/ext/client-cli/pom.xml index eaf526b4..f6c6ae6c 100644 --- a/ext/client-cli/pom.xml +++ b/ext/client-cli/pom.xml @@ -1,6 +1,6 @@ true diff --git a/ext/client-cli/src/main/java/module-info.java b/ext/client-cli/src/main/java/module-info.java new file mode 100644 index 00000000..bdbb624f --- /dev/null +++ b/ext/client-cli/src/main/java/module-info.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0, which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the + * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + * version 2 with the GNU Classpath Exception, which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + */ + +/** + * Tyrus Test Tools Module + */ + +module org.glassfish.tyrus.ext.client.cli { + requires jakarta.websocket; + requires jline; + + requires org.glassfish.tyrus.client; + + exports org.glassfish.tyrus.ext.client.cli; +} \ No newline at end of file diff --git a/ext/client-cli/src/main/java/org/glassfish/tyrus/ext/client/cli/ClientCli.java b/ext/client-cli/src/main/java/org/glassfish/tyrus/ext/client/cli/ClientCli.java index 78c89ca6..7bdab0eb 100644 --- a/ext/client-cli/src/main/java/org/glassfish/tyrus/ext/client/cli/ClientCli.java +++ b/ext/client-cli/src/main/java/org/glassfish/tyrus/ext/client/cli/ClientCli.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -23,14 +23,14 @@ import java.net.URISyntaxException; import java.nio.ByteBuffer; -import javax.websocket.CloseReason; -import javax.websocket.DeploymentException; -import javax.websocket.OnClose; -import javax.websocket.OnError; -import javax.websocket.OnMessage; -import javax.websocket.PongMessage; -import javax.websocket.Session; -import javax.websocket.WebSocketContainer; +import jakarta.websocket.CloseReason; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.OnClose; +import jakarta.websocket.OnError; +import jakarta.websocket.OnMessage; +import jakarta.websocket.PongMessage; +import jakarta.websocket.Session; +import jakarta.websocket.WebSocketContainer; import org.glassfish.tyrus.client.ClientManager; @@ -42,7 +42,7 @@ /** * Simple WebSocket CLI client, handy tool usable for simple endpoint testing. * - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek * @author Gerard Davison (gerard.davison at oracle.com) */ public class ClientCli { @@ -56,7 +56,7 @@ public class ClientCli { /** * Client side endpoint, prints everything into given console. */ - @javax.websocket.ClientEndpoint + @jakarta.websocket.ClientEndpoint public static class ClientEndpoint { private final ConsoleReader console; diff --git a/ext/client-java8/pom.xml b/ext/client-java8/pom.xml index dc4e42cc..4aab416b 100644 --- a/ext/client-java8/pom.xml +++ b/ext/client-java8/pom.xml @@ -1,6 +1,6 @@ true diff --git a/ext/client-java8/src/main/java/module-info.java b/ext/client-java8/src/main/java/module-info.java new file mode 100644 index 00000000..879fc9c2 --- /dev/null +++ b/ext/client-java8/src/main/java/module-info.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0, which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the + * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + * version 2 with the GNU Classpath Exception, which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + */ + +/** + * Tyrus Java8 Client Extension Module + */ + +module org.glassfish.tyrus.ext.client.java8 { + requires jakarta.websocket; + requires org.glassfish.tyrus.client; + requires org.glassfish.tyrus.core; + + exports org.glassfish.tyrus.ext.client.java8; +} \ No newline at end of file diff --git a/ext/client-java8/src/main/java/org/glassfish/tyrus/ext/client/java8/SessionBuilder.java b/ext/client-java8/src/main/java/org/glassfish/tyrus/ext/client/java8/SessionBuilder.java index e168788a..270181ac 100644 --- a/ext/client-java8/src/main/java/org/glassfish/tyrus/ext/client/java8/SessionBuilder.java +++ b/ext/client-java8/src/main/java/org/glassfish/tyrus/ext/client/java8/SessionBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -28,14 +28,14 @@ import java.util.concurrent.ForkJoinTask; import java.util.function.BiConsumer; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.CloseReason; -import javax.websocket.DeploymentException; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.MessageHandler; -import javax.websocket.Session; -import javax.websocket.WebSocketContainer; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.CloseReason; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.Session; +import jakarta.websocket.WebSocketContainer; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.core.Beta; @@ -49,8 +49,8 @@ * Session} * can be opened even without it and used only for sending messages. *

- * {@link javax.websocket.Encoder Encoders} and {@link javax.websocket.Decoder decoders} can be registered by creating - * {@link javax.websocket.ClientEndpointConfig} and registering it to SessionBuilder via + * {@link jakarta.websocket.Encoder Encoders} and {@link jakarta.websocket.Decoder decoders} can be registered by creating + * {@link jakarta.websocket.ClientEndpointConfig} and registering it to SessionBuilder via * {@link org.glassfish.tyrus.ext.client.java8.SessionBuilder#clientEndpointConfig} method call. *

* Code example: @@ -63,7 +63,7 @@ * .onClose((session1, closeReason) -> onCloseLatch.countDown()) * .connect(); * - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ @Beta public class SessionBuilder { @@ -84,7 +84,7 @@ public class SessionBuilder { private BiConsumer onClose; /** - * Create SessionBuilder with provided {@link javax.websocket.WebSocketContainer}. + * Create SessionBuilder with provided {@link jakarta.websocket.WebSocketContainer}. * * @param container provided websocket container. */ @@ -111,9 +111,9 @@ public SessionBuilder() { } /** - * Set {@link javax.websocket.ClientEndpointConfig}. + * Set {@link jakarta.websocket.ClientEndpointConfig}. * - * @param clientEndpointConfig {@link javax.websocket.ClientEndpointConfig} to be set. + * @param clientEndpointConfig {@link jakarta.websocket.ClientEndpointConfig} to be set. * @return updated SessionBuilder instance. */ public SessionBuilder clientEndpointConfig(ClientEndpointConfig clientEndpointConfig) { @@ -163,7 +163,7 @@ public SessionBuilder messageHandlerPartial(Class clazz, MessageHandler.P * * @param onOpen method invoked when a {@link Session} is opened. * @return updated SessionBuilder instance. - * @see javax.websocket.OnOpen + * @see jakarta.websocket.OnOpen */ public SessionBuilder onOpen(BiConsumer onOpen) { this.onOpen = onOpen; @@ -171,11 +171,11 @@ public SessionBuilder onOpen(BiConsumer onOpen) { } /** - * Set method reference which will be invoked when {@link javax.websocket.OnError} method is invoked. + * Set method reference which will be invoked when {@link jakarta.websocket.OnError} method is invoked. * - * @param onError method invoked when {@link javax.websocket.OnError} method is invoked. + * @param onError method invoked when {@link jakarta.websocket.OnError} method is invoked. * @return updated SessionBuilder instance. - * @see javax.websocket.OnError + * @see jakarta.websocket.OnError */ public SessionBuilder onError(BiConsumer onError) { this.onError = onError; @@ -187,7 +187,7 @@ public SessionBuilder onError(BiConsumer onError) { * * @param onClose method invoked when a {@link Session} is closed. * @return updated SessionBuilder instance. - * @see javax.websocket.OnClose + * @see jakarta.websocket.OnClose */ public SessionBuilder onClose(BiConsumer onClose) { this.onClose = onClose; diff --git a/ext/client-java8/src/test/java/org/glassfish/tyrus/ext/client/java8/SessionBuilderTest.java b/ext/client-java8/src/test/java/org/glassfish/tyrus/ext/client/java8/SessionBuilderTest.java index 9493f97e..d97134ad 100644 --- a/ext/client-java8/src/test/java/org/glassfish/tyrus/ext/client/java8/SessionBuilderTest.java +++ b/ext/client-java8/src/test/java/org/glassfish/tyrus/ext/client/java8/SessionBuilderTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -25,15 +25,15 @@ import java.util.concurrent.TimeUnit; import java.util.function.Function; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.DecodeException; -import javax.websocket.Decoder; -import javax.websocket.DeploymentException; -import javax.websocket.EncodeException; -import javax.websocket.Encoder; -import javax.websocket.OnMessage; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.DecodeException; +import jakarta.websocket.Decoder; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.EncodeException; +import jakarta.websocket.Encoder; +import jakarta.websocket.OnMessage; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; import org.glassfish.tyrus.core.coder.CoderAdapter; import org.glassfish.tyrus.server.Server; @@ -43,7 +43,7 @@ import static org.junit.Assert.assertTrue; /** - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public class SessionBuilderTest extends TestContainer { diff --git a/ext/extension-deflate/pom.xml b/ext/extension-deflate/pom.xml index 55a7fdc8..1167e2e4 100644 --- a/ext/extension-deflate/pom.xml +++ b/ext/extension-deflate/pom.xml @@ -1,6 +1,6 @@ - 4.0.4 - 2.4.4 - 3.2.6 - 1.2 - 1.1.6 - 1.1.6 - 2.6.7 + 2.0.0 + 3.0.0 + 4.0.0 + 3.0.1 + 2.0.1 + 1.0.0 + 3.0.1 + 3.0.2 + 3.3.1 + 5.0.0 - javax.websocket + jakarta.websocket org.glassfish 0.0 - 1.0 - 1.0 + 2.0 + 2.0 11 - 1.0.0 + 2.0.0 0.0.0 ${api_package} @@ -123,7 +126,7 @@ org.glassfish.* - 1.1 + 2.0.0 ${spec_version}.99.b${build_number} ${new_impl_version}-b${build_number} ${spec_version}.99.b${build_number} @@ -131,11 +134,6 @@ ${new_spec_version}-b${build_number} gf-cddl-gpl - - 3.0.1 - 2.3.3 - 2.3.6 - 1.3.5 @@ -171,10 +169,10 @@ org.apache.maven.plugins maven-compiler-plugin - 3.1 + 3.10.1 - 1.8 - 1.8 + 11 + 11 UTF-8 @@ -198,12 +196,12 @@ org.apache.maven.plugins maven-checkstyle-plugin - 3.0.0 + 3.1.0 com.puppycrawl.tools checkstyle - 8.18 + 8.30 @@ -217,7 +215,7 @@ true etc/config/checkstyle-build.xml true - **/guide/*,**/org/glassfish/tyrus/core/wsadl/model/**/*,**/LocalizationMessages.java + **/guide/*,**/org/glassfish/tyrus/core/wsadl/model/**/*,**/LocalizationMessages.java,**/module-info.java @@ -242,6 +240,7 @@ true false + false false etc/config/copyright.txt @@ -299,7 +298,7 @@ org.apache.felix maven-bundle-plugin - 2.4.0 + 5.1.2 true @@ -344,12 +343,12 @@ org.apache.maven.plugins maven-surefire-plugin - 2.17 + 3.0.0-M5 org.apache.maven.plugins maven-shade-plugin - 2.1 + 3.2.4 org.codehaus.mojo @@ -488,11 +487,11 @@ jakarta.ejb jakarta.ejb-api - ${javax.ejb-api.version} + ${ejb-api.version} - javax.enterprise - cdi-api + jakarta.enterprise + jakarta.enterprise.cdi-api ${cdi-api.version} @@ -501,8 +500,8 @@ ${json-api.version} - org.glassfish - jakarta.json + org.eclipse.parsson + parsson ${json-impl.version} @@ -604,7 +603,7 @@ org.glassfish.main.extras glassfish-embedded-all - 5.0 + 6.2.1 jakarta.xml.bind @@ -629,7 +628,7 @@ jakarta.annotation jakarta.annotation-api - ${javax.annotation.version} + ${annotation-api.version} diff --git a/samples/auction/pom.xml b/samples/auction/pom.xml index b343fcf7..67f73b7d 100755 --- a/samples/auction/pom.xml +++ b/samples/auction/pom.xml @@ -1,6 +1,6 @@ true diff --git a/server/src/main/java/module-info.java b/server/src/main/java/module-info.java new file mode 100644 index 00000000..772f7726 --- /dev/null +++ b/server/src/main/java/module-info.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2021, 2022 Oracle and/or its affiliates. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0, which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the + * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + * version 2 with the GNU Classpath Exception, which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + */ + +/** + * Tyrus Server Module + */ + +module org.glassfish.tyrus.server { + requires java.logging; + + requires transitive jakarta.websocket; + + requires org.glassfish.tyrus.client; + requires org.glassfish.tyrus.core; + requires org.glassfish.tyrus.spi; + + exports org.glassfish.tyrus.server; +} \ No newline at end of file diff --git a/server/src/main/java/org/glassfish/tyrus/server/Server.java b/server/src/main/java/org/glassfish/tyrus/server/Server.java index 31f1fe67..1de35de1 100755 --- a/server/src/main/java/org/glassfish/tyrus/server/Server.java +++ b/server/src/main/java/org/glassfish/tyrus/server/Server.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -25,7 +25,7 @@ import java.util.StringTokenizer; import java.util.logging.Logger; -import javax.websocket.DeploymentException; +import jakarta.websocket.DeploymentException; import org.glassfish.tyrus.spi.ServerContainer; import org.glassfish.tyrus.spi.ServerContainerFactory; @@ -33,8 +33,8 @@ /** * Implementation of the WebSocket Server. * - * @author Stepan Kopriva (stepan.kopriva at oracle.com) - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Stepan Kopriva + * @author Pavel Bucek */ public class Server { @@ -67,9 +67,9 @@ public class Server { * Create new server instance. * * @param configuration to be registered with the server. Classes annotated with {@link - * javax.websocket.server.ServerEndpoint}, implementing - * {@link javax.websocket.server.ServerApplicationConfig} or extending {@link - * javax.websocket.server.ServerEndpointConfig} + * jakarta.websocket.server.ServerEndpoint}, implementing + * {@link jakarta.websocket.server.ServerApplicationConfig} or extending {@link + * jakarta.websocket.server.ServerEndpointConfig} * are supported. */ public Server(Class... configuration) { @@ -82,9 +82,9 @@ public Server(Class... configuration) { * @param properties properties used as a parameter to {@link ServerContainerFactory#createServerContainer * (java.util.Map)} call. * @param configuration to be registered with the server. Classes annotated with {@link - * javax.websocket.server.ServerEndpoint}, implementing {@link - * javax.websocket.server.ServerApplicationConfig} or extending {@link - * javax.websocket.server.ServerEndpointConfig} + * jakarta.websocket.server.ServerEndpoint}, implementing {@link + * jakarta.websocket.server.ServerApplicationConfig} or extending {@link + * jakarta.websocket.server.ServerEndpointConfig} * are supported. */ public Server(Map properties, Class... configuration) { @@ -101,9 +101,9 @@ public Server(Map properties, Class... configuration) { * @param properties properties used as a parameter to {@link ServerContainerFactory#createServerContainer * (java.util.Map)} call. * @param configuration to be registered with the server. Classes annotated with {@link - * javax.websocket.server.ServerEndpoint}, implementing - * {@link javax.websocket.server.ServerApplicationConfig} or extending {@link - * javax.websocket.server.ServerEndpointConfig} + * jakarta.websocket.server.ServerEndpoint}, implementing + * {@link jakarta.websocket.server.ServerApplicationConfig} or extending {@link + * jakarta.websocket.server.ServerEndpointConfig} * are supported. * @see #getPort() */ @@ -122,9 +122,9 @@ public Server(String hostName, int port, String contextPath, Map * @param properties properties used as a parameter to {@link ServerContainerFactory#createServerContainer * (java.util.Map)} call. * @param configuration to be registered with the server. Classes annotated with {@link - * javax.websocket.server.ServerEndpoint}, implementing {@link - * javax.websocket.server.ServerApplicationConfig} - * or extending {@link javax.websocket.server.ServerEndpointConfig} + * jakarta.websocket.server.ServerEndpoint}, implementing {@link + * jakarta.websocket.server.ServerApplicationConfig} + * or extending {@link jakarta.websocket.server.ServerEndpointConfig} * are supported. * @see #getPort() */ diff --git a/server/src/main/java/org/glassfish/tyrus/server/TyrusServerConfiguration.java b/server/src/main/java/org/glassfish/tyrus/server/TyrusServerConfiguration.java index fc9e4768..acaa2d4f 100644 --- a/server/src/main/java/org/glassfish/tyrus/server/TyrusServerConfiguration.java +++ b/server/src/main/java/org/glassfish/tyrus/server/TyrusServerConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -24,11 +24,11 @@ import java.util.logging.Level; import java.util.logging.Logger; -import javax.websocket.DeploymentException; -import javax.websocket.Endpoint; -import javax.websocket.server.ServerApplicationConfig; -import javax.websocket.server.ServerEndpoint; -import javax.websocket.server.ServerEndpointConfig; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.server.ServerApplicationConfig; +import jakarta.websocket.server.ServerEndpoint; +import jakarta.websocket.server.ServerEndpointConfig; import org.glassfish.tyrus.core.ErrorCollector; import org.glassfish.tyrus.core.ReflectionHelper; @@ -36,7 +36,7 @@ /** * Container for either deployed {@link ServerApplicationConfig}s, if any, or deployed classes. * - * @author Stepan Kopriva (stepan.kopriva at oracle.com) + * @author Stepan Kopriva */ public class TyrusServerConfiguration implements ServerApplicationConfig { @@ -62,7 +62,7 @@ public TyrusServerConfiguration(Set> classes, Set * * @param classes classes to be included in this application instance. Can contain any combination * of annotated endpoints (see {@link ServerEndpoint}). - * @param dynamicallyAddedClasses dynamically deployed classes. See {@link javax.websocket.server + * @param dynamicallyAddedClasses dynamically deployed classes. See {@link jakarta.websocket.server * .ServerContainer#addEndpoint(Class)}. * @param serverEndpointConfigs List of instances of {@link ServerEndpointConfig} to be deployed. * @param errorCollector model errors are reported to this instance. Cannot be {@code null}. diff --git a/server/src/main/java/org/glassfish/tyrus/server/TyrusServerContainer.java b/server/src/main/java/org/glassfish/tyrus/server/TyrusServerContainer.java index 667dcace..b771d2f2 100755 --- a/server/src/main/java/org/glassfish/tyrus/server/TyrusServerContainer.java +++ b/server/src/main/java/org/glassfish/tyrus/server/TyrusServerContainer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -20,16 +20,17 @@ import java.net.URI; import java.util.Collections; import java.util.HashSet; +import java.util.Map; import java.util.Set; import java.util.concurrent.Future; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.DeploymentException; -import javax.websocket.Endpoint; -import javax.websocket.Extension; -import javax.websocket.Session; -import javax.websocket.server.ServerApplicationConfig; -import javax.websocket.server.ServerEndpointConfig; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.Extension; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerApplicationConfig; +import jakarta.websocket.server.ServerEndpointConfig; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.core.BaseContainer; @@ -39,9 +40,9 @@ /** * Server Container Implementation. * - * @author Martin Matula (martin.matula at oracle.com) - * @author Pavel Bucek (pavel.bucek at oracle.com) - * @author Stepan Kopriva (stepan.kopriva at oracle.com) + * @author Martin Matula + * @author Pavel Bucek + * @author Stepan Kopriva */ public abstract class TyrusServerContainer extends BaseContainer implements ServerContainer { private final ErrorCollector collector; @@ -51,7 +52,7 @@ public abstract class TyrusServerContainer extends BaseContainer implements Serv private final Set> classes; private final ServerApplicationConfig serverApplicationConfig; - private boolean canDeploy = true; + private boolean notYetStarted = true; private long defaultMaxSessionIdleTimeout = 0; private long defaultAsyncSendTimeout = 0; private int maxTextMessageBufferSize = Integer.MAX_VALUE; @@ -65,7 +66,7 @@ public abstract class TyrusServerContainer extends BaseContainer implements Serv * Create new {@link TyrusServerContainer}. * * @param classes classes to be included in this application instance. Can contain any combination of annotated - * endpoints (see {@link javax.websocket.server.ServerEndpoint}) or {@link javax.websocket.Endpoint} + * endpoints (see {@link jakarta.websocket.server.ServerEndpoint}) or {@link jakarta.websocket.Endpoint} * descendants. */ public TyrusServerContainer(Set> classes) { @@ -163,19 +164,17 @@ public void stop() { @Override public void addEndpoint(Class endpointClass) throws DeploymentException { - if (canDeploy) { - dynamicallyAddedClasses.add(endpointClass); - } else { - throw new IllegalStateException("Not in 'deploy' scope."); + dynamicallyAddedClasses.add(endpointClass); + if (!notYetStarted) { + register(endpointClass); } } @Override public void addEndpoint(ServerEndpointConfig serverEndpointConfig) throws DeploymentException { - if (canDeploy) { - dynamicallyAddedEndpointConfigs.add(serverEndpointConfig); - } else { - throw new IllegalStateException("Not in 'deploy' scope."); + dynamicallyAddedEndpointConfigs.add(serverEndpointConfig); + if (!notYetStarted) { + register(serverEndpointConfig); } } @@ -225,7 +224,7 @@ public Session connectToServer(Endpoint endpointInstance, ClientEndpointConfig c } /** - * Non-blocking version of {@link javax.websocket.WebSocketContainer#connectToServer(Class, java.net.URI)}. + * Non-blocking version of {@link jakarta.websocket.WebSocketContainer#connectToServer(Class, java.net.URI)}. *

* Only simple checks are performed in the main thread; client container is created in different thread, same * applies to connecting etc. @@ -240,8 +239,8 @@ public Future asyncConnectToServer(Class annotatedEndpointClass, URI } /** - * Non-blocking version of {@link javax.websocket.WebSocketContainer#connectToServer(Class, - * javax.websocket.ClientEndpointConfig, java.net.URI)}. + * Non-blocking version of {@link jakarta.websocket.WebSocketContainer#connectToServer(Class, + * jakarta.websocket.ClientEndpointConfig, java.net.URI)}. *

* Only simple checks are performed in the main thread; client container is created in different thread, same * applies to connecting etc. @@ -251,7 +250,7 @@ public Future asyncConnectToServer(Class annotatedEndpointClass, URI * @param cec the configuration used to configure the programmatic endpoint. * @return the Session created if the connection is successful. * @throws DeploymentException if the configuration is not valid - * @see javax.websocket.WebSocketContainer#connectToServer(Class, javax.websocket.ClientEndpointConfig, + * @see jakarta.websocket.WebSocketContainer#connectToServer(Class, jakarta.websocket.ClientEndpointConfig, * java.net.URI) */ public Future asyncConnectToServer(Class endpointClass, ClientEndpointConfig cec, @@ -260,8 +259,8 @@ public Future asyncConnectToServer(Class endpointCl } /** - * Non-blocking version of {@link javax.websocket.WebSocketContainer#connectToServer(javax.websocket.Endpoint, - * javax.websocket.ClientEndpointConfig, java.net.URI)}. + * Non-blocking version of {@link jakarta.websocket.WebSocketContainer#connectToServer(jakarta.websocket.Endpoint, + * jakarta.websocket.ClientEndpointConfig, java.net.URI)}. *

* Only simple checks are performed in the main thread; client container is created in different thread, same * applies to connecting etc. @@ -271,8 +270,8 @@ public Future asyncConnectToServer(Class endpointCl * @param cec the configuration used to configure the programmatic endpoint. * @return the Session created if the connection is successful. * @throws DeploymentException if the configuration is not valid - * @see javax.websocket.WebSocketContainer#connectToServer(javax.websocket.Endpoint, - * javax.websocket.ClientEndpointConfig, java.net.URI) + * @see jakarta.websocket.WebSocketContainer#connectToServer(jakarta.websocket.Endpoint, + * jakarta.websocket.ClientEndpointConfig, java.net.URI) */ public Future asyncConnectToServer(Endpoint endpointInstance, ClientEndpointConfig cec, URI path) throws DeploymentException { @@ -280,7 +279,7 @@ public Future asyncConnectToServer(Endpoint endpointInstance, ClientEnd } /** - * Non-blocking version of {@link javax.websocket.WebSocketContainer#connectToServer(Object, java.net.URI)}. + * Non-blocking version of {@link jakarta.websocket.WebSocketContainer#connectToServer(Object, java.net.URI)}. *

* Only simple checks are performed in the main thread; client container is created in different thread, same * applies to connecting etc. @@ -289,7 +288,7 @@ public Future asyncConnectToServer(Endpoint endpointInstance, ClientEnd * @param path the complete path to the server endpoint. * @return the Session created if the connection is successful. * @throws DeploymentException if the annotated endpoint instance is not valid. - * @see javax.websocket.WebSocketContainer#connectToServer(Object, java.net.URI) + * @see jakarta.websocket.WebSocketContainer#connectToServer(Object, java.net.URI) */ public Future asyncConnectToServer(Object obj, URI path) throws DeploymentException { return getClientManager().asyncConnectToServer(obj, path); @@ -341,10 +340,16 @@ public void setDefaultMaxSessionIdleTimeout(long defaultMaxSessionIdleTimeout) { } /** - * Container is no longer required to accept {@link #addEndpoint(javax.websocket.server.ServerEndpointConfig)} and + * Container is no longer required to accept {@link #addEndpoint(jakarta.websocket.server.ServerEndpointConfig)} and * {@link #addEndpoint(Class)} calls. */ public void doneDeployment() { - canDeploy = false; + notYetStarted = false; + } + + // @Override in 2.1 + public void upgradeHttpToWebSocket(Object httpServletRequest, Object httpServletResponse, ServerEndpointConfig sec, + Map pathParameters) throws IOException, DeploymentException { + throw new UnsupportedOperationException(); } } diff --git a/server/src/test/java/org/glassfish/tyrus/server/ServerEndpointConfigAdapter.java b/server/src/test/java/org/glassfish/tyrus/server/ServerEndpointConfigAdapter.java index 516b47c4..1960d094 100644 --- a/server/src/test/java/org/glassfish/tyrus/server/ServerEndpointConfigAdapter.java +++ b/server/src/test/java/org/glassfish/tyrus/server/ServerEndpointConfigAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -20,13 +20,13 @@ import java.util.List; import java.util.Map; -import javax.websocket.Decoder; -import javax.websocket.Encoder; -import javax.websocket.Extension; -import javax.websocket.server.ServerEndpointConfig; +import jakarta.websocket.Decoder; +import jakarta.websocket.Encoder; +import jakarta.websocket.Extension; +import jakarta.websocket.server.ServerEndpointConfig; /** - * @author Stepan Kopriva (stepan.kopriva at oracle.com) + * @author Stepan Kopriva */ public abstract class ServerEndpointConfigAdapter implements ServerEndpointConfig { @Override diff --git a/server/src/test/java/org/glassfish/tyrus/server/TyrusServerConfigurationTest.java b/server/src/test/java/org/glassfish/tyrus/server/TyrusServerConfigurationTest.java index 9469d573..991226bb 100644 --- a/server/src/test/java/org/glassfish/tyrus/server/TyrusServerConfigurationTest.java +++ b/server/src/test/java/org/glassfish/tyrus/server/TyrusServerConfigurationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -20,12 +20,12 @@ import java.util.HashSet; import java.util.Set; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.Session; -import javax.websocket.server.ServerApplicationConfig; -import javax.websocket.server.ServerEndpoint; -import javax.websocket.server.ServerEndpointConfig; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerApplicationConfig; +import jakarta.websocket.server.ServerEndpoint; +import jakarta.websocket.server.ServerEndpointConfig; import org.junit.Assert; import org.junit.Test; @@ -33,7 +33,7 @@ /** * Tests correct construction of {@link TyrusServerConfiguration} from scanned classes. * - * @author Stepan Kopriva (stepan.kopriva at oracle.com) + * @author Stepan Kopriva */ public class TyrusServerConfigurationTest { diff --git a/spi/pom.xml b/spi/pom.xml index 7df05bc7..e980b100 100755 --- a/spi/pom.xml +++ b/spi/pom.xml @@ -1,6 +1,6 @@ + + + 4.0.0 + + + org.glassfish.tyrus.tests + tyrus-tests-containers + 2.0.99-SNAPSHOT + + + war + tyrus-tests-containers-jdk-client + + Tyrus JDK Containers Tests + + + + jakarta.xml.bind + jakarta.xml.bind-api + + + org.glassfish.tyrus + tyrus-client + + + org.glassfish.tyrus + tyrus-container-grizzly-server + test + + + org.glassfish.tyrus + tyrus-server + test + + + org.glassfish.tyrus.tests + tyrus-test-tools + test + + + junit + junit + test + + + diff --git a/containers/jdk-client/src/test/java/org/glassfish/tyrus/container/jdk/client/UnknownHostTest.java b/tests/containers/jdk-client/src/test/java/org/glassfish/tyrus/container/jdk/client/UnknownHostTest.java similarity index 76% rename from containers/jdk-client/src/test/java/org/glassfish/tyrus/container/jdk/client/UnknownHostTest.java rename to tests/containers/jdk-client/src/test/java/org/glassfish/tyrus/container/jdk/client/UnknownHostTest.java index da463f9b..4e9e4edd 100644 --- a/containers/jdk-client/src/test/java/org/glassfish/tyrus/container/jdk/client/UnknownHostTest.java +++ b/tests/containers/jdk-client/src/test/java/org/glassfish/tyrus/container/jdk/client/UnknownHostTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -17,19 +17,19 @@ package org.glassfish.tyrus.container.jdk.client; import org.junit.Assume; +import org.junit.Assert; import org.junit.Before; import org.junit.Test; -import javax.websocket.ContainerProvider; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.Session; -import javax.websocket.WebSocketContainer; +import jakarta.websocket.ContainerProvider; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.Session; +import jakarta.websocket.WebSocketContainer; import java.net.URI; import java.util.logging.Level; import java.util.logging.Logger; -import static org.junit.Assert.*; public class UnknownHostTest { @@ -53,7 +53,7 @@ public void testIncreaseFileDescriptorsOnTyrusImplementationInCaseOfUnresolvedAd container.connectToServer(webSocketClientEndpoint, uri); } catch (Exception e) { LOG.log(Level.FINE, e.getMessage()); - assertTrue(e.getMessage().contains("Connection failed")); + Assert.assertTrue(e.getMessage().contains("Connection failed")); } LOG.log(Level.INFO, "AFTER WARMUP COUNT: {0}", getOpenFileDescriptorCount()); @@ -69,17 +69,27 @@ public void testIncreaseFileDescriptorsOnTyrusImplementationInCaseOfUnresolvedAd session = container.connectToServer(webSocketClientEndpoint, uri); } catch (Exception e) { LOG.log(Level.FINE, e.getMessage()); - assertTrue(e.getMessage().contains("Connection failed")); - assertNull(session); + Assert.assertTrue(e.getMessage().contains("Connection failed")); + Assert.assertNull(session); } } - long fileDescriptorsAfter = getOpenFileDescriptorCount(); + long fileDescriptorsAfter = 0; + try { + for (int i = 0; i != 10; i++) { + fileDescriptorsAfter = getOpenFileDescriptorCount(); + if (fileDescriptorsBefore != fileDescriptorsAfter) { + Thread.sleep(100L); + } + } + } catch (Exception e) { + // ignore + } //Then LOG.log(Level.INFO, "END COUNT: {0}", getOpenFileDescriptorCount()); - assertEquals(fileDescriptorsBefore, fileDescriptorsAfter); + Assert.assertEquals(fileDescriptorsBefore, fileDescriptorsAfter); } diff --git a/tests/containers/pom.xml b/tests/containers/pom.xml new file mode 100644 index 00000000..e804db60 --- /dev/null +++ b/tests/containers/pom.xml @@ -0,0 +1,41 @@ + + + + 4.0.0 + + + org.glassfish.tyrus.tests + tyrus-tests-project + 2.0.99-SNAPSHOT + + + pom + tyrus-tests-containers + + Tyrus Container Tests + + + + + jdk-client + servlet + + diff --git a/tests/containers/servlet/pom.xml b/tests/containers/servlet/pom.xml new file mode 100644 index 00000000..51abc401 --- /dev/null +++ b/tests/containers/servlet/pom.xml @@ -0,0 +1,50 @@ + + + + 4.0.0 + + + org.glassfish.tyrus.tests + tyrus-tests-containers + 2.0.99-SNAPSHOT + + + war + tyrus-tests-containers-servlet + + Tyrus Servlet Containers Tests + + + + jakarta.servlet + jakarta.servlet-api + test + + + org.glassfish.tyrus + tyrus-container-servlet + test + + + junit + junit + test + + + diff --git a/tests/containers/servlet/src/test/java/module-info.java b/tests/containers/servlet/src/test/java/module-info.java new file mode 100644 index 00000000..01fc1867 --- /dev/null +++ b/tests/containers/servlet/src/test/java/module-info.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0, which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the + * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + * version 2 with the GNU Classpath Exception, which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + */ + +/** + * Tyrus Servlet Containers Tests Module + */ + +module org.glassfish.tyrus.test.container.servlet { + requires jakarta.servlet; + requires junit; + requires org.glassfish.tyrus.container.servlet; + + uses jakarta.servlet.ServletContainerInitializer; + + exports org.glassfish.tyrus.test.container.servlet; +} \ No newline at end of file diff --git a/tests/containers/servlet/src/test/java/org/glassfish/tyrus/test/container/servlet/TyrusServletContainerInitializerLoaderTest.java b/tests/containers/servlet/src/test/java/org/glassfish/tyrus/test/container/servlet/TyrusServletContainerInitializerLoaderTest.java new file mode 100644 index 00000000..08d4604e --- /dev/null +++ b/tests/containers/servlet/src/test/java/org/glassfish/tyrus/test/container/servlet/TyrusServletContainerInitializerLoaderTest.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0, which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the + * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + * version 2 with the GNU Classpath Exception, which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + */ + +package org.glassfish.tyrus.test.container.servlet; + +import jakarta.servlet.ServletContainerInitializer; +import org.glassfish.tyrus.servlet.TyrusServletContainerInitializer; +import org.junit.Assert; +import org.junit.Test; + +import java.util.Iterator; +import java.util.ServiceLoader; + +public class TyrusServletContainerInitializerLoaderTest { + @Test + public void loadTyrusServletContainerInitializerLoader() { + final ServiceLoader loader = ServiceLoader.load(ServletContainerInitializer.class); + final Iterator it = loader.iterator(); + Assert.assertTrue( + loader.stream() + .map(provider -> provider.get()) + .anyMatch(initializer -> TyrusServletContainerInitializer.class.equals(initializer.getClass())) + ); +// while (it.hasNext()) { +// ServletContainerInitializer initializer = it.next(); +// System.out.println(initializer.getClass().getName()); +// } + } + +} diff --git a/tests/e2e/application-config/pom.xml b/tests/e2e/application-config/pom.xml index b21a66d0..42360987 100755 --- a/tests/e2e/application-config/pom.xml +++ b/tests/e2e/application-config/pom.xml @@ -1,6 +1,6 @@ @@ -72,6 +73,12 @@ org.apache.maven.plugins maven-surefire-plugin + + + + org/glassfish/tyrus/tests/e2e/auth/basic/BasicAuthTest.java + + diff --git a/tests/e2e/jetty/auth-basic/src/main/java/org/glassfish/tyrus/tests/e2e/auth/basic/BasicAuthEchoEndpoint.java b/tests/e2e/jetty/auth-basic/src/main/java/org/glassfish/tyrus/tests/e2e/auth/basic/BasicAuthEchoEndpoint.java index 76cc50c9..81c72a38 100644 --- a/tests/e2e/jetty/auth-basic/src/main/java/org/glassfish/tyrus/tests/e2e/auth/basic/BasicAuthEchoEndpoint.java +++ b/tests/e2e/jetty/auth-basic/src/main/java/org/glassfish/tyrus/tests/e2e/auth/basic/BasicAuthEchoEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,13 +16,13 @@ package org.glassfish.tyrus.tests.e2e.auth.basic; -import javax.websocket.OnMessage; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.OnMessage; +import jakarta.websocket.server.ServerEndpoint; /** * Echo endpoint for string messages. * - * @author Ondrej Kosatka (ondrej.kosatka at oracle.com) + * @author Ondrej Kosatka */ @ServerEndpoint("/basic-auth-echo") public class BasicAuthEchoEndpoint { diff --git a/tests/e2e/jetty/auth-basic/src/test/java/org/glassfish/tyrus/tests/e2e/auth/basic/BasicAuthTest.java b/tests/e2e/jetty/auth-basic/src/test/java/org/glassfish/tyrus/tests/e2e/auth/basic/BasicAuthTest.java index 55643c44..1e98deb5 100644 --- a/tests/e2e/jetty/auth-basic/src/test/java/org/glassfish/tyrus/tests/e2e/auth/basic/BasicAuthTest.java +++ b/tests/e2e/jetty/auth-basic/src/test/java/org/glassfish/tyrus/tests/e2e/auth/basic/BasicAuthTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -20,13 +20,13 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.DeploymentException; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.MessageHandler; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.client.ClientProperties; @@ -42,7 +42,7 @@ /** * Authorization tests. * - * @author Ondrej Kosatka (ondrej.kosatka at oracle.com) + * @author Ondrej Kosatka */ public class BasicAuthTest extends TestContainer { diff --git a/tests/e2e/jetty/auth-digest/pom.xml b/tests/e2e/jetty/auth-digest/pom.xml index 5e741634..e8f7cc36 100644 --- a/tests/e2e/jetty/auth-digest/pom.xml +++ b/tests/e2e/jetty/auth-digest/pom.xml @@ -1,6 +1,6 @@ @@ -72,6 +73,12 @@ org.apache.maven.plugins maven-surefire-plugin + + + + org/glassfish/tyrus/tests/e2e/auth/basic/DigestAuthTest.java + + diff --git a/tests/e2e/jetty/auth-digest/src/main/java/org/glassfish/tyrus/tests/e2e/auth/basic/DigestAuthEchoEndpoint.java b/tests/e2e/jetty/auth-digest/src/main/java/org/glassfish/tyrus/tests/e2e/auth/basic/DigestAuthEchoEndpoint.java index ef9bbc1b..5ae39cb3 100644 --- a/tests/e2e/jetty/auth-digest/src/main/java/org/glassfish/tyrus/tests/e2e/auth/basic/DigestAuthEchoEndpoint.java +++ b/tests/e2e/jetty/auth-digest/src/main/java/org/glassfish/tyrus/tests/e2e/auth/basic/DigestAuthEchoEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,13 +16,13 @@ package org.glassfish.tyrus.tests.e2e.auth.basic; -import javax.websocket.OnMessage; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.OnMessage; +import jakarta.websocket.server.ServerEndpoint; /** * Echo endpoint for string messages. * - * @author Ondrej Kosatka (ondrej.kosatka at oracle.com) + * @author Ondrej Kosatka */ @ServerEndpoint("/digest-auth-echo") public class DigestAuthEchoEndpoint { diff --git a/tests/e2e/jetty/auth-digest/src/test/java/org/glassfish/tyrus/tests/e2e/auth/basic/DigestAuthTest.java b/tests/e2e/jetty/auth-digest/src/test/java/org/glassfish/tyrus/tests/e2e/auth/basic/DigestAuthTest.java index 7db4d9c7..78612008 100644 --- a/tests/e2e/jetty/auth-digest/src/test/java/org/glassfish/tyrus/tests/e2e/auth/basic/DigestAuthTest.java +++ b/tests/e2e/jetty/auth-digest/src/test/java/org/glassfish/tyrus/tests/e2e/auth/basic/DigestAuthTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -20,13 +20,13 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.DeploymentException; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.MessageHandler; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.client.ClientProperties; @@ -41,7 +41,7 @@ /** * Authorization tests. * - * @author Ondrej Kosatka (ondrej.kosatka at oracle.com) + * @author Ondrej Kosatka */ public class DigestAuthTest extends TestContainer { diff --git a/tests/e2e/jetty/pom.xml b/tests/e2e/jetty/pom.xml index 0d5d0624..b522dd48 100755 --- a/tests/e2e/jetty/pom.xml +++ b/tests/e2e/jetty/pom.xml @@ -1,6 +1,6 @@ @@ -96,18 +100,5 @@ - - jdk9+ - - [9,) - - - - com.sun.xml.bind - jaxb-osgi - test - - - diff --git a/tests/e2e/standard-config/src/test/java/module-info.java b/tests/e2e/standard-config/src/test/java/module-info.java new file mode 100644 index 00000000..1ee2a5d5 --- /dev/null +++ b/tests/e2e/standard-config/src/test/java/module-info.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0, which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the + * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + * version 2 with the GNU Classpath Exception, which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + */ + +/** + * Tyrus End-to-End Standard Config Tests Module + */ + +module org.glassfish.tyrus.tests.e2e.stdconfig { + requires java.logging; + + requires grizzly.http.server; + + requires junit; + + requires jakarta.xml.bind; + requires jakarta.json; + requires jakarta.websocket; + + requires com.sun.xml.bind.osgi; + + requires org.glassfish.tyrus.client; + requires org.glassfish.tyrus.core; + requires org.glassfish.tyrus.container.grizzly.server; + requires org.glassfish.tyrus.server; + requires org.glassfish.tyrus.spi; + + requires org.glassfish.tyrus.test.tools; + + exports org.glassfish.tyrus.test.standard_config; + exports org.glassfish.tyrus.test.standard_config.bean; + exports org.glassfish.tyrus.test.standard_config.bean.stin; + exports org.glassfish.tyrus.test.standard_config.message; + exports org.glassfish.tyrus.test.standard_config.decoder; + + opens org.glassfish.tyrus.test.standard_config.bean to jakarta.xml.bind; +} \ No newline at end of file diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/AnnotatedClientTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/AnnotatedClientTest.java index 724dff84..10a1395a 100755 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/AnnotatedClientTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/AnnotatedClientTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -20,15 +20,15 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpoint; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.ContainerProvider; -import javax.websocket.DeploymentException; -import javax.websocket.EndpointConfig; -import javax.websocket.OnMessage; -import javax.websocket.OnOpen; -import javax.websocket.Session; -import javax.websocket.WebSocketContainer; +import jakarta.websocket.ClientEndpoint; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.ContainerProvider; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.OnMessage; +import jakarta.websocket.OnOpen; +import jakarta.websocket.Session; +import jakarta.websocket.WebSocketContainer; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.server.Server; @@ -44,7 +44,7 @@ /** * Tests the client with the annotated version of the * - * @author Stepan Kopriva (stepan.kopriva at oracle.com) + * @author Stepan Kopriva */ public class AnnotatedClientTest extends TestContainer { @@ -234,7 +234,7 @@ public void testNonAnnotatedClassAsyncClient() throws Exception { /** * Testing the basic annotations. * - * @author Stepan Kopriva (stepan.kopriva at oracle.com) + * @author Stepan Kopriva */ @ClientEndpoint(decoders = {TestDecoder.class}) public class ClientTestEndpoint { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/AsyncTimeoutTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/AsyncTimeoutTest.java index 88090257..cda8f983 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/AsyncTimeoutTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/AsyncTimeoutTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -19,14 +19,14 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.DeploymentException; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.MessageHandler; -import javax.websocket.OnMessage; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.OnMessage; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.server.Server; @@ -36,7 +36,7 @@ import static org.junit.Assert.assertTrue; /** - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public class AsyncTimeoutTest extends TestContainer { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/BinaryStreamDecoderTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/BinaryStreamDecoderTest.java index 79718a72..16480030 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/BinaryStreamDecoderTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/BinaryStreamDecoderTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -24,19 +24,19 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.ContainerProvider; -import javax.websocket.DecodeException; -import javax.websocket.Decoder; -import javax.websocket.DeploymentException; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.MessageHandler; -import javax.websocket.OnMessage; -import javax.websocket.RemoteEndpoint; -import javax.websocket.Session; -import javax.websocket.WebSocketContainer; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.ContainerProvider; +import jakarta.websocket.DecodeException; +import jakarta.websocket.Decoder; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.OnMessage; +import jakarta.websocket.RemoteEndpoint; +import jakarta.websocket.Session; +import jakarta.websocket.WebSocketContainer; +import jakarta.websocket.server.ServerEndpoint; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.server.Server; @@ -47,7 +47,7 @@ import static org.junit.Assert.assertTrue; /** - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public class BinaryStreamDecoderTest extends TestContainer { public static class TestMessage { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/BinaryTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/BinaryTest.java index 437cb5e6..37316834 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/BinaryTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/BinaryTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -22,14 +22,14 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.DeploymentException; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.MessageHandler; -import javax.websocket.OnMessage; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.OnMessage; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.server.Server; @@ -41,7 +41,7 @@ /** * Test for all supported message types. * - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public class BinaryTest extends TestContainer { @@ -59,7 +59,7 @@ public class BinaryTest extends TestContainer { /** * Bean to test correct processing of binary message. * - * @author Stepan Kopriva (stepan.kopriva at oracle.com) + * @author Stepan Kopriva */ @ServerEndpoint(value = "/binary2") public static class BinaryByteBufferEndpoint { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/BlockingBinaryTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/BlockingBinaryTest.java index 41fc05d8..1d3a094e 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/BlockingBinaryTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/BlockingBinaryTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -23,14 +23,14 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.DeploymentException; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.MessageHandler; -import javax.websocket.OnOpen; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.OnOpen; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.server.Server; @@ -42,7 +42,7 @@ /** * Tests the basic client behavior, sending and receiving binary messages * - * @author Danny Coward (danny.coward at oracle.com) + * @author Danny Coward */ public class BlockingBinaryTest extends TestContainer { @@ -71,7 +71,7 @@ public void testClient() throws DeploymentException { } /** - * @author Danny Coward (danny.coward at oracle.com) + * @author Danny Coward */ @ServerEndpoint(value = "/blockingbinary") public static class BlockingBinaryEndpoint extends Endpoint { @@ -119,7 +119,7 @@ public void reply() { } /** - * @author Danny Coward (danny.coward at oracle.com) + * @author Danny Coward */ public static class BlockingBinaryClient extends Endpoint { volatile boolean gotTheSameThingBack = false; diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/BlockingInputTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/BlockingInputTest.java index 17cf9f05..51fe0710 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/BlockingInputTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/BlockingInputTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -23,12 +23,12 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpoint; -import javax.websocket.OnMessage; -import javax.websocket.OnOpen; -import javax.websocket.PongMessage; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.ClientEndpoint; +import jakarta.websocket.OnMessage; +import jakarta.websocket.OnOpen; +import jakarta.websocket.PongMessage; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.server.Server; diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/BlockingStreamingTextTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/BlockingStreamingTextTest.java index 5887f757..9a71c4f3 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/BlockingStreamingTextTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/BlockingStreamingTextTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -22,13 +22,13 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.MessageHandler; -import javax.websocket.OnOpen; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.OnOpen; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.server.Server; @@ -40,8 +40,8 @@ /** * Tests the basic client behavior, sending and receiving message * - * @author Danny Coward (danny.coward at oracle.com) - * @author Martin Matula (martin.matula at oracle.com) + * @author Danny Coward + * @author Martin Matula */ public class BlockingStreamingTextTest extends TestContainer { @@ -73,8 +73,8 @@ public void testBlockingStreamingTextServer() { } /** - * @author Danny Coward (danny.coward at oracle.com) - * @author Martin Matula (martin.matula at oracle.com) + * @author Danny Coward + * @author Martin Matula */ @ServerEndpoint(value = "/blocking-streaming") public static class BlockingStreamingTextEndpoint { @@ -119,7 +119,7 @@ public void onOpen(final Session session) { } /** - * @author Danny Coward (danny.coward at oracle.com) + * @author Danny Coward */ public static class BlockingStreamingTextClient extends Endpoint { String receivedMessage; diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/BroadcasterTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/BroadcasterTest.java index c16775e1..00aaf26a 100755 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/BroadcasterTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/BroadcasterTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -20,15 +20,15 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.DeploymentException; -import javax.websocket.EncodeException; -import javax.websocket.EndpointConfig; -import javax.websocket.MessageHandler; -import javax.websocket.OnMessage; -import javax.websocket.RemoteEndpoint; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.EncodeException; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.OnMessage; +import jakarta.websocket.RemoteEndpoint; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.core.TyrusSession; @@ -41,7 +41,7 @@ /** * Tests broadcasting to several clients. * - * @author Martin Matula (martin.matula at oracle.com) + * @author Martin Matula */ public class BroadcasterTest extends TestContainer { private static final String SENT_MESSAGE = "Hello World"; @@ -157,8 +157,8 @@ public void onMessage(String message) { } /** - * @author Martin Matula (martin.matula at oracle.com) - * @author Stepan Kopriva (stepan.kopriva at oracle.com) + * @author Martin Matula + * @author Stepan Kopriva */ @ServerEndpoint(value = "/broadcast") public static class BroadcasterTestEndpoint { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/BufferSizeTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/BufferSizeTest.java index 4f4a8366..b25dc30a 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/BufferSizeTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/BufferSizeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -24,17 +24,17 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.CloseReason; -import javax.websocket.DeploymentException; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.MessageHandler; -import javax.websocket.OnClose; -import javax.websocket.OnMessage; -import javax.websocket.OnOpen; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.CloseReason; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.OnClose; +import jakarta.websocket.OnMessage; +import jakarta.websocket.OnOpen; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.server.Server; @@ -46,7 +46,7 @@ import static org.junit.Assert.assertTrue; /** - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public class BufferSizeTest extends TestContainer { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/BufferedInputStreamTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/BufferedInputStreamTest.java index f43daddd..cbd4cbec 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/BufferedInputStreamTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/BufferedInputStreamTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -23,15 +23,15 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.DeploymentException; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.MessageHandler; -import javax.websocket.OnMessage; -import javax.websocket.OnOpen; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.OnMessage; +import jakarta.websocket.OnOpen; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.server.Server; diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ClientCloseTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ClientCloseTest.java index 17f61f6e..5ae483ed 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ClientCloseTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ClientCloseTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -21,14 +21,14 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.DeploymentException; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.MessageHandler; -import javax.websocket.OnMessage; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.OnMessage; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.server.Server; diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ClientExecutorsManagementTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ClientExecutorsManagementTest.java index d03f8ee7..65b273d6 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ClientExecutorsManagementTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ClientExecutorsManagementTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -24,16 +24,16 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicReference; -import javax.websocket.ClientEndpoint; -import javax.websocket.CloseReason; -import javax.websocket.ContainerProvider; -import javax.websocket.DeploymentException; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.OnMessage; -import javax.websocket.OnOpen; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.ClientEndpoint; +import jakarta.websocket.CloseReason; +import jakarta.websocket.ContainerProvider; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.OnMessage; +import jakarta.websocket.OnOpen; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.client.ClientProperties; diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ClientManagerTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ClientManagerTest.java index 46f37e0a..8228a810 100755 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ClientManagerTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ClientManagerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -20,10 +20,10 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.DeploymentException; -import javax.websocket.EndpointConfig; -import javax.websocket.Session; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.Session; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.server.Server; @@ -35,9 +35,9 @@ import static org.junit.Assert.assertTrue; /** - * Tests the implementation of {@link javax.websocket.WebSocketContainer}. + * Tests the implementation of {@link jakarta.websocket.WebSocketContainer}. * - * @author Stepan Kopriva (stepan.kopriva at oracle.com) + * @author Stepan Kopriva */ public class ClientManagerTest extends TestContainer { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ClientReconnectHandlerTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ClientReconnectHandlerTest.java index f7ee44ed..c4f4b8dc 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ClientReconnectHandlerTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ClientReconnectHandlerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -22,14 +22,14 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.CloseReason; -import javax.websocket.DeploymentException; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.OnMessage; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.CloseReason; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.OnMessage; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.client.ClientProperties; @@ -40,7 +40,7 @@ import static org.junit.Assert.assertTrue; /** - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public class ClientReconnectHandlerTest extends TestContainer { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ClientTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ClientTest.java index 6e1716d1..b4238667 100755 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ClientTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ClientTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -21,10 +21,10 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.DeploymentException; -import javax.websocket.EndpointConfig; -import javax.websocket.Session; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.Session; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.server.Server; @@ -37,7 +37,7 @@ /** * Tests the basic client behavior, sending and receiving message. * - * @author Stepan Kopriva (stepan.kopriva at oracle.com) + * @author Stepan Kopriva */ public class ClientTest extends TestContainer { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ControlFrameInDataStreamTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ControlFrameInDataStreamTest.java index bf0b4362..2258953c 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ControlFrameInDataStreamTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ControlFrameInDataStreamTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -21,14 +21,14 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpoint; -import javax.websocket.CloseReason; -import javax.websocket.OnClose; -import javax.websocket.OnMessage; -import javax.websocket.OnOpen; -import javax.websocket.PongMessage; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.ClientEndpoint; +import jakarta.websocket.CloseReason; +import jakarta.websocket.OnClose; +import jakarta.websocket.OnMessage; +import jakarta.websocket.OnOpen; +import jakarta.websocket.PongMessage; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.server.Server; diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/CustomMaskingKeyGeneratorTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/CustomMaskingKeyGeneratorTest.java index e7692bc5..8224f9d4 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/CustomMaskingKeyGeneratorTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/CustomMaskingKeyGeneratorTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -22,15 +22,15 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.Extension; -import javax.websocket.MessageHandler; -import javax.websocket.OnMessage; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; -import javax.websocket.server.ServerEndpointConfig; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.Extension; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.OnMessage; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; +import jakarta.websocket.server.ServerEndpointConfig; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.client.ClientProperties; diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/DecodedObjectTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/DecodedObjectTest.java index e91b2fd6..3b44d798 100755 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/DecodedObjectTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/DecodedObjectTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -21,14 +21,14 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.DecodeException; -import javax.websocket.Decoder; -import javax.websocket.DeploymentException; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.MessageHandler; -import javax.websocket.Session; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.DecodeException; +import jakarta.websocket.Decoder; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.Session; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.core.coder.CoderAdapter; @@ -45,7 +45,7 @@ /** * Tests the decoding and message handling of custom object. * - * @author Stepan Kopriva (stepan.kopriva at oracle.com) + * @author Stepan Kopriva */ public class DecodedObjectTest extends TestContainer { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/EncodedObjectTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/EncodedObjectTest.java index deabeb79..94751630 100755 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/EncodedObjectTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/EncodedObjectTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -21,17 +21,17 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.DeploymentException; -import javax.websocket.EncodeException; -import javax.websocket.Encoder; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.MessageHandler; -import javax.websocket.OnMessage; -import javax.websocket.OnOpen; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.EncodeException; +import jakarta.websocket.Encoder; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.OnMessage; +import jakarta.websocket.OnOpen; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.core.coder.CoderAdapter; @@ -46,7 +46,7 @@ /** * Tests encoding of custom objects. * - * @author Stepan Kopriva (stepan.kopriva at oracle.com) + * @author Stepan Kopriva */ public class EncodedObjectTest extends TestContainer { @@ -238,7 +238,7 @@ public StringContainer helloWorld(String message) { } /** - * @author Stepan Kopriva (stepan.kopriva at oracle.com) + * @author Stepan Kopriva */ public static class StringContainerEncoder extends CoderAdapter implements Encoder.Text { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/EncoderBinaryStreamTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/EncoderBinaryStreamTest.java index fb13bdc9..68329ed9 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/EncoderBinaryStreamTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/EncoderBinaryStreamTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -22,16 +22,16 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.DeploymentException; -import javax.websocket.EncodeException; -import javax.websocket.Encoder; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.MessageHandler; -import javax.websocket.OnMessage; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.EncodeException; +import jakarta.websocket.Encoder; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.OnMessage; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.core.coder.CoderAdapter; @@ -42,7 +42,7 @@ import static org.junit.Assert.assertEquals; /** - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public class EncoderBinaryStreamTest extends TestContainer { @@ -51,7 +51,7 @@ public class EncoderBinaryStreamTest extends TestContainer { /** * Exception thrown during execution @OnOpen annotated method. * - * @author Danny Coward (danny.coward at oracle.com) + * @author Danny Coward */ @ServerEndpoint(value = "/apple", encoders = {BinaryStreamEncoder.class}) public static class OnOpenErrorTestEndpoint { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ExtensionsTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ExtensionsTest.java index ed47f094..694c0fed 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ExtensionsTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ExtensionsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -22,17 +22,17 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.DeploymentException; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.Extension; -import javax.websocket.MessageHandler; -import javax.websocket.OnMessage; -import javax.websocket.OnOpen; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; -import javax.websocket.server.ServerEndpointConfig; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.Extension; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.OnMessage; +import jakarta.websocket.OnOpen; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; +import jakarta.websocket.server.ServerEndpointConfig; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.core.TyrusExtension; @@ -43,7 +43,7 @@ import static org.junit.Assert.assertEquals; /** - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ @SuppressWarnings("serial") public class ExtensionsTest extends TestContainer { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/GenericClientEndpointTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/GenericClientEndpointTest.java index b690310e..9e8345c9 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/GenericClientEndpointTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/GenericClientEndpointTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -19,10 +19,10 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpoint; -import javax.websocket.DeploymentException; -import javax.websocket.OnMessage; -import javax.websocket.Session; +import jakarta.websocket.ClientEndpoint; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.OnMessage; +import jakarta.websocket.Session; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.server.Server; @@ -33,7 +33,7 @@ import static org.junit.Assert.assertTrue; /** - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public class GenericClientEndpointTest extends TestContainer { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/HandshakeTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/HandshakeTest.java index 113cd550..42fa16db 100755 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/HandshakeTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/HandshakeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -23,12 +23,12 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.DeploymentException; -import javax.websocket.EndpointConfig; -import javax.websocket.HandshakeResponse; -import javax.websocket.Session; -import javax.websocket.server.HandshakeRequest; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.HandshakeResponse; +import jakarta.websocket.Session; +import jakarta.websocket.server.HandshakeRequest; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.server.Server; @@ -41,7 +41,7 @@ /** * Tests whether the HandShake parameters (sub-protocols, extensions) are sent correctly. * - * @author Stepan Kopriva (stepan.kopriva at oracle.com) + * @author Stepan Kopriva */ public class HandshakeTest extends TestContainer { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/HeartbeatTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/HeartbeatTest.java index 4f8ac4d7..85ba563a 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/HeartbeatTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/HeartbeatTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -21,17 +21,17 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.CloseReason; -import javax.websocket.DeploymentException; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.MessageHandler; -import javax.websocket.OnMessage; -import javax.websocket.OnOpen; -import javax.websocket.PongMessage; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.CloseReason; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.OnMessage; +import jakarta.websocket.OnOpen; +import jakarta.websocket.PongMessage; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.core.TyrusSession; diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/HelloBinaryClient.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/HelloBinaryClient.java index f7e0afb4..59cb5934 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/HelloBinaryClient.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/HelloBinaryClient.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -19,13 +19,13 @@ import java.nio.ByteBuffer; import java.util.concurrent.CountDownLatch; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.MessageHandler; -import javax.websocket.Session; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.Session; /** - * @author Danny Coward (danny.coward at oracle.com) + * @author Danny Coward */ public class HelloBinaryClient extends Endpoint { volatile boolean echoWorked = false; diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/HelloBinaryTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/HelloBinaryTest.java index a52ff9cd..87e28550 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/HelloBinaryTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/HelloBinaryTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -20,12 +20,12 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.DeploymentException; -import javax.websocket.MessageHandler; -import javax.websocket.OnOpen; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.OnOpen; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.server.Server; @@ -37,7 +37,7 @@ /** * Tests the basic client behavior, sending and receiving message * - * @author Danny Coward (danny.coward at oracle.com) + * @author Danny Coward */ public class HelloBinaryTest extends TestContainer { @@ -64,7 +64,7 @@ public void testClient() throws DeploymentException { } /** - * @author Danny Coward (danny.coward at oracle.com) + * @author Danny Coward */ @ServerEndpoint(value = "/hellobinary") diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/HelloTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/HelloTest.java index 6e61a1c0..cd7460ad 100755 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/HelloTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/HelloTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -20,14 +20,14 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.ContainerProvider; -import javax.websocket.DeploymentException; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.MessageHandler; -import javax.websocket.Session; -import javax.websocket.WebSocketContainer; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.ContainerProvider; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.Session; +import jakarta.websocket.WebSocketContainer; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.server.Server; @@ -40,7 +40,7 @@ /** * Tests the basic echo. * - * @author Stepan Kopriva (stepan.kopriva at oracle.com) + * @author Stepan Kopriva */ public class HelloTest extends TestContainer { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/HelloTextClient.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/HelloTextClient.java index 3bd3d201..510d699a 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/HelloTextClient.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/HelloTextClient.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -18,13 +18,13 @@ import java.util.concurrent.CountDownLatch; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.MessageHandler; -import javax.websocket.Session; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.Session; /** - * @author Danny Coward (danny.coward at oracle.com) + * @author Danny Coward */ public class HelloTextClient extends Endpoint { boolean gotSomethingBack = false; diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/HelloTextTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/HelloTextTest.java index 9901e86d..a880693a 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/HelloTextTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/HelloTextTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -19,12 +19,12 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.DeploymentException; -import javax.websocket.OnMessage; -import javax.websocket.OnOpen; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.OnMessage; +import jakarta.websocket.OnOpen; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.server.Server; @@ -36,7 +36,7 @@ /** * Tests the basic client behavior, sending and receiving message * - * @author Danny Coward (danny.coward at oracle.com) + * @author Danny Coward */ public class HelloTextTest extends TestContainer { @@ -63,7 +63,7 @@ public void testClient() throws DeploymentException { } /** - * @author Danny Coward (danny.coward at oracle.com) + * @author Danny Coward */ @ServerEndpoint(value = "/hellotext") public static class HelloTextEndpoint { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/HostVerificationTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/HostVerificationTest.java index 2e2ac3ac..663d6081 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/HostVerificationTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/HostVerificationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,8 +16,8 @@ package org.glassfish.tyrus.test.standard_config; -import javax.websocket.ClientEndpoint; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.ClientEndpoint; +import jakarta.websocket.server.ServerEndpoint; import javax.net.ssl.HostnameVerifier; import javax.net.ssl.SSLException; diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/JsonTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/JsonTest.java index 4ea6b803..ff03b1de 100755 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/JsonTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/JsonTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -21,22 +21,22 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.DecodeException; -import javax.websocket.Decoder; -import javax.websocket.DeploymentException; -import javax.websocket.EncodeException; -import javax.websocket.Encoder; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.MessageHandler; -import javax.websocket.OnMessage; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; - -import javax.json.Json; -import javax.json.JsonException; -import javax.json.JsonObject; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.DecodeException; +import jakarta.websocket.Decoder; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.EncodeException; +import jakarta.websocket.Encoder; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.OnMessage; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; + +import jakarta.json.Json; +import jakarta.json.JsonException; +import jakarta.json.JsonObject; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.core.coder.CoderAdapter; @@ -49,7 +49,7 @@ /** * Tests the JSON format. * - * @author Stepan Kopriva (stepan.kopriva at oracle.com) + * @author Stepan Kopriva */ public class JsonTest extends TestContainer { @@ -99,7 +99,7 @@ public void onMessage(String message) { } /** - * @author Danny Coward (danny.coward at oracle.com) + * @author Danny Coward */ @ServerEndpoint( value = "/json2", @@ -116,7 +116,7 @@ public JsonObject helloWorld(JsonObject message) { } /** - * @author Danny Coward (danny.coward at oracle.com) + * @author Danny Coward */ public static class JsonDecoder extends CoderAdapter implements Decoder.Text { @@ -137,7 +137,7 @@ public boolean willDecode(String s) { } /** - * @author Danny Coward (danny.coward at oracle.com) + * @author Danny Coward */ public static class JsonEncoder extends CoderAdapter implements Encoder.Text { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/MaxMessageSizeTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/MaxMessageSizeTest.java index e6001f6c..c9e5afc0 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/MaxMessageSizeTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/MaxMessageSizeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -20,19 +20,19 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpoint; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.CloseReason; -import javax.websocket.DeploymentException; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.MessageHandler; -import javax.websocket.OnClose; -import javax.websocket.OnError; -import javax.websocket.OnMessage; -import javax.websocket.OnOpen; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.ClientEndpoint; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.CloseReason; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.OnClose; +import jakarta.websocket.OnError; +import jakarta.websocket.OnMessage; +import jakarta.websocket.OnOpen; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.server.Server; @@ -43,7 +43,7 @@ import static org.junit.Assert.assertNotNull; /** - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public class MaxMessageSizeTest extends TestContainer { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/MessageHandlersTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/MessageHandlersTest.java index 52426488..93567808 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/MessageHandlersTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/MessageHandlersTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -26,14 +26,14 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.DeploymentException; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.MessageHandler; -import javax.websocket.OnMessage; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.OnMessage; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.core.Utils; @@ -45,7 +45,7 @@ import static org.junit.Assert.assertEquals; /** - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public class MessageHandlersTest extends TestContainer { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/MessageParamOrderTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/MessageParamOrderTest.java index f61f6427..246d89f8 100755 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/MessageParamOrderTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/MessageParamOrderTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -20,12 +20,12 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.DeploymentException; -import javax.websocket.EndpointConfig; -import javax.websocket.OnMessage; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.OnMessage; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.server.Server; @@ -37,9 +37,9 @@ /** * Tests the correct behavior of various orders of parameters of methods annotated with - * {@link javax.websocket.OnMessage} + * {@link jakarta.websocket.OnMessage} * - * @author Stepan Kopriva (stepan.kopriva at oracle.com) + * @author Stepan Kopriva */ public class MessageParamOrderTest extends TestContainer { @@ -136,7 +136,7 @@ public void onMessage(String message) { /** * Together with HelloTestBean used to test invocation of methods with various order of parameters. * - * @author Stepan Kopriva (stepan.kopriva at oracle.com) + * @author Stepan Kopriva */ @ServerEndpoint(value = "/hello") public static class MessageParamOrderTestBeanEndpoint { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/MessageSequenceTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/MessageSequenceTest.java index bbfc46db..9eb549d0 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/MessageSequenceTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/MessageSequenceTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2020 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -26,17 +26,17 @@ import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.CloseReason; -import javax.websocket.DeploymentException; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.MessageHandler; -import javax.websocket.OnClose; -import javax.websocket.OnError; -import javax.websocket.OnMessage; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.CloseReason; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.OnClose; +import jakarta.websocket.OnError; +import jakarta.websocket.OnMessage; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.server.Server; diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ModifyRequestResponseHeadersTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ModifyRequestResponseHeadersTest.java index 7de104fe..7c06256e 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ModifyRequestResponseHeadersTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ModifyRequestResponseHeadersTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -23,19 +23,19 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpoint; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.DeploymentException; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.HandshakeResponse; -import javax.websocket.MessageHandler; -import javax.websocket.OnMessage; -import javax.websocket.OnOpen; -import javax.websocket.Session; -import javax.websocket.server.HandshakeRequest; -import javax.websocket.server.ServerEndpoint; -import javax.websocket.server.ServerEndpointConfig; +import jakarta.websocket.ClientEndpoint; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.HandshakeResponse; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.OnMessage; +import jakarta.websocket.OnOpen; +import jakarta.websocket.Session; +import jakarta.websocket.server.HandshakeRequest; +import jakarta.websocket.server.ServerEndpoint; +import jakarta.websocket.server.ServerEndpointConfig; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.server.Server; @@ -46,7 +46,7 @@ import static org.junit.Assert.assertTrue; /** - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public class ModifyRequestResponseHeadersTest extends TestContainer { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/OnCloseTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/OnCloseTest.java index 8a8fb536..535508c5 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/OnCloseTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/OnCloseTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -20,17 +20,17 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.CloseReason; -import javax.websocket.DeploymentException; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.OnClose; -import javax.websocket.OnError; -import javax.websocket.OnMessage; -import javax.websocket.OnOpen; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.CloseReason; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.OnClose; +import jakarta.websocket.OnError; +import jakarta.websocket.OnMessage; +import jakarta.websocket.OnOpen; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.server.Server; @@ -41,7 +41,7 @@ import static org.junit.Assert.assertTrue; /** - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public class OnCloseTest extends TestContainer { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/OriginTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/OriginTest.java index b2c46e48..c278619a 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/OriginTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/OriginTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -19,14 +19,14 @@ import java.io.IOException; import java.net.URISyntaxException; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.DeploymentException; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.OnMessage; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; -import javax.websocket.server.ServerEndpointConfig; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.OnMessage; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; +import jakarta.websocket.server.ServerEndpointConfig; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.server.Server; @@ -37,7 +37,7 @@ import static org.junit.Assert.fail; /** - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public class OriginTest extends TestContainer { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ParallelBroadcastTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ParallelBroadcastTest.java index cff8ed93..2c73c734 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ParallelBroadcastTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ParallelBroadcastTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -25,10 +25,10 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; -import javax.websocket.ClientEndpoint; -import javax.websocket.OnMessage; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.ClientEndpoint; +import jakarta.websocket.OnMessage; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.client.ClientProperties; diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/PartialBinaryTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/PartialBinaryTest.java index b3dc6539..148b4fc1 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/PartialBinaryTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/PartialBinaryTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -21,14 +21,14 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.DeploymentException; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.MessageHandler; -import javax.websocket.OnMessage; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.OnMessage; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.server.Server; @@ -38,7 +38,7 @@ import org.junit.Test; /** - * @author Stepan Kopriva (stepan.kopriva at oracle.com) + * @author Stepan Kopriva */ public class PartialBinaryTest extends TestContainer { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/PingPongTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/PingPongTest.java index a5b70232..e026ce8f 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/PingPongTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/PingPongTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -22,17 +22,17 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.DeploymentException; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.MessageHandler; -import javax.websocket.OnError; -import javax.websocket.OnMessage; -import javax.websocket.OnOpen; -import javax.websocket.PongMessage; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.OnError; +import jakarta.websocket.OnMessage; +import jakarta.websocket.OnOpen; +import jakarta.websocket.PongMessage; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.server.Server; @@ -47,7 +47,7 @@ /** * Tests sending and receiving ping and pongs * - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public class PingPongTest extends TestContainer { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/PrimitiveDataTypesTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/PrimitiveDataTypesTest.java index eedf44b0..5e60f2c7 100755 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/PrimitiveDataTypesTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/PrimitiveDataTypesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -20,10 +20,10 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.DeploymentException; -import javax.websocket.EndpointConfig; -import javax.websocket.Session; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.Session; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.server.Server; @@ -35,7 +35,7 @@ /** * Tests the primitive data types * - * @author Stepan Kopriva (stepan.kopriva at oracle.com) + * @author Stepan Kopriva */ public class PrimitiveDataTypesTest extends TestContainer { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ProxySelectorNullTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ProxySelectorNullTest.java index 0924ba57..577a2a44 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ProxySelectorNullTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ProxySelectorNullTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -21,10 +21,10 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.DeploymentException; -import javax.websocket.EndpointConfig; -import javax.websocket.Session; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.Session; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.server.Server; @@ -35,7 +35,7 @@ import org.junit.Test; /** - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public class ProxySelectorNullTest extends TestContainer { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ProxyTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ProxyTest.java index 5ed0af03..cfd01fb5 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ProxyTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ProxyTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2020 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -22,12 +22,12 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpoint; -import javax.websocket.DeploymentException; -import javax.websocket.OnMessage; -import javax.websocket.OnOpen; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.ClientEndpoint; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.OnMessage; +import jakarta.websocket.OnOpen; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.client.ClientProperties; diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/QueryParamTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/QueryParamTest.java index 1ad6aa7f..d7ab0db6 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/QueryParamTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/QueryParamTest.java @@ -21,14 +21,14 @@ import org.glassfish.tyrus.test.tools.TestContainer; import org.junit.Test; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.DeploymentException; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.MessageHandler; -import javax.websocket.OnMessage; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.OnMessage; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; import java.io.IOException; import java.net.URI; import java.net.URLEncoder; diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ReaderWriterTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ReaderWriterTest.java index 6e538a88..745db843 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ReaderWriterTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ReaderWriterTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -22,18 +22,18 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.DeploymentException; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.MessageHandler; -import javax.websocket.OnMessage; -import javax.websocket.OnOpen; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.OnMessage; +import jakarta.websocket.OnOpen; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; +import jakarta.xml.bind.JAXBContext; +import jakarta.xml.bind.JAXBException; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.server.Server; @@ -44,7 +44,7 @@ import static org.junit.Assert.assertTrue; /** - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public class ReaderWriterTest extends TestContainer { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/RemoteTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/RemoteTest.java index f0306858..4dd9a38d 100755 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/RemoteTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/RemoteTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -20,10 +20,10 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.DeploymentException; -import javax.websocket.EndpointConfig; -import javax.websocket.Session; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.Session; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.server.Server; @@ -35,7 +35,7 @@ /** * Tests the WebSocket remote for basic types * - * @author Stepan Kopriva (stepan.kopriva at oracle.com) + * @author Stepan Kopriva */ public class RemoteTest extends TestContainer { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/RequestParameterMapTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/RequestParameterMapTest.java index e550a797..c94f0fd2 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/RequestParameterMapTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/RequestParameterMapTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -21,14 +21,14 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.DeploymentException; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.MessageHandler; -import javax.websocket.OnOpen; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.OnOpen; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.server.Server; @@ -38,7 +38,7 @@ import static org.junit.Assert.assertTrue; /** - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public class RequestParameterMapTest extends TestContainer { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/SameHeadersOnServerTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/SameHeadersOnServerTest.java index 0197b967..98e699c4 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/SameHeadersOnServerTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/SameHeadersOnServerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -29,10 +29,10 @@ import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; -import javax.websocket.HandshakeResponse; -import javax.websocket.server.HandshakeRequest; -import javax.websocket.server.ServerEndpoint; -import javax.websocket.server.ServerEndpointConfig; +import jakarta.websocket.HandshakeResponse; +import jakarta.websocket.server.HandshakeRequest; +import jakarta.websocket.server.ServerEndpoint; +import jakarta.websocket.server.ServerEndpointConfig; import org.glassfish.tyrus.server.Server; import org.glassfish.tyrus.spi.UpgradeRequest; diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ServerSessionConnectToServerTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ServerSessionConnectToServerTest.java index 9db33d4a..99160310 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ServerSessionConnectToServerTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/ServerSessionConnectToServerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -21,15 +21,15 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.DeploymentException; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.MessageHandler; -import javax.websocket.OnMessage; -import javax.websocket.Session; -import javax.websocket.WebSocketContainer; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.OnMessage; +import jakarta.websocket.Session; +import jakarta.websocket.WebSocketContainer; +import jakarta.websocket.server.ServerEndpoint; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.server.Server; @@ -40,7 +40,7 @@ import static org.junit.Assert.assertTrue; /** - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public class ServerSessionConnectToServerTest extends TestContainer { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/SessionGetOpenSessionsTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/SessionGetOpenSessionsTest.java index 706cdfc5..b405d734 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/SessionGetOpenSessionsTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/SessionGetOpenSessionsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -20,14 +20,14 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.DeploymentException; -import javax.websocket.MessageHandler; -import javax.websocket.OnError; -import javax.websocket.OnMessage; -import javax.websocket.OnOpen; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.OnError; +import jakarta.websocket.OnMessage; +import jakarta.websocket.OnOpen; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.server.Server; @@ -39,7 +39,7 @@ /** * Tests the ServerContainer.getOpenSessions method. * - * @author Stepan Kopriva (stepan.kopriva at oracle.com) + * @author Stepan Kopriva */ public class SessionGetOpenSessionsTest extends TestContainer { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/SessionTimeoutTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/SessionTimeoutTest.java index e4bd8eee..60910746 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/SessionTimeoutTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/SessionTimeoutTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -22,17 +22,17 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.CloseReason; -import javax.websocket.DeploymentException; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.MessageHandler; -import javax.websocket.OnClose; -import javax.websocket.OnMessage; -import javax.websocket.OnOpen; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.CloseReason; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.OnClose; +import jakarta.websocket.OnMessage; +import jakarta.websocket.OnOpen; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.server.Server; @@ -42,7 +42,7 @@ import static org.junit.Assert.*; /** - * @author Stepan Kopriva (stepan.kopriva at oracle.com) + * @author Stepan Kopriva */ public class SessionTimeoutTest extends TestContainer { @@ -274,9 +274,14 @@ public EndpointConfig getEndpointConfig() { @ServerEndpoint(value = "/timeout1") public static class SessionClientTimeoutEndpoint { public static final AtomicBoolean clientOnCloseCalled = new AtomicBoolean(false); + } + @ServerEndpoint(value = "/timeout1b") + public static class SessionClientTimeoutEndpoint2 { + public static final AtomicBoolean clientOnCloseCalled = new AtomicBoolean(false); } + @Test public void testSessionClientTimeoutSession() throws DeploymentException { Server server = startServer(SessionClientTimeoutEndpoint.class); @@ -451,9 +456,9 @@ public void onClose(Session session, CloseReason closeReason) { @Test public void testSessionTimeoutReset2() throws DeploymentException { - Server server = startServer(SessionClientTimeoutEndpoint.class); + Server server = startServer(SessionClientTimeoutEndpoint2.class); final CountDownLatch onCloseLatch = new CountDownLatch(1); - SessionClientTimeoutEndpoint.clientOnCloseCalled.set(false); + SessionClientTimeoutEndpoint2.clientOnCloseCalled.set(false); try { final ClientEndpointConfig cec = ClientEndpointConfig.Builder.create().build(); @@ -477,16 +482,16 @@ public EndpointConfig getEndpointConfig() { @Override public void onClose(Session session, CloseReason closeReason) { System.out.println(System.currentTimeMillis() + "### !closed " + closeReason); - SessionClientTimeoutEndpoint.clientOnCloseCalled.set(true); + SessionClientTimeoutEndpoint2.clientOnCloseCalled.set(true); onCloseLatch.countDown(); } - }, cec, getURI(SessionClientTimeoutEndpoint.class)); + }, cec, getURI(SessionClientTimeoutEndpoint2.class)); assertTrue(session.getMaxIdleTimeout() == 1000); session.setMaxIdleTimeout(-10); assertFalse(onCloseLatch.await(4, TimeUnit.SECONDS)); - assertFalse(SessionClientTimeoutEndpoint.clientOnCloseCalled.get()); + assertFalse(SessionClientTimeoutEndpoint2.clientOnCloseCalled.get()); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException(e.getMessage(), e); diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/SharedContainerTimeoutTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/SharedContainerTimeoutTest.java index 4f144f0a..71d6eba1 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/SharedContainerTimeoutTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/SharedContainerTimeoutTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -20,9 +20,9 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.DeploymentException; -import javax.websocket.Session; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Session; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.client.ClientProperties; @@ -36,7 +36,7 @@ import static org.junit.Assert.assertTrue; /** - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public class SharedContainerTimeoutTest extends TestContainer { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/SimpleRemoteTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/SimpleRemoteTest.java index 5ec3e021..91d55cde 100755 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/SimpleRemoteTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/SimpleRemoteTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -23,12 +23,12 @@ import java.util.logging.Level; import java.util.logging.Logger; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.DeploymentException; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.MessageHandler; -import javax.websocket.Session; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.Session; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.server.Server; @@ -43,8 +43,8 @@ /** * Tests the basic behaviour of remote * - * @author Stepan Kopriva (stepan.kopriva at oracle.com) - * @author Martin Matula (martin.matula at oracle.com) + * @author Stepan Kopriva + * @author Martin Matula */ public class SimpleRemoteTest extends TestContainer { private String receivedMessage; diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/StreamingBinaryTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/StreamingBinaryTest.java index d41b4efb..7420348f 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/StreamingBinaryTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/StreamingBinaryTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -23,14 +23,14 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.DeploymentException; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.MessageHandler; -import javax.websocket.OnOpen; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.OnOpen; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.server.Server; @@ -42,7 +42,7 @@ /** * Tests the basic client behavior, sending and receiving message * - * @author Danny Coward (danny.coward at oracle.com) + * @author Danny Coward */ public class StreamingBinaryTest extends TestContainer { @@ -69,8 +69,8 @@ public void testClient() throws DeploymentException { } /** - * @author Danny Coward (danny.coward at oracle.com) - * @author Martin Matula (martin.matula at oracle.com) + * @author Danny Coward + * @author Martin Matula */ @ServerEndpoint(value = "/streamingbinary") public static class StreamingBinaryEndpoint { @@ -121,7 +121,7 @@ private void sendPartial(ByteBuffer bb, boolean isLast) throws IOException, Inte } /** - * @author Danny Coward (danny.coward at oracle.com) + * @author Danny Coward */ public static class StreamingBinaryClient extends Endpoint { boolean gotTheSameThingBack = false; diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/StreamingTextAnnotTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/StreamingTextAnnotTest.java index 0e0cfc2d..ec52384c 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/StreamingTextAnnotTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/StreamingTextAnnotTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -20,12 +20,12 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.DeploymentException; -import javax.websocket.OnMessage; -import javax.websocket.OnOpen; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.OnMessage; +import jakarta.websocket.OnOpen; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.server.Server; @@ -37,8 +37,8 @@ /** * Tests the basic client behavior, sending and receiving message * - * @author Danny Coward (danny.coward at oracle.com) - * @author Martin Matula (martin.matula at oracle.com) + * @author Danny Coward + * @author Martin Matula */ public class StreamingTextAnnotTest extends TestContainer { @@ -65,7 +65,7 @@ public void testClient() throws DeploymentException { } /** - * @author Martin Matula (martin.matula at oracle.com) + * @author Martin Matula */ @ServerEndpoint(value = "/streamingtext1") public static class StreamingTextAnnotEndpoint { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/StreamingTextTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/StreamingTextTest.java index 70b41c7f..f085c2e5 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/StreamingTextTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/StreamingTextTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -20,14 +20,14 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.DeploymentException; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.MessageHandler; -import javax.websocket.OnOpen; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.OnOpen; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.server.Server; @@ -39,8 +39,8 @@ /** * Tests the basic client behavior, sending and receiving message * - * @author Danny Coward (danny.coward at oracle.com) - * @author Martin Matula (martin.matula at oracle.com) + * @author Danny Coward + * @author Martin Matula */ public class StreamingTextTest extends TestContainer { @@ -67,8 +67,8 @@ public void testClient() throws DeploymentException { } /** - * @author Danny Coward (danny.coward at oracle.com) - * @author Martin Matula (martin.matula at oracle.com) + * @author Danny Coward + * @author Martin Matula */ @ServerEndpoint(value = "/streamingtext") public static class StreamingTextEndpoint { @@ -119,8 +119,8 @@ private void sendPartial(String partialString, boolean isLast) throws IOExceptio } /** - * @author Danny Coward (danny.coward at oracle.com) - * @author Martin Matula (martin.matula at oracle.com) + * @author Danny Coward + * @author Martin Matula */ public static class StreamingTextClient extends Endpoint { boolean gotSomethingBack = false; diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/SubProtocolTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/SubProtocolTest.java index 0a6d97db..27c7e67d 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/SubProtocolTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/SubProtocolTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -23,15 +23,15 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.ContainerProvider; -import javax.websocket.DeploymentException; -import javax.websocket.EndpointConfig; -import javax.websocket.HandshakeResponse; -import javax.websocket.MessageHandler; -import javax.websocket.OnOpen; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.ContainerProvider; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.HandshakeResponse; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.OnOpen; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.server.Server; @@ -45,7 +45,7 @@ /** * See https://java.net/jira/browse/TYRUS-205. * - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public class SubProtocolTest extends TestContainer { @@ -68,7 +68,7 @@ public void orderingTest() throws DeploymentException { final ClientEndpointConfig clientEndpointConfig = ClientEndpointConfig.Builder.create().preferredSubprotocols( Arrays.asList("MBWS.huawei.com", "soap", "v10.stomp")).build(); - ContainerProvider.getWebSocketContainer().connectToServer(new javax.websocket.Endpoint() { + ContainerProvider.getWebSocketContainer().connectToServer(new jakarta.websocket.Endpoint() { @Override public void onOpen(final Session session, EndpointConfig config) { session.addMessageHandler(new MessageHandler.Whole() { @@ -115,7 +115,7 @@ public void afterResponse(HandshakeResponse hr) { } }).preferredSubprotocols(Arrays.asList("a", "b", "c")).build(); ClientManager client = createClient(); - client.connectToServer(new javax.websocket.Endpoint() { + client.connectToServer(new jakarta.websocket.Endpoint() { @Override public void onOpen(final Session session, EndpointConfig config) { session.addMessageHandler(new MessageHandler.Whole() { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/TestEndpointAdapter.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/TestEndpointAdapter.java index d93c9327..5632fb0e 100755 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/TestEndpointAdapter.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/TestEndpointAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,12 +16,12 @@ package org.glassfish.tyrus.test.standard_config; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.Session; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.Session; /** - * @author Stepan Kopriva (stepan.kopriva at oracle.com) + * @author Stepan Kopriva */ public abstract class TestEndpointAdapter extends Endpoint { public abstract void onMessage(String message); diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/TestHello404.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/TestHello404.java index 33a1adb1..06e9b5fc 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/TestHello404.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/TestHello404.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -18,14 +18,14 @@ import java.io.IOException; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.DeploymentException; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.MessageHandler; -import javax.websocket.OnMessage; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.OnMessage; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.core.HandshakeException; @@ -39,7 +39,7 @@ import static org.junit.Assert.assertTrue; /** - * @author Stepan Kopriva (stepan.kopriva at oracle.com) + * @author Stepan Kopriva */ public class TestHello404 extends TestContainer { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/TestTextMessageHandler.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/TestTextMessageHandler.java index f3941a96..b41b62c5 100755 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/TestTextMessageHandler.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/TestTextMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,10 +16,10 @@ package org.glassfish.tyrus.test.standard_config; -import javax.websocket.MessageHandler; +import jakarta.websocket.MessageHandler; /** - * @author Danny Coward (danny.coward at oracle.com) + * @author Danny Coward */ public class TestTextMessageHandler implements MessageHandler.Whole { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/TextStreamDecoderTest.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/TextStreamDecoderTest.java index 844babb0..307c9822 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/TextStreamDecoderTest.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/TextStreamDecoderTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -22,17 +22,17 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.DecodeException; -import javax.websocket.Decoder; -import javax.websocket.DeploymentException; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.MessageHandler; -import javax.websocket.OnMessage; -import javax.websocket.RemoteEndpoint; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.DecodeException; +import jakarta.websocket.Decoder; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.OnMessage; +import jakarta.websocket.RemoteEndpoint; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.server.Server; @@ -43,7 +43,7 @@ import static org.junit.Assert.assertTrue; /** - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public class TextStreamDecoderTest extends TestContainer { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/Tyrus109Test.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/Tyrus109Test.java index ef5bb35e..6afd6dbf 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/Tyrus109Test.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/Tyrus109Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -19,16 +19,16 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.CloseReason; -import javax.websocket.DeploymentException; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.OnError; -import javax.websocket.OnMessage; -import javax.websocket.OnOpen; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.CloseReason; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.OnError; +import jakarta.websocket.OnMessage; +import jakarta.websocket.OnOpen; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.server.Server; @@ -37,7 +37,7 @@ import org.junit.Test; /** - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public class Tyrus109Test extends TestContainer { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/Tyrus203Test.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/Tyrus203Test.java index 19c1f67e..2461cba5 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/Tyrus203Test.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/Tyrus203Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -19,15 +19,15 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.DeploymentException; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.MessageHandler; -import javax.websocket.OnMessage; -import javax.websocket.Session; -import javax.websocket.server.PathParam; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.OnMessage; +import jakarta.websocket.Session; +import jakarta.websocket.server.PathParam; +import jakarta.websocket.server.ServerEndpoint; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.server.Server; @@ -39,7 +39,7 @@ /** * https://java.net/jira/browse/TYRUS-203 * - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ public class Tyrus203Test extends TestContainer { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/EchoEndpoint.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/EchoEndpoint.java index 5632bf52..eeb3f4da 100755 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/EchoEndpoint.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/EchoEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,14 +16,14 @@ package org.glassfish.tyrus.test.standard_config.bean; -import javax.websocket.OnMessage; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.OnMessage; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; /** * Bean for basic echo test. * - * @author Stepan Kopriva (stepan.kopriva at oracle.com) + * @author Stepan Kopriva */ @ServerEndpoint(value = "/echoendpoint") public class EchoEndpoint { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/JAXBBean.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/JAXBBean.java index 61a7bedb..2428699d 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/JAXBBean.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/JAXBBean.java @@ -16,10 +16,10 @@ package org.glassfish.tyrus.test.standard_config.bean; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlRootElement; /** - * @author Pavel Bucek (pavel.bucek at oracle.com) + * @author Pavel Bucek */ @XmlRootElement public class JAXBBean { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/SimpleRemoteTestEndpoint.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/SimpleRemoteTestEndpoint.java index dca03f63..1ee9cd17 100755 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/SimpleRemoteTestEndpoint.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/SimpleRemoteTestEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,12 +16,12 @@ package org.glassfish.tyrus.test.standard_config.bean; -import javax.websocket.OnMessage; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.OnMessage; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; /** - * @author Danny Coward (danny.coward at oracle.com) + * @author Danny Coward */ @ServerEndpoint(value = "/customremote/hello2") public class SimpleRemoteTestEndpoint { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/TestEndpoint.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/TestEndpoint.java index 452710a4..58b1e694 100755 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/TestEndpoint.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/TestEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -19,13 +19,13 @@ import java.io.IOException; -import javax.websocket.OnMessage; -import javax.websocket.OnOpen; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.OnMessage; +import jakarta.websocket.OnOpen; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; /** - * @author Stepan Kopriva (stepan.kopriva at oracle.com) + * @author Stepan Kopriva */ @ServerEndpoint(value = "/echo1", subprotocols = {"asd"}) diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/stin/BooleanBean.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/stin/BooleanBean.java index 039ffbf5..36f4a0a2 100755 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/stin/BooleanBean.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/stin/BooleanBean.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -17,11 +17,11 @@ package org.glassfish.tyrus.test.standard_config.bean.stin; -import javax.websocket.OnMessage; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.OnMessage; +import jakarta.websocket.server.ServerEndpoint; /** - * @author Danny Coward (danny.coward at oracle.com) + * @author Danny Coward */ @ServerEndpoint("/standardInputTypes/boolean") public class BooleanBean { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/stin/CharBean.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/stin/CharBean.java index e764067c..7be98d94 100755 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/stin/CharBean.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/stin/CharBean.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -17,11 +17,11 @@ package org.glassfish.tyrus.test.standard_config.bean.stin; -import javax.websocket.OnMessage; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.OnMessage; +import jakarta.websocket.server.ServerEndpoint; /** - * @author Danny Coward (danny.coward at oracle.com) + * @author Danny Coward */ @ServerEndpoint("/standardInputTypes/char") public class CharBean { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/stin/DoubleBean.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/stin/DoubleBean.java index a0160762..2becbf25 100755 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/stin/DoubleBean.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/stin/DoubleBean.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -17,11 +17,11 @@ package org.glassfish.tyrus.test.standard_config.bean.stin; -import javax.websocket.OnMessage; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.OnMessage; +import jakarta.websocket.server.ServerEndpoint; /** - * @author Danny Coward (danny.coward at oracle.com) + * @author Danny Coward */ @ServerEndpoint("/standardInputTypes/double") public class DoubleBean { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/stin/FloatBean.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/stin/FloatBean.java index 93c1d2c2..5b97acdc 100755 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/stin/FloatBean.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/stin/FloatBean.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -17,11 +17,11 @@ package org.glassfish.tyrus.test.standard_config.bean.stin; -import javax.websocket.OnMessage; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.OnMessage; +import jakarta.websocket.server.ServerEndpoint; /** - * @author Danny Coward (danny.coward at oracle.com) + * @author Danny Coward */ // @ServerEndpoint( // path="/standardInputTypes/float", diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/stin/IntBean.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/stin/IntBean.java index d63ac4ac..1a1e8f95 100755 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/stin/IntBean.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/stin/IntBean.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -17,11 +17,11 @@ package org.glassfish.tyrus.test.standard_config.bean.stin; -import javax.websocket.OnMessage; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.OnMessage; +import jakarta.websocket.server.ServerEndpoint; /** - * @author Danny Coward (danny.coward at oracle.com) + * @author Danny Coward */ // @ServerEndpoint( // path="/standardInputTypes/int", diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/stin/LongBean.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/stin/LongBean.java index f1f7220b..ec3196d7 100755 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/stin/LongBean.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/stin/LongBean.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -17,11 +17,11 @@ package org.glassfish.tyrus.test.standard_config.bean.stin; -import javax.websocket.OnMessage; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.OnMessage; +import jakarta.websocket.server.ServerEndpoint; /** - * @author Danny Coward (danny.coward at oracle.com) + * @author Danny Coward */ @ServerEndpoint("/standardInputTypes/long") public class LongBean { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/stin/ShortBean.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/stin/ShortBean.java index af3ad5e4..0abe2b00 100755 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/stin/ShortBean.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/stin/ShortBean.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -17,11 +17,11 @@ package org.glassfish.tyrus.test.standard_config.bean.stin; -import javax.websocket.OnMessage; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.OnMessage; +import jakarta.websocket.server.ServerEndpoint; /** - * @author Danny Coward (danny.coward at oracle.com) + * @author Danny Coward */ @ServerEndpoint("/standardInputTypes/short") public class ShortBean { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/stin/StringBean.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/stin/StringBean.java index 8cb6647e..aef05991 100755 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/stin/StringBean.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/stin/StringBean.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,11 +16,11 @@ package org.glassfish.tyrus.test.standard_config.bean.stin; -import javax.websocket.OnMessage; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.OnMessage; +import jakarta.websocket.server.ServerEndpoint; /** - * @author Danny Coward (danny.coward at oracle.com) + * @author Danny Coward */ @ServerEndpoint(value = "/standardInputTypes/String") public class StringBean { diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/stin/Util.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/stin/Util.java index 9ccd6c36..c1e97a18 100755 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/stin/Util.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/bean/stin/Util.java @@ -17,7 +17,7 @@ package org.glassfish.tyrus.test.standard_config.bean.stin; /** - * @author Danny Coward (danny.coward at oracle.com) + * @author Danny Coward */ public class Util { public static String PASS = "PASS"; diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/decoder/TestDecoder.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/decoder/TestDecoder.java index 6d8e1325..0279d91d 100755 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/decoder/TestDecoder.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/decoder/TestDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,8 +16,8 @@ package org.glassfish.tyrus.test.standard_config.decoder; -import javax.websocket.DecodeException; -import javax.websocket.Decoder; +import jakarta.websocket.DecodeException; +import jakarta.websocket.Decoder; import org.glassfish.tyrus.core.coder.CoderAdapter; import org.glassfish.tyrus.test.standard_config.message.TestMessage; @@ -25,7 +25,7 @@ /** * Decoder for the TestMessage * - * @author Stepan Kopriva (stepan.kopriva at oracle.com) + * @author Stepan Kopriva */ public class TestDecoder extends CoderAdapter implements Decoder.Text { @Override diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/message/StringContainer.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/message/StringContainer.java index 95440908..952d4b7e 100755 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/message/StringContainer.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/message/StringContainer.java @@ -19,7 +19,7 @@ /** * Used * - * @author Stepan Kopriva (stepan.kopriva at oracle.com) + * @author Stepan Kopriva */ public class StringContainer { private String string; diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/message/TestMessage.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/message/TestMessage.java index f1ad1983..30ff91b3 100755 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/message/TestMessage.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/message/TestMessage.java @@ -19,7 +19,7 @@ /** * Message for testing TestDecoder. * - * @author Stepan Kopriva (stepan.kopriva at oracle.com) + * @author Stepan Kopriva */ public class TestMessage { public static final String PREFIX = "prefix"; diff --git a/tests/pom.xml b/tests/pom.xml index ecd1347b..b2a25a2b 100755 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -1,6 +1,6 @@ + + + + + true + + + + \ No newline at end of file diff --git a/tests/servlet/embedded-glassfish-test/pom.xml b/tests/servlet/embedded-glassfish-test/pom.xml new file mode 100644 index 00000000..8b7b9939 --- /dev/null +++ b/tests/servlet/embedded-glassfish-test/pom.xml @@ -0,0 +1,293 @@ + + + + 4.0.0 + + + org.glassfish.tyrus.tests.servlet + tyrus-tests-servlet-project + 2.0.99-SNAPSHOT + + + war + tyrus-tests-servlet-embedded-gf + + Tyrus Servlet Tests on Glassfish + + + 6.2.1 + 5.7.2 + + + + + org.glassfish.tyrus + tyrus-container-servlet + provided + + + org.glassfish.tyrus + tyrus-core + provided + + + jakarta.websocket + jakarta.websocket-api + provided + + + jakarta.servlet + jakarta.servlet-api + provided + + + org.glassfish.tyrus + tyrus-server + provided + + + org.glassfish.tyrus + tyrus-container-grizzly-client + test + + + org.glassfish.tyrus + tyrus-container-jdk-client + test + + + org.junit.jupiter + junit-jupiter + ${junit.jupiter.version} + test + + + org.junit.platform + junit-platform-launcher + 1.7.2 + test + + + org.jboss.arquillian.junit5 + arquillian-junit5-container + 1.7.0.Alpha10 + test + + + org.jboss.arquillian.container + arquillian-glassfish-managed-6 + 1.0.0.Alpha1 + test + + + org.glassfish.hk2 + hk2-locator + + + + + org.glassfish.hk2 + hk2-locator + 3.0.0 + test + + + org.glassfish.main.common + simple-glassfish-api + ${glassfish.container.version} + test + + + org.glassfish.main.web + web-core + ${glassfish.container.version} + test + + + + + + maven-failsafe-plugin + 3.0.0-M5 + false + + + + integration-test + verify + + + org.glassfish.tyrus.tests.servlet:tyrus-tests-servlet-embedded-gf + + 8080 + true + + + ${project.build.directory}/glassfish6 + + + + + + + org.junit.platform + junit-platform-surefire-provider + 1.3.2 + + + org.apache.maven.surefire + surefire-api + 3.0.0-M5 + + + org.apache.maven.surefire + common-java5 + 3.0.0-M5 + + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.2.0 + + + unpack + process-test-resources + + unpack + + + + + org.glassfish.main.distributions + glassfish + ${glassfish.container.version} + zip + false + ${project.build.directory} + + + + + + copy + process-test-resources + + copy + + + + + jakarta.websocket + jakarta.websocket-api + ${websocket-api.version} + jar + true + ${project.build.directory}/glassfish6/glassfish/modules + jakarta.websocket-api.jar + + + org.glassfish.tyrus + tyrus-client + ${project.version} + jar + true + ${project.build.directory}/glassfish6/glassfish/modules + tyrus-client.jar + + + org.glassfish.tyrus + tyrus-container-glassfish-cdi + ${project.version} + jar + true + ${project.build.directory}/glassfish6/glassfish/modules + tyrus-container-glassfish-cdi.jar + + + org.glassfish.tyrus + tyrus-container-glassfish-ejb + ${project.version} + jar + true + ${project.build.directory}/glassfish6/glassfish/modules + tyrus-container-glassfish-ejb.jar + + + org.glassfish.tyrus + tyrus-container-grizzly-client + ${project.version} + jar + true + ${project.build.directory}/glassfish6/glassfish/modules + tyrus-container-grizzly-client.jar + + + org.glassfish.tyrus + tyrus-container-servlet + ${project.version} + jar + true + ${project.build.directory}/glassfish6/glassfish/modules + tyrus-container-servlet.jar + + + org.glassfish.tyrus + tyrus-core + ${project.version} + jar + true + ${project.build.directory}/glassfish6/glassfish/modules + tyrus-core.jar + + + org.glassfish.tyrus + tyrus-server + ${project.version} + jar + true + ${project.build.directory}/glassfish6/glassfish/modules + tyrus-server.jar + + + org.glassfish.tyrus + tyrus-spi + ${project.version} + jar + true + ${project.build.directory}/glassfish6/glassfish/modules + tyrus-spi.jar + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 11 + + + + + diff --git a/tests/servlet/embedded-glassfish-test/src/main/java/module-info.java b/tests/servlet/embedded-glassfish-test/src/main/java/module-info.java new file mode 100644 index 00000000..346cba70 --- /dev/null +++ b/tests/servlet/embedded-glassfish-test/src/main/java/module-info.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2021, 2022 Oracle and/or its affiliates. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0, which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the + * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + * version 2 with the GNU Classpath Exception, which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + */ + +/** + * Tyrus Servlet Tests on Glassfish Module + */ + +module org.glassfish.tyrus.test.servlet.embedded.gf { + requires jakarta.websocket; + requires jakarta.servlet; + + requires org.glassfish.tyrus.server; + requires org.glassfish.tyrus.client; + + exports org.glassfish.tyrus.tests.servlet.embedded; + + opens org.glassfish.tyrus.tests.servlet.embedded; +} \ No newline at end of file diff --git a/tests/servlet/embedded-glassfish-test/src/main/java/org/glassfish/tyrus/tests/servlet/embedded/DispatchingServletFilter.java b/tests/servlet/embedded-glassfish-test/src/main/java/org/glassfish/tyrus/tests/servlet/embedded/DispatchingServletFilter.java new file mode 100644 index 00000000..1529dfd7 --- /dev/null +++ b/tests/servlet/embedded-glassfish-test/src/main/java/org/glassfish/tyrus/tests/servlet/embedded/DispatchingServletFilter.java @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0, which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the + * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + * version 2 with the GNU Classpath Exception, which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + */ + +package org.glassfish.tyrus.tests.servlet.embedded; + +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.annotation.WebFilter; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerContainer; +import org.glassfish.tyrus.server.TyrusServerContainer; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +@WebFilter(filterName = "A", value = "/*") +public class DispatchingServletFilter implements Filter { + + public static enum OP { + UpgradeHttpToWebSocket, + AddEndpoint + } + + @Override + public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) + throws ServletException, IOException { + final HttpServletRequest servletRequest = (HttpServletRequest) request; + final Object objectContainer = request.getServletContext().getAttribute(ServerContainer.class.getName()); + if (objectContainer == null + || servletRequest.getQueryString() == null) { + chain.doFilter(request, response); + return; + } + if (servletRequest.getQueryString().equals(OP.UpgradeHttpToWebSocket.toString())) { + final String path = "/servlet-test/test/{a}/{b}"; + final Map parameters = new HashMap<>(); + parameters.put("a", "hello"); + parameters.put("b", "world"); + final TyrusServerContainer container = (TyrusServerContainer) objectContainer; + try { + container.upgradeHttpToWebSocket( + request, + response, + new DispatchingServletProgrammaticEndpointConfig(ProgramaticEndpoint.class, path), + parameters); + } catch (DeploymentException e) { + e.printStackTrace(); + } + } else if (servletRequest.getQueryString().equals(OP.AddEndpoint.toString())) { + final TyrusServerContainer container = (TyrusServerContainer) objectContainer; + try { + final String path = "/test/{a}/{b}"; + container.addEndpoint(new DispatchingServletProgrammaticEndpointConfig(ProgramaticEndpoint.class, path)); + } catch (DeploymentException e) { + throw new ServletException(e); + } + } + } + + public static class ProgramaticEndpoint extends Endpoint { + + @Override + public void onOpen(Session session, EndpointConfig config) { + session.addMessageHandler(new ProgramaticEndpointMessageHandler(session)); + } + + @Override + public void onError(Session session, Throwable thr) { + thr.printStackTrace(); + } + + /* + * Anonymous classes do not work with Arquillian archive and module-info. + */ + class ProgramaticEndpointMessageHandler implements MessageHandler.Whole { + private final Session session; + private final Map parameters; + + public ProgramaticEndpointMessageHandler(Session session) { + this.session = session; + this.parameters = session.getPathParameters(); + } + + @Override + public void onMessage(String message) { + try { + session.getBasicRemote().sendText(parameters.get("a")); + session.getBasicRemote().sendText(parameters.get("b")); + } catch (IOException e) { + onError(session, e); + } + } + } + } +} diff --git a/tests/servlet/embedded-glassfish-test/src/main/java/org/glassfish/tyrus/tests/servlet/embedded/DispatchingServletProgrammaticEndpointConfig.java b/tests/servlet/embedded-glassfish-test/src/main/java/org/glassfish/tyrus/tests/servlet/embedded/DispatchingServletProgrammaticEndpointConfig.java new file mode 100644 index 00000000..6b3e082e --- /dev/null +++ b/tests/servlet/embedded-glassfish-test/src/main/java/org/glassfish/tyrus/tests/servlet/embedded/DispatchingServletProgrammaticEndpointConfig.java @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0, which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the + * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + * version 2 with the GNU Classpath Exception, which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + */ + +package org.glassfish.tyrus.tests.servlet.embedded; + +import jakarta.websocket.Decoder; +import jakarta.websocket.Encoder; +import jakarta.websocket.Endpoint; +import jakarta.websocket.Extension; +import jakarta.websocket.server.ServerEndpointConfig; + +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public class DispatchingServletProgrammaticEndpointConfig implements ServerEndpointConfig { + + private final Class endpointClass; + private final String path; + + public DispatchingServletProgrammaticEndpointConfig(Class endpointClass, String path) { + this.endpointClass = endpointClass; + this.path = path; + } + + @Override + public Class getEndpointClass() { + return endpointClass; + } + + @Override + public String getPath() { + return path; + } + + @Override + public List getSubprotocols() { + return Collections.emptyList(); + } + + @Override + public List getExtensions() { + return Collections.emptyList(); + } + + @Override + public Configurator getConfigurator() { + return new ProgrammaticEndpointConfigurator(); + } + + @Override + public List> getEncoders() { + return Collections.emptyList(); + } + + @Override + public List> getDecoders() { + return Collections.emptyList(); + } + + @Override + public Map getUserProperties() { + return Collections.emptyMap(); + } + + /* + * Anonymous classes do not work with Arquillian archive and module-info. + */ + static class ProgrammaticEndpointConfigurator extends Configurator { + @Override + public T getEndpointInstance(Class endpointClass) throws InstantiationException { + if (DispatchingServletFilter.ProgramaticEndpoint.class.equals(endpointClass)) { + return (T) new DispatchingServletFilter.ProgramaticEndpoint(); + } + return super.getEndpointInstance(endpointClass); + } + } +} diff --git a/tests/servlet/embedded-glassfish-test/src/main/java/org/glassfish/tyrus/tests/servlet/embedded/OnOpenCloseEndpoint.java b/tests/servlet/embedded-glassfish-test/src/main/java/org/glassfish/tyrus/tests/servlet/embedded/OnOpenCloseEndpoint.java new file mode 100644 index 00000000..92b736a4 --- /dev/null +++ b/tests/servlet/embedded-glassfish-test/src/main/java/org/glassfish/tyrus/tests/servlet/embedded/OnOpenCloseEndpoint.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0, which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the + * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + * version 2 with the GNU Classpath Exception, which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + */ + +package org.glassfish.tyrus.tests.servlet.embedded; + +import java.io.IOException; + +import jakarta.websocket.OnOpen; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; + +/** + * Close the session withing {@link OnOpen} annotated method invocation. + */ +@ServerEndpoint("/onOpenClose") +public class OnOpenCloseEndpoint { + @OnOpen + public void onOpen(Session session) throws IOException { + session.close(); + } +} diff --git a/tests/servlet/embedded-glassfish-test/src/main/java/org/glassfish/tyrus/tests/servlet/embedded/PlainEchoEndpoint.java b/tests/servlet/embedded-glassfish-test/src/main/java/org/glassfish/tyrus/tests/servlet/embedded/PlainEchoEndpoint.java new file mode 100644 index 00000000..789f16d2 --- /dev/null +++ b/tests/servlet/embedded-glassfish-test/src/main/java/org/glassfish/tyrus/tests/servlet/embedded/PlainEchoEndpoint.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0, which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the + * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + * version 2 with the GNU Classpath Exception, which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + */ + +package org.glassfish.tyrus.tests.servlet.embedded; + +import jakarta.websocket.OnMessage; +import jakarta.websocket.server.ServerEndpoint; + +/** + * Echo endpoint for string messages. + */ +@ServerEndpoint("/plainEcho") +public class PlainEchoEndpoint { + + @OnMessage + public String onMessage(String s) { + return s; + } +} diff --git a/tests/servlet/embedded-glassfish-test/src/test/java/org/glassfish/tyrus/tests/servlet/embedded/ServletTestBase.java b/tests/servlet/embedded-glassfish-test/src/test/java/org/glassfish/tyrus/tests/servlet/embedded/ServletTestBase.java new file mode 100644 index 00000000..b8308400 --- /dev/null +++ b/tests/servlet/embedded-glassfish-test/src/test/java/org/glassfish/tyrus/tests/servlet/embedded/ServletTestBase.java @@ -0,0 +1,258 @@ +/* + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0, which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the + * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + * version 2 with the GNU Classpath Exception, which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + */ + +package org.glassfish.tyrus.tests.servlet.embedded; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.URISyntaxException; +import java.nio.charset.StandardCharsets; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; + +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; + +import org.glassfish.tyrus.client.ClientManager; + +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.spec.WebArchive; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +/** + * Primarily meant to test servlet integration, might be someday used for simple stress testing. + *

+ * Tests are executed from descendant classes, which must implement {@link #getScheme()} method. This is used to enable + * testing with {@code ws} and {@code wss} schemes. + */ +public abstract class ServletTestBase { + + private static final String CONTEXT_PATH = "/servlet-test"; + private static final String defaultHost = "localhost"; + private static final int defaultPort = 8025; + private String contextPath; + + public ServletTestBase() { + setContextPath(CONTEXT_PATH); + } + + protected abstract String getScheme(); + + public void testPlainEchoShort() throws DeploymentException, InterruptedException, IOException { + final CountDownLatch messageLatch = new CountDownLatch(1); + final String MESSAGE = "Do or do not, there is no try."; + + final ClientManager client = createClient(); + client.connectToServer(new Endpoint() { + @Override + public void onOpen(Session session, EndpointConfig EndpointConfig) { + try { + session.addMessageHandler(new MessageHandler.Whole() { + @Override + public void onMessage(String message) { + assertEquals(message, MESSAGE); + messageLatch.countDown(); + } + }); + + session.getBasicRemote().sendText(MESSAGE); + } catch (IOException e) { + // do nothing + } + } + }, ClientEndpointConfig.Builder.create().build(), + getURI(PlainEchoEndpoint.class.getAnnotation(ServerEndpoint.class).value(), + getScheme())); + + messageLatch.await(1, TimeUnit.SECONDS); + assertEquals(0, messageLatch.getCount()); + } + + public void testUpgradeHttpToWebSocket() throws DeploymentException, InterruptedException, IOException { + final CountDownLatch messageLatch = new CountDownLatch(2); + final StringBuilder messageBuilder = new StringBuilder(); + + final ClientManager client = createClient(); + client.connectToServer(new Endpoint() { + @Override + public void onOpen(Session session, EndpointConfig EndpointConfig) { + try { + session.addMessageHandler(new MessageHandler.Whole() { + @Override + public void onMessage(String message) { + messageBuilder.append(message); + messageLatch.countDown(); + } + }); + + session.getBasicRemote().sendText("MESSAGE"); + } catch (IOException e) { + // do nothing + } + } + }, ClientEndpointConfig.Builder.create().build(), + getURI("/test?" + DispatchingServletFilter.OP.UpgradeHttpToWebSocket, getScheme())); + + messageLatch.await(5, TimeUnit.SECONDS); + assertEquals(0, messageLatch.getCount()); + assertEquals(messageBuilder.toString(), "helloworld"); + } + + public void testAddEndpoint() throws DeploymentException, InterruptedException, IOException { + final CountDownLatch messageLatch = new CountDownLatch(1); + final StringBuilder messageBuilder = new StringBuilder(); + + try { + final ClientManager client = createClient(); + client.connectToServer(new Endpoint() { + @Override + public void onOpen(Session session, EndpointConfig EndpointConfig) { + try { + session.getBasicRemote().sendText("MESSAGE"); + session.close(); + } catch (IOException e) { + // do nothing + } + } + }, ClientEndpointConfig.Builder.create().build(), + getURI("/anything?" + DispatchingServletFilter.OP.AddEndpoint, getScheme())); + } catch (DeploymentException e) { + // Ignore - not WebSocket handshake, just HTTP, used for adding the Endpoint + } + + final ClientManager client = createClient(); + client.connectToServer(new Endpoint() { + @Override + public void onOpen(Session session, EndpointConfig EndpointConfig) { + try { + session.addMessageHandler(new MessageHandler.Whole() { + @Override + public void onMessage(String message) { + messageBuilder.append(message); + messageLatch.countDown(); + } + }); + + session.getBasicRemote().sendText("MESSAGE"); + } catch (IOException e) { + // do nothing + } + } + }, ClientEndpointConfig.Builder.create().build(), + getURI("/test/Tyrus/Rocks", getScheme())); + + messageLatch.await(5, TimeUnit.SECONDS); + assertEquals(0, messageLatch.getCount()); + assertEquals("TyrusRocks", messageBuilder.toString()); + } + + public static WebArchive createDeployment() throws IOException { + + InputStream inputStream = ServletTestBase.class.getClassLoader().getResourceAsStream("WEB-INF/glassfish-web.xml"); + // Replace the servlet_adaptor in web.xml.template with the System variable set as servlet adaptor + String webXml = new String(inputStream.readAllBytes(), StandardCharsets.UTF_8);; + + WebArchive archive = ShrinkWrap.create(WebArchive.class, "servlet-test.war"); + archive.addClasses(OnOpenCloseEndpoint.class, PlainEchoEndpoint.class, + DispatchingServletFilter.class, + DispatchingServletFilter.OP.class, + DispatchingServletFilter.ProgramaticEndpoint.class, + DispatchingServletFilter.ProgramaticEndpoint.ProgramaticEndpointMessageHandler.class, + DispatchingServletProgrammaticEndpointConfig.class, + DispatchingServletProgrammaticEndpointConfig.ProgrammaticEndpointConfigurator.class + ); + archive.addAsWebInfResource(new StringAsset(webXml), "glassfish-web.xml"); + System.out.println(archive.toString(true)); + + return archive; + + } + + /** + * Get the {@link ClientManager} instance. + * + * @return {@link ClientManager} which can be used to connect to a server + */ + protected ClientManager createClient() { + final String clientContainerClassName = System.getProperty("tyrus.test.container.client"); + if (clientContainerClassName != null) { + return ClientManager.createClient(clientContainerClassName); + } else { + return ClientManager.createClient(); + } + } + + /** + * Get the {@link URI} for the given {@link String} path. + * + * @param endpointPath the path the {@link URI} is computed for. + * @param scheme scheme of newly created {@link URI}. If {@code null}, "ws" will be used. + * @return {@link URI} which is used to connect to the given path. + */ + protected URI getURI(String endpointPath, String scheme) { + try { + String currentScheme = scheme == null ? "ws" : scheme; + int port = getPort(); + + if ((port == 80 && "ws".equalsIgnoreCase(currentScheme)) + || (port == 443 && "wss".equalsIgnoreCase(currentScheme))) { + port = -1; + } + + return new URI(currentScheme, null, getHost(), port, contextPath + endpointPath, null, null); + } catch (URISyntaxException e) { + e.printStackTrace(); + return null; + } + } + + /** + * Get port used for creating remote endpoint {@link URI}. + * + * @return port used for creating remote endpoint {@link URI}. + */ + protected int getPort() { + final String port = System.getProperty("tyrus.test.port"); + if (port != null) { + try { + return Integer.parseInt(port); + } catch (NumberFormatException nfe) { + // do nothing + } + } + return defaultPort; + } + + protected String getHost() { + final String host = System.getProperty("tyrus.test.host"); + if (host != null) { + return host; + } + return defaultHost; + } + + protected void setContextPath(String contextPath) { + this.contextPath = contextPath; + } +} diff --git a/tests/servlet/embedded-glassfish-test/src/test/java/org/glassfish/tyrus/tests/servlet/embedded/WsServletTestIT.java b/tests/servlet/embedded-glassfish-test/src/test/java/org/glassfish/tyrus/tests/servlet/embedded/WsServletTestIT.java new file mode 100644 index 00000000..8d021d43 --- /dev/null +++ b/tests/servlet/embedded-glassfish-test/src/test/java/org/glassfish/tyrus/tests/servlet/embedded/WsServletTestIT.java @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0, which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the + * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + * version 2 with the GNU Classpath Exception, which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + */ + +package org.glassfish.tyrus.tests.servlet.embedded; + +import jakarta.websocket.DeploymentException; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; + +import java.io.IOException; + +/** + * Unsecured (not using SSL) run of tests in {@link ServletTestBase} + */ +@ExtendWith(ArquillianExtension.class) +public class WsServletTestIT extends ServletTestBase { + + @Override + protected String getScheme() { + return "ws"; + } + + @Deployment(testable = false) + public static WebArchive createDeployment() throws IOException { + return ServletTestBase.createDeployment(); + } + + @Test + public void testPlainEchoShort() throws DeploymentException, IOException, InterruptedException { + super.testPlainEchoShort(); + } + + @Test + public void testAddEndpointTestUpgradeHttpToWebSocket() throws DeploymentException, InterruptedException, IOException { + super.testAddEndpoint(); + super.testUpgradeHttpToWebSocket(); + } +} + + diff --git a/tests/servlet/embedded-glassfish-test/src/test/resources/WEB-INF/glassfish-web.xml b/tests/servlet/embedded-glassfish-test/src/test/resources/WEB-INF/glassfish-web.xml new file mode 100644 index 00000000..4ac53e04 --- /dev/null +++ b/tests/servlet/embedded-glassfish-test/src/test/resources/WEB-INF/glassfish-web.xml @@ -0,0 +1,29 @@ + + + + + + /servlet-test + + + + Keep a copy of the generated servlet class' java code. + + + diff --git a/tests/servlet/inject/pom.xml b/tests/servlet/inject/pom.xml index b72d57ac..391e11c7 100644 --- a/tests/servlet/inject/pom.xml +++ b/tests/servlet/inject/pom.xml @@ -1,6 +1,6 @@ true diff --git a/tests/tools/src/main/java/module-info.java b/tests/tools/src/main/java/module-info.java new file mode 100644 index 00000000..e9294b02 --- /dev/null +++ b/tests/tools/src/main/java/module-info.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0, which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the + * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + * version 2 with the GNU Classpath Exception, which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + */ + +/** + * Tyrus Test Tools Module + */ + +module org.glassfish.tyrus.test.tools { + requires jakarta.websocket; + + requires grizzly.framework; + requires grizzly.http; + requires grizzly.http.server; + + requires junit; + + requires org.glassfish.tyrus.client; + requires org.glassfish.tyrus.server; + + exports org.glassfish.tyrus.test.tools; +} \ No newline at end of file diff --git a/tests/tools/src/main/java/org/glassfish/tyrus/test/tools/TestContainer.java b/tests/tools/src/main/java/org/glassfish/tyrus/test/tools/TestContainer.java index 01adf658..4daf3c2c 100644 --- a/tests/tools/src/main/java/org/glassfish/tyrus/test/tools/TestContainer.java +++ b/tests/tools/src/main/java/org/glassfish/tyrus/test/tools/TestContainer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -24,11 +24,11 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.websocket.ClientEndpoint; -import javax.websocket.DeploymentException; -import javax.websocket.OnMessage; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.ClientEndpoint; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.OnMessage; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; import org.glassfish.tyrus.client.ClientManager; import org.glassfish.tyrus.server.Server; @@ -39,7 +39,7 @@ /** * Utilities for creating automated tests easily. * - * @author Stepan Kopriva (stepan.kopriva at oracle.com) + * @author Stepan Kopriva */ public class TestContainer {