![JAR search and dependency download from the Maven repository](/logo.png)
ee.jakarta.tck.ws.rs.common.client.JaxrsWebTestCase Maven / Gradle / Ivy
/*
* Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* This Source Code may also be made available under the following Secondary
* Licenses when the conditions for such availability set forth in the
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
* version 2 with the GNU Classpath Exception, which is available at
* https://www.gnu.org/software/classpath/license.html.
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
*/
package ee.jakarta.tck.ws.rs.common.client;
import java.io.IOException;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.Future;
import ee.jakarta.tck.ws.rs.common.webclient.TestFailureException;
import ee.jakarta.tck.ws.rs.common.webclient.WebTestCase;
import ee.jakarta.tck.ws.rs.common.webclient.http.HttpRequest;
import ee.jakarta.tck.ws.rs.common.webclient.http.HttpResponse;
import ee.jakarta.tck.ws.rs.common.webclient.validation.ValidationFactory;
import ee.jakarta.tck.ws.rs.common.webclient.validation.ValidationStrategy;
import ee.jakarta.tck.ws.rs.lib.util.TestUtil;
import jakarta.ws.rs.client.Client;
import jakarta.ws.rs.client.ClientBuilder;
import jakarta.ws.rs.client.Entity;
import jakarta.ws.rs.client.Invocation;
import jakarta.ws.rs.client.InvocationCallback;
import jakarta.ws.rs.client.WebTarget;
import jakarta.ws.rs.core.MediaType;
import jakarta.ws.rs.core.Request;
import jakarta.ws.rs.core.Response;
/**
* Replaces WebTestCase to be used with JAXRS client instead of apache client
*
* @author supol
*/
public class JaxrsWebTestCase extends WebTestCase {
/**
* The JAXRS request instance
*/
protected Request request;
/**
* The JAXRS response instance
*/
protected Response response;
/**
* GET, PUT, OPTIONS, ...
*/
protected String requestType;
/**
* The URL of the Request
*/
protected String urlRequest;
/**
* The HTTP content entity. A MessageBodyWriter needs to be
* registered if not a standard entity type supported by JAXRS
*/
protected Object entity;
/**
* port of the server
*/
protected int port;
/**
* host name of the server
*/
protected String hostname;
/**
* HTTP header list
*/
protected Map headerMap;
/**
* Apache HTTP response mock
*/
protected HttpResponse _response;
/**
* print the response entity
*/
protected boolean printEntity = true;
/**
* buffer the returned entity
*/
protected boolean bufferEntity = false;
/**
* Provider logging the request and response
*/
protected Object loggingFilter;
/**
* other providers, such as MessageBodyReader, or MessageBodyWriter
*/
protected List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy