| java.lang.Object com.sun.portal.wireless.tests.ClientSession
ClientSession | public class ClientSession (Code) | | Represents a client session. The order of operations is:
- new ClientSession(Device)
- connectLogin()
- sendCredentials()
- ... (add more as necessary)
|
Method Summary | |
public void | doGet(String path, Map params) Sends a GET request with the given parameters to a URL constructed with the
given path. | public void | doPost(String path, Map params) Sends a POST request with the given parameters to a URL constructed
with the given path. | public HttpURLConnection | getConnection() | public String | getCookie() | public void | getDesktop() Gets the portal desktop using the following parameters from the
Configuration class:
- host
- port
- loginUrl
- testLoginA
- testPasswdA
- dtUrl
This method will first call connectLogin and sendCredentials
before sending the GET request to the desktop. | public void | login() Connects to the Identity Server login page, using the following
parameters from the Configuration class:
After this method is called, getConnection() and
getCookie() will return non-null values if the login
connection was successful. | public void | logout() | public void | sendCredentials() Sends user login credentials to an Identity Server auth module,
using the following parameters from the Configuration class:
- loginUrl
- testLoginA
- testPasswdA
connectLogin must be called first. |
doGet | public void doGet(String path, Map params) throws Exception(Code) | | Sends a GET request with the given parameters to a URL constructed with the
given path. The URL is constructed as "http://" + Configuration.host
+ ":" + Configuration.port + "/" + path .
Parameters: path - the path used to construct the URL to GET the request Parameters: params - a Map of parameters and values |
doPost | public void doPost(String path, Map params) throws Exception(Code) | | Sends a POST request with the given parameters to a URL constructed
with the given path. The URL is constructed as "http://" +
Configuration.host + ":" + Configuration.port + "/" + path .
Parameters: path - the path used to construct the URL to POST the request Parameters: params - a Map of parameters and values |
getDesktop | public void getDesktop() throws Exception(Code) | | Gets the portal desktop using the following parameters from the
Configuration class:
- host
- port
- loginUrl
- testLoginA
- testPasswdA
- dtUrl
This method will first call connectLogin and sendCredentials
before sending the GET request to the desktop.
|
login | public void login() throws Exception(Code) | | Connects to the Identity Server login page, using the following
parameters from the Configuration class:
After this method is called, getConnection() and
getCookie() will return non-null values if the login
connection was successful.
|
logout | public void logout() throws Exception(Code) | | Disconnects from the Identity Server, using the following
parameters from the Configuration class:
|
sendCredentials | public void sendCredentials() throws Exception(Code) | | Sends user login credentials to an Identity Server auth module,
using the following parameters from the Configuration class:
- loginUrl
- testLoginA
- testPasswdA
connectLogin must be called first. The auth module is
assumed to take two tokens:
|
|
|