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 booleanprotected JaxrsWebTestCaseFields 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 voidCalls setHeader(Property.REQUEST_HEADERS, header : values);voidaddProvider(Object providerToRegister) protected voidbufferEntity(boolean buffer) protected StringbuildRequest(JAXRSCommonClient.Request type, String... path) protected StringbuildRequest(String type, String... path) Deprecated.voidcleanup()cleanupis 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.Responseprotected Stringprotected <T> TgetResponseBody(Class<T> clazz) protected String[]protected jakarta.ws.rs.core.Response.Statusget HttpResponse#statusCodeprotected JaxrsWebTestCaseprotected voidinvoke()Invokes a test based on the properties stored in TEST_PROPS.static <T> StringlistToString(List<T> list) protected voidprintClientCall(boolean print) protected voidprotected voidsetPrintEntity(boolean printEntity) protected voidsetProperty(String key, String value) Deprecated.protected voidsetRequestContentEntity(Object object) protected voidsetTestProperties(JaxrsWebTestCase testCase) Sets the appropriate test properties based on the values stored in TEST_PROPSprotected voidsetTextCaser(TextCaser caser) voidsetup()setupis by the test harness to initialize the tests.protected voidsetWebTestCaseProperties(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:
invokein classJAXRSCommonClient- Throws:
JAXRSCommonClient.Fault- If an error occurs during the test run
-
cleanup
Description copied from class:JAXRSCommonClientcleanupis called by the test harness to cleanup after text execution- Overrides:
cleanupin classJAXRSCommonClient- Throws:
JAXRSCommonClient.Fault- if an error occurs
-
setup
public void setup()Description copied from class:JAXRSCommonClientsetupis by the test harness to initialize the tests.- Overrides:
setupin classJAXRSCommonClient
-
getTestCase
-
buildRequest
- Overrides:
buildRequestin classJAXRSCommonClient
-
setProperty
Deprecated.Description copied from class:JAXRSCommonClientSet TEST_PROPS property value. If it already exists, the value is appended- Overrides:
setPropertyin classJAXRSCommonClient
-
buildRequest
Deprecated.Description copied from class:JAXRSCommonClientCreate request/ / HTTP/1.1. ContextRoot is defined in every client. - Overrides:
buildRequestin 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:
getResponseBodyin classJAXRSCommonClient- Returns:
- http response body as string
-
getResponseBody
-
getProvidersToRegister
-
addProvider
-
getResponseHeaders
- Overrides:
getResponseHeadersin 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:JAXRSCommonClientget HttpResponse#statusCode- Overrides:
getResponseStatusCodein 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
-