Package com.sun.ts.tests.common.web
Class WebServer
java.lang.Object
com.sun.ts.tests.common.web.WebServer
Facade class to ease client access to a TS test deployed in the Web container. Shield clients from underlying TS and
HTPP indiosyncrasies.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected URLConnectionprotected Stringprotected intprotected Propertiesprotected static final Stringprotected static final Stringprotected static final Stringprotected URLprotected static final Stringprotected static final String -
Method Summary
Modifier and TypeMethodDescriptioncall(String webFile, String testName, Properties args) Call test 'testName' in web component deployed as 'webFile', passing 'args' as input parameters.static WebServernewInstance(Properties props) Factory method to build a WebServer object from TS props parsing relevant properties.protected static voidprintConfigError(String msg) Convenience method to print TS configuration error messagesbooleanCall test 'testName' in web component deployed as 'webFile'.
-
Field Details
-
PROTOCOL
- See Also:
-
WEB_HOST_PROP
- See Also:
-
WEB_PORT_PROP
- See Also:
-
RESULT_PROP
- See Also:
-
TEST_NAME_PROP
- See Also:
-
host
-
port
protected int port -
url
-
conn
-
props
-
-
Method Details
-
newInstance
Factory method to build a WebServer object from TS props parsing relevant properties.- Throws:
IllegalArgumentException
-
test
Call test 'testName' in web component deployed as 'webFile'.- Parameters:
webFile- file component (see java.net.URL) of the url the web component mapped to.testName- Name of the test to run in this web component.- Returns:
- true if test pass. false otherwise.
-
call
public Properties call(String webFile, String testName, Properties args) throws IllegalArgumentException Call test 'testName' in web component deployed as 'webFile', passing 'args' as input parameters.- Parameters:
webFile- file component (see java.net.URL) of the url the web component mapped to.testName- Name of the test to run in this web component.args- input parameters in a Properties object. This object need at least to have valid TS harness logging properties;- Returns:
- output parameters in a Properties object. Return null if a problem occured or test failed.
- Throws:
IllegalArgumentException
-
printConfigError
Convenience method to print TS configuration error messages
-