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
-
Nested Class Summary
Nested classes/interfaces inherited from class ee.jakarta.tck.ws.rs.common.JAXRSCommonClient
JAXRSCommonClient.Fault, JAXRSCommonClient.Property, JAXRSCommonClient.Request
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<jakarta.ws.rs.client.Client>
protected boolean
protected JaxrsWebTestCase
Fields inherited from class ee.jakarta.tck.ws.rs.common.JAXRSCommonClient
_contextRoot, _generalURI, _hostname, _port, _redirect, _saveState, _servlet, _state, _testCase, _testName, _tsHome, _useSavedState, GET, GF_SUFFIX, GOLDENFILE, GOLDENFILEDIR, HTTP10, HTTP11, indent, newline, REQUEST, REQUEST_HEADERS, SEARCH_STRING, servletAdaptor, SERVLETHOSTPROP, SERVLETPORTPROP, SL, STATUS_CODE, TEST_PROPS, TESTDIR, TSHOME
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Calls setHeader(Property.REQUEST_HEADERS, header : values);void
addProvider
(Object providerToRegister) protected void
bufferEntity
(boolean buffer) protected String
buildRequest
(JAXRSCommonClient.Request type, String... path) protected String
buildRequest
(String type, String... path) Deprecated.void
cleanup()
cleanup
is called by the test harness to cleanup after text executionstatic String[]
getMetadata
(jakarta.ws.rs.core.MultivaluedMap<String, Object> metadata) This method is typically used to transform http headers metadata into a String array.protected jakarta.ws.rs.core.Response
protected String
protected <T> T
getResponseBody
(Class<T> clazz) protected String[]
protected jakarta.ws.rs.core.Response.Status
get HttpResponse#statusCodeprotected JaxrsWebTestCase
protected void
invoke()
Invokes a test based on the properties stored in TEST_PROPS.static <T> String
listToString
(List<T> list) protected void
printClientCall
(boolean print) protected void
protected void
setPrintEntity
(boolean printEntity) protected void
setProperty
(String key, String value) Deprecated.protected void
setRequestContentEntity
(Object object) protected void
setTestProperties
(JaxrsWebTestCase testCase) Sets the appropriate test properties based on the values stored in TEST_PROPSprotected void
setTextCaser
(TextCaser caser) void
setup()
setup
is by the test harness to initialize the tests.protected void
setWebTestCaseProperties
(JaxrsWebTestCase testCase) protected static String[]
splitByColon
(String value) Replaces String#split("|"), as it does not split for special character '|'Methods inherited from class ee.jakarta.tck.ws.rs.common.JAXRSCommonClient
assertCause, assertContains, assertContains, assertContainsIgnoreCase, assertContainsIgnoreCase, assertEquals, assertEqualsBool, assertEqualsInt, assertEqualsLong, assertNotNull, assertNull, assertResponseBodyContain, assertResponseHeadersContain, buildAccept, buildContentType, buildHeaderMediaType, buildRequest10, clearProperty, clearTestProperties, createHttpRequest, editWebXmlString, fault, getAbsoluteUrl, getAbsoluteUrl, getContextRoot, getLocalInterfaceInfo, getServletName, getStatusCode, isNullOrEmpty, logMsg, logTrace, objectsToString, objectsToString, setContextRoot, setProperty, setProperty, setServletName, setTestDir, setTestProperties, setWebTestCaseProperties, setWebTestCaseRequest, toString
-
Field Details
-
testCase
-
isTestCaseAfterInvocation
protected boolean isTestCaseAfterInvocation -
clients
-
-
Constructor Details
-
JaxrsCommonClient
public JaxrsCommonClient()
-
-
Method Details
-
setTestProperties
Sets the appropriate test properties based on the values stored in TEST_PROPS
-
setWebTestCaseProperties
-
splitByColon
Replaces String#split("|"), as it does not split for special character '|' -
invoke
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 classJAXRSCommonClient
- Throws:
JAXRSCommonClient.Fault
- If an error occurs during the test run
-
cleanup
Description copied from class:JAXRSCommonClient
cleanup
is called by the test harness to cleanup after text execution- Overrides:
cleanup
in classJAXRSCommonClient
- 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 classJAXRSCommonClient
-
getTestCase
-
buildRequest
- Overrides:
buildRequest
in classJAXRSCommonClient
-
setProperty
Deprecated.Description copied from class:JAXRSCommonClient
Set TEST_PROPS property value. If it already exists, the value is appended- Overrides:
setProperty
in classJAXRSCommonClient
-
buildRequest
Deprecated.Description copied from class:JAXRSCommonClient
Create request/ / HTTP/1.1. ContextRoot is defined in every client. - Overrides:
buildRequest
in classJAXRSCommonClient
- 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
- Overrides:
getResponseBody
in classJAXRSCommonClient
- Returns:
- http response body as string
-
getResponseBody
-
getProvidersToRegister
-
addProvider
-
getResponseHeaders
- Overrides:
getResponseHeaders
in classJAXRSCommonClient
- Returns:
- http response body as string
- Throws:
JAXRSCommonClient.Fault
- when an error occur
-
addHeader
Calls setHeader(Property.REQUEST_HEADERS, header : values);- Parameters:
header
- Recommended one of HttpHeaders static valuesvalues
- the value[1]value[2]...value[n] which are to be assigned to header name
-
getMetadata
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 classJAXRSCommonClient
- Returns:
- JAXRS Response.Status equivalent of HttpResponse#statusCode
-
setRequestContentEntity
-
listToString
-
printClientCall
protected void printClientCall(boolean print) -
setAsynchronousProcessing
protected void setAsynchronousProcessing() -
setPrintEntity
protected void setPrintEntity(boolean printEntity) -
bufferEntity
protected void bufferEntity(boolean buffer) -
setTextCaser
-