Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/3.0' into 'origin/3.1'
Browse files Browse the repository at this point in the history
Signed-off-by: Maxim Nesen <maxim.nesen@oracle.com>
  • Loading branch information
senivam committed Jul 19, 2023
2 parents eeb0ade + d06b586 commit a45e825
Show file tree
Hide file tree
Showing 66 changed files with 1,573 additions and 428 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2022 Contributors to the Eclipse Foundation
# Copyright (c) 2022, 2023 Contributors to the Eclipse Foundation
#
# 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 Down Expand Up @@ -29,11 +29,11 @@ jobs:

steps:
- name: Checkout for build
uses: actions/checkout@v2.3.4
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: ${{ matrix.java_version }}
Expand All @@ -43,3 +43,8 @@ jobs:
sed -i 's/jdk.tls.disabledAlgorithms/# jdk.tls.disabledAlgorithms/g' -i $secLoc
- name: Build
run: mvn -V -U -B ${{matrix.verify_profiles}} org.eclipse.dash:license-tool-plugin:license-check -DexcludeArtifactIds=bsh,jmh-core,jmh-generator-annprocess,swing-layout
- name: Upload license-check info
uses: actions/upload-artifact@v3
with:
name: license-summary.txt
path: target/dash/summary
2 changes: 1 addition & 1 deletion NOTICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jakarta.inject Version: 1
* License: Apache License, 2.0
* Copyright (C) 2009 The JSR-330 Expert Group

Javassist Version 3.29.0-GA
Javassist Version 3.29.2-GA
* License: Apache License, 2.0
* Project: http://www.javassist.org/
* Copyright (C) 1999- Shigeru Chiba. All Rights Reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2015, 2022 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2015, 2023 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 Down Expand Up @@ -98,6 +98,11 @@
<war>${project.build.directory}/${project.build.finalName}.war</war>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>${war.mvn.plugin.version}</version>
</plugin>
</plugins>
</build>

Expand All @@ -122,5 +127,6 @@
<properties>
<java.version>11</java.version>
<jersey.config.test.container.port>8080</jersey.config.test.container.port>
<war.mvn.plugin.version>3.4.0</war.mvn.plugin.version>
</properties>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,19 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire.mvn.plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>${war.mvn.plugin.version}</version>
</plugin>
</plugins>
</build>

<properties>
<jersey.version>${project.version}</jersey.version>
<jetty.version>11.0.15</jetty.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<surefire.mvn.plugin.version>3.0.0-M7</surefire.mvn.plugin.version>
<surefire.mvn.plugin.version>3.1.2</surefire.mvn.plugin.version>
<war.mvn.plugin.version>3.4.0</war.mvn.plugin.version>
</properties>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@

<properties>
<jersey.version>${project.version}</jersey.version>
<junit-jupiter.version>5.9.1</junit-jupiter.version>
<junit-jupiter.version>5.9.3</junit-jupiter.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<surefire.mvn.plugin.version>3.0.0-M7</surefire.mvn.plugin.version>
<surefire.mvn.plugin.version>3.1.2</surefire.mvn.plugin.version>
</properties>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>${war.mvn.plugin.version}</version>
</plugin>
</plugins>
</build>

Expand Down Expand Up @@ -58,5 +63,6 @@
<properties>
<jersey.version>${project.version}</jersey.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<war.mvn.plugin.version>3.4.0</war.mvn.plugin.version>
</properties>
</project>
2 changes: 1 addition & 1 deletion bundles/jaxrs-ri/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@
<showWarnings>false</showWarnings>
<fork>false</fork>
<excludes>
<exclude>module-info.java</exclude>
<exclude>module-info.java</exclude><exclude>META-INF/versions/11/**</exclude>
</excludes>
</configuration>
</plugin>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
/*
* Copyright (c) 2023 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.helidon.connector;

import org.glassfish.jersey.client.ClientConfig;
import org.glassfish.jersey.client.ClientProperties;
import org.glassfish.jersey.client.HttpUrlConnectorProvider;
import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.test.JerseyTest;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.client.ClientBuilder;
import jakarta.ws.rs.client.ClientRequestContext;
import jakarta.ws.rs.client.ClientRequestFilter;
import jakarta.ws.rs.core.Application;
import jakarta.ws.rs.core.Context;
import jakarta.ws.rs.core.HttpHeaders;
import jakarta.ws.rs.core.Response;
import java.io.IOException;

// The Helidon jar has META-INF set
// Test of override
class MetaInfOverrideTest extends JerseyTest {

@Path("/origin")
public static class UserAgentServer {
@GET
public String get(@Context HttpHeaders headers) {
return headers.getHeaderString(HttpHeaders.USER_AGENT);
}
}

@Override
protected Application configure() {
return new ResourceConfig(UserAgentServer.class);
}

@Test
void defaultMetaInfTest() {
try (Response r = target("origin").request().get()) {
Assertions.assertEquals(200, r.getStatus());
Assertions.assertTrue(r.readEntity(String.class).contains("Helidon"));
}
}

@Test
void overrideMetaInfTest() {
ClientConfig config = new ClientConfig();
config.connectorProvider(new HttpUrlConnectorProvider());
try (Response r = ClientBuilder.newClient(config).target(target("origin").getUri()).request().get()) {
Assertions.assertEquals(200, r.getStatus());
r.bufferEntity();
System.out.println(r.readEntity(String.class));
Assertions.assertTrue(r.readEntity(String.class).contains("HttpUrlConnection"));
}
}

@Test
void overrideMetaInfByOtherConfigPropertyTest() {
ClientConfig config = new ClientConfig();
config.property(ClientProperties.CONNECTOR_PROVIDER, "org.glassfish.jersey.client.HttpUrlConnectorProvider");
try (Response r = ClientBuilder.newClient(config).target(target("origin").getUri()).request().get()) {
Assertions.assertEquals(200, r.getStatus());
r.bufferEntity();
System.out.println(r.readEntity(String.class));
Assertions.assertTrue(r.readEntity(String.class).contains("HttpUrlConnection"));
}
}

@Test
void overrideMetaInfByThePropertyTest() {
try (Response r = ClientBuilder.newBuilder()
.property(ClientProperties.CONNECTOR_PROVIDER, "org.glassfish.jersey.client.HttpUrlConnectorProvider")
.build()
.target(target("origin").getUri()).request().get()) {
Assertions.assertEquals(200, r.getStatus());
r.bufferEntity();
System.out.println(r.readEntity(String.class));
Assertions.assertTrue(r.readEntity(String.class).contains("HttpUrlConnection"));
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2022 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2023 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 Down Expand Up @@ -189,6 +189,9 @@ public int read() throws IOException {

if (content.isReadable()) {
content.retain();
if (nis == null) {
nis = new NettyInputStream();
}
nis.publish(content);
}

Expand Down
24 changes: 24 additions & 0 deletions containers/jetty-http2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,42 @@
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-util</artifactId>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.http2</groupId>
<artifactId>http2-server</artifactId>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-alpn-conscrypt-server</artifactId>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
Expand Down
6 changes: 6 additions & 0 deletions containers/jetty-servlet/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-webapp</artifactId>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
import org.glassfish.jersey.internal.util.PropertiesHelper;
import org.glassfish.jersey.internal.util.PropertyAlias;

import jakarta.ws.rs.client.ClientBuilder;

/**
* Jersey client implementation configuration properties.
*
Expand Down Expand Up @@ -444,7 +446,7 @@ public final class ClientProperties {
EXPECT_100_CONTINUE_THRESHOLD_SIZE = "jersey.config.client.request.expect.100.continue.threshold.size";

/**
* Default threshold size (64kb) after which which Expect:100-Continue header would be applied before
* Default threshold size (64kb) after which Expect:100-Continue header would be applied before
* the main request.
*
* @since 2.32
Expand Down Expand Up @@ -481,6 +483,22 @@ public final class ClientProperties {
*/
public static final String SNI_HOST_NAME = "jersey.config.client.sniHostName";

/**
* Sets the {@link org.glassfish.jersey.client.spi.ConnectorProvider} class. Overrides the value from META-INF/services.
*
* <p>
* The value MUST be an instance of {@code String}.
* </p>
* <p>
* The property is recognized by {@link ClientBuilder}.
* </p>
* <p>
* The name of the configuration property is <tt>{@value}</tt>.
* </p>
* @since 2.40
*/
public static final String CONNECTOR_PROVIDER = "jersey.config.client.connector.provider";

private ClientProperties() {
// prevents instantiation
}
Expand Down
Loading

0 comments on commit a45e825

Please sign in to comment.