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 SummaryNested classes/interfaces inherited from class com.sun.ts.lib.harness.EETestEETest.Fault, EETest.SetupException
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected StringContext root of target testsprotected StringGeneral file/request URI for both gfiles and testsprotected StringTarget webserver hostnameprotected intTarget webserver portProperties parametersprotected booleanprotected booleanSave state.protected org.apache.commons.httpclient.HttpStateHttpState that may be used for multiple invocations requiring state.protected WebTestCaseTest case.protected StringCurrent test nameprotected Stringlocation of _tsHomeprotected booleanUse saved state.protected static final StringBasic Auth passwordprotected static final StringBasic Auth realmprotected static final StringBasic Auth usernameprotected static final StringContent propertyprotected static final String100 - continueprotected static final String201 - createdprotected static final StringExpect response body propertyprotected static final StringExpected headers propertyprotected StringFollow redirect.protected static final String403 - Forbiddenprotected static final StringDefault request methodprotected static final StringGoldenfile suffixprotected static final StringGoldenfile propertyprotected StringGoldenfile directoryprotected static final String410 - GONEprotected static final StringHTTP 1.0protected static final StringHTTP 1.1protected static final StringIgnore response bodyprotected static final StringIgnore HTTP status codesprotected static final String500 - internal server errorprotected static final StringJSP suffixprotected static final String411 - length requiredprotected static final String302 - moved temporarilyprotected static final String404 - not foundprotected static final String200 - okprotected static final StringReason-Phrase propertyprotected static final StringRequest propertyprotected static final StringRequest headers propertyprotected static final StringResponse Match propertyprotected static final StringSave current HTTP state.protected static final StringSearch string propertyprotected static final StringSearch string case insensitive propertyprotected static final String503 - service unavailableprotected static final StringTS Webserver host propertyprotected static final StringTS Webserver port propertyprotected static final StringForward slashprotected static final StringStandard test propertyprotected static final StringStatusCode propertyprotected static final StringValidation strategyprotected static final StringTest name propertyprotected static final PropertiesTest propertiesprotected StringCurrent test directoryprotected static final StringTS home propertyprotected static final String401 - Unauthorizedprotected static final StringUnexpected header propertyprotected static final StringUnexpected response match propertyprotected static final StringUnordered search string propertyprotected static final StringUse any saved stateFields inherited from class com.sun.ts.lib.harness.EETesterr, iLogDelaySeconds, log, sTestCase
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidcleanup()cleanupis called by the test harness to cleanup after text executionprotected voidinvoke()Invokes a test based on the properties stored in TEST_PROPS.voidsetContextRoot(String root) voidsetGeneralURI(String URI) voidsetGoldenFileDir(String goldenDir) Sets the goldenfile directoryvoidsetTestDir(String testDir) setTestDirsets the current test directory.protected voidsetTestProperties(WebTestCase testCase) Sets the appropriate test properties based on the values stored in TEST_PROPSvoidsetup(String[] args, Properties p) setupis by the test harness to initialize the tests.Methods inherited from class com.sun.ts.lib.harness.EETestgetPropsReady, getTestPropsFromArgs, initializeProperties, logErr, logErr, logMsg, logTrace, logTrace, run, run, run, run, runAllTestCases, setTestStatus
- 
Field Details- 
_propsProperties parameters
- 
UNAUTHORIZED401 - Unauthorized- See Also:
 
- 
FORBIDDEN403 - Forbidden- See Also:
 
- 
NOT_FOUND404 - not found- See Also:
 
- 
OK200 - ok- See Also:
 
- 
CREATED201 - created- See Also:
 
- 
INTERNAL_SERVER_ERROR500 - internal server error- See Also:
 
- 
SERVICE_UNAVAILABLE503 - service unavailable- See Also:
 
- 
CONTINUE100 - continue- See Also:
 
- 
MOVED_TEMPORARY302 - moved temporarily- See Also:
 
- 
GONE410 - GONE- See Also:
 
- 
LENGTH_REQUIRED411 - length required- See Also:
 
- 
SERVLETHOSTPROPTS Webserver host property- See Also:
 
- 
SERVLETPORTPROPTS Webserver port property- See Also:
 
- 
TSHOMETS home property- See Also:
 
- 
TEST_PROPSTest properties
- 
STATUS_CODEStatusCode property- See Also:
 
- 
REASON_PHRASEReason-Phrase property- See Also:
 
- 
EXPECTED_HEADERSExpected headers property- See Also:
 
- 
UNEXPECTED_HEADERSUnexpected header property- See Also:
 
- 
EXPECT_RESPONSE_BODYExpect response body property- See Also:
 
- 
REQUESTRequest property- See Also:
 
- 
REQUEST_HEADERSRequest headers property- See Also:
 
- 
GOLDENFILEGoldenfile property- See Also:
 
- 
SEARCH_STRINGSearch string property- See Also:
 
- 
SEARCH_STRING_IGNORE_CASESearch string case insensitive property- See Also:
 
- 
BASIC_AUTH_USERBasic Auth username- See Also:
 
- 
BASIC_AUTH_PASSWDBasic Auth password- See Also:
 
- 
BASIC_AUTH_REALMBasic Auth realm- See Also:
 
- 
UNORDERED_SEARCH_STRINGUnordered search string property- See Also:
 
- 
CONTENTContent property- See Also:
 
- 
TEST_NAMETest name property- See Also:
 
- 
RESPONSE_MATCHResponse Match property- See Also:
 
- 
UNEXPECTED_RESPONSE_MATCHUnexpected response match property- See Also:
 
- 
STANDARDStandard test property- See Also:
 
- 
IGNORE_BODYIgnore response body- See Also:
 
- 
STRATEGYValidation strategy- See Also:
 
- 
TESTDIRCurrent test directory
- 
GOLDENFILEDIRGoldenfile directory
- 
GETDefault request method- See Also:
 
- 
HTTP10HTTP 1.0- See Also:
 
- 
HTTP11HTTP 1.1- See Also:
 
- 
SLForward slash- See Also:
 
- 
GF_SUFFIXGoldenfile suffix- See Also:
 
- 
JSP_SUFFIXJSP suffix- See Also:
 
- 
USE_SAVED_STATEUse any saved state- See Also:
 
- 
SAVE_STATESave current HTTP state.- See Also:
 
- 
IGNORE_STATUS_CODEIgnore HTTP status codes- See Also:
 
- 
_testNameCurrent test name
- 
_tsHomelocation of _tsHome
- 
_contextRootContext root of target tests
- 
_generalURIGeneral file/request URI for both gfiles and tests
- 
_hostnameTarget webserver hostname
- 
_portprotected int _portTarget webserver port
- 
_stateprotected org.apache.commons.httpclient.HttpState _stateHttpState that may be used for multiple invocations requiring state.
- 
_testCaseTest case.
- 
_useSavedStateprotected boolean _useSavedStateUse saved state.
- 
_saveStateprotected boolean _saveStateSave state.
- 
FOLLOW_REDIRECTFollow redirect.
- 
_redirectprotected boolean _redirect
 
- 
- 
Constructor Details- 
BaseUrlClientpublic BaseUrlClient()
 
- 
- 
Method Details- 
setTestDirsetTestDirsets the current test directory.- Parameters:
- testDir- a- Stringvalue
 
- 
setGeneralURI
- 
setContextRoot
- 
getContextRoot
- 
setGoldenFileDirSets the goldenfile directory- Parameters:
- goldenDir- goldenfile directory based off test directory
 
- 
setupsetupis by the test harness to initialize the tests.- Parameters:
- args- a- String[]value
- p- a- Propertiesvalue
- Throws:
- Exception- if an error occurs
 
- 
cleanupcleanupis called by the test harness to cleanup after text execution- Throws:
- Exception- if an error occurs
 
- 
invokeInvokes 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
 
- 
setTestPropertiesSets the appropriate test properties based on the values stored in TEST_PROPS- Parameters:
- testCase- a- WebTestCasevalue
 
 
-