From 129e770f89647d3e29a7a747318e7ee63609ab0c Mon Sep 17 00:00:00 2001 From: Maxim Nesen Date: Thu, 23 Jun 2022 12:54:18 +0200 Subject: [PATCH] new module for dependencyConvergence validation Signed-off-by: Maxim Nesen --- connectors/apache-connector/pom.xml | 12 + connectors/apache5-connector/pom.xml | 12 + connectors/grizzly-connector/pom.xml | 9 + examples/groovy/pom.xml | 2 +- examples/open-tracing/pom.xml | 2 +- ext/cdi/jersey-weld2-se/pom.xml | 12 + ext/mvc-mustache/pom.xml | 11 + ext/rx/rx-client-rxjava2/pom.xml | 8 +- ext/spring6/pom.xml | 6 + incubator/kryo/pom.xml | 11 + pom.xml | 10 +- .../container-runner-maven-plugin/pom.xml | 2 +- tests/e2e-client/pom.xml | 5 + ...unkedInputStreamClosedPrematurelyTest.java | 19 +- .../ssl/AbstractConnectorServerTest.java | 6 +- .../e2e/client/connector/ssl/Server.java | 9 +- .../e2e/server/wadl/WadlBeanParamTest.java | 7 +- .../e2e/server/wadl/WadlResourceTest.java | 7 +- tests/integration/jersey-5087/pom.xml | 333 ++++++++++++++++++ .../integration/jersey5087/Jersey5087.java | 26 ++ .../integration/jersey5087/Resource5087.java | 30 ++ .../jersey5087/Jersey5087Test.java | 53 +++ tests/integration/pom.xml | 1 + 23 files changed, 562 insertions(+), 31 deletions(-) create mode 100644 tests/integration/jersey-5087/pom.xml create mode 100644 tests/integration/jersey-5087/src/main/java/org/glassfish/jersey/tests/integration/jersey5087/Jersey5087.java create mode 100644 tests/integration/jersey-5087/src/main/java/org/glassfish/jersey/tests/integration/jersey5087/Resource5087.java create mode 100644 tests/integration/jersey-5087/src/test/java/org/glassfish/jersey/tests/integration/jersey5087/Jersey5087Test.java diff --git a/connectors/apache-connector/pom.xml b/connectors/apache-connector/pom.xml index f366855622..258ef18f32 100644 --- a/connectors/apache-connector/pom.xml +++ b/connectors/apache-connector/pom.xml @@ -40,6 +40,18 @@ org.apache.httpcomponents httpclient + + + commons-codec + commons-codec + + + + + commons-codec + commons-codec + ${commons.codec.version} + test diff --git a/connectors/apache5-connector/pom.xml b/connectors/apache5-connector/pom.xml index 6e2441819d..9d08082d24 100644 --- a/connectors/apache5-connector/pom.xml +++ b/connectors/apache5-connector/pom.xml @@ -40,8 +40,20 @@ org.apache.httpcomponents.client5 httpclient5 + + + org.slf4j + slf4j-api + + + + org.slf4j + slf4j-api + ${slf4j.version} + test + org.glassfish.jersey.containers jersey-container-grizzly2-http diff --git a/connectors/grizzly-connector/pom.xml b/connectors/grizzly-connector/pom.xml index a9327a5488..ba96bfdfcf 100644 --- a/connectors/grizzly-connector/pom.xml +++ b/connectors/grizzly-connector/pom.xml @@ -49,8 +49,17 @@ org.glassfish.grizzly connection-pool + + org.slf4j + slf4j-api + + + org.slf4j + slf4j-api + ${slf4j.version} + org.glassfish.grizzly grizzly-websockets diff --git a/examples/groovy/pom.xml b/examples/groovy/pom.xml index c3cb7147e2..49a7051320 100644 --- a/examples/groovy/pom.xml +++ b/examples/groovy/pom.xml @@ -77,7 +77,7 @@ org.codehaus.gmavenplus gmavenplus-plugin - 1.12.1 + ${org.codehaus.gmavenplus.version} 1 diff --git a/examples/open-tracing/pom.xml b/examples/open-tracing/pom.xml index 71eca1909f..cc01f9962e 100644 --- a/examples/open-tracing/pom.xml +++ b/examples/open-tracing/pom.xml @@ -52,7 +52,7 @@ com.uber.jaeger jaeger-core - 0.27.0 + ${com.uber.jaeger.version} org.slf4j diff --git a/ext/cdi/jersey-weld2-se/pom.xml b/ext/cdi/jersey-weld2-se/pom.xml index 17e5f204be..18eddfb97e 100644 --- a/ext/cdi/jersey-weld2-se/pom.xml +++ b/ext/cdi/jersey-weld2-se/pom.xml @@ -36,6 +36,12 @@ org.jboss.weld.se weld-se-core + + + jakarta.interceptor + jakarta.interceptor-api + + provided @@ -51,6 +57,12 @@ jakarta.enterprise jakarta.enterprise.cdi-api + + + jakarta.interceptor + jakarta.interceptor-api + + diff --git a/ext/mvc-mustache/pom.xml b/ext/mvc-mustache/pom.xml index 8a14f5c259..c409a7c045 100644 --- a/ext/mvc-mustache/pom.xml +++ b/ext/mvc-mustache/pom.xml @@ -66,6 +66,17 @@ com.github.spullara.mustache.java compiler ${mustache.version} + + + com.google.guava + guava + + + + + com.google.guava + guava + ${guava.version} diff --git a/ext/rx/rx-client-rxjava2/pom.xml b/ext/rx/rx-client-rxjava2/pom.xml index d0f8bb2493..f859654bd6 100644 --- a/ext/rx/rx-client-rxjava2/pom.xml +++ b/ext/rx/rx-client-rxjava2/pom.xml @@ -42,11 +42,17 @@ io.reactivex.rxjava2 rxjava ${rxjava2.version} + + + org.reactivestreams + reactive-streams + + org.reactivestreams reactive-streams - 1.0.0 + ${reactive.streams.version} diff --git a/ext/spring6/pom.xml b/ext/spring6/pom.xml index c7817c6b71..701fc992ff 100644 --- a/ext/spring6/pom.xml +++ b/ext/spring6/pom.xml @@ -89,6 +89,12 @@ org.glassfish.hk2 hk2 ${hk2.version} + + + org.ow2.asm + asm + + diff --git a/incubator/kryo/pom.xml b/incubator/kryo/pom.xml index 7c09b331be..36b1f1ba80 100644 --- a/incubator/kryo/pom.xml +++ b/incubator/kryo/pom.xml @@ -48,6 +48,17 @@ com.esotericsoftware kryo + + + org.ow2.asm + asm + + + + + org.ow2.asm + asm + ${asm.version} diff --git a/pom.xml b/pom.xml index cf11075bd6..ca17016add 100644 --- a/pom.xml +++ b/pom.xml @@ -2109,6 +2109,14 @@ 1.16 3.1.0 + + 2.0.0-alpha6 + 1.15 + 1.0.3 + 0.27.0 + 1.13.1 + + 3.0 3.0 @@ -2134,7 +2142,7 @@ 1.10.2 1.44 5.6.0 - 4.0.1 + 4.0.2 3.9.0 0.8.17 4.1.75.Final diff --git a/test-framework/maven/container-runner-maven-plugin/pom.xml b/test-framework/maven/container-runner-maven-plugin/pom.xml index ce864fbb2a..8306f9ff3c 100644 --- a/test-framework/maven/container-runner-maven-plugin/pom.xml +++ b/test-framework/maven/container-runner-maven-plugin/pom.xml @@ -119,7 +119,7 @@ org.codehaus.gmavenplus gmavenplus-plugin - 1.13.1 + ${org.codehaus.gmavenplus.version} org.apache.maven.shared diff --git a/tests/e2e-client/pom.xml b/tests/e2e-client/pom.xml index 1dce53c7e4..a286c36bf0 100644 --- a/tests/e2e-client/pom.xml +++ b/tests/e2e-client/pom.xml @@ -182,6 +182,11 @@ xmlunit test + + commons-io + commons-io + ${commons.io.version} + diff --git a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/ChunkedInputStreamClosedPrematurelyTest.java b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/ChunkedInputStreamClosedPrematurelyTest.java index 33b1fbb819..3298e5de6f 100644 --- a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/ChunkedInputStreamClosedPrematurelyTest.java +++ b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/ChunkedInputStreamClosedPrematurelyTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020 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 @@ -22,6 +22,7 @@ import java.net.HttpURLConnection; import java.net.URL; import java.util.Arrays; +import java.util.concurrent.CompletableFuture; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.ExecutionException; @@ -57,8 +58,6 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; -import com.google.common.util.concurrent.SettableFuture; - /** * Reproducer for JERSEY-2705. Client side entity InputStream exception * in chunked mode should not lead to the same behavior on the server side, @@ -80,7 +79,7 @@ public class ChunkedInputStreamClosedPrematurelyTest extends JerseyTest { @SuppressWarnings({"ThrowableResultOfMethodCallIgnored", "JavaDoc"}) public static class TestResource { - private static final ConcurrentMap> REQUEST_MAP = new ConcurrentHashMap<>(); + private static final ConcurrentMap> REQUEST_MAP = new ConcurrentHashMap<>(); @QueryParam(REQ_ID_PARAM_NAME) private String reqId; @@ -100,7 +99,7 @@ public String post(InputStream is) { thrown = ex; } - if (!getFutureFor(reqId).set(thrown)) { + if (!getFutureFor(reqId).complete(thrown)) { LOGGER.log(Level.WARNING, "Unable to set stream processing exception into the settable future instance for request id " + reqId, thrown); @@ -113,7 +112,7 @@ public String post(InputStream is) { @GET public Boolean getRequestWasMade() { // add a new future for the request if not there yet to avoid race conditions with POST processing - final SettableFuture esf = getFutureFor(reqId); + final CompletableFuture esf = getFutureFor(reqId); try { // wait for up to three second for a request to be made; // there is always a value, if set... @@ -126,7 +125,7 @@ public Boolean getRequestWasMade() { @Path("/requestCausedException") @GET public Boolean getRequestCausedException() { - final SettableFuture esf = getFutureFor(reqId); + final CompletableFuture esf = getFutureFor(reqId); try { return esf.get(3, TimeUnit.SECONDS) != NO_EXCEPTION; } catch (InterruptedException | ExecutionException | TimeoutException e) { @@ -134,9 +133,9 @@ public Boolean getRequestCausedException() { } } - private SettableFuture getFutureFor(String key) { - final SettableFuture esf = SettableFuture.create(); - final SettableFuture oldEsf = REQUEST_MAP.putIfAbsent(key, esf); + private CompletableFuture getFutureFor(String key) { + final CompletableFuture esf = new CompletableFuture(); + final CompletableFuture oldEsf = REQUEST_MAP.putIfAbsent(key, esf); return (oldEsf != null) ? oldEsf : esf; } } diff --git a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/ssl/AbstractConnectorServerTest.java b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/ssl/AbstractConnectorServerTest.java index f26fca912b..7976f4dafe 100644 --- a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/ssl/AbstractConnectorServerTest.java +++ b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/ssl/AbstractConnectorServerTest.java @@ -36,7 +36,7 @@ import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -import com.google.common.io.ByteStreams; +import org.apache.commons.io.IOUtils; /** * SSL connector hostname verification tests. @@ -99,9 +99,9 @@ protected SSLContext getSslContext() throws IOException { final InputStream trustStore = SslConnectorConfigurationTest.class.getResourceAsStream(clientTrustStore()); final InputStream keyStore = SslConnectorConfigurationTest.class.getResourceAsStream(CLIENT_KEY_STORE); return SslConfigurator.newInstance() - .trustStoreBytes(ByteStreams.toByteArray(trustStore)) + .trustStoreBytes(IOUtils.toByteArray(trustStore)) .trustStorePassword("asdfgh") - .keyStoreBytes(ByteStreams.toByteArray(keyStore)) + .keyStoreBytes(IOUtils.toByteArray(keyStore)) .keyPassword("asdfgh") .createSSLContext(); } diff --git a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/ssl/Server.java b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/ssl/Server.java index c986c2c01f..20795c326e 100644 --- a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/ssl/Server.java +++ b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/ssl/Server.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 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 @@ -23,6 +23,7 @@ import jakarta.ws.rs.core.UriBuilder; +import org.apache.commons.io.IOUtils; import org.glassfish.jersey.logging.LoggingFeature; import org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpServerFactory; import org.glassfish.jersey.server.ResourceConfig; @@ -31,8 +32,6 @@ import org.glassfish.grizzly.ssl.SSLContextConfigurator; import org.glassfish.grizzly.ssl.SSLEngineConfigurator; -import com.google.common.io.ByteStreams; - /** * A simple SSL-secured HTTP server for testing purposes. * @@ -87,9 +86,9 @@ public static Server start(String keystore) throws IOException { SSLContextConfigurator sslContext = new SSLContextConfigurator(); // set up security context - sslContext.setKeyStoreBytes(ByteStreams.toByteArray(keyStore)); // contains server key pair + sslContext.setKeyStoreBytes(IOUtils.toByteArray(keyStore)); // contains server key pair sslContext.setKeyStorePass("asdfgh"); - sslContext.setTrustStoreBytes(ByteStreams.toByteArray(trustStore)); // contains client certificate + sslContext.setTrustStoreBytes(IOUtils.toByteArray(trustStore)); // contains client certificate sslContext.setTrustStorePass("asdfgh"); ResourceConfig rc = new ResourceConfig(); diff --git a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/wadl/WadlBeanParamTest.java b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/wadl/WadlBeanParamTest.java index 195c6755aa..9dc66d9b27 100644 --- a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/wadl/WadlBeanParamTest.java +++ b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/wadl/WadlBeanParamTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -22,6 +22,7 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; +import java.util.Collections; import jakarta.ws.rs.BeanParam; import jakarta.ws.rs.CookieParam; @@ -61,8 +62,6 @@ import org.w3c.dom.Element; import org.w3c.dom.Node; -import com.google.common.collect.ImmutableMap; - /** * Tests whether WADL for a {@link BeanParam} annotated resource method parameter is generated properly. *

@@ -168,7 +167,7 @@ private void testBeanParamConstructorInitializedBean(String resource) throws Exc XPathConstants.NODE)) ); XMLUnit.setXpathNamespaceContext( - new SimpleNamespaceContext(ImmutableMap.of("wadl", "http://wadl.dev.java.net/2009/02"))); + new SimpleNamespaceContext(Collections.singletonMap("wadl", "http://wadl.dev.java.net/2009/02"))); diff.overrideElementQualifier(elementQualifier); XMLAssert.assertXMLEqual(diff, true); } diff --git a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/wadl/WadlResourceTest.java b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/wadl/WadlResourceTest.java index 72371288ed..42e549e8d6 100644 --- a/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/wadl/WadlResourceTest.java +++ b/tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server/wadl/WadlResourceTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 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 @@ -27,6 +27,7 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import java.net.URI; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -112,8 +113,6 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; -import com.google.common.collect.ImmutableMap; - import com.sun.research.ws.wadl.Method; import com.sun.research.ws.wadl.Param; import com.sun.research.ws.wadl.Request; @@ -1279,7 +1278,7 @@ public void testWadlIsSameForAnnotatedAndNot() throws Exception { XPathConstants.NODE)) ); XMLUnit.setXpathNamespaceContext( - new SimpleNamespaceContext(ImmutableMap.of("wadl", "http://wadl.dev.java.net/2009/02"))); + new SimpleNamespaceContext(Collections.singletonMap("wadl", "http://wadl.dev.java.net/2009/02"))); final ElementQualifier elementQualifier = new RecursiveElementNameAndTextQualifier(); diff.overrideElementQualifier(elementQualifier); XMLAssert.assertXMLEqual(diff, true); diff --git a/tests/integration/jersey-5087/pom.xml b/tests/integration/jersey-5087/pom.xml new file mode 100644 index 0000000000..efbfe3c2e1 --- /dev/null +++ b/tests/integration/jersey-5087/pom.xml @@ -0,0 +1,333 @@ + + + + + + project + org.glassfish.jersey.tests.integration + 3.1.0-SNAPSHOT + + 4.0.0 + + jersey-5087 + war + jersey-tests-integration-jersey-5087 + + dependencyConvergence rule check + + + + + org.glassfish.jersey + jersey-bom + ${project.version} + pom + import + + + + + + + org.glassfish.jersey.core + jersey-common + + + org.glassfish.jersey.core + jersey-client + + + org.glassfish.jersey.core + jersey-server + + + org.glassfish.jersey.bundles + jaxrs-ri + + + org.glassfish.jersey.connectors + jersey-apache-connector + + + org.glassfish.jersey.connectors + jersey-apache5-connector + + + org.glassfish.jersey.connectors + jersey-helidon-connector + + + org.glassfish.jersey.connectors + jersey-grizzly-connector + + + org.glassfish.jersey.connectors + jersey-jetty-connector + + + org.glassfish.jersey.connectors + jersey-jdk-connector + + + org.glassfish.jersey.connectors + jersey-netty-connector + + + org.glassfish.jersey.containers + jersey-container-jetty-http + + + org.glassfish.jersey.containers + jersey-container-grizzly2-http + + + org.glassfish.jersey.containers + jersey-container-grizzly2-servlet + + + org.glassfish.jersey.containers + jersey-container-jetty-servlet + + + org.glassfish.jersey.containers + jersey-container-jdk-http + + + org.glassfish.jersey.containers + jersey-container-netty-http + + + org.glassfish.jersey.containers + jersey-container-servlet + + + org.glassfish.jersey.containers + jersey-container-servlet-core + + + org.glassfish.jersey.containers + jersey-container-simple-http + + + org.glassfish.jersey.containers.glassfish + jersey-gf-ejb + + + org.glassfish.jersey.ext + jersey-bean-validation + + + org.glassfish.jersey.ext + jersey-entity-filtering + + + org.glassfish.jersey.ext + jersey-metainf-services + + + org.glassfish.jersey.ext.microprofile + jersey-mp-config + + + org.glassfish.jersey.ext + jersey-mvc + + + org.glassfish.jersey.ext + jersey-mvc-bean-validation + + + org.glassfish.jersey.ext + jersey-mvc-freemarker + + + org.glassfish.jersey.ext + jersey-mvc-jsp + + + org.glassfish.jersey.ext + jersey-mvc-mustache + + + org.glassfish.jersey.ext + jersey-proxy-client + + + org.glassfish.jersey.ext + jersey-spring6 + + + org.glassfish.jersey.ext + jersey-declarative-linking + + + org.glassfish.jersey.ext + jersey-wadl-doclet + + + org.glassfish.jersey.ext.cdi + jersey-weld2-se + + + org.glassfish.jersey.ext.cdi + jersey-cdi1x + + + org.glassfish.jersey.ext.cdi + jersey-cdi1x-transaction + + + org.glassfish.jersey.ext.cdi + jersey-cdi1x-validation + + + org.glassfish.jersey.ext.cdi + jersey-cdi1x-servlet + + + org.glassfish.jersey.ext.cdi + jersey-cdi1x-ban-custom-hk2-binding + + + org.glassfish.jersey.ext.cdi + jersey-cdi-rs-inject + + + org.glassfish.jersey.ext.rx + jersey-rx-client-guava + + + org.glassfish.jersey.ext.rx + jersey-rx-client-rxjava + + + org.glassfish.jersey.ext.rx + jersey-rx-client-rxjava2 + + + org.glassfish.jersey.ext.microprofile + jersey-mp-rest-client + + + org.glassfish.jersey.media + jersey-media-jaxb + + + org.glassfish.jersey.media + jersey-media-json-jackson + + + org.glassfish.jersey.media + jersey-media-json-jettison + + + org.glassfish.jersey.media + jersey-media-json-processing + + + org.glassfish.jersey.media + jersey-media-json-binding + + + org.glassfish.jersey.media + jersey-media-kryo + + + org.glassfish.jersey.media + jersey-media-moxy + + + org.glassfish.jersey.media + jersey-media-multipart + + + org.glassfish.jersey.media + jersey-media-sse + + + org.glassfish.jersey.security + oauth1-client + + + org.glassfish.jersey.security + oauth1-server + + + org.glassfish.jersey.security + oauth1-signature + + + org.glassfish.jersey.security + oauth2-client + + + org.glassfish.jersey.inject + jersey-hk2 + + + org.glassfish.jersey.inject + jersey-cdi2-se + + + org.glassfish.jersey.test-framework + jersey-test-framework-core + + + org.glassfish.jersey.test-framework.providers + jersey-test-framework-provider-bundle + pom + + + org.glassfish.jersey.test-framework.providers + jersey-test-framework-provider-external + + + org.glassfish.jersey.test-framework.providers + jersey-test-framework-provider-grizzly2 + + + org.glassfish.jersey.test-framework.providers + jersey-test-framework-provider-inmemory + + + org.glassfish.jersey.test-framework.providers + jersey-test-framework-provider-jdk-http + + + org.glassfish.jersey.test-framework.providers + jersey-test-framework-provider-simple + + + org.glassfish.jersey.test-framework.providers + jersey-test-framework-provider-jetty + + + org.glassfish.jersey.test-framework + jersey-test-framework-util + + + + + + true + + \ No newline at end of file diff --git a/tests/integration/jersey-5087/src/main/java/org/glassfish/jersey/tests/integration/jersey5087/Jersey5087.java b/tests/integration/jersey-5087/src/main/java/org/glassfish/jersey/tests/integration/jersey5087/Jersey5087.java new file mode 100644 index 0000000000..05f4d67b4e --- /dev/null +++ b/tests/integration/jersey-5087/src/main/java/org/glassfish/jersey/tests/integration/jersey5087/Jersey5087.java @@ -0,0 +1,26 @@ +/* + * 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 + */ + +package org.glassfish.jersey.tests.integration.jersey5087; + +import org.glassfish.jersey.server.ResourceConfig; + +public class Jersey5087 extends ResourceConfig { + + public Jersey5087() { + register(Resource5087.class); + } +} diff --git a/tests/integration/jersey-5087/src/main/java/org/glassfish/jersey/tests/integration/jersey5087/Resource5087.java b/tests/integration/jersey-5087/src/main/java/org/glassfish/jersey/tests/integration/jersey5087/Resource5087.java new file mode 100644 index 0000000000..ce32dc3aeb --- /dev/null +++ b/tests/integration/jersey-5087/src/main/java/org/glassfish/jersey/tests/integration/jersey5087/Resource5087.java @@ -0,0 +1,30 @@ +/* + * 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 + */ + +package org.glassfish.jersey.tests.integration.jersey5087; + +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; + +@Path("/") +public class Resource5087 { + + @GET + public String getResource() { + return "OK"; + } + +} diff --git a/tests/integration/jersey-5087/src/test/java/org/glassfish/jersey/tests/integration/jersey5087/Jersey5087Test.java b/tests/integration/jersey-5087/src/test/java/org/glassfish/jersey/tests/integration/jersey5087/Jersey5087Test.java new file mode 100644 index 0000000000..8c1b3be51e --- /dev/null +++ b/tests/integration/jersey-5087/src/test/java/org/glassfish/jersey/tests/integration/jersey5087/Jersey5087Test.java @@ -0,0 +1,53 @@ +/* + * 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 + */ + +package org.glassfish.jersey.tests.integration.jersey5087; + +import org.glassfish.jersey.server.ResourceConfig; +import org.glassfish.jersey.server.ServerProperties; +import org.glassfish.jersey.test.DeploymentContext; +import org.glassfish.jersey.test.JerseyTest; +import org.glassfish.jersey.test.ServletDeploymentContext; +import org.glassfish.jersey.test.grizzly.GrizzlyWebTestContainerFactory; +import org.glassfish.jersey.test.spi.TestContainerFactory; +import org.junit.Assert; +import org.junit.Test; + +import java.util.EnumSet; + +public class Jersey5087Test extends JerseyTest { + + @Override + protected ResourceConfig configure() { + return new Jersey5087(); + } + + @Override + protected TestContainerFactory getTestContainerFactory() { + return new GrizzlyWebTestContainerFactory(); + } + + @Override + protected DeploymentContext configureDeployment() { + return ServletDeploymentContext.newInstance(Jersey5087.class); + } + + @Test + public void testDependenciesClash() { + final String response = target().request().get(String.class); + Assert.assertEquals("OK", response); + } +} diff --git a/tests/integration/pom.xml b/tests/integration/pom.xml index 6406f8de65..1d5f1b6337 100644 --- a/tests/integration/pom.xml +++ b/tests/integration/pom.xml @@ -59,6 +59,7 @@ jersey-4722 microprofile reactive-streams + jersey-5087