Class AbstractUrlClient
java.lang.Object
com.sun.ts.lib.harness.EETest
com.sun.ts.tests.common.webclient.BaseUrlClient
com.sun.ts.tests.servlet.common.client.AbstractUrlClient
- All Implemented Interfaces:
- Serializable
Base client for Servlet tests.
- See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from class com.sun.ts.lib.harness.EETestEETest.Fault, EETest.SetupException
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected static final Stringapitest property nameprotected static final Stringno servlet nameprotected final org.slf4j.LoggerThe logger for this class.Fields inherited from class com.sun.ts.tests.common.webclient.BaseUrlClient_contextRoot, _generalURI, _hostname, _port, _props, _redirect, _saveState, _state, _testCase, _testName, _tsHome, _useSavedState, BASIC_AUTH_PASSWD, BASIC_AUTH_REALM, BASIC_AUTH_USER, CONTENT, CONTINUE, CREATED, EXPECT_RESPONSE_BODY, EXPECTED_HEADERS, FOLLOW_REDIRECT, FORBIDDEN, GET, GF_SUFFIX, GOLDENFILE, GOLDENFILEDIR, GONE, HTTP10, HTTP11, IGNORE_BODY, IGNORE_STATUS_CODE, INTERNAL_SERVER_ERROR, JSP_SUFFIX, LENGTH_REQUIRED, MOVED_TEMPORARY, NOT_FOUND, OK, REASON_PHRASE, REQUEST, REQUEST_HEADERS, RESPONSE_MATCH, SAVE_STATE, SEARCH_STRING, SEARCH_STRING_IGNORE_CASE, SERVICE_UNAVAILABLE, SERVLETHOSTPROP, SERVLETPORTPROP, SL, STANDARD, STATUS_CODE, STRATEGY, TEST_NAME, TEST_PROPS, TESTDIR, TSHOME, UNAUTHORIZED, UNEXPECTED_HEADERS, UNEXPECTED_RESPONSE_MATCH, UNORDERED_SEARCH_STRING, USE_SAVED_STATEFields inherited from class com.sun.ts.lib.harness.EETesterr, iLogDelaySeconds, log, sTestCase
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptiongetHttpsURLConnection(URL newURL) Opens a URLConnection.protected StringgetLocalInterfaceInfo(boolean returnAddresses) Returns a string containing the local interface information.protected StringgetRequest(String rq) Returns the request string.protected StringGets the name of the servlet to use when building a request for a single servlet API test.protected URLBuilds a URL.protected StringgetURLString(String protocol, String hostname, int portnum, String sContext) Builds a url string.protected voidsetServletName(String servlet) Sets the name of the servlet to use when building a request for a single servlet API test.protected voidsetTestProperties(WebTestCase testCase) Sets the appropriate test properties based on the values stored in TEST_PROPSMethods inherited from class com.sun.ts.tests.common.webclient.BaseUrlClientcleanup, getContextRoot, invoke, setContextRoot, setGeneralURI, setGoldenFileDir, setTestDir, setupMethods inherited from class com.sun.ts.lib.harness.EETestgetPropsReady, getTestPropsFromArgs, initializeProperties, logErr, logErr, logMsg, logTrace, logTrace, run, run, run, run, runAllTestCases, setTestStatus
- 
Field Details- 
loggerprotected final org.slf4j.Logger loggerThe logger for this class.
- 
APITESTapitest property name- See Also:
 
- 
DONOTUSEServletNameno servlet name- See Also:
 
 
- 
- 
Constructor Details- 
AbstractUrlClientprotected AbstractUrlClient()Constructor.
 
- 
- 
Method Details- 
setTestPropertiesDescription copied from class:BaseUrlClientSets the appropriate test properties based on the values stored in TEST_PROPS- Overrides:
- setTestPropertiesin class- BaseUrlClient
- Parameters:
- testCase- a- WebTestCasevalue
 
- 
setServletNameSets the name of the servlet to use when building a request for a single servlet API test.- Parameters:
- servlet- - the name of the servlet
 
- 
getServletNameGets the name of the servlet to use when building a request for a single servlet API test.- Returns:
- the name of the servlet
 
- 
getLocalInterfaceInfoReturns a string containing the local interface information.- Parameters:
- returnAddresses- if true, returns IP addresses; if false, returns hostnames
- Returns:
- a string containing the local interface information
 
- 
getRequestReturns the request string.- Parameters:
- rq- - the request string
- Returns:
- the request string
 
- 
getURLStringBuilds a url string.- Parameters:
- protocol- - the protocol
- hostname- - the hostname
- portnum- - the port number
- sContext- - the context
- Returns:
- the url string
 
- 
getURLprotected URL getURL(String protocol, String hostname, int portnum, String sContext) throws MalformedURLException Builds a URL.- Parameters:
- protocol- - the protocol
- hostname- - the hostname
- portnum- - the port number
- sContext- - the context
- Returns:
- the url string
- Throws:
- MalformedURLException- - if an error occurs
 
- 
getHttpsURLConnectionOpens a URLConnection.- Parameters:
- newURL- - the URL
- Returns:
- the URLConnection
- Throws:
- IOException- - if an error occurs
 
 
-