Class BaseUrlClient
java.lang.Object
com.sun.ts.lib.harness.EETest
com.sun.ts.tests.common.webclient.BaseUrlClient
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AbstractUrlClient
,SecBasicClient
Provides base test initialization and runtime logic into a common class. All test areas will need to extend this class to provided area specific functionality needed for that particular technology.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.sun.ts.lib.harness.EETest
EETest.Fault, EETest.SetupException
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String
Context root of target testsprotected String
General file/request URI for both gfiles and testsprotected String
Target webserver hostnameprotected int
Target webserver portProperties parametersprotected boolean
protected boolean
Save state.protected org.apache.commons.httpclient.HttpState
HttpState that may be used for multiple invocations requiring state.protected WebTestCase
Test case.protected String
Current test nameprotected String
location of _tsHomeprotected boolean
Use saved state.protected static final String
Basic Auth passwordprotected static final String
Basic Auth realmprotected static final String
Basic Auth usernameprotected static final String
Content propertyprotected static final String
100 - continueprotected static final String
201 - createdprotected static final String
Expect response body propertyprotected static final String
Expected headers propertyprotected String
Follow redirect.protected static final String
403 - Forbiddenprotected static final String
Default request methodprotected static final String
Goldenfile suffixprotected static final String
Goldenfile propertyprotected String
Goldenfile directoryprotected static final String
410 - GONEprotected static final String
HTTP 1.0protected static final String
HTTP 1.1protected static final String
Ignore response bodyprotected static final String
Ignore HTTP status codesprotected static final String
500 - internal server errorprotected static final String
JSP suffixprotected static final String
411 - length requiredprotected static final String
302 - moved temporarilyprotected static final String
404 - not foundprotected static final String
200 - okprotected static final String
Reason-Phrase propertyprotected static final String
Request propertyprotected static final String
Request headers propertyprotected static final String
Response Match propertyprotected static final String
Save current HTTP state.protected static final String
Search string propertyprotected static final String
Search string case insensitive propertyprotected static final String
503 - service unavailableprotected static final String
TS Webserver host propertyprotected static final String
TS Webserver port propertyprotected static final String
Forward slashprotected static final String
Standard test propertyprotected static final String
StatusCode propertyprotected static final String
Validation strategyprotected static final String
Test name propertyprotected static final Properties
Test propertiesprotected String
Current test directoryprotected static final String
TS home propertyprotected static final String
401 - Unauthorizedprotected static final String
Unexpected header propertyprotected static final String
Unexpected response match propertyprotected static final String
Unordered search string propertyprotected static final String
Use any saved stateFields inherited from class com.sun.ts.lib.harness.EETest
err, iLogDelaySeconds, log, sTestCase
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
cleanup()
cleanup
is called by the test harness to cleanup after text executionprotected void
invoke()
Invokes a test based on the properties stored in TEST_PROPS.void
setContextRoot
(String root) void
setGeneralURI
(String URI) void
setGoldenFileDir
(String goldenDir) Sets the goldenfile directoryvoid
setTestDir
(String testDir) setTestDir
sets the current test directory.protected void
setTestProperties
(WebTestCase testCase) Sets the appropriate test properties based on the values stored in TEST_PROPSvoid
setup
(String[] args, Properties p) setup
is by the test harness to initialize the tests.Methods inherited from class com.sun.ts.lib.harness.EETest
getPropsReady, getTestPropsFromArgs, initializeProperties, logErr, logErr, logMsg, logTrace, logTrace, run, run, run, run, runAllTestCases, setTestStatus
-
Field Details
-
_props
Properties parameters -
UNAUTHORIZED
401 - Unauthorized- See Also:
-
FORBIDDEN
403 - Forbidden- See Also:
-
NOT_FOUND
404 - not found- See Also:
-
OK
200 - ok- See Also:
-
CREATED
201 - created- See Also:
-
INTERNAL_SERVER_ERROR
500 - internal server error- See Also:
-
SERVICE_UNAVAILABLE
503 - service unavailable- See Also:
-
CONTINUE
100 - continue- See Also:
-
MOVED_TEMPORARY
302 - moved temporarily- See Also:
-
GONE
410 - GONE- See Also:
-
LENGTH_REQUIRED
411 - length required- See Also:
-
SERVLETHOSTPROP
TS Webserver host property- See Also:
-
SERVLETPORTPROP
TS Webserver port property- See Also:
-
TSHOME
TS home property- See Also:
-
TEST_PROPS
Test properties -
STATUS_CODE
StatusCode property- See Also:
-
REASON_PHRASE
Reason-Phrase property- See Also:
-
EXPECTED_HEADERS
Expected headers property- See Also:
-
UNEXPECTED_HEADERS
Unexpected header property- See Also:
-
EXPECT_RESPONSE_BODY
Expect response body property- See Also:
-
REQUEST
Request property- See Also:
-
REQUEST_HEADERS
Request headers property- See Also:
-
GOLDENFILE
Goldenfile property- See Also:
-
SEARCH_STRING
Search string property- See Also:
-
SEARCH_STRING_IGNORE_CASE
Search string case insensitive property- See Also:
-
BASIC_AUTH_USER
Basic Auth username- See Also:
-
BASIC_AUTH_PASSWD
Basic Auth password- See Also:
-
BASIC_AUTH_REALM
Basic Auth realm- See Also:
-
UNORDERED_SEARCH_STRING
Unordered search string property- See Also:
-
CONTENT
Content property- See Also:
-
TEST_NAME
Test name property- See Also:
-
RESPONSE_MATCH
Response Match property- See Also:
-
UNEXPECTED_RESPONSE_MATCH
Unexpected response match property- See Also:
-
STANDARD
Standard test property- See Also:
-
IGNORE_BODY
Ignore response body- See Also:
-
STRATEGY
Validation strategy- See Also:
-
TESTDIR
Current test directory -
GOLDENFILEDIR
Goldenfile directory -
GET
Default request method- See Also:
-
HTTP10
HTTP 1.0- See Also:
-
HTTP11
HTTP 1.1- See Also:
-
SL
Forward slash- See Also:
-
GF_SUFFIX
Goldenfile suffix- See Also:
-
JSP_SUFFIX
JSP suffix- See Also:
-
USE_SAVED_STATE
Use any saved state- See Also:
-
SAVE_STATE
Save current HTTP state.- See Also:
-
IGNORE_STATUS_CODE
Ignore HTTP status codes- See Also:
-
_testName
Current test name -
_tsHome
location of _tsHome -
_contextRoot
Context root of target tests -
_generalURI
General file/request URI for both gfiles and tests -
_hostname
Target webserver hostname -
_port
protected int _portTarget webserver port -
_state
protected org.apache.commons.httpclient.HttpState _stateHttpState that may be used for multiple invocations requiring state. -
_testCase
Test case. -
_useSavedState
protected boolean _useSavedStateUse saved state. -
_saveState
protected boolean _saveStateSave state. -
FOLLOW_REDIRECT
Follow redirect. -
_redirect
protected boolean _redirect
-
-
Constructor Details
-
BaseUrlClient
public BaseUrlClient()
-
-
Method Details
-
setTestDir
setTestDir
sets the current test directory.- Parameters:
testDir
- aString
value
-
setGeneralURI
-
setContextRoot
-
getContextRoot
-
setGoldenFileDir
Sets the goldenfile directory- Parameters:
goldenDir
- goldenfile directory based off test directory
-
setup
setup
is by the test harness to initialize the tests.- Parameters:
args
- aString[]
valuep
- aProperties
value- Throws:
Exception
- if an error occurs
-
cleanup
cleanup
is called by the test harness to cleanup after text execution- Throws:
Exception
- if an error occurs
-
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.
- Throws:
Exception
- If an error occurs during the test run
-
setTestProperties
Sets the appropriate test properties based on the values stored in TEST_PROPS- Parameters:
testCase
- aWebTestCase
value
-