diff --git a/connectors/jetty-connector/src/main/java17/org/glassfish/jersey/jetty/connector/JettyConnector.java b/connectors/jetty-connector/src/main/java17/org/glassfish/jersey/jetty/connector/JettyConnector.java index 4ae73dd286..01afd476e5 100644 --- a/connectors/jetty-connector/src/main/java17/org/glassfish/jersey/jetty/connector/JettyConnector.java +++ b/connectors/jetty-connector/src/main/java17/org/glassfish/jersey/jetty/connector/JettyConnector.java @@ -26,6 +26,7 @@ import java.net.URI; import java.nio.ByteBuffer; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Optional; @@ -253,10 +254,13 @@ public HttpCookieStore getCookieStore() { @Override public ClientResponse apply(final ClientRequest jerseyRequest) throws ProcessingException { final Request jettyRequest = translateRequest(jerseyRequest); - final Map clientHeadersSnapshot = writeOutBoundHeaders(jerseyRequest.getHeaders(), jettyRequest); - final Request.Content entity = getBytesProvider(jerseyRequest); + final Map clientHeadersSnapshot = new HashMap<>(); + final Request.Content entity = + getBytesProvider(jerseyRequest, jerseyRequest.getHeaders(), clientHeadersSnapshot, jettyRequest); if (entity != null) { jettyRequest.body(entity); + } else { + clientHeadersSnapshot.putAll(writeOutBoundHeaders(jerseyRequest.getHeaders(), jettyRequest)); } try { @@ -343,13 +347,16 @@ private Map writeOutBoundHeaders(final MultivaluedMap e : stringHeaders.entrySet()) { - httpRequest.addHeader(new HttpField(e.getKey(), e.getValue())); + httpRequest.headers(httpFields -> httpFields.put(new HttpField(e.getKey(), e.getValue()))); } } return stringHeaders; } - private Request.Content getBytesProvider(final ClientRequest clientRequest) { + private Request.Content getBytesProvider(final ClientRequest clientRequest, + final MultivaluedMap headers, + final Map snapshot, + final Request request) { final Object entity = clientRequest.getEntity(); if (entity == null) { @@ -360,6 +367,7 @@ private Request.Content getBytesProvider(final ClientRequest clientRequest) { clientRequest.setStreamProvider(new OutboundMessageContext.StreamProvider() { @Override public OutputStream getOutputStream(final int contentLength) throws IOException { + snapshot.putAll(writeOutBoundHeaders(headers, request)); return outputStream; } }); diff --git a/connectors/jetty11-connector/pom.xml b/connectors/jetty11-connector/pom.xml index 8862fb8c82..c25195f0ac 100644 --- a/connectors/jetty11-connector/pom.xml +++ b/connectors/jetty11-connector/pom.xml @@ -38,11 +38,12 @@ + + + + + - org.eclipse.jetty - jetty-server - ${jetty11.version} - org.eclipse.jetty jetty-client ${jetty11.version} diff --git a/connectors/jetty11-connector/src/main/java/org/glassfish/jersey/jetty11/connector/Jetty11ClientProperties.java b/connectors/jetty11-connector/src/main/java/org/glassfish/jersey/jetty/connector/JettyClientProperties.java similarity index 96% rename from connectors/jetty11-connector/src/main/java/org/glassfish/jersey/jetty11/connector/Jetty11ClientProperties.java rename to connectors/jetty11-connector/src/main/java/org/glassfish/jersey/jetty/connector/JettyClientProperties.java index d2d9986175..d99c918cd6 100644 --- a/connectors/jetty11-connector/src/main/java/org/glassfish/jersey/jetty11/connector/Jetty11ClientProperties.java +++ b/connectors/jetty11-connector/src/main/java/org/glassfish/jersey/jetty/connector/JettyClientProperties.java @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.jetty11.connector; +package org.glassfish.jersey.jetty.connector; import java.util.Map; @@ -22,17 +22,17 @@ import org.glassfish.jersey.internal.util.PropertiesHelper; /** - * Configuration options specific to the Client API that utilizes {@link Jetty11ConnectorProvider}. + * Configuration options specific to the Client API that utilizes {@link JettyConnectorProvider}. * * @author Arul Dhesiaseelan (aruld at acm.org) */ @PropertiesClass -public final class Jetty11ClientProperties { +public final class JettyClientProperties { /** * Prevents instantiation. */ - private Jetty11ClientProperties() { + private JettyClientProperties() { throw new AssertionError("No instances allowed."); } diff --git a/connectors/jetty11-connector/src/main/java/org/glassfish/jersey/jetty11/connector/Jetty11Connector.java b/connectors/jetty11-connector/src/main/java/org/glassfish/jersey/jetty/connector/JettyConnector.java similarity index 94% rename from connectors/jetty11-connector/src/main/java/org/glassfish/jersey/jetty11/connector/Jetty11Connector.java rename to connectors/jetty11-connector/src/main/java/org/glassfish/jersey/jetty/connector/JettyConnector.java index beb723d941..7565b4bd9b 100644 --- a/connectors/jetty11-connector/src/main/java/org/glassfish/jersey/jetty11/connector/Jetty11Connector.java +++ b/connectors/jetty11-connector/src/main/java/org/glassfish/jersey/jetty/connector/JettyConnector.java @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.jetty11.connector; +package org.glassfish.jersey.jetty.connector; import jakarta.ws.rs.ProcessingException; import jakarta.ws.rs.client.Client; @@ -93,10 +93,10 @@ *
  • {@link ClientProperties#PROXY_USERNAME}
  • *
  • {@link ClientProperties#PROXY_PASSWORD}
  • *
  • {@link ClientProperties#PROXY_PASSWORD}
  • - *
  • {@link Jetty11ClientProperties#DISABLE_COOKIES}
  • * - *
  • {@link Jetty11ClientProperties#ENABLE_SSL_HOSTNAME_VERIFICATION}
  • - *
  • {@link Jetty11ClientProperties#PREEMPTIVE_BASIC_AUTHENTICATION}
  • - *
  • {@link Jetty11ClientProperties#SYNC_LISTENER_RESPONSE_MAX_SIZE}
  • + *
  • {@link JettyClientProperties#DISABLE_COOKIES}
  • * + *
  • {@link JettyClientProperties#ENABLE_SSL_HOSTNAME_VERIFICATION}
  • + *
  • {@link JettyClientProperties#PREEMPTIVE_BASIC_AUTHENTICATION}
  • + *
  • {@link JettyClientProperties#SYNC_LISTENER_RESPONSE_MAX_SIZE}
  • * *

    * This transport supports both synchronous and asynchronous processing of client requests. @@ -129,9 +129,9 @@ * @author Arul Dhesiaseelan (aruld at acm.org) * @author Marek Potociar */ -public class Jetty11Connector implements Connector { +public class JettyConnector implements Connector { - private static final Logger LOGGER = Logger.getLogger(Jetty11Connector.class.getName()); + private static final Logger LOGGER = Logger.getLogger(JettyConnector.class.getName()); private final HttpClient client; private final CookieStore cookieStore; @@ -144,7 +144,7 @@ public class Jetty11Connector implements Connector { * @param jaxrsClient JAX-RS client instance, for which the connector is created. * @param config client configuration. */ - protected Jetty11Connector(final Client jaxrsClient, final Configuration config) { + public JettyConnector(final Client jaxrsClient, final Configuration config) { this.configuration = config; HttpClient httpClient = getRegisteredHttpClient(config); @@ -160,7 +160,7 @@ protected Jetty11Connector(final Client jaxrsClient, final Configuration config) this.client = httpClient; Boolean enableHostnameVerification = (Boolean) config.getProperties() - .get(Jetty11ClientProperties.ENABLE_SSL_HOSTNAME_VERIFICATION); + .get(JettyClientProperties.ENABLE_SSL_HOSTNAME_VERIFICATION); if (enableHostnameVerification != null) { final String verificationAlgorithm = enableHostnameVerification ? "HTTPS" : null; client.getSslContextFactory().setEndpointIdentificationAlgorithm(verificationAlgorithm); @@ -180,11 +180,11 @@ protected Jetty11Connector(final Client jaxrsClient, final Configuration config) threadPool.setName(name); client.setExecutor(threadPool); } - Boolean disableCookies = (Boolean) config.getProperties().get(Jetty11ClientProperties.DISABLE_COOKIES); + Boolean disableCookies = (Boolean) config.getProperties().get(JettyClientProperties.DISABLE_COOKIES); disableCookies = (disableCookies != null) ? disableCookies : false; final AuthenticationStore auth = client.getAuthenticationStore(); - final Object basicAuthProvider = config.getProperty(Jetty11ClientProperties.PREEMPTIVE_BASIC_AUTHENTICATION); + final Object basicAuthProvider = config.getProperty(JettyClientProperties.PREEMPTIVE_BASIC_AUTHENTICATION); if (basicAuthProvider != null && (basicAuthProvider instanceof BasicAuthentication)) { auth.addAuthentication((BasicAuthentication) basicAuthProvider); } @@ -206,7 +206,7 @@ protected Jetty11Connector(final Client jaxrsClient, final Configuration config) } final Object slResponseMaxSize = configuration.getProperties() - .get(Jetty11ClientProperties.SYNC_LISTENER_RESPONSE_MAX_SIZE); + .get(JettyClientProperties.SYNC_LISTENER_RESPONSE_MAX_SIZE); if (slResponseMaxSize != null && slResponseMaxSize instanceof Integer && (Integer) slResponseMaxSize > 0) { this.syncListenerResponseMaxSize = Optional.of((Integer) slResponseMaxSize); @@ -244,11 +244,11 @@ protected HttpClientTransport initClientTransport(ClientConnector clientConnecto * @since 2.41 */ protected HttpClient getRegisteredHttpClient(Configuration config) { - if (config.isRegistered(Jetty11HttpClientSupplier.class)) { + if (config.isRegistered(JettyHttpClientSupplier.class)) { Optional contract = config.getInstances().stream() - .filter(a-> Jetty11HttpClientSupplier.class.isInstance(a)).findFirst(); + .filter(a-> JettyHttpClientSupplier.class.isInstance(a)).findFirst(); if (contract.isPresent()) { - return ((Jetty11HttpClientSupplier) contract.get()).getHttpClient(); + return ((JettyHttpClientSupplier) contract.get()).getHttpClient(); } } return null; @@ -298,7 +298,7 @@ public ClientResponse apply(final ClientRequest jerseyRequest) throws Processing jettyResponse = listener.get(); } HeaderUtils.checkHeaderChanges(clientHeadersSnapshot, jerseyRequest.getHeaders(), - Jetty11Connector.this.getClass().getName(), jerseyRequest.getConfiguration()); + JettyConnector.this.getClass().getName(), jerseyRequest.getConfiguration()); final jakarta.ws.rs.core.Response.StatusType status = jettyResponse.getReason() == null ? Statuses.from(jettyResponse.getStatus()) @@ -354,7 +354,7 @@ private Request translateRequest(final ClientRequest clientRequest) { request.idleTimeout((Integer) readTimeout, TimeUnit.MILLISECONDS); } - final Object totalTimeout = clientRequest.resolveProperty(Jetty11ClientProperties.TOTAL_TIMEOUT, -1); + final Object totalTimeout = clientRequest.resolveProperty(JettyClientProperties.TOTAL_TIMEOUT, -1); if (totalTimeout != null && totalTimeout instanceof Integer && (Integer) totalTimeout > 0) { request.timeout((Integer) totalTimeout, TimeUnit.MILLISECONDS); } @@ -459,7 +459,7 @@ public Future apply(final ClientRequest jerseyRequest, final AsyncConnectorCa @Override public void onHeaders(final Response jettyResponse) { HeaderUtils.checkHeaderChanges(clientHeadersSnapshot, jerseyRequest.getHeaders(), - Jetty11Connector.this.getClass().getName(), jerseyRequest.getConfiguration()); + JettyConnector.this.getClass().getName(), jerseyRequest.getConfiguration()); if (responseFuture.isDone()) { if (!callbackInvoked.compareAndSet(false, true)) { diff --git a/connectors/jetty11-connector/src/main/java/org/glassfish/jersey/jetty11/connector/Jetty11ConnectorProvider.java b/connectors/jetty11-connector/src/main/java/org/glassfish/jersey/jetty/connector/JettyConnectorProvider.java similarity index 89% rename from connectors/jetty11-connector/src/main/java/org/glassfish/jersey/jetty11/connector/Jetty11ConnectorProvider.java rename to connectors/jetty11-connector/src/main/java/org/glassfish/jersey/jetty/connector/JettyConnectorProvider.java index de6bc77c9c..167683a849 100644 --- a/connectors/jetty11-connector/src/main/java/org/glassfish/jersey/jetty11/connector/Jetty11ConnectorProvider.java +++ b/connectors/jetty11-connector/src/main/java/org/glassfish/jersey/jetty/connector/JettyConnectorProvider.java @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.jetty11.connector; +package org.glassfish.jersey.jetty.connector; import jakarta.ws.rs.ProcessingException; import jakarta.ws.rs.client.Client; @@ -42,10 +42,10 @@ *
  • {@link org.glassfish.jersey.client.ClientProperties#PROXY_USERNAME}
  • *
  • {@link org.glassfish.jersey.client.ClientProperties#PROXY_PASSWORD}
  • *
  • {@link org.glassfish.jersey.client.ClientProperties#PROXY_PASSWORD}
  • - *
  • {@link Jetty11ClientProperties#DISABLE_COOKIES}
  • * - *
  • {@link Jetty11ClientProperties#ENABLE_SSL_HOSTNAME_VERIFICATION}
  • - *
  • {@link Jetty11ClientProperties#PREEMPTIVE_BASIC_AUTHENTICATION}
  • - *
  • {@link Jetty11ClientProperties#SYNC_LISTENER_RESPONSE_MAX_SIZE}
  • + *
  • {@link JettyClientProperties#DISABLE_COOKIES}
  • * + *
  • {@link JettyClientProperties#ENABLE_SSL_HOSTNAME_VERIFICATION}
  • + *
  • {@link JettyClientProperties#PREEMPTIVE_BASIC_AUTHENTICATION}
  • + *
  • {@link JettyClientProperties#SYNC_LISTENER_RESPONSE_MAX_SIZE}
  • * *

    *

    @@ -82,14 +82,14 @@ * @author Marek Potociar * @since 2.5 */ -public class Jetty11ConnectorProvider implements ConnectorProvider { +public class JettyConnectorProvider implements ConnectorProvider { @Override public Connector getConnector(Client client, Configuration runtimeConfig) { if (JdkVersion.getJdkVersion().getMajor() < 11) { throw new ProcessingException(LocalizationMessages.NOT_SUPPORTED()); } - return new Jetty11Connector(client, runtimeConfig); + return new JettyConnector(client, runtimeConfig); } /** @@ -119,8 +119,8 @@ public static HttpClient getHttpClient(Configurable component) { connector = initializable.getConfiguration().getConnector(); } - if (connector instanceof Jetty11Connector) { - return ((Jetty11Connector) connector).getHttpClient(); + if (connector instanceof JettyConnector) { + return ((JettyConnector) connector).getHttpClient(); } throw new IllegalArgumentException(LocalizationMessages.EXPECTED_CONNECTOR_PROVIDER_NOT_USED()); diff --git a/connectors/jetty11-connector/src/main/java/org/glassfish/jersey/jetty11/connector/Jetty11HttpClientContract.java b/connectors/jetty11-connector/src/main/java/org/glassfish/jersey/jetty/connector/JettyHttpClientContract.java similarity index 87% rename from connectors/jetty11-connector/src/main/java/org/glassfish/jersey/jetty11/connector/Jetty11HttpClientContract.java rename to connectors/jetty11-connector/src/main/java/org/glassfish/jersey/jetty/connector/JettyHttpClientContract.java index 3b0321d0ad..95782f2c97 100644 --- a/connectors/jetty11-connector/src/main/java/org/glassfish/jersey/jetty11/connector/Jetty11HttpClientContract.java +++ b/connectors/jetty11-connector/src/main/java/org/glassfish/jersey/jetty/connector/JettyHttpClientContract.java @@ -14,17 +14,17 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.jetty11.connector; +package org.glassfish.jersey.jetty.connector; import org.eclipse.jetty.client.HttpClient; import org.glassfish.jersey.spi.Contract; /** * A contract that allows for an optional registration of user predefined Jetty {@code HttpClient} - * that is consequently used by {@link Jetty11Connector} + * that is consequently used by {@link JettyConnector} */ @Contract -public interface Jetty11HttpClientContract { +public interface JettyHttpClientContract { /** * Supply a user predefined HttpClient * @return a user predefined HttpClient diff --git a/connectors/jetty11-connector/src/main/java/org/glassfish/jersey/jetty11/connector/Jetty11HttpClientSupplier.java b/connectors/jetty11-connector/src/main/java/org/glassfish/jersey/jetty/connector/JettyHttpClientSupplier.java similarity index 84% rename from connectors/jetty11-connector/src/main/java/org/glassfish/jersey/jetty11/connector/Jetty11HttpClientSupplier.java rename to connectors/jetty11-connector/src/main/java/org/glassfish/jersey/jetty/connector/JettyHttpClientSupplier.java index b5f1462cb1..de6453b35a 100644 --- a/connectors/jetty11-connector/src/main/java/org/glassfish/jersey/jetty11/connector/Jetty11HttpClientSupplier.java +++ b/connectors/jetty11-connector/src/main/java/org/glassfish/jersey/jetty/connector/JettyHttpClientSupplier.java @@ -13,12 +13,12 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.jetty11.connector; +package org.glassfish.jersey.jetty.connector; import org.eclipse.jetty.client.HttpClient; /** - * Jetty HttpClient supplier to be registered into Jersey configuration to be used by {@link Jetty11Connector}. + * Jetty HttpClient supplier to be registered into Jersey configuration to be used by {@link JettyConnector}. * Not every possible configuration option is covered by the Jetty Connector and this supplier offers a way to provide * an HttpClient that has configured the options not covered by the Jetty Connector. *

    @@ -35,17 +35,17 @@ * } * *

    - * The {@code HttpClient} is configured as if it was created by {@link Jetty11Connector} the usual way. + * The {@code HttpClient} is configured as if it was created by {@link JettyConnector} the usual way. *

    */ -public class Jetty11HttpClientSupplier implements Jetty11HttpClientContract { +public class JettyHttpClientSupplier implements JettyHttpClientContract { private final HttpClient httpClient; /** * {@code HttpClient} supplier to be optionally registered to a {@link org.glassfish.jersey.client.ClientConfig} - * @param httpClient a HttpClient to be supplied when {@link Jetty11Connector#getHttpClient()} is called. + * @param httpClient a HttpClient to be supplied when {@link JettyConnector#getHttpClient()} is called. */ - public Jetty11HttpClientSupplier(HttpClient httpClient) { + public JettyHttpClientSupplier(HttpClient httpClient) { this.httpClient = httpClient; } diff --git a/connectors/jetty11-connector/src/main/java/org/glassfish/jersey/jetty11/connector/package-info.java b/connectors/jetty11-connector/src/main/java/org/glassfish/jersey/jetty/connector/package-info.java similarity index 94% rename from connectors/jetty11-connector/src/main/java/org/glassfish/jersey/jetty11/connector/package-info.java rename to connectors/jetty11-connector/src/main/java/org/glassfish/jersey/jetty/connector/package-info.java index 0f85c4f693..8416cf40e1 100644 --- a/connectors/jetty11-connector/src/main/java/org/glassfish/jersey/jetty11/connector/package-info.java +++ b/connectors/jetty11-connector/src/main/java/org/glassfish/jersey/jetty/connector/package-info.java @@ -18,4 +18,4 @@ * Jersey client {@link org.glassfish.jersey.client.spi.Connector connector} based on the * Jetty Client. */ -package org.glassfish.jersey.jetty11.connector; +package org.glassfish.jersey.jetty.connector; diff --git a/connectors/jetty11-connector/src/main/resources/org/glassfish/jersey/jetty11/connector/localization.properties b/connectors/jetty11-connector/src/main/resources/org/glassfish/jersey/jetty/connector/localization.properties similarity index 100% rename from connectors/jetty11-connector/src/main/resources/org/glassfish/jersey/jetty11/connector/localization.properties rename to connectors/jetty11-connector/src/main/resources/org/glassfish/jersey/jetty/connector/localization.properties diff --git a/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/AsyncTest.java b/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/AsyncTest.java similarity index 98% rename from connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/AsyncTest.java rename to connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/AsyncTest.java index 9d0edbc556..8755aaf028 100644 --- a/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/AsyncTest.java +++ b/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/AsyncTest.java @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.jetty11.connector; +package org.glassfish.jersey.jetty.connector; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; @@ -149,7 +149,7 @@ protected Application configure() { protected void configureClient(ClientConfig config) { // TODO: fails with true on request - should be fixed by resolving JERSEY-2273 config.register(new LoggingFeature(LOGGER, LoggingFeature.Verbosity.HEADERS_ONLY)); - config.connectorProvider(new Jetty11ConnectorProvider()); + config.connectorProvider(new JettyConnectorProvider()); } /** diff --git a/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/AuthFilterTest.java b/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/AuthFilterTest.java similarity index 95% rename from connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/AuthFilterTest.java rename to connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/AuthFilterTest.java index 1c6cddcb9d..be077c9b5e 100644 --- a/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/AuthFilterTest.java +++ b/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/AuthFilterTest.java @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.jetty11.connector; +package org.glassfish.jersey.jetty.connector; import java.util.logging.Logger; @@ -49,7 +49,7 @@ protected Application configure() { @Override protected void configureClient(ClientConfig config) { - config.connectorProvider(new Jetty11ConnectorProvider()); + config.connectorProvider(new JettyConnectorProvider()); } @Test diff --git a/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/AuthTest.java b/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/AuthTest.java similarity index 93% rename from connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/AuthTest.java rename to connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/AuthTest.java index 6b5111b1dd..27ca10a198 100644 --- a/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/AuthTest.java +++ b/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/AuthTest.java @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.jetty11.connector; +package org.glassfish.jersey.jetty.connector; import java.util.logging.Logger; @@ -158,9 +158,9 @@ protected Application configure() { @Test public void testAuthGet() { ClientConfig config = new ClientConfig(); - config.property(Jetty11ClientProperties.PREEMPTIVE_BASIC_AUTHENTICATION, + config.property(JettyClientProperties.PREEMPTIVE_BASIC_AUTHENTICATION, new BasicAuthentication(getBaseUri(), "WallyWorld", "name", "password")); - config.connectorProvider(new Jetty11ConnectorProvider()); + config.connectorProvider(new JettyConnectorProvider()); Client client = ClientBuilder.newClient(config); Response response = client.target(getBaseUri()).path(PATH).request().get(); @@ -171,9 +171,9 @@ public void testAuthGet() { @Test public void testAuthPost() { ClientConfig config = new ClientConfig(); - config.property(Jetty11ClientProperties.PREEMPTIVE_BASIC_AUTHENTICATION, + config.property(JettyClientProperties.PREEMPTIVE_BASIC_AUTHENTICATION, new BasicAuthentication(getBaseUri(), "WallyWorld", "name", "password")); - config.connectorProvider(new Jetty11ConnectorProvider()); + config.connectorProvider(new JettyConnectorProvider()); Client client = ClientBuilder.newClient(config); Response response = client.target(getBaseUri()).path(PATH).request().post(Entity.text("POST")); @@ -184,9 +184,9 @@ public void testAuthPost() { @Test public void testAuthDelete() { ClientConfig config = new ClientConfig(); - config.property(Jetty11ClientProperties.PREEMPTIVE_BASIC_AUTHENTICATION, + config.property(JettyClientProperties.PREEMPTIVE_BASIC_AUTHENTICATION, new BasicAuthentication(getBaseUri(), "WallyWorld", "name", "password")); - config.connectorProvider(new Jetty11ConnectorProvider()); + config.connectorProvider(new JettyConnectorProvider()); Client client = ClientBuilder.newClient(config); Response response = client.target(getBaseUri()).path(PATH).request().delete(); diff --git a/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/CookieTest.java b/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/CookieTest.java similarity index 88% rename from connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/CookieTest.java rename to connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/CookieTest.java index 0cd585e9db..7534d3d63c 100644 --- a/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/CookieTest.java +++ b/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/CookieTest.java @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.jetty11.connector; +package org.glassfish.jersey.jetty.connector; import java.util.logging.Logger; @@ -72,7 +72,7 @@ protected Application configure() { @Test public void testCookieResource() { ClientConfig config = new ClientConfig(); - config.connectorProvider(new Jetty11ConnectorProvider()); + config.connectorProvider(new JettyConnectorProvider()); Client client = ClientBuilder.newClient(config); WebTarget r = client.target(getBaseUri()); @@ -85,15 +85,15 @@ public void testCookieResource() { @Test public void testDisabledCookies() { ClientConfig cc = new ClientConfig(); - cc.property(Jetty11ClientProperties.DISABLE_COOKIES, true); - cc.connectorProvider(new Jetty11ConnectorProvider()); + cc.property(JettyClientProperties.DISABLE_COOKIES, true); + cc.connectorProvider(new JettyConnectorProvider()); JerseyClient client = JerseyClientBuilder.createClient(cc); WebTarget r = client.target(getBaseUri()); assertEquals("NO-COOKIE", r.request().get(String.class)); assertEquals("NO-COOKIE", r.request().get(String.class)); - final Jetty11Connector connector = (Jetty11Connector) client.getConfiguration().getConnector(); + final JettyConnector connector = (JettyConnector) client.getConfiguration().getConnector(); if (connector.getCookieStore() != null) { assertTrue(connector.getCookieStore().getCookies().isEmpty()); } else { @@ -105,14 +105,14 @@ public void testDisabledCookies() { @Test public void testCookies() { ClientConfig cc = new ClientConfig(); - cc.connectorProvider(new Jetty11ConnectorProvider()); + cc.connectorProvider(new JettyConnectorProvider()); JerseyClient client = JerseyClientBuilder.createClient(cc); WebTarget r = client.target(getBaseUri()); assertEquals("NO-COOKIE", r.request().get(String.class)); assertEquals("value", r.request().get(String.class)); - final Jetty11Connector connector = (Jetty11Connector) client.getConfiguration().getConnector(); + final JettyConnector connector = (JettyConnector) client.getConfiguration().getConnector(); assertNotNull(connector.getCookieStore().getCookies()); assertEquals(1, connector.getCookieStore().getCookies().size()); assertEquals("value", connector.getCookieStore().getCookies().get(0).getValue()); diff --git a/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/CustomLoggingFilter.java b/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/CustomLoggingFilter.java similarity index 98% rename from connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/CustomLoggingFilter.java rename to connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/CustomLoggingFilter.java index 386f96e05e..48f51a17b0 100644 --- a/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/CustomLoggingFilter.java +++ b/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/CustomLoggingFilter.java @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.jetty11.connector; +package org.glassfish.jersey.jetty.connector; import java.io.IOException; diff --git a/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/EntityTest.java b/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/EntityTest.java similarity index 97% rename from connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/EntityTest.java rename to connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/EntityTest.java index e9de3530ec..22f50d3942 100644 --- a/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/EntityTest.java +++ b/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/EntityTest.java @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.jetty11.connector; +package org.glassfish.jersey.jetty.connector; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeoutException; @@ -110,7 +110,7 @@ protected Application configure() { @Override protected void configureClient(ClientConfig config) { - config.connectorProvider(new Jetty11ConnectorProvider()); + config.connectorProvider(new JettyConnectorProvider()); //.register(/*JacksonFeature.class*/); } diff --git a/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/ErrorTest.java b/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/ErrorTest.java similarity index 96% rename from connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/ErrorTest.java rename to connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/ErrorTest.java index a8a97e5f69..a85cbc578e 100644 --- a/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/ErrorTest.java +++ b/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/ErrorTest.java @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.jetty11.connector; +package org.glassfish.jersey.jetty.connector; import java.util.logging.Logger; @@ -52,7 +52,7 @@ protected Application configure() { @Override protected void configureClient(ClientConfig config) { - config.connectorProvider(new Jetty11ConnectorProvider()); + config.connectorProvider(new JettyConnectorProvider()); } diff --git a/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/FollowRedirectsTest.java b/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/FollowRedirectsTest.java similarity index 95% rename from connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/FollowRedirectsTest.java rename to connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/FollowRedirectsTest.java index a30efbc87e..d1a91cd0db 100644 --- a/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/FollowRedirectsTest.java +++ b/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/FollowRedirectsTest.java @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.jetty11.connector; +package org.glassfish.jersey.jetty.connector; import java.io.IOException; import java.net.URI; @@ -77,7 +77,7 @@ protected Application configure() { @Override protected void configureClient(ClientConfig config) { config.property(ClientProperties.FOLLOW_REDIRECTS, false); - config.connectorProvider(new Jetty11ConnectorProvider()); + config.connectorProvider(new JettyConnectorProvider()); } private static class RedirectTestFilter implements ClientResponseFilter { @@ -96,7 +96,7 @@ public void filter(ClientRequestContext requestContext, ClientResponseContext re public void testDoFollow() { final URI u = target().getUri(); ClientConfig config = new ClientConfig().property(ClientProperties.FOLLOW_REDIRECTS, true); - config.connectorProvider(new Jetty11ConnectorProvider()); + config.connectorProvider(new JettyConnectorProvider()); Client c = ClientBuilder.newClient(config); WebTarget t = c.target(u); Response r = t.path("test/redirect") @@ -131,7 +131,7 @@ public void testDontFollow() { public void testDontFollowPerRequestOverride() { final URI u = target().getUri(); ClientConfig config = new ClientConfig().property(ClientProperties.FOLLOW_REDIRECTS, true); - config.connectorProvider(new Jetty11ConnectorProvider()); + config.connectorProvider(new JettyConnectorProvider()); Client client = ClientBuilder.newClient(config); WebTarget t = client.target(u); t.property(ClientProperties.FOLLOW_REDIRECTS, false); diff --git a/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/GZIPContentEncodingTest.java b/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/GZIPContentEncodingTest.java similarity index 94% rename from connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/GZIPContentEncodingTest.java rename to connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/GZIPContentEncodingTest.java index 459eccb3f1..727c389ef8 100644 --- a/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/GZIPContentEncodingTest.java +++ b/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/GZIPContentEncodingTest.java @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.jetty11.connector; +package org.glassfish.jersey.jetty.connector; import java.util.Arrays; import java.util.logging.Logger; @@ -66,7 +66,7 @@ protected Application configure() { @Override protected void configureClient(ClientConfig config) { config.register(GZipEncoder.class); - config.connectorProvider(new Jetty11ConnectorProvider()); + config.connectorProvider(new JettyConnectorProvider()); } @Test @@ -85,7 +85,7 @@ public void testPost() { public void testPostChunked() { ClientConfig config = new ClientConfig(); config.property(ClientProperties.CHUNKED_ENCODING_SIZE, 1024); - config.connectorProvider(new Jetty11ConnectorProvider()); + config.connectorProvider(new JettyConnectorProvider()); config.register(new LoggingFeature(LOGGER, LoggingFeature.Verbosity.PAYLOAD_ANY)); Client client = ClientBuilder.newClient(config); diff --git a/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/HelloWorldTest.java b/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/HelloWorldTest.java similarity index 98% rename from connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/HelloWorldTest.java rename to connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/HelloWorldTest.java index a60719b523..4e9f09eb8e 100644 --- a/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/HelloWorldTest.java +++ b/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/HelloWorldTest.java @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.jetty11.connector; +package org.glassfish.jersey.jetty.connector; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; @@ -70,7 +70,7 @@ protected Application configure() { @Override protected void configureClient(ClientConfig config) { - config.connectorProvider(new Jetty11ConnectorProvider()); + config.connectorProvider(new JettyConnectorProvider()); } @Test diff --git a/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/HttpHeadersTest.java b/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/HttpHeadersTest.java similarity index 96% rename from connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/HttpHeadersTest.java rename to connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/HttpHeadersTest.java index 3d03872fd8..c40b8114a9 100644 --- a/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/HttpHeadersTest.java +++ b/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/HttpHeadersTest.java @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.jetty11.connector; +package org.glassfish.jersey.jetty.connector; import java.util.List; import java.util.logging.Logger; @@ -79,7 +79,7 @@ protected Application configure() { @Override protected void configureClient(ClientConfig config) { - config.connectorProvider(new Jetty11ConnectorProvider()); + config.connectorProvider(new JettyConnectorProvider()); } @Test diff --git a/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/ManagedClientTest.java b/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/ManagedClientTest.java similarity index 98% rename from connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/ManagedClientTest.java rename to connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/ManagedClientTest.java index 628af896d7..eeafa010f3 100644 --- a/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/ManagedClientTest.java +++ b/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/ManagedClientTest.java @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.jetty11.connector; +package org.glassfish.jersey.jetty.connector; import java.io.IOException; import java.lang.annotation.Documented; @@ -231,7 +231,7 @@ public MyClientBConfig() { @Override protected void configureClient(ClientConfig config) { - config.connectorProvider(new Jetty11ConnectorProvider()); + config.connectorProvider(new JettyConnectorProvider()); } /** diff --git a/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/MethodTest.java b/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/MethodTest.java similarity index 97% rename from connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/MethodTest.java rename to connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/MethodTest.java index f62834b8d8..dc366d16d9 100644 --- a/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/MethodTest.java +++ b/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/MethodTest.java @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.jetty11.connector; +package org.glassfish.jersey.jetty.connector; import java.util.concurrent.ExecutionException; import java.util.logging.Logger; @@ -87,7 +87,7 @@ protected Application configure() { @Override protected void configureClient(ClientConfig config) { - config.connectorProvider(new Jetty11ConnectorProvider()); + config.connectorProvider(new JettyConnectorProvider()); } @Test diff --git a/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/NoEntityTest.java b/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/NoEntityTest.java similarity index 96% rename from connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/NoEntityTest.java rename to connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/NoEntityTest.java index f5f754d276..d4b3f2e2d0 100644 --- a/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/NoEntityTest.java +++ b/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/NoEntityTest.java @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.jetty11.connector; +package org.glassfish.jersey.jetty.connector; import java.util.logging.Logger; @@ -61,7 +61,7 @@ protected Application configure() { @Override protected void configureClient(ClientConfig config) { - config.connectorProvider(new Jetty11ConnectorProvider()); + config.connectorProvider(new JettyConnectorProvider()); } @Test diff --git a/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/SyncResponseSizeTest.java b/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/SyncResponseSizeTest.java similarity index 91% rename from connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/SyncResponseSizeTest.java rename to connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/SyncResponseSizeTest.java index be67e9a363..32c71bb376 100644 --- a/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/SyncResponseSizeTest.java +++ b/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/SyncResponseSizeTest.java @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.jetty11.connector; +package org.glassfish.jersey.jetty.connector; import org.glassfish.jersey.client.ClientConfig; import org.glassfish.jersey.client.ClientProperties; @@ -97,7 +97,7 @@ protected Application configure() { @Override protected void configureClient(ClientConfig config) { - config.connectorProvider(new Jetty11ConnectorProvider()); + config.connectorProvider(new JettyConnectorProvider()); } @Test @@ -111,7 +111,7 @@ public void testDefaultSmall() { public void testDefaultTooBig() { final URI u = target().getUri(); ClientConfig config = new ClientConfig().property(ClientProperties.READ_TIMEOUT, 1_000); - config.connectorProvider(new Jetty11ConnectorProvider()); + config.connectorProvider(new JettyConnectorProvider()); Client c = ClientBuilder.newClient(config); WebTarget t = c.target(u); @@ -131,8 +131,8 @@ public void testDefaultTooBig() { public void testCustomBig() { final URI u = target().getUri(); ClientConfig config = new ClientConfig().property(ClientProperties.READ_TIMEOUT, 1_000); - config.connectorProvider(new Jetty11ConnectorProvider()); - config.property(Jetty11ClientProperties.SYNC_LISTENER_RESPONSE_MAX_SIZE, maxBufferSize); + config.connectorProvider(new JettyConnectorProvider()); + config.property(JettyClientProperties.SYNC_LISTENER_RESPONSE_MAX_SIZE, maxBufferSize); Client c = ClientBuilder.newClient(config); WebTarget t = c.target(u); @@ -152,8 +152,8 @@ public void testCustomBig() { public void testCustomTooBig() { final URI u = target().getUri(); ClientConfig config = new ClientConfig().property(ClientProperties.READ_TIMEOUT, 1_000); - config.connectorProvider(new Jetty11ConnectorProvider()); - config.property(Jetty11ClientProperties.SYNC_LISTENER_RESPONSE_MAX_SIZE, maxBufferSize); + config.connectorProvider(new JettyConnectorProvider()); + config.property(JettyClientProperties.SYNC_LISTENER_RESPONSE_MAX_SIZE, maxBufferSize); Client c = ClientBuilder.newClient(config); WebTarget t = c.target(u); diff --git a/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/TimeoutTest.java b/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/TimeoutTest.java similarity index 96% rename from connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/TimeoutTest.java rename to connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/TimeoutTest.java index 364426238f..cb8d0e28c6 100644 --- a/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/TimeoutTest.java +++ b/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/TimeoutTest.java @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.jetty11.connector; +package org.glassfish.jersey.jetty.connector; import java.net.URI; import java.nio.charset.StandardCharsets; @@ -126,7 +126,7 @@ protected Application configure() { @Override protected void configureClient(ClientConfig config) { - config.connectorProvider(new Jetty11ConnectorProvider()); + config.connectorProvider(new JettyConnectorProvider()); } @Test @@ -140,7 +140,7 @@ public void testFast() { public void testSlow() { final URI u = target().getUri(); ClientConfig config = new ClientConfig().property(ClientProperties.READ_TIMEOUT, 1_000); - config.connectorProvider(new Jetty11ConnectorProvider()); + config.connectorProvider(new JettyConnectorProvider()); Client c = ClientBuilder.newClient(config); WebTarget t = c.target(u); try { @@ -158,7 +158,7 @@ public void testSlow() { public void testTimeoutInRequest() { final URI u = target().getUri(); ClientConfig config = new ClientConfig(); - config.connectorProvider(new Jetty11ConnectorProvider()); + config.connectorProvider(new JettyConnectorProvider()); Client c = ClientBuilder.newClient(config); WebTarget t = c.target(u); try { @@ -203,7 +203,7 @@ public void testSlowlyStreamedContentDoesTotalTimeout() throws Exception { try { target("test") - .property(Jetty11ClientProperties.TOTAL_TIMEOUT, 100L) + .property(JettyClientProperties.TOTAL_TIMEOUT, 100L) .property(CommonProperties.OUTBOUND_CONTENT_LENGTH_BUFFER_SERVER, "-1") .path("stream") .queryParam("count", count) diff --git a/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/TraceSupportTest.java b/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/TraceSupportTest.java similarity index 98% rename from connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/TraceSupportTest.java rename to connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/TraceSupportTest.java index 751f1273a5..a7661cb5a2 100644 --- a/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/TraceSupportTest.java +++ b/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/TraceSupportTest.java @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.jetty11.connector; +package org.glassfish.jersey.jetty.connector; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; @@ -190,7 +190,7 @@ private void _testTraceWithEntity(final boolean isAsync, final boolean useJettyC } private Client getJettyClient() { - return ClientBuilder.newClient(new ClientConfig().connectorProvider(new Jetty11ConnectorProvider())); + return ClientBuilder.newClient(new ClientConfig().connectorProvider(new JettyConnectorProvider())); } diff --git a/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/UnderlyingHttpClientAccessTest.java b/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/UnderlyingHttpClientAccessTest.java similarity index 84% rename from connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/UnderlyingHttpClientAccessTest.java rename to connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/UnderlyingHttpClientAccessTest.java index c1a647043c..7802e458a7 100644 --- a/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty11/connector/UnderlyingHttpClientAccessTest.java +++ b/connectors/jetty11-connector/src/test/java/org/glassfish/jersey/jetty/connector/UnderlyingHttpClientAccessTest.java @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.jetty11.connector; +package org.glassfish.jersey.jetty.connector; import jakarta.ws.rs.client.Client; import jakarta.ws.rs.client.ClientBuilder; @@ -42,13 +42,13 @@ public class UnderlyingHttpClientAccessTest { */ @Test public void testHttpClientInstanceAccess() { - final Client client = ClientBuilder.newClient(new ClientConfig().connectorProvider(new Jetty11ConnectorProvider())); - final HttpClient hcOnClient = Jetty11ConnectorProvider.getHttpClient(client); + final Client client = ClientBuilder.newClient(new ClientConfig().connectorProvider(new JettyConnectorProvider())); + final HttpClient hcOnClient = JettyConnectorProvider.getHttpClient(client); // important: the web target instance in this test must be only created AFTER the client has been pre-initialized // (see org.glassfish.jersey.client.Initializable.preInitialize method). This is here achieved by calling the // connector provider's static getHttpClient method above. final WebTarget target = client.target("http://localhost/"); - final HttpClient hcOnTarget = Jetty11ConnectorProvider.getHttpClient(target); + final HttpClient hcOnTarget = JettyConnectorProvider.getHttpClient(target); assertNotNull(hcOnClient, "HTTP client instance set on JerseyClient should not be null."); assertNotNull(hcOnTarget, "HTTP client instance set on JerseyWebTarget should not be null."); @@ -60,11 +60,11 @@ public void testHttpClientInstanceAccess() { public void testGetProvidedClientInstance() { final HttpClient httpClient = new HttpClient(); final ClientConfig clientConfig = new ClientConfig() - .connectorProvider(new Jetty11ConnectorProvider()) - .register(new Jetty11HttpClientSupplier(httpClient)); + .connectorProvider(new JettyConnectorProvider()) + .register(new JettyHttpClientSupplier(httpClient)); final Client client = ClientBuilder.newClient(clientConfig); final WebTarget target = client.target("http://localhost/"); - final HttpClient hcOnTarget = Jetty11ConnectorProvider.getHttpClient(target); + final HttpClient hcOnTarget = JettyConnectorProvider.getHttpClient(target); assertThat("Instance provided to a ClientConfig differs from instance provided by JettyProvider", httpClient, is(hcOnTarget)); diff --git a/connectors/jetty11-http2-connector/src/main/java/org/glassfish/jersey/jetty11/http2/connector/Jetty11Http2ClientSupplier.java b/connectors/jetty11-http2-connector/src/main/java/org/glassfish/jersey/jetty/http2/connector/JettyHttp2ClientSupplier.java similarity index 75% rename from connectors/jetty11-http2-connector/src/main/java/org/glassfish/jersey/jetty11/http2/connector/Jetty11Http2ClientSupplier.java rename to connectors/jetty11-http2-connector/src/main/java/org/glassfish/jersey/jetty/http2/connector/JettyHttp2ClientSupplier.java index f13ef3d797..454efd0db8 100644 --- a/connectors/jetty11-http2-connector/src/main/java/org/glassfish/jersey/jetty11/http2/connector/Jetty11Http2ClientSupplier.java +++ b/connectors/jetty11-http2-connector/src/main/java/org/glassfish/jersey/jetty/http2/connector/JettyHttp2ClientSupplier.java @@ -14,36 +14,36 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.jetty11.http2.connector; +package org.glassfish.jersey.jetty.http2.connector; import org.eclipse.jetty.client.HttpClient; import org.eclipse.jetty.client.HttpClientTransport; import org.eclipse.jetty.http2.client.HTTP2Client; import org.eclipse.jetty.http2.client.http.HttpClientTransportOverHTTP2; -import org.glassfish.jersey.jetty11.connector.Jetty11Connector; -import org.glassfish.jersey.jetty11.connector.Jetty11HttpClientContract; -import org.glassfish.jersey.jetty11.connector.Jetty11HttpClientSupplier; +import org.glassfish.jersey.jetty.connector.JettyConnector; +import org.glassfish.jersey.jetty.connector.JettyHttpClientContract; +import org.glassfish.jersey.jetty.connector.JettyHttpClientSupplier; /** - * HTTP/2 enabled version of the {@link Jetty11HttpClientSupplier} + * HTTP/2 enabled version of the {@link JettyHttpClientSupplier} * * @since 2.41 */ -public class Jetty11Http2ClientSupplier implements Jetty11HttpClientContract { +public class JettyHttp2ClientSupplier implements JettyHttpClientContract { private final HttpClient http2Client; /** * default Http2Client created for the supplier. */ - public Jetty11Http2ClientSupplier() { + public JettyHttp2ClientSupplier() { this(createHttp2Client()); } /** * supplier for the {@code HttpClient} with {@code HttpClientTransportOverHTTP2} to be optionally registered * to a {@link org.glassfish.jersey.client.ClientConfig} - * @param http2Client a HttpClient to be supplied when {@link Jetty11Connector#getHttpClient()} is called. + * @param http2Client a HttpClient to be supplied when {@link JettyConnector#getHttpClient()} is called. */ - public Jetty11Http2ClientSupplier(HttpClient http2Client) { + public JettyHttp2ClientSupplier(HttpClient http2Client) { this.http2Client = http2Client; } diff --git a/connectors/jetty11-http2-connector/src/main/java/org/glassfish/jersey/jetty11/http2/connector/Jetty11Http2Connector.java b/connectors/jetty11-http2-connector/src/main/java/org/glassfish/jersey/jetty/http2/connector/JettyHttp2Connector.java similarity index 80% rename from connectors/jetty11-http2-connector/src/main/java/org/glassfish/jersey/jetty11/http2/connector/Jetty11Http2Connector.java rename to connectors/jetty11-http2-connector/src/main/java/org/glassfish/jersey/jetty/http2/connector/JettyHttp2Connector.java index 35dc50486e..7f1e45dd1f 100644 --- a/connectors/jetty11-http2-connector/src/main/java/org/glassfish/jersey/jetty11/http2/connector/Jetty11Http2Connector.java +++ b/connectors/jetty11-http2-connector/src/main/java/org/glassfish/jersey/jetty/http2/connector/JettyHttp2Connector.java @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.jetty11.http2.connector; +package org.glassfish.jersey.jetty.http2.connector; import jakarta.ws.rs.client.Client; import jakarta.ws.rs.core.Configuration; @@ -24,16 +24,16 @@ import org.eclipse.jetty.http2.client.HTTP2Client; import org.eclipse.jetty.http2.client.http.HttpClientTransportOverHTTP2; import org.eclipse.jetty.io.ClientConnector; -import org.glassfish.jersey.jetty11.connector.Jetty11Connector; +import org.glassfish.jersey.jetty.connector.JettyConnector; import java.util.Optional; /** - * Extends {@link Jetty11Connector} with HTTP/2 transport support + * Extends {@link JettyConnector} with HTTP/2 transport support * * @since 2.41 */ -class Jetty11Http2Connector extends Jetty11Connector { +class JettyHttp2Connector extends JettyConnector { /** @@ -42,7 +42,7 @@ class Jetty11Http2Connector extends Jetty11Connector { * @param jaxrsClient JAX-RS client instance, for which the connector is created. * @param config client configuration. */ - Jetty11Http2Connector(Client jaxrsClient, Configuration config) { + JettyHttp2Connector(Client jaxrsClient, Configuration config) { super(jaxrsClient, config); } @@ -69,11 +69,11 @@ protected HttpClientTransport initClientTransport(ClientConnector clientConnecto */ @Override protected HttpClient getRegisteredHttpClient(Configuration config) { - if (config.isRegistered(Jetty11Http2ClientSupplier.class)) { + if (config.isRegistered(JettyHttp2ClientSupplier.class)) { Optional contract = config.getInstances().stream() - .filter(a-> Jetty11Http2ClientSupplier.class.isInstance(a)).findFirst(); + .filter(a-> JettyHttp2ClientSupplier.class.isInstance(a)).findFirst(); if (contract.isPresent()) { - return ((Jetty11Http2ClientSupplier) contract.get()).getHttpClient(); + return ((JettyHttp2ClientSupplier) contract.get()).getHttpClient(); } } return null; diff --git a/connectors/jetty11-http2-connector/src/main/java/org/glassfish/jersey/jetty11/http2/connector/Jetty11Http2ConnectorProvider.java b/connectors/jetty11-http2-connector/src/main/java/org/glassfish/jersey/jetty/http2/connector/JettyHttp2ConnectorProvider.java similarity index 76% rename from connectors/jetty11-http2-connector/src/main/java/org/glassfish/jersey/jetty11/http2/connector/Jetty11Http2ConnectorProvider.java rename to connectors/jetty11-http2-connector/src/main/java/org/glassfish/jersey/jetty/http2/connector/JettyHttp2ConnectorProvider.java index a4d02d53bf..02eaf5a81b 100644 --- a/connectors/jetty11-http2-connector/src/main/java/org/glassfish/jersey/jetty11/http2/connector/Jetty11Http2ConnectorProvider.java +++ b/connectors/jetty11-http2-connector/src/main/java/org/glassfish/jersey/jetty/http2/connector/JettyHttp2ConnectorProvider.java @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.jetty11.http2.connector; +package org.glassfish.jersey.jetty.http2.connector; import jakarta.ws.rs.client.Client; import jakarta.ws.rs.core.Configurable; @@ -22,18 +22,18 @@ import org.eclipse.jetty.client.HttpClient; import org.glassfish.jersey.client.Initializable; import org.glassfish.jersey.client.spi.Connector; -import org.glassfish.jersey.jetty11.connector.Jetty11ConnectorProvider; -import org.glassfish.jersey.jetty11.connector.LocalizationMessages; +import org.glassfish.jersey.jetty.connector.JettyConnectorProvider; +import org.glassfish.jersey.jetty.connector.LocalizationMessages; /** - * Provides HTTP2 enabled version of the {@link Jetty11ConnectorProvider} for a client + * Provides HTTP2 enabled version of the {@link JettyConnectorProvider} for a client * * @since 2.41 */ -public class Jetty11Http2ConnectorProvider extends Jetty11ConnectorProvider { +public class JettyHttp2ConnectorProvider extends JettyConnectorProvider { @Override public Connector getConnector(Client client, Configuration runtimeConfig) { - return new Jetty11Http2Connector(client, runtimeConfig); + return new JettyHttp2Connector(client, runtimeConfig); } public static HttpClient getHttpClient(Configurable component) { @@ -49,8 +49,8 @@ public static HttpClient getHttpClient(Configurable component) { connector = initializable.getConfiguration().getConnector(); } - if (connector instanceof Jetty11Http2Connector) { - return ((Jetty11Http2Connector) connector).getHttpClient(); + if (connector instanceof JettyHttp2Connector) { + return ((JettyHttp2Connector) connector).getHttpClient(); } throw new IllegalArgumentException(LocalizationMessages.EXPECTED_CONNECTOR_PROVIDER_NOT_USED()); diff --git a/connectors/jetty11-http2-connector/src/main/java/org/glassfish/jersey/jetty11/http2/connector/package-info.java b/connectors/jetty11-http2-connector/src/main/java/org/glassfish/jersey/jetty/http2/connector/package-info.java similarity index 93% rename from connectors/jetty11-http2-connector/src/main/java/org/glassfish/jersey/jetty11/http2/connector/package-info.java rename to connectors/jetty11-http2-connector/src/main/java/org/glassfish/jersey/jetty/http2/connector/package-info.java index 0caf2700d4..960bbb656b 100644 --- a/connectors/jetty11-http2-connector/src/main/java/org/glassfish/jersey/jetty11/http2/connector/package-info.java +++ b/connectors/jetty11-http2-connector/src/main/java/org/glassfish/jersey/jetty/http2/connector/package-info.java @@ -18,4 +18,4 @@ * Jersey HTTP2 client {@link org.glassfish.jersey.client.spi.Connector connector} based on the * Jetty Client. */ -package org.glassfish.jersey.jetty11.http2.connector; +package org.glassfish.jersey.jetty.http2.connector; diff --git a/connectors/jetty11-http2-connector/src/main/resources/org/glassfish/jersey/jetty11/http2/connector/localization.properties b/connectors/jetty11-http2-connector/src/main/resources/org/glassfish/jersey/jetty/http2/connector/localization.properties similarity index 100% rename from connectors/jetty11-http2-connector/src/main/resources/org/glassfish/jersey/jetty11/http2/connector/localization.properties rename to connectors/jetty11-http2-connector/src/main/resources/org/glassfish/jersey/jetty/http2/connector/localization.properties diff --git a/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/AsyncTest.java b/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/AsyncTest.java similarity index 98% rename from connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/AsyncTest.java rename to connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/AsyncTest.java index e938d43a94..76ef67bf56 100644 --- a/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/AsyncTest.java +++ b/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/AsyncTest.java @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.jetty11.http2.connector; +package org.glassfish.jersey.jetty.http2.connector; import org.glassfish.jersey.client.ClientConfig; import org.glassfish.jersey.logging.LoggingFeature; @@ -141,7 +141,7 @@ protected Application configure() { @Override protected void configureClient(ClientConfig config) { config.register(new LoggingFeature(LOGGER, LoggingFeature.Verbosity.HEADERS_ONLY)); - config.connectorProvider(new Jetty11Http2ConnectorProvider()); + config.connectorProvider(new JettyHttp2ConnectorProvider()); } /** diff --git a/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/AuthFilterTest.java b/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/AuthFilterTest.java similarity index 95% rename from connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/AuthFilterTest.java rename to connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/AuthFilterTest.java index 2038901761..5daad2d38c 100644 --- a/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/AuthFilterTest.java +++ b/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/AuthFilterTest.java @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.jetty11.http2.connector; +package org.glassfish.jersey.jetty.http2.connector; import org.glassfish.jersey.client.ClientConfig; import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature; @@ -44,7 +44,7 @@ protected Application configure() { @Override protected void configureClient(ClientConfig config) { - config.connectorProvider(new Jetty11Http2ConnectorProvider()); + config.connectorProvider(new JettyHttp2ConnectorProvider()); } @Test diff --git a/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/AuthTest.java b/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/AuthTest.java similarity index 91% rename from connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/AuthTest.java rename to connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/AuthTest.java index e594c20bae..7fe2edf6e7 100644 --- a/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/AuthTest.java +++ b/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/AuthTest.java @@ -14,11 +14,11 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.jetty11.http2.connector; +package org.glassfish.jersey.jetty.http2.connector; import org.eclipse.jetty.client.util.BasicAuthentication; import org.glassfish.jersey.client.ClientConfig; -import org.glassfish.jersey.jetty11.connector.Jetty11ClientProperties; +import org.glassfish.jersey.jetty.connector.JettyClientProperties; import org.glassfish.jersey.logging.LoggingFeature; import org.glassfish.jersey.server.ResourceConfig; import org.glassfish.jersey.test.JerseyTest; @@ -153,9 +153,9 @@ protected Application configure() { @Test public void testAuthGet() { ClientConfig config = new ClientConfig(); - config.property(Jetty11ClientProperties.PREEMPTIVE_BASIC_AUTHENTICATION, + config.property(JettyClientProperties.PREEMPTIVE_BASIC_AUTHENTICATION, new BasicAuthentication(getBaseUri(), "WallyWorld", "name", "password")); - config.connectorProvider(new Jetty11Http2ConnectorProvider()); + config.connectorProvider(new JettyHttp2ConnectorProvider()); Client client = ClientBuilder.newClient(config); Response response = client.target(getBaseUri()).path(PATH).request().get(); @@ -166,9 +166,9 @@ public void testAuthGet() { @Test public void testAuthPost() { ClientConfig config = new ClientConfig(); - config.property(Jetty11ClientProperties.PREEMPTIVE_BASIC_AUTHENTICATION, + config.property(JettyClientProperties.PREEMPTIVE_BASIC_AUTHENTICATION, new BasicAuthentication(getBaseUri(), "WallyWorld", "name", "password")); - config.connectorProvider(new Jetty11Http2ConnectorProvider()); + config.connectorProvider(new JettyHttp2ConnectorProvider()); Client client = ClientBuilder.newClient(config); Response response = client.target(getBaseUri()).path(PATH).request().post(Entity.text("POST")); @@ -179,9 +179,9 @@ public void testAuthPost() { @Test public void testAuthDelete() { ClientConfig config = new ClientConfig(); - config.property(Jetty11ClientProperties.PREEMPTIVE_BASIC_AUTHENTICATION, + config.property(JettyClientProperties.PREEMPTIVE_BASIC_AUTHENTICATION, new BasicAuthentication(getBaseUri(), "WallyWorld", "name", "password")); - config.connectorProvider(new Jetty11Http2ConnectorProvider()); + config.connectorProvider(new JettyHttp2ConnectorProvider()); Client client = ClientBuilder.newClient(config); Response response = client.target(getBaseUri()).path(PATH).request().delete(); diff --git a/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/CookieTest.java b/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/CookieTest.java similarity index 86% rename from connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/CookieTest.java rename to connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/CookieTest.java index b5cd635c34..eb1c6539b4 100644 --- a/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/CookieTest.java +++ b/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/CookieTest.java @@ -14,12 +14,12 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.jetty11.http2.connector; +package org.glassfish.jersey.jetty.http2.connector; import org.glassfish.jersey.client.ClientConfig; import org.glassfish.jersey.client.JerseyClient; import org.glassfish.jersey.client.JerseyClientBuilder; -import org.glassfish.jersey.jetty11.connector.Jetty11ClientProperties; +import org.glassfish.jersey.jetty.connector.JettyClientProperties; import org.glassfish.jersey.logging.LoggingFeature; import org.glassfish.jersey.server.ResourceConfig; import org.glassfish.jersey.test.JerseyTest; @@ -68,7 +68,7 @@ protected Application configure() { @Test public void testCookieResource() { ClientConfig config = new ClientConfig(); - config.connectorProvider(new Jetty11Http2ConnectorProvider()); + config.connectorProvider(new JettyHttp2ConnectorProvider()); Client client = ClientBuilder.newClient(config); WebTarget r = client.target(getBaseUri()); @@ -81,15 +81,15 @@ public void testCookieResource() { @Test public void testDisabledCookies() { ClientConfig cc = new ClientConfig(); - cc.property(Jetty11ClientProperties.DISABLE_COOKIES, true); - cc.connectorProvider(new Jetty11Http2ConnectorProvider()); + cc.property(JettyClientProperties.DISABLE_COOKIES, true); + cc.connectorProvider(new JettyHttp2ConnectorProvider()); JerseyClient client = JerseyClientBuilder.createClient(cc); WebTarget r = client.target(getBaseUri()); assertEquals("NO-COOKIE", r.request().get(String.class)); assertEquals("NO-COOKIE", r.request().get(String.class)); - final Jetty11Http2Connector connector = (Jetty11Http2Connector) client.getConfiguration().getConnector(); + final JettyHttp2Connector connector = (JettyHttp2Connector) client.getConfiguration().getConnector(); if (connector.getCookieStore() != null) { assertTrue(connector.getCookieStore().getCookies().isEmpty()); } else { @@ -101,14 +101,14 @@ public void testDisabledCookies() { @Test public void testCookies() { ClientConfig cc = new ClientConfig(); - cc.connectorProvider(new Jetty11Http2ConnectorProvider()); + cc.connectorProvider(new JettyHttp2ConnectorProvider()); JerseyClient client = JerseyClientBuilder.createClient(cc); WebTarget r = client.target(getBaseUri()); assertEquals("NO-COOKIE", r.request().get(String.class)); assertEquals("value", r.request().get(String.class)); - final Jetty11Http2Connector connector = (Jetty11Http2Connector) client.getConfiguration().getConnector(); + final JettyHttp2Connector connector = (JettyHttp2Connector) client.getConfiguration().getConnector(); assertNotNull(connector.getCookieStore().getCookies()); assertEquals(1, connector.getCookieStore().getCookies().size()); assertEquals("value", connector.getCookieStore().getCookies().get(0).getValue()); diff --git a/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/CustomLoggingFilter.java b/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/CustomLoggingFilter.java similarity index 97% rename from connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/CustomLoggingFilter.java rename to connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/CustomLoggingFilter.java index 45708b6b17..369169a02c 100644 --- a/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/CustomLoggingFilter.java +++ b/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/CustomLoggingFilter.java @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.jetty11.http2.connector; +package org.glassfish.jersey.jetty.http2.connector; import jakarta.ws.rs.client.ClientRequestContext; import jakarta.ws.rs.client.ClientRequestFilter; diff --git a/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/EntityTest.java b/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/EntityTest.java similarity index 97% rename from connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/EntityTest.java rename to connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/EntityTest.java index 9c276e85ca..0f508ca384 100644 --- a/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/EntityTest.java +++ b/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/EntityTest.java @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.jetty11.http2.connector; +package org.glassfish.jersey.jetty.http2.connector; import org.glassfish.jersey.client.ClientConfig; import org.glassfish.jersey.jackson.JacksonFeature; @@ -103,7 +103,7 @@ protected Application configure() { @Override protected void configureClient(ClientConfig config) { - config.connectorProvider(new Jetty11Http2ConnectorProvider()) + config.connectorProvider(new JettyHttp2ConnectorProvider()) .register(JacksonFeature.class); } diff --git a/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/ErrorTest.java b/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/ErrorTest.java similarity index 96% rename from connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/ErrorTest.java rename to connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/ErrorTest.java index bc534fe20c..64d819874d 100644 --- a/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/ErrorTest.java +++ b/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/ErrorTest.java @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.jetty11.http2.connector; +package org.glassfish.jersey.jetty.http2.connector; import org.glassfish.jersey.client.ClientConfig; import org.glassfish.jersey.logging.LoggingFeature; @@ -47,7 +47,7 @@ protected Application configure() { @Override protected void configureClient(ClientConfig config) { - config.connectorProvider(new Jetty11Http2ConnectorProvider()); + config.connectorProvider(new JettyHttp2ConnectorProvider()); } diff --git a/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/FollowRedirectsTest.java b/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/FollowRedirectsTest.java similarity index 94% rename from connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/FollowRedirectsTest.java rename to connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/FollowRedirectsTest.java index 121a82635e..2604f9b2df 100644 --- a/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/FollowRedirectsTest.java +++ b/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/FollowRedirectsTest.java @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.jetty11.http2.connector; +package org.glassfish.jersey.jetty.http2.connector; import org.glassfish.jersey.client.ClientConfig; import org.glassfish.jersey.client.ClientProperties; @@ -69,7 +69,7 @@ protected Application configure() { @Override protected void configureClient(ClientConfig config) { config.property(ClientProperties.FOLLOW_REDIRECTS, false); - config.connectorProvider(new Jetty11Http2ConnectorProvider()); + config.connectorProvider(new JettyHttp2ConnectorProvider()); } private static class RedirectTestFilter implements ClientResponseFilter { @@ -88,7 +88,7 @@ public void filter(ClientRequestContext requestContext, ClientResponseContext re public void testDoFollow() { final URI u = target().getUri(); ClientConfig config = new ClientConfig().property(ClientProperties.FOLLOW_REDIRECTS, true); - config.connectorProvider(new Jetty11Http2ConnectorProvider()); + config.connectorProvider(new JettyHttp2ConnectorProvider()); Client c = ClientBuilder.newClient(config); WebTarget t = c.target(u); Response r = t.path("test/redirect") @@ -118,7 +118,7 @@ public void testDontFollow() { public void testDontFollowPerRequestOverride() { final URI u = target().getUri(); ClientConfig config = new ClientConfig().property(ClientProperties.FOLLOW_REDIRECTS, true); - config.connectorProvider(new Jetty11Http2ConnectorProvider()); + config.connectorProvider(new JettyHttp2ConnectorProvider()); Client client = ClientBuilder.newClient(config); WebTarget t = client.target(u); t.property(ClientProperties.FOLLOW_REDIRECTS, false); diff --git a/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/GZIPContentEncodingTest.java b/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/GZIPContentEncodingTest.java similarity index 94% rename from connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/GZIPContentEncodingTest.java rename to connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/GZIPContentEncodingTest.java index 81396439e4..29bb444014 100644 --- a/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/GZIPContentEncodingTest.java +++ b/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/GZIPContentEncodingTest.java @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.jetty11.http2.connector; +package org.glassfish.jersey.jetty.http2.connector; import org.glassfish.jersey.client.ClientConfig; import org.glassfish.jersey.client.ClientProperties; @@ -61,7 +61,7 @@ protected Application configure() { @Override protected void configureClient(ClientConfig config) { config.register(GZipEncoder.class); - config.connectorProvider(new Jetty11Http2ConnectorProvider()); + config.connectorProvider(new JettyHttp2ConnectorProvider()); } @Test @@ -80,7 +80,7 @@ public void testPost() { public void testPostChunked() { ClientConfig config = new ClientConfig(); config.property(ClientProperties.CHUNKED_ENCODING_SIZE, 1024); - config.connectorProvider(new Jetty11Http2ConnectorProvider()); + config.connectorProvider(new JettyHttp2ConnectorProvider()); config.register(new LoggingFeature(LOGGER, LoggingFeature.Verbosity.PAYLOAD_ANY)); Client client = ClientBuilder.newClient(config); diff --git a/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/HelloWorldTest.java b/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/HelloWorldTest.java similarity index 98% rename from connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/HelloWorldTest.java rename to connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/HelloWorldTest.java index 0f674acfc3..ac6870a57b 100644 --- a/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/HelloWorldTest.java +++ b/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/HelloWorldTest.java @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.jetty11.http2.connector; +package org.glassfish.jersey.jetty.http2.connector; import org.glassfish.jersey.client.ClientConfig; import org.glassfish.jersey.logging.LoggingFeature; @@ -65,7 +65,7 @@ protected Application configure() { @Override protected void configureClient(ClientConfig config) { - config.connectorProvider(new Jetty11Http2ConnectorProvider()); + config.connectorProvider(new JettyHttp2ConnectorProvider()); } @Test diff --git a/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/Http2PresenceTest.java b/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/Http2PresenceTest.java similarity index 92% rename from connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/Http2PresenceTest.java rename to connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/Http2PresenceTest.java index df7da3ffa8..71b1361c01 100644 --- a/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/Http2PresenceTest.java +++ b/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/Http2PresenceTest.java @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.jetty11.http2.connector; +package org.glassfish.jersey.jetty.http2.connector; import org.eclipse.jetty.client.HttpClient; import org.eclipse.jetty.http2.client.http.HttpClientTransportOverHTTP2; @@ -79,7 +79,7 @@ protected Application configure() { @Override protected void configureClient(ClientConfig config) { - config.connectorProvider(new Jetty11Http2ConnectorProvider()); + config.connectorProvider(new JettyHttp2ConnectorProvider()); } @Test @@ -93,9 +93,9 @@ public void testPost() { @Test public void testHttp2Presence() { final ConnectorProvider provider = ((ClientConfig) target().getConfiguration()).getConnectorProvider(); - assertTrue(provider instanceof Jetty11Http2ConnectorProvider); + assertTrue(provider instanceof JettyHttp2ConnectorProvider); - final HttpClient client = ((Jetty11Http2ConnectorProvider) provider).getHttpClient(target()); + final HttpClient client = ((JettyHttp2ConnectorProvider) provider).getHttpClient(target()); assertTrue(client.getTransport() instanceof HttpClientTransportOverHTTP2); } diff --git a/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/HttpHeadersTest.java b/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/HttpHeadersTest.java similarity index 96% rename from connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/HttpHeadersTest.java rename to connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/HttpHeadersTest.java index 9cdd81ed73..cb3b3198a3 100644 --- a/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/HttpHeadersTest.java +++ b/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/HttpHeadersTest.java @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.jetty11.http2.connector; +package org.glassfish.jersey.jetty.http2.connector; import org.glassfish.jersey.client.ClientConfig; import org.glassfish.jersey.logging.LoggingFeature; @@ -71,7 +71,7 @@ protected Application configure() { @Override protected void configureClient(ClientConfig config) { - config.connectorProvider(new Jetty11Http2ConnectorProvider()); + config.connectorProvider(new JettyHttp2ConnectorProvider()); } @Test diff --git a/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/ManagedClientTest.java b/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/ManagedClientTest.java similarity index 98% rename from connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/ManagedClientTest.java rename to connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/ManagedClientTest.java index e5ba7d326e..215408bd25 100644 --- a/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/ManagedClientTest.java +++ b/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/ManagedClientTest.java @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.jetty11.http2.connector; +package org.glassfish.jersey.jetty.http2.connector; import org.glassfish.jersey.client.ClientConfig; import org.glassfish.jersey.logging.LoggingFeature; @@ -225,7 +225,7 @@ public MyClientBConfig() { @Override protected void configureClient(ClientConfig config) { - config.connectorProvider(new Jetty11Http2ConnectorProvider()); + config.connectorProvider(new JettyHttp2ConnectorProvider()); } /** diff --git a/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/MethodTest.java b/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/MethodTest.java similarity index 97% rename from connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/MethodTest.java rename to connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/MethodTest.java index 2dabed5e5e..8412c41ebb 100644 --- a/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/MethodTest.java +++ b/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/MethodTest.java @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.jetty11.http2.connector; +package org.glassfish.jersey.jetty.http2.connector; import org.glassfish.jersey.client.ClientConfig; import org.glassfish.jersey.logging.LoggingFeature; @@ -80,7 +80,7 @@ protected Application configure() { @Override protected void configureClient(ClientConfig config) { - config.connectorProvider(new Jetty11Http2ConnectorProvider()); + config.connectorProvider(new JettyHttp2ConnectorProvider()); } @Test diff --git a/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/NoEntityTest.java b/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/NoEntityTest.java similarity index 95% rename from connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/NoEntityTest.java rename to connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/NoEntityTest.java index 3414f2cc3d..1c14296c4b 100644 --- a/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/NoEntityTest.java +++ b/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/NoEntityTest.java @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.jetty11.http2.connector; +package org.glassfish.jersey.jetty.http2.connector; import org.glassfish.jersey.client.ClientConfig; import org.glassfish.jersey.logging.LoggingFeature; @@ -54,7 +54,7 @@ protected Application configure() { @Override protected void configureClient(ClientConfig config) { - config.connectorProvider(new Jetty11Http2ConnectorProvider()); + config.connectorProvider(new JettyHttp2ConnectorProvider()); } @Test diff --git a/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/SyncResponseSizeTest.java b/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/SyncResponseSizeTest.java similarity index 89% rename from connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/SyncResponseSizeTest.java rename to connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/SyncResponseSizeTest.java index 159738e98c..e3b2c3d007 100644 --- a/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/SyncResponseSizeTest.java +++ b/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/SyncResponseSizeTest.java @@ -14,11 +14,11 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.jetty11.http2.connector; +package org.glassfish.jersey.jetty.http2.connector; import org.glassfish.jersey.client.ClientConfig; import org.glassfish.jersey.client.ClientProperties; -import org.glassfish.jersey.jetty11.connector.Jetty11ClientProperties; +import org.glassfish.jersey.jetty.connector.JettyClientProperties; import org.glassfish.jersey.logging.LoggingFeature; import org.glassfish.jersey.server.ResourceConfig; import org.glassfish.jersey.test.JerseyTest; @@ -87,7 +87,7 @@ protected Application configure() { @Override protected void configureClient(ClientConfig config) { - config.connectorProvider(new Jetty11Http2ConnectorProvider()); + config.connectorProvider(new JettyHttp2ConnectorProvider()); } @Test @@ -101,7 +101,7 @@ public void testDefaultSmall() { public void testDefaultTooBig() { final URI u = target().getUri(); ClientConfig config = new ClientConfig().property(ClientProperties.READ_TIMEOUT, 1_000); - config.connectorProvider(new Jetty11Http2ConnectorProvider()); + config.connectorProvider(new JettyHttp2ConnectorProvider()); Client c = ClientBuilder.newClient(config); WebTarget t = c.target(u); @@ -121,8 +121,8 @@ public void testDefaultTooBig() { public void testCustomBig() { final URI u = target().getUri(); ClientConfig config = new ClientConfig().property(ClientProperties.READ_TIMEOUT, 1_000); - config.connectorProvider(new Jetty11Http2ConnectorProvider()); - config.property(Jetty11ClientProperties.SYNC_LISTENER_RESPONSE_MAX_SIZE, maxBufferSize); + config.connectorProvider(new JettyHttp2ConnectorProvider()); + config.property(JettyClientProperties.SYNC_LISTENER_RESPONSE_MAX_SIZE, maxBufferSize); Client c = ClientBuilder.newClient(config); WebTarget t = c.target(u); @@ -142,8 +142,8 @@ public void testCustomBig() { public void testCustomTooBig() { final URI u = target().getUri(); ClientConfig config = new ClientConfig().property(ClientProperties.READ_TIMEOUT, 1_000); - config.connectorProvider(new Jetty11Http2ConnectorProvider()); - config.property(Jetty11ClientProperties.SYNC_LISTENER_RESPONSE_MAX_SIZE, maxBufferSize); + config.connectorProvider(new JettyHttp2ConnectorProvider()); + config.property(JettyClientProperties.SYNC_LISTENER_RESPONSE_MAX_SIZE, maxBufferSize); Client c = ClientBuilder.newClient(config); WebTarget t = c.target(u); diff --git a/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/TimeoutTest.java b/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/TimeoutTest.java similarity index 95% rename from connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/TimeoutTest.java rename to connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/TimeoutTest.java index e3745efca7..59f242e11c 100644 --- a/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/TimeoutTest.java +++ b/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/TimeoutTest.java @@ -14,12 +14,12 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.jetty11.http2.connector; +package org.glassfish.jersey.jetty.http2.connector; import org.glassfish.jersey.CommonProperties; import org.glassfish.jersey.client.ClientConfig; import org.glassfish.jersey.client.ClientProperties; -import org.glassfish.jersey.jetty11.connector.Jetty11ClientProperties; +import org.glassfish.jersey.jetty.connector.JettyClientProperties; import org.glassfish.jersey.logging.LoggingFeature; import org.glassfish.jersey.server.ResourceConfig; import org.glassfish.jersey.test.JerseyTest; @@ -121,7 +121,7 @@ protected Application configure() { @Override protected void configureClient(ClientConfig config) { - config.connectorProvider(new Jetty11Http2ConnectorProvider()); + config.connectorProvider(new JettyHttp2ConnectorProvider()); } @Test @@ -135,7 +135,7 @@ public void testFast() { public void testSlow() { final URI u = target().getUri(); ClientConfig config = new ClientConfig().property(ClientProperties.READ_TIMEOUT, 1_000); - config.connectorProvider(new Jetty11Http2ConnectorProvider()); + config.connectorProvider(new JettyHttp2ConnectorProvider()); Client c = ClientBuilder.newClient(config); WebTarget t = c.target(u); try { @@ -153,7 +153,7 @@ public void testSlow() { public void testTimeoutInRequest() { final URI u = target().getUri(); ClientConfig config = new ClientConfig(); - config.connectorProvider(new Jetty11Http2ConnectorProvider()); + config.connectorProvider(new JettyHttp2ConnectorProvider()); Client c = ClientBuilder.newClient(config); WebTarget t = c.target(u); try { @@ -197,7 +197,7 @@ public void testSlowlyStreamedContentDoesTotalTimeout() throws Exception { try { target("test") - .property(Jetty11ClientProperties.TOTAL_TIMEOUT, 100L) + .property(JettyClientProperties.TOTAL_TIMEOUT, 100L) .property(CommonProperties.OUTBOUND_CONTENT_LENGTH_BUFFER_SERVER, "-1") .path("stream") .queryParam("count", count) diff --git a/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/TraceSupportTest.java b/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/TraceSupportTest.java similarity index 98% rename from connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/TraceSupportTest.java rename to connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/TraceSupportTest.java index 815167e155..4bf0bdaad4 100644 --- a/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/TraceSupportTest.java +++ b/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/TraceSupportTest.java @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.jetty11.http2.connector; +package org.glassfish.jersey.jetty.http2.connector; import org.glassfish.jersey.client.ClientConfig; import org.glassfish.jersey.logging.LoggingFeature; @@ -183,7 +183,7 @@ private void _testTraceWithEntity(final boolean isAsync, final boolean useJettyC } private Client getJettyClient() { - return ClientBuilder.newClient(new ClientConfig().connectorProvider(new Jetty11Http2ConnectorProvider())); + return ClientBuilder.newClient(new ClientConfig().connectorProvider(new JettyHttp2ConnectorProvider())); } diff --git a/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/UnderlyingHttpClientAccessTest.java b/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/UnderlyingHttpClientAccessTest.java similarity index 83% rename from connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/UnderlyingHttpClientAccessTest.java rename to connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/UnderlyingHttpClientAccessTest.java index b56b536528..29efcba9d6 100644 --- a/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty11/http2/connector/UnderlyingHttpClientAccessTest.java +++ b/connectors/jetty11-http2-connector/src/test/java/org/glassfish/jersey/jetty/http2/connector/UnderlyingHttpClientAccessTest.java @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.jetty11.http2.connector; +package org.glassfish.jersey.jetty.http2.connector; import org.eclipse.jetty.client.HttpClient; import org.glassfish.jersey.client.ClientConfig; @@ -36,13 +36,13 @@ public class UnderlyingHttpClientAccessTest { */ @Test public void testHttpClientInstanceAccess() { - final Client client = ClientBuilder.newClient(new ClientConfig().connectorProvider(new Jetty11Http2ConnectorProvider())); - final HttpClient hcOnClient = Jetty11Http2ConnectorProvider.getHttpClient(client); + final Client client = ClientBuilder.newClient(new ClientConfig().connectorProvider(new JettyHttp2ConnectorProvider())); + final HttpClient hcOnClient = JettyHttp2ConnectorProvider.getHttpClient(client); // important: the web target instance in this test must be only created AFTER the client has been pre-initialized // (see org.glassfish.jersey.client.Initializable.preInitialize method). This is here achieved by calling the // connector provider's static getHttpClient method above. final WebTarget target = client.target("http://localhost/"); - final HttpClient hcOnTarget = Jetty11Http2ConnectorProvider.getHttpClient(target); + final HttpClient hcOnTarget = JettyHttp2ConnectorProvider.getHttpClient(target); assertNotNull(hcOnClient, "HTTP client instance set on JerseyClient should not be null."); assertNotNull(hcOnTarget, "HTTP client instance set on JerseyWebTarget should not be null."); @@ -54,11 +54,11 @@ public void testHttpClientInstanceAccess() { public void testGetProvidedClientInstance() { final HttpClient httpClient = new HttpClient(); final ClientConfig clientConfig = new ClientConfig() - .connectorProvider(new Jetty11Http2ConnectorProvider()) - .register(new Jetty11Http2ClientSupplier(httpClient)); + .connectorProvider(new JettyHttp2ConnectorProvider()) + .register(new JettyHttp2ClientSupplier(httpClient)); final Client client = ClientBuilder.newClient(clientConfig); final WebTarget target = client.target("http://localhost/"); - final HttpClient hcOnTarget = Jetty11Http2ConnectorProvider.getHttpClient(target); + final HttpClient hcOnTarget = JettyHttp2ConnectorProvider.getHttpClient(target); assertThat("Instance provided to a ClientConfig differs from instance provided by JettyProvider", httpClient, is(hcOnTarget)); diff --git a/tests/e2e-client/pom.xml b/tests/e2e-client/pom.xml index 006c84b050..03dc2b77ad 100644 --- a/tests/e2e-client/pom.xml +++ b/tests/e2e-client/pom.xml @@ -75,6 +75,12 @@ jersey-test-framework-provider-bundle pom test + + + org.glassfish.jersey.test-framework.providers + jersey-test-framework-provider-jetty + + jakarta.annotation @@ -156,11 +162,6 @@ jersey-jdk-connector test - - org.glassfish.jersey.connectors - jersey-jetty-connector - test - org.glassfish.jersey.connectors jersey-netty-connector @@ -226,6 +227,117 @@ + + Jetty12Default + + [17,) + + + + org.glassfish.jersey.connectors + jersey-jetty-connector + test + + + org.glassfish.jersey.test-framework.providers + jersey-test-framework-provider-jetty + + + + + Jetty11JDK11 + + [11,17) + + + + org.glassfish.jersey.connectors + jersey-jetty11-connector + test + + + org.eclipse.jetty + jetty-client + ${jetty11.version} + + + org.slf4j + slf4j-api + + + + + org.eclipse.jetty + jetty-http + ${jetty11.version} + + + org.slf4j + slf4j-api + + + org.eclipse.jetty + jetty-util + + + + + org.eclipse.jetty + jetty-io + ${jetty11.version} + + + org.slf4j + slf4j-api + + + org.eclipse.jetty + jetty-util + + + + + org.eclipse.jetty + jetty-util + ${jetty11.version} + + + org.slf4j + slf4j-api + + + + + org.slf4j + slf4j-api + ${slf4j.version} + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + default-testCompile + test-compile + + + org/glassfish/jersey/tests/e2e/client/connector/proxy/Proxy*Test.java + org/glassfish/jersey/tests/e2e/client/nettyconnector/Expect100ContinueTest.java + + + + testCompile + + + + + + + + JettyTestExclude diff --git a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/HttpPatchTest.java b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/HttpPatchTest.java index 3bbc161e8e..f2c7d82e23 100644 --- a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/HttpPatchTest.java +++ b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/HttpPatchTest.java @@ -24,7 +24,6 @@ import java.util.concurrent.Future; import java.util.logging.Level; import java.util.logging.Logger; -import java.util.stream.Stream; import jakarta.ws.rs.PATCH; import jakarta.ws.rs.Path; @@ -36,10 +35,8 @@ import org.glassfish.jersey.apache.connector.ApacheConnectorProvider; import org.glassfish.jersey.apache5.connector.Apache5ConnectorProvider; import org.glassfish.jersey.client.ClientConfig; -import org.glassfish.jersey.client.HttpUrlConnectorProvider; import org.glassfish.jersey.client.spi.ConnectorProvider; import org.glassfish.jersey.grizzly.connector.GrizzlyConnectorProvider; -import org.glassfish.jersey.internal.util.JdkVersion; import org.glassfish.jersey.jdk.connector.JdkConnectorProvider; import org.glassfish.jersey.jetty.connector.JettyConnectorProvider; import org.glassfish.jersey.jnh.connector.JavaNetHttpConnectorProvider; @@ -63,18 +60,15 @@ public class HttpPatchTest { private static final Logger LOGGER = Logger.getLogger(RequestHeaderModificationsTest.class.getName()); public static List testData() { - int size = JdkVersion.getJdkVersion().getMajor() < 17 ? 6 : 7; - final ConnectorProvider[] providers = new ConnectorProvider[size]; - providers[0] = new JdkConnectorProvider(); - providers[1] = new GrizzlyConnectorProvider(); - providers[2] = new ApacheConnectorProvider(); - providers[3] = new Apache5ConnectorProvider(); - providers[4] = new NettyConnectorProvider(); - providers[5] = new JavaNetHttpConnectorProvider(); - if (size == 7) { - providers[6] = new JettyConnectorProvider(); - } - + final ConnectorProvider[] providers = new ConnectorProvider[] { + new JdkConnectorProvider(), + new GrizzlyConnectorProvider(), + new ApacheConnectorProvider(), + new Apache5ConnectorProvider(), + new NettyConnectorProvider(), + new JavaNetHttpConnectorProvider(), + new JettyConnectorProvider(), + }; return Arrays.asList(providers); } diff --git a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/MultiPartTest.java b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/MultiPartTest.java index c0e7c49f17..83a52dd8a3 100644 --- a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/MultiPartTest.java +++ b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/MultiPartTest.java @@ -19,16 +19,15 @@ import org.glassfish.jersey.client.ClientConfig; import org.glassfish.jersey.client.HttpUrlConnectorProvider; import org.glassfish.jersey.client.spi.ConnectorProvider; -import org.glassfish.jersey.internal.util.JdkVersion; import org.glassfish.jersey.jdk.connector.JdkConnectorProvider; import org.glassfish.jersey.jetty.connector.JettyConnectorProvider; -import org.glassfish.jersey.netty.connector.NettyConnectorProvider; import org.glassfish.jersey.logging.LoggingFeature; import org.glassfish.jersey.media.multipart.BodyPart; import org.glassfish.jersey.media.multipart.BodyPartEntity; import org.glassfish.jersey.media.multipart.MultiPart; import org.glassfish.jersey.media.multipart.MultiPartFeature; import org.glassfish.jersey.message.internal.ReaderWriter; +import org.glassfish.jersey.netty.connector.NettyConnectorProvider; import org.glassfish.jersey.server.ResourceConfig; import org.glassfish.jersey.test.JerseyTest; import org.glassfish.jersey.test.TestProperties; @@ -58,19 +57,16 @@ public class MultiPartTest { private static final Logger LOGGER = Logger.getLogger(RequestHeaderModificationsTest.class.getName()); public static ConnectorProvider[] testData() { - int size = /*JdkVersion.getJdkVersion().getMajor() < 17 ? */3 /*: 4*/; - final ConnectorProvider[] providers = new ConnectorProvider[size]; - providers[0] = new HttpUrlConnectorProvider(); - providers[1] = new NettyConnectorProvider(); - providers[2] = new JdkConnectorProvider(); - /*if (size == 4) { //It's Jetty11ConnectorProvider in the 3.1, - //and we can not test it here due to incompatibility - //of Jetty 12 and Jetty 11 - providers[3] = new JettyConnectorProvider(); - }*/ + final ConnectorProvider[] providers = new ConnectorProvider[] { + new HttpUrlConnectorProvider(), + new NettyConnectorProvider(), + new JdkConnectorProvider(), + new JettyConnectorProvider(), + }; return providers; } + @TestFactory public Collection generateTests() { Collection tests = new ArrayList<>(); diff --git a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/RequestHeaderModificationsTest.java b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/RequestHeaderModificationsTest.java index 42464214ad..adc1b27662 100644 --- a/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/RequestHeaderModificationsTest.java +++ b/tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/connector/RequestHeaderModificationsTest.java @@ -58,7 +58,6 @@ import org.glassfish.jersey.client.ClientConfig; import org.glassfish.jersey.client.HttpUrlConnectorProvider; import org.glassfish.jersey.client.spi.ConnectorProvider; -import org.glassfish.jersey.internal.util.JdkVersion; import org.glassfish.jersey.jetty.connector.JettyConnectorProvider; import org.glassfish.jersey.jnh.connector.JavaNetHttpConnectorProvider; import org.glassfish.jersey.logging.LoggingFeature; @@ -111,7 +110,7 @@ public static List testData() { {new JavaNetHttpConnectorProvider(), true, true, false, false}, {new HttpUrlConnectorProvider(), true, true, true, true}, {new GrizzlyConnectorProvider(), false, false, true, true}, // change to true when JERSEY-2341 fixed - {new JettyConnectorProvider(), false, false, true, false}, // change to true when JERSEY-2341 fixed + {new JettyConnectorProvider(), true, false, true, false}, // change to true when JERSEY-2341 fixed {new ApacheConnectorProvider(), false, false, true, true}, // change to true when JERSEY-2341 fixed {new Apache5ConnectorProvider(), false, false, true, true}, // change to true when JERSEY-2341 fixed {new JavaNetHttpConnectorProvider(), true, true, false, false}, @@ -122,10 +121,6 @@ public static List testData() { public Collection generateTests() { Collection tests = new ArrayList<>(); testData().forEach(arr -> { - if (JdkVersion.getJdkVersion().getMajor() < 17 - && arr[0].getClass().getName().contains("Jetty")) { - return; - } RequestHeaderModificationsTemplateTest test = new RequestHeaderModificationsTemplateTest( (ConnectorProvider) arr[0], (boolean) arr[1], (boolean) arr[2], (boolean) arr[3], (boolean) arr[4]) {}; tests.add(TestHelper.toTestContainer(test, String.format("%s (%s, %s, %s)", 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 690faa46ce..0fde39c79d 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 @@ -28,7 +28,6 @@ import org.glassfish.jersey.client.HttpUrlConnectorProvider; import org.glassfish.jersey.client.spi.ConnectorProvider; import org.glassfish.jersey.grizzly.connector.GrizzlyConnectorProvider; -import org.glassfish.jersey.internal.util.JdkVersion; import org.glassfish.jersey.jetty.connector.JettyConnectorProvider; import org.glassfish.jersey.jnh.connector.JavaNetHttpConnectorProvider; @@ -55,16 +54,14 @@ public abstract class AbstractConnectorServerTest { * @return test parameters. */ public static Stream testData() { - int size = JdkVersion.getJdkVersion().getMajor() < 17 ? 5 : 6; - final ConnectorProvider[] providers = new ConnectorProvider[size]; - providers[0] = new HttpUrlConnectorProvider(); - providers[1] = new GrizzlyConnectorProvider(); - providers[2] = new ApacheConnectorProvider(); - providers[3] = new Apache5ConnectorProvider(); - providers[4] = new JavaNetHttpConnectorProvider(); - if (size == 6) { - providers[5] = new JettyConnectorProvider(); - } + final ConnectorProvider[] providers = new ConnectorProvider[] { + new HttpUrlConnectorProvider(), + new GrizzlyConnectorProvider(), + new ApacheConnectorProvider(), + new Apache5ConnectorProvider(), + new JavaNetHttpConnectorProvider(), + new JettyConnectorProvider() + }; return Stream.of(providers); }