Skip to content

Commit

Permalink
new module for dependencyConvergence validation
Browse files Browse the repository at this point in the history
Signed-off-by: Maxim Nesen <[email protected]>
  • Loading branch information
senivam authored and jansupol committed Jul 21, 2022
1 parent d662df1 commit 129e770
Show file tree
Hide file tree
Showing 23 changed files with 562 additions and 31 deletions.
12 changes: 12 additions & 0 deletions connectors/apache-connector/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<exclusions>
<exclusion>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>${commons.codec.version}</version>
<scope>test</scope>
</dependency>

<dependency>
Expand Down
12 changes: 12 additions & 0 deletions connectors/apache5-connector/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,20 @@
<dependency>
<groupId>org.apache.httpcomponents.client5</groupId>
<artifactId>httpclient5</artifactId>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-grizzly2-http</artifactId>
Expand Down
9 changes: 9 additions & 0 deletions connectors/grizzly-connector/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,17 @@
<groupId>org.glassfish.grizzly</groupId>
<artifactId>connection-pool</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.grizzly</groupId>
<artifactId>grizzly-websockets</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion examples/groovy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
<plugin>
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>
<version>1.12.1</version>
<version>${org.codehaus.gmavenplus.version}</version>
<executions>
<execution>
<id>1</id>
Expand Down
2 changes: 1 addition & 1 deletion examples/open-tracing/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<dependency>
<groupId>com.uber.jaeger</groupId>
<artifactId>jaeger-core</artifactId>
<version>0.27.0</version>
<version>${com.uber.jaeger.version}</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
Expand Down
12 changes: 12 additions & 0 deletions ext/cdi/jersey-weld2-se/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@
<dependency>
<groupId>org.jboss.weld.se</groupId>
<artifactId>weld-se-core</artifactId>
<exclusions>
<exclusion>
<groupId>jakarta.interceptor</groupId>
<artifactId>jakarta.interceptor-api</artifactId>
</exclusion>
</exclusions>
<scope>provided</scope>
</dependency>
<dependency>
Expand All @@ -51,6 +57,12 @@
<dependency>
<groupId>jakarta.enterprise</groupId>
<artifactId>jakarta.enterprise.cdi-api</artifactId>
<exclusions>
<exclusion>
<groupId>jakarta.interceptor</groupId>
<artifactId>jakarta.interceptor-api</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

Expand Down
11 changes: 11 additions & 0 deletions ext/mvc-mustache/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,17 @@
<groupId>com.github.spullara.mustache.java</groupId>
<artifactId>compiler</artifactId>
<version>${mustache.version}</version>
<exclusions>
<exclusion>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
</dependency>
</dependencies>

Expand Down
8 changes: 7 additions & 1 deletion ext/rx/rx-client-rxjava2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,17 @@
<groupId>io.reactivex.rxjava2</groupId>
<artifactId>rxjava</artifactId>
<version>${rxjava2.version}</version>
<exclusions>
<exclusion>
<groupId>org.reactivestreams</groupId>
<artifactId>reactive-streams</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.reactivestreams</groupId>
<artifactId>reactive-streams</artifactId>
<version>1.0.0</version>
<version>${reactive.streams.version}</version>
</dependency>
</dependencies>
</project>
6 changes: 6 additions & 0 deletions ext/spring6/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@
<groupId>org.glassfish.hk2</groupId>
<artifactId>hk2</artifactId>
<version>${hk2.version}</version>
<exclusions>
<exclusion>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
Expand Down
11 changes: 11 additions & 0 deletions incubator/kryo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,17 @@
<dependency>
<groupId>com.esotericsoftware</groupId>
<artifactId>kryo</artifactId>
<exclusions>
<exclusion>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<version>${asm.version}</version>
</dependency>

<dependency>
Expand Down
10 changes: 9 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2109,6 +2109,14 @@
<grizzly.client.version>1.16</grizzly.client.version>
<enforcer.version>3.1.0</enforcer.version>

<!--versions, extracted here due to maven-enforcer-plugin -->
<slf4j.version>2.0.0-alpha6</slf4j.version>
<commons.codec.version>1.15</commons.codec.version>
<reactive.streams.version>1.0.3</reactive.streams.version>
<com.uber.jaeger.version>0.27.0</com.uber.jaeger.version>
<org.codehaus.gmavenplus.version>1.13.1</org.codehaus.gmavenplus.version>
<!-- end of versions extracted here due to maven-enforcer-plugin -->

<!-- microprofile -->
<microprofile.config.version>3.0</microprofile.config.version>
<microprofile.rest.client.version>3.0</microprofile.rest.client.version>
Expand All @@ -2134,7 +2142,7 @@
<jmh.version>1.10.2</jmh.version>
<jmockit.version>1.44</jmockit.version>
<junit5.version>5.6.0</junit5.version>
<kryo.version>4.0.1</kryo.version>
<kryo.version>4.0.2</kryo.version>
<mockito.version>3.9.0</mockito.version> <!-- CQ 17673 -->
<mustache.version>0.8.17</mustache.version>
<netty.version>4.1.75.Final</netty.version>
Expand Down
2 changes: 1 addition & 1 deletion test-framework/maven/container-runner-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
<dependency>
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>
<version>1.13.1</version>
<version>${org.codehaus.gmavenplus.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.maven.shared</groupId>
Expand Down
5 changes: 5 additions & 0 deletions tests/e2e-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,11 @@
<artifactId>xmlunit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons.io.version}</version>
</dependency>
</dependencies>

<profiles>
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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;
Expand Down Expand Up @@ -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,
Expand All @@ -80,7 +79,7 @@ public class ChunkedInputStreamClosedPrematurelyTest extends JerseyTest {
@SuppressWarnings({"ThrowableResultOfMethodCallIgnored", "JavaDoc"})
public static class TestResource {

private static final ConcurrentMap<String, SettableFuture<Exception>> REQUEST_MAP = new ConcurrentHashMap<>();
private static final ConcurrentMap<String, CompletableFuture<Exception>> REQUEST_MAP = new ConcurrentHashMap<>();

@QueryParam(REQ_ID_PARAM_NAME)
private String reqId;
Expand All @@ -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);
Expand All @@ -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<Exception> esf = getFutureFor(reqId);
final CompletableFuture<Exception> esf = getFutureFor(reqId);
try {
// wait for up to three second for a request to be made;
// there is always a value, if set...
Expand All @@ -126,17 +125,17 @@ public Boolean getRequestWasMade() {
@Path("/requestCausedException")
@GET
public Boolean getRequestCausedException() {
final SettableFuture<Exception> esf = getFutureFor(reqId);
final CompletableFuture<Exception> esf = getFutureFor(reqId);
try {
return esf.get(3, TimeUnit.SECONDS) != NO_EXCEPTION;
} catch (InterruptedException | ExecutionException | TimeoutException e) {
throw new InternalServerErrorException("Post request processing has timed out for request id " + reqId, e);
}
}

private SettableFuture<Exception> getFutureFor(String key) {
final SettableFuture<Exception> esf = SettableFuture.create();
final SettableFuture<Exception> oldEsf = REQUEST_MAP.putIfAbsent(key, esf);
private CompletableFuture<Exception> getFutureFor(String key) {
final CompletableFuture<Exception> esf = new CompletableFuture();
final CompletableFuture<Exception> oldEsf = REQUEST_MAP.putIfAbsent(key, esf);
return (oldEsf != null) ? oldEsf : esf;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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;
Expand All @@ -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.
*
Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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;
Expand Down Expand Up @@ -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.
* <p/>
Expand Down Expand Up @@ -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);
}
Expand Down
Loading

0 comments on commit 129e770

Please sign in to comment.