diff --git a/bundles/client-jdk/pom.xml b/bundles/client-jdk/pom.xml index e526a6f6..f9740f49 100644 --- a/bundles/client-jdk/pom.xml +++ b/bundles/client-jdk/pom.xml @@ -1,6 +1,6 @@ + + + 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/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-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/extension-deflate/src/main/java/module-info.java b/ext/extension-deflate/src/main/java/module-info.java new file mode 100644 index 00000000..3e83a9c7 --- /dev/null +++ b/ext/extension-deflate/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 Extension - Per Message Deflate Module + */ + +module org.glassfish.tyrus.ext.extension.deflate { + requires java.logging; + requires jakarta.websocket; + requires org.glassfish.tyrus.core; + + exports org.glassfish.tyrus.ext.extension.deflate; +} \ No newline at end of file diff --git a/ext/monitoring-jmx/src/main/java/module-info.java b/ext/monitoring-jmx/src/main/java/module-info.java new file mode 100644 index 00000000..1ec9f31f --- /dev/null +++ b/ext/monitoring-jmx/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 Monitoring JMX Module + */ + +module org.glassfish.tyrus.ext.monitoring.jmx { + requires java.desktop; + requires java.logging; + requires java.management; + + requires org.glassfish.tyrus.core; + + exports org.glassfish.tyrus.ext.monitoring.jmx; +} \ No newline at end of file diff --git a/pom.xml b/pom.xml index d44c7db6..9f68bae1 100644 --- a/pom.xml +++ b/pom.xml @@ -104,12 +104,12 @@ 2.0.0 3.0.0 4.0.0 - 3.0.0 + 3.0.1 2.0.1 1.0.0 3.0.1 3.0.2 - 3.0.1 + 3.3.1 5.0.0 jakarta.websocket @@ -169,10 +169,10 @@ org.apache.maven.plugins maven-compiler-plugin - 3.1 + 3.8.1 - 1.8 - 1.8 + 11 + 11 UTF-8 @@ -196,12 +196,12 @@ org.apache.maven.plugins maven-checkstyle-plugin - 3.0.0 + 3.1.0 com.puppycrawl.tools checkstyle - 8.18 + 8.30 @@ -215,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 @@ -298,7 +298,7 @@ org.apache.felix maven-bundle-plugin - 2.4.0 + 5.1.2 true @@ -343,7 +343,7 @@ org.apache.maven.plugins maven-surefire-plugin - 2.17 + 3.0.0-M5 org.apache.maven.plugins diff --git a/server/src/main/java/module-info.java b/server/src/main/java/module-info.java new file mode 100644 index 00000000..cff63277 --- /dev/null +++ b/server/src/main/java/module-info.java @@ -0,0 +1,31 @@ +/* + * 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 Server Module + */ + +module org.glassfish.tyrus.server { + requires java.logging; + + requires jakarta.websocket; + + requires transitive 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/spi/pom.xml b/spi/pom.xml index 8b1b9bc2..32d32dfa 100755 --- a/spi/pom.xml +++ b/spi/pom.xml @@ -45,7 +45,7 @@ org.glassfish.tyrus.spi.*;version=${project.version} - jakarta.websocket;version=${apijar.bundle.version},* + jakarta.websocket.* true diff --git a/spi/src/main/java/module-info.java b/spi/src/main/java/module-info.java new file mode 100644 index 00000000..96704cd2 --- /dev/null +++ b/spi/src/main/java/module-info.java @@ -0,0 +1,26 @@ +/* + * 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 Container SPI Module + */ +module org.glassfish.tyrus.spi { + requires jakarta.websocket; + + exports org.glassfish.tyrus.spi; + + uses org.glassfish.tyrus.spi.ServerContainerFactory; +} \ No newline at end of file diff --git a/tests/containers/jdk-client/pom.xml b/tests/containers/jdk-client/pom.xml new file mode 100644 index 00000000..3e2c72db --- /dev/null +++ b/tests/containers/jdk-client/pom.xml @@ -0,0 +1,63 @@ + + + + 4.0.0 + + + org.glassfish.tyrus.tests + tyrus-tests-containers + 2.0-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 90% 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 f4453912..e39499a6 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, 2020 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,6 +17,7 @@ package org.glassfish.tyrus.container.jdk.client; import org.junit.Assume; +import org.junit.Assert; import org.junit.Before; import org.junit.Test; @@ -29,7 +30,6 @@ 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,8 +69,8 @@ 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); } } @@ -79,7 +79,7 @@ public void testIncreaseFileDescriptorsOnTyrusImplementationInCaseOfUnresolvedAd //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..a33a3d66 --- /dev/null +++ b/tests/containers/pom.xml @@ -0,0 +1,41 @@ + + + + 4.0.0 + + + org.glassfish.tyrus.tests + tyrus-tests-project + 2.0-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..43b5cae7 --- /dev/null +++ b/tests/containers/servlet/pom.xml @@ -0,0 +1,50 @@ + + + + 4.0.0 + + + org.glassfish.tyrus.tests + tyrus-tests-containers + 2.0-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/src/test/java/module-info.java b/tests/e2e/application-config/src/test/java/module-info.java new file mode 100644 index 00000000..de1a60f8 --- /dev/null +++ b/tests/e2e/application-config/src/test/java/module-info.java @@ -0,0 +1,33 @@ +/* + * 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 Application Config Tests Module + */ + +module org.glassfish.tyrus.test.e2e.appconfig { + requires jakarta.websocket; + + requires junit; + + requires org.glassfish.tyrus.client; + requires org.glassfish.tyrus.core; + requires org.glassfish.tyrus.server; + requires org.glassfish.tyrus.test.tools; + requires org.glassfish.tyrus.container.grizzly.server; + + exports org.glassfish.tyrus.test.e2e.appconfig; +} \ No newline at end of file diff --git a/tests/e2e/jdk8/src/test/java/module-info.java b/tests/e2e/jdk8/src/test/java/module-info.java new file mode 100644 index 00000000..6cc61e6c --- /dev/null +++ b/tests/e2e/jdk8/src/test/java/module-info.java @@ -0,0 +1,33 @@ +/* + * 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 + */ + +/** + * TTyrus End-to-End Java 8 Tests Module + */ + +module org.glassfish.tyrus.test.e2e.jdk8 { + requires jakarta.websocket; + + requires junit; + + requires org.glassfish.tyrus.client; + requires org.glassfish.tyrus.container.grizzly.server; + requires org.glassfish.tyrus.server; + + requires org.glassfish.tyrus.test.tools; + + exports org.glassfish.tyrus.test.e2e.jdk8; +} \ No newline at end of file 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/pom.xml b/tests/pom.xml index c458cd7d..bc6f8df6 100755 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -1,6 +1,6 @@