Class TestClient
java.lang.Object
ee.jakarta.tck.concurrent.framework.TestClient
- Direct Known Subclasses:
AnnotationFullTests
,AnnotationWebTests
,ContextFullTests
,ContextPropagationFullTests
,ContextPropagationServletTests
,ContextPropagationWebTests
,ContextWebTests
,DeploymentDescriptorFullTests
,DeploymentDescriptorWebTests
,ManagedExecutorDefinitionFullTests
,ManagedExecutorDefinitionWebTests
,ManagedScheduledExecutorDefinitionFullTests
,ManagedScheduledExecutorDefinitionWebTests
,ManagedThreadFactoryDefinitionFullTests
,ManagedThreadFactoryDefinitionWebTests
,ManagedThreadFactoryTests
,SecurityFullTests
,SecurityFullTests
,SecurityWebTests
,SecurityWebTests
,TransactionTests
,TransactionTests
,TransactionTests
,TransactionTests
,VirtualFullTests
,VirtualWebTests
This class is intended to be used in conjunction with TestServlet.
TestServlets are deployed to the application server and has custom
doGet/doPost methods that will return a successful or failure message
depending on the test outcome.
The TestClient class has runTest methods that will create an HTTP connection
to the TestServlet and provide the TestServlet with the method name it needs
to test. The TestClient class will then confirm that it recieved a successful
outcome from the test.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
assertStringInResponse
(String message, String expected, String resp) Asserts that the response from a runTestWithResponse method contains a specific string.protected String
Override this method to return the servlet path for the suite of tests.void
runTest
(URLBuilder builder) Runs test against servlet using a URLBuilder.void
Runs test against servlet at baseURL, and will run against a specified testName.runTestWithResponse
(URLBuilder builder, Properties props) Runs test against servlet using a URLBuilder.runTestWithResponse
(URL baseURL, String testName, Properties props) Runs test against servlet at baseURL, and will run against a specified testName.
-
Field Details
-
SUCCESS
- See Also:
-
FAILURE
- See Also:
-
TEST_METHOD
- See Also:
-
nl
-
-
Constructor Details
-
TestClient
public TestClient()
-
-
Method Details
-
runTest
Runs test against servlet at baseURL, and will run against a specified testName. -
runTest
Runs test against servlet using a URLBuilder. This is useful for complicated testing situations. -
runTestWithResponse
Runs test against servlet at baseURL, and will run against a specified testName. Provide properties if you want them included in a POST request, otherwise pass in null. -
runTestWithResponse
Runs test against servlet using a URLBuilder. This is useful for complicated testing situations. Provide properties if you want them included in a POST request, otherwise pass in null. -
getServletPath
Override this method to return the servlet path for the suite of tests. Used for the runTest() methods. -
assertStringInResponse
Asserts that the response from a runTestWithResponse method contains a specific string.- Parameters:
message
- - message to display if test failsexpected
- - the expected string to find in the responseresp
- - the response you received from the servlet
-