Skip to content

Commit

Permalink
Add a jpms related fix
Browse files Browse the repository at this point in the history
opens org.glassfish.tyrus.core.wsadl.model to jakarta.xml.bind

Signed-off-by: jansupol <[email protected]>
  • Loading branch information
jansupol committed May 31, 2022
1 parent 93c87c1 commit 20e9480
Show file tree
Hide file tree
Showing 8 changed files with 117 additions and 10 deletions.
2 changes: 2 additions & 0 deletions core/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
exports org.glassfish.tyrus.core.uri.internal;
exports org.glassfish.tyrus.core.wsadl.model;

opens org.glassfish.tyrus.core.wsadl.model to jakarta.xml.bind;

uses org.glassfish.tyrus.core.ComponentProvider;

provides jakarta.websocket.server.ServerEndpointConfig.Configurator with org.glassfish.tyrus.core.TyrusServerEndpointConfigurator;
Expand Down
39 changes: 39 additions & 0 deletions tests/e2e/non-deployable/src/test/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Copyright (c) 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
*/

module tyrus.tests.e2e.nondeployable {
requires grizzly.framework;
requires grizzly.http;
requires grizzly.http.server;

requires java.logging;

requires jakarta.websocket;
requires jakarta.websocket.client;

requires junit;

requires org.glassfish.tyrus.core;
requires org.glassfish.tyrus.container.grizzly.client;
requires org.glassfish.tyrus.container.grizzly.server;
requires org.glassfish.tyrus.container.inmemory;
requires org.glassfish.tyrus.container.jdk.client;
requires org.glassfish.tyrus.server;
requires org.glassfish.tyrus.spi;
requires org.glassfish.tyrus.test.tools;

exports org.glassfish.tyrus.test.e2e.non_deployable;
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2021 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 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
Expand All @@ -24,15 +24,16 @@
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.logging.Logger;

import jakarta.websocket.ContainerProvider;
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.container.grizzly.client.GrizzlyContainerProvider;
import org.glassfish.tyrus.server.Server;

import org.junit.Test;
Expand All @@ -57,7 +58,13 @@ public void testEphemeralPort() throws DeploymentException, IOException, Interru
final CountDownLatch latch = new CountDownLatch(1);

try {
ContainerProvider.getWebSocketContainer().connectToServer(new Endpoint() {
// ContainerProvider.getWebSocketContainer() returns randomly in-memory container with module-info
new GrizzlyContainerProvider() {
@Override
protected WebSocketContainer getContainer() {
return super.getContainer();
}
}.getContainer().connectToServer(new Endpoint() {
@Override
public void onOpen(Session session, EndpointConfig config) {

Expand Down
24 changes: 24 additions & 0 deletions tests/servlet/basic/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright (c) 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
*/

module org.glassfish.tyrus.tests.servlet.basic {
requires jakarta.websocket;
requires jakarta.websocket.client;

requires org.glassfish.tyrus.core;

exports org.glassfish.tyrus.tests.servlet.basic;
}
29 changes: 29 additions & 0 deletions tests/servlet/basic/src/test/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright (c) 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
*/

module org.glassfish.tyrus.tests.servlet.basic.test {
requires jakarta.websocket;
requires jakarta.websocket.client;

requires junit;

requires org.glassfish.tyrus.container.grizzly.client;
requires org.glassfish.tyrus.server;
requires org.glassfish.tyrus.test.tools;
requires org.glassfish.tyrus.tests.servlet.basic;

exports org.glassfish.tyrus.tests.servlet.basic.test to junit;
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
*/

package org.glassfish.tyrus.tests.servlet.basic;
package org.glassfish.tyrus.tests.servlet.basic.test;

import java.io.IOException;
import java.net.URI;
Expand All @@ -39,6 +39,12 @@
import org.glassfish.tyrus.server.Server;
import org.glassfish.tyrus.test.tools.TestContainer;

import org.glassfish.tyrus.tests.servlet.basic.MultiEchoEndpoint;
import org.glassfish.tyrus.tests.servlet.basic.OnOpenCloseEndpoint;
import org.glassfish.tyrus.tests.servlet.basic.PlainEchoEndpoint;
import org.glassfish.tyrus.tests.servlet.basic.RequestUriEndpoint;
import org.glassfish.tyrus.tests.servlet.basic.TyrusBroadcastEndpoint;
import org.glassfish.tyrus.tests.servlet.basic.WebSocketBroadcastEndpoint;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2017 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 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
Expand All @@ -14,10 +14,10 @@
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
*/

package org.glassfish.tyrus.tests.servlet.basic;
package org.glassfish.tyrus.tests.servlet.basic.test;

/**
* Unsecured (not using SSL) run of tests in {@link org.glassfish.tyrus.tests.servlet.basic.ServletTestBase}
* Unsecured (not using SSL) run of tests in {@link ServletTestBase}
*
* @author Petr Janouch
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2017 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 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
Expand All @@ -14,12 +14,12 @@
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
*/

package org.glassfish.tyrus.tests.servlet.basic;
package org.glassfish.tyrus.tests.servlet.basic.test;

import static org.junit.Assume.assumeTrue;

/**
* Secured (using SSL) run of tests in {@link org.glassfish.tyrus.tests.servlet.basic.ServletTestBase}.
* Secured (using SSL) run of tests in {@link ServletTestBase}.
* <p/>
* The test will be run only if system property {@code tyrus.test.port.ssl} is set.
*
Expand Down

0 comments on commit 20e9480

Please sign in to comment.