Class JaxrsCommonClient

java.lang.Object
ee.jakarta.tck.ws.rs.common.JAXRSCommonClient
ee.jakarta.tck.ws.rs.common.client.JaxrsCommonClient
Direct Known Subclasses:
JAXRSClientIT, JAXRSClientIT, JAXRSClientIT, JAXRSClientIT, JAXRSClientIT, JAXRSClientIT, JAXRSClientIT, JAXRSClientIT, JAXRSClientIT, JAXRSClientIT, JAXRSClientIT, JAXRSClientIT, JAXRSClientIT, JAXRSClientIT, JAXRSClientIT, JAXRSClientIT, JAXRSClientIT, JAXRSClientIT, JAXRSClientIT, JAXRSClientIT, JAXRSClientIT, JAXRSClientIT, JAXRSClientIT, JAXRSClientIT, JAXRSClientIT, JAXRSClientIT, JAXRSClientIT, JAXRSClientIT, JAXRSClientIT, JAXRSClientIT, JAXRSClientIT, JAXRSClientIT, JAXRSClientIT, JAXRSClientIT, JAXRSClientIT, JAXRSClientIT, JAXRSClientIT, JAXRSClientIT, JAXRSClientIT, JAXRSClientIT, JAXRSClientIT, ReaderClient, ReaderClient, SSEJAXRSClient, WriterClient, WriterClient

public class JaxrsCommonClient extends JAXRSCommonClient
  • Field Details

    • testCase

      protected transient JaxrsWebTestCase testCase
    • isTestCaseAfterInvocation

      protected boolean isTestCaseAfterInvocation
    • clients

      protected List<jakarta.ws.rs.client.Client> clients
  • Constructor Details

    • JaxrsCommonClient

      public JaxrsCommonClient()
  • Method Details

    • setTestProperties

      protected void setTestProperties(JaxrsWebTestCase testCase)
       Sets the appropriate test properties based
       on the values stored in TEST_PROPS
       
    • setWebTestCaseProperties

      protected void setWebTestCaseProperties(JaxrsWebTestCase testCase)
    • splitByColon

      protected static String[] splitByColon(String value)
      Replaces String#split("|"), as it does not split for special character '|'
    • invoke

      protected void invoke() throws JAXRSCommonClient.Fault
       Invokes a test based on the properties
       stored in TEST_PROPS.  Once the test has completed,
       the properties in TEST_PROPS will be cleared.
       
      Overrides:
      invoke in class JAXRSCommonClient
      Throws:
      JAXRSCommonClient.Fault - If an error occurs during the test run
    • cleanup

      public void cleanup() throws JAXRSCommonClient.Fault
      Description copied from class: JAXRSCommonClient
      cleanup is called by the test harness to cleanup after text execution
      Overrides:
      cleanup in class JAXRSCommonClient
      Throws:
      JAXRSCommonClient.Fault - if an error occurs
    • setup

      public void setup()
      Description copied from class: JAXRSCommonClient
      setup is by the test harness to initialize the tests.
      Overrides:
      setup in class JAXRSCommonClient
    • getTestCase

      protected JaxrsWebTestCase getTestCase()
    • buildRequest

      protected String buildRequest(JAXRSCommonClient.Request type, String... path)
      Overrides:
      buildRequest in class JAXRSCommonClient
    • setProperty

      @Deprecated protected void setProperty(String key, String value)
      Deprecated.
      Description copied from class: JAXRSCommonClient
      Set TEST_PROPS property value. If it already exists, the value is appended
      Overrides:
      setProperty in class JAXRSCommonClient
    • buildRequest

      @Deprecated protected String buildRequest(String type, String... path)
      Deprecated.
      Description copied from class: JAXRSCommonClient
      Create request // HTTP/1.1. ContextRoot is defined in every client.
      Overrides:
      buildRequest in class JAXRSCommonClient
      Parameters:
      type - PUT, GET, POST, ...
      path - path defined in a servlet
      Returns:
      String representing HTTP request
    • getResponse

      protected jakarta.ws.rs.core.Response getResponse()
    • getResponseBody

      protected String getResponseBody()
      Overrides:
      getResponseBody in class JAXRSCommonClient
      Returns:
      http response body as string
    • getResponseBody

      protected <T> T getResponseBody(Class<T> clazz)
    • getProvidersToRegister

      public List<Object> getProvidersToRegister()
    • addProvider

      public void addProvider(Object providerToRegister)
    • getResponseHeaders

      protected String[] getResponseHeaders() throws JAXRSCommonClient.Fault
      Overrides:
      getResponseHeaders in class JAXRSCommonClient
      Returns:
      http response body as string
      Throws:
      JAXRSCommonClient.Fault - when an error occur
    • addHeader

      protected void addHeader(String header, String... values)
      Calls setHeader(Property.REQUEST_HEADERS, header : values);
      Parameters:
      header - Recommended one of HttpHeaders static values
      values - the value[1]value[2]...value[n] which are to be assigned to header name
    • getMetadata

      public static String[] getMetadata(jakarta.ws.rs.core.MultivaluedMap<String,Object> metadata)
      This method is typically used to transform http headers metadata into a String array. The headers are in a form of java class instance, e.g. stream(!), or String
      Parameters:
      metadata -
      Returns:
    • getResponseStatusCode

      protected jakarta.ws.rs.core.Response.Status getResponseStatusCode()
      Description copied from class: JAXRSCommonClient
      get HttpResponse#statusCode
      Overrides:
      getResponseStatusCode in class JAXRSCommonClient
      Returns:
      JAXRS Response.Status equivalent of HttpResponse#statusCode
    • setRequestContentEntity

      protected void setRequestContentEntity(Object object)
    • listToString

      public static <T> String listToString(List<T> list)
    • printClientCall

      protected void printClientCall(boolean print)
    • setAsynchronousProcessing

      protected void setAsynchronousProcessing()
    • setPrintEntity

      protected void setPrintEntity(boolean printEntity)
    • bufferEntity

      protected void bufferEntity(boolean buffer)
    • setTextCaser

      protected void setTextCaser(TextCaser caser)