From 74e2279c55bed4d6abe6a7968f7e52e16af8ffa6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Apr 2021 16:39:09 +0000 Subject: [PATCH 1/3] Bump commons-io in /test-framework/maven/custom-enforcer-rules Bumps commons-io from 2.2 to 2.7. Signed-off-by: dependabot[bot] --- test-framework/maven/custom-enforcer-rules/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-framework/maven/custom-enforcer-rules/pom.xml b/test-framework/maven/custom-enforcer-rules/pom.xml index 091caa6b15..7bc4727a9b 100644 --- a/test-framework/maven/custom-enforcer-rules/pom.xml +++ b/test-framework/maven/custom-enforcer-rules/pom.xml @@ -46,7 +46,7 @@ commons-io commons-io - 2.2 + 2.7 From e129ced692959513a14a8d2d0e4e117aeaaee8ee Mon Sep 17 00:00:00 2001 From: jansupol <15908245+jansupol@users.noreply.github.com> Date: Mon, 10 May 2021 13:43:08 +0200 Subject: [PATCH 2/3] JDK16 Support (#4785) * JDK16 Support Signed-off-by: jansupol --- .travis.yml | 2 +- connectors/jdk-connector/pom.xml | 22 +++++++++++++ core-client/pom.xml | 10 +++++- .../jersey/client/ClientRequestTest.java | 17 +++++++--- core-common/pom.xml | 2 +- .../logging/LoggingInterceptorTest.java | 4 +-- .../src/test/resources/surefire.policy | 1 + examples/cdi-webapp/pom.xml | 4 +-- examples/helloworld-cdi2-se/pom.xml | 6 ---- .../helloworld-spring-annotations/pom.xml | 4 +-- .../helloworld/test/AbstractWebAppTest.java | 4 +-- .../osgi-http-service/functional-test/pom.xml | 6 ++++ .../test/AbstractHttpServiceTest.java | 4 +-- .../glassfish/jersey/examples/reload/App.java | 22 ++++++++++--- .../ValidationInterceptorExecutor.java | 7 +++- ext/cdi/jersey-cdi1x-validation/pom.xml | 16 +++++---- .../internal/CdiInterceptorWrapper.java | 6 ++-- .../CdiInterceptorWrapperExtension.java | 15 +++++++-- ext/microprofile/mp-rest-client/pom.xml | 1 + .../restclient/ReflectionUtil.java | 33 ++++++++++++++++--- ext/spring4/pom.xml | 18 ++++++++++ incubator/declarative-linking/pom.xml | 18 ++++++++++ .../se/injector/JerseyInjectionTarget.java | 10 +++++- .../jersey/inject/hk2/SupplierProxyTest.java | 11 ++++--- pom.xml | 23 ++++++++----- .../e2e/server/wadl/WadlResourceTest.java | 11 +++++-- .../cdi-beanvalidation-webapp/pom.xml | 8 ++--- .../cdi/bv/CdiValidationInterceptor.java | 6 ++-- .../cdi-client-on-server/pom.xml | 4 +-- .../cdi-integration/cdi-client/pom.xml | 4 +-- .../cdi-ejb-test-webapp/pom.xml | 4 +-- .../pom.xml | 4 +-- .../cdi-integration/cdi-log-check/pom.xml | 4 +-- .../cdi-manually-bound/pom.xml | 10 ++---- .../cdi-multimodule/lib/pom.xml | 4 +-- .../cdi-multimodule/war1/pom.xml | 4 +-- .../cdi-multimodule/war2/pom.xml | 4 +-- .../cdi-multipart-webapp/pom.xml | 4 +-- .../cdi-integration/cdi-test-webapp/pom.xml | 4 +-- .../pom.xml | 4 +-- .../pom.xml | 4 +-- .../cdi-with-jersey-injection-webapp/pom.xml | 4 +-- .../context-inject-on-server/pom.xml | 7 ++-- tests/integration/j-376/pom.xml | 4 +-- tests/integration/jersey-3992/pom.xml | 4 +-- tests/integration/jersey-4003/pom.xml | 2 +- tests/integration/jersey-4697/pom.xml | 2 +- .../microprofile/rest-client/pom.xml | 14 +++++--- tests/integration/spring4/pom.xml | 18 ++++++++++ ...MultiThreadingAggregatedReservoirTest.java | 4 +-- 50 files changed, 286 insertions(+), 122 deletions(-) diff --git a/.travis.yml b/.travis.yml index f746552135..62d6276d5d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ services: jdk: - oraclejdk8 - openjdk11 - - openjdk15 + - openjdk16 cache: directories: diff --git a/connectors/jdk-connector/pom.xml b/connectors/jdk-connector/pom.xml index d460e0d040..4b14906d21 100644 --- a/connectors/jdk-connector/pom.xml +++ b/connectors/jdk-connector/pom.xml @@ -104,6 +104,28 @@ + + disable_tls1and11 + + + [16,) + + + + + org.apache.maven.plugins + maven-surefire-plugin + + false + + **/SslFilterTLS1Test.java + **/SslFilterTLS11Test.java + + + + + + diff --git a/core-client/pom.xml b/core-client/pom.xml index a61bc606e7..1a2f6ef0e4 100644 --- a/core-client/pom.xml +++ b/core-client/pom.xml @@ -118,6 +118,14 @@ jakarta.inject + + + com.sun.activation + jakarta.activation + ${jakarta.activation.version} + test + + junit junit @@ -132,7 +140,7 @@ org.mockito - mockito-all + mockito-core test diff --git a/core-client/src/test/java/org/glassfish/jersey/client/ClientRequestTest.java b/core-client/src/test/java/org/glassfish/jersey/client/ClientRequestTest.java index 59afe35bf1..965241138a 100644 --- a/core-client/src/test/java/org/glassfish/jersey/client/ClientRequestTest.java +++ b/core-client/src/test/java/org/glassfish/jersey/client/ClientRequestTest.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 @@ -32,14 +32,14 @@ import org.glassfish.jersey.message.MessageBodyWorkers; import org.hamcrest.core.Is; +import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; -import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.MockitoAnnotations; -import org.mockito.runners.MockitoJUnitRunner; + import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNull; @@ -53,7 +53,7 @@ * * @author Marek Potociar */ -@RunWith(MockitoJUnitRunner.class) +//@RunWith(MockitoJUnitRunner.class) public class ClientRequestTest { @Mock @@ -61,9 +61,16 @@ public class ClientRequestTest { @Mock private GenericType entityType; + private AutoCloseable mockito; + @Before public void initMocks() { - MockitoAnnotations.initMocks(this); + mockito = MockitoAnnotations.openMocks(this); + } + + @After + public void closeMocks() throws Exception { + mockito.close(); } /** diff --git a/core-common/pom.xml b/core-common/pom.xml index 523326dd8b..9ecbc63ff4 100644 --- a/core-common/pom.xml +++ b/core-common/pom.xml @@ -212,7 +212,7 @@ org.mockito - mockito-all + mockito-core test diff --git a/core-common/src/test/java/org/glassfish/jersey/logging/LoggingInterceptorTest.java b/core-common/src/test/java/org/glassfish/jersey/logging/LoggingInterceptorTest.java index c19cb1934e..9034406c14 100644 --- a/core-common/src/test/java/org/glassfish/jersey/logging/LoggingInterceptorTest.java +++ b/core-common/src/test/java/org/glassfish/jersey/logging/LoggingInterceptorTest.java @@ -150,8 +150,8 @@ public void testLogInboundEntityMockedStream() throws Exception { private Answer chunk(int size, char filler) { return invocation -> { - byte[] buf = invocation.getArgumentAt(0, byte[].class); - int offset = invocation.getArgumentAt(1, Integer.class); + byte[] buf = invocation.getArgument(0, byte[].class); + int offset = invocation.getArgument(1, Integer.class); Arrays.fill(buf, offset, offset + size, (byte) filler); return size; }; diff --git a/core-common/src/test/resources/surefire.policy b/core-common/src/test/resources/surefire.policy index 530db3cf62..850e4b33ab 100644 --- a/core-common/src/test/resources/surefire.policy +++ b/core-common/src/test/resources/surefire.policy @@ -38,6 +38,7 @@ grant codebase "file:${project.build.directory}/test-classes/-" { permission java.lang.RuntimePermission "accessDeclaredMembers"; permission java.lang.RuntimePermission "accessClassInPackage.sun.reflect"; permission java.lang.RuntimePermission "reflectionFactoryAccess"; + permission java.lang.RuntimePermission "getProtectionDomain"; // mockito for JDK<16 }; grant codebase "file:${project.build.directory}/classes/-" { diff --git a/examples/cdi-webapp/pom.xml b/examples/cdi-webapp/pom.xml index e50b1cd19b..df56399ecb 100644 --- a/examples/cdi-webapp/pom.xml +++ b/examples/cdi-webapp/pom.xml @@ -45,8 +45,8 @@ provided - javax.enterprise - cdi-api + jakarta.enterprise + jakarta.enterprise.cdi-api provided diff --git a/examples/helloworld-cdi2-se/pom.xml b/examples/helloworld-cdi2-se/pom.xml index 6fd45fc4a3..c331b8501f 100644 --- a/examples/helloworld-cdi2-se/pom.xml +++ b/examples/helloworld-cdi2-se/pom.xml @@ -26,11 +26,6 @@ Jersey "Hello world" example with CDI 2 SE. - - 2.0 - ${weld3.version} - - org.glassfish.jersey.inject @@ -91,7 +86,6 @@ org.jboss.weld.se weld-se-core - 3.1.1.Final diff --git a/examples/helloworld-spring-annotations/pom.xml b/examples/helloworld-spring-annotations/pom.xml index b95a1a2242..af61a128eb 100644 --- a/examples/helloworld-spring-annotations/pom.xml +++ b/examples/helloworld-spring-annotations/pom.xml @@ -32,13 +32,13 @@ org.glassfish.jersey.ext - jersey-spring4 + jersey-spring5 ${project.version} org.springframework spring-web - ${spring4.version} + ${spring5.version} compile diff --git a/examples/osgi-helloworld-webapp/functional-test/src/test/java/org/glassfish/jersey/examples/helloworld/test/AbstractWebAppTest.java b/examples/osgi-helloworld-webapp/functional-test/src/test/java/org/glassfish/jersey/examples/helloworld/test/AbstractWebAppTest.java index d682b2e87e..02cfeff251 100644 --- a/examples/osgi-helloworld-webapp/functional-test/src/test/java/org/glassfish/jersey/examples/helloworld/test/AbstractWebAppTest.java +++ b/examples/osgi-helloworld-webapp/functional-test/src/test/java/org/glassfish/jersey/examples/helloworld/test/AbstractWebAppTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2020 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 Distribution License v. 1.0, which is available at @@ -135,7 +135,7 @@ public List + + org.ops4j.pax.url + pax-url-mvn + 1.3.7 + test + junit diff --git a/examples/osgi-http-service/functional-test/src/test/java/org/glassfish/jersey/examples/osgihttpservice/test/AbstractHttpServiceTest.java b/examples/osgi-http-service/functional-test/src/test/java/org/glassfish/jersey/examples/osgihttpservice/test/AbstractHttpServiceTest.java index db56a1145f..b8b131b024 100644 --- a/examples/osgi-http-service/functional-test/src/test/java/org/glassfish/jersey/examples/osgihttpservice/test/AbstractHttpServiceTest.java +++ b/examples/osgi-http-service/functional-test/src/test/java/org/glassfish/jersey/examples/osgihttpservice/test/AbstractHttpServiceTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2020 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 Distribution License v. 1.0, which is available at @@ -96,7 +96,7 @@ public List