com.togethersoft.testing.shared
Class ServerURL


public class ServerURL

Provides convienient way to send commands to test server.
ITestAsset asset = ....;
ServerURL url = new ServerURL( asset ); // construct URL to communicate with test server
url.setCommand("myCommand"); // set a command to execute at server in request string
url.addParameter("myParameter" , "myValue"); // add string parameter to command in request string. (optional )
InputStream in = url.openStream(); // open stream and read response from server


Field Summary
 private final static CategoryLOG
           
 private StringmyCommand
           
 private StringmyRequestString
           
 private URLmyServer
           
 private StringmyStringRepresentation
           

Constructor Summary
ServerURL(ITestAssetRO asset, String refid)
          Creates a new server URL for given asset and reference id.
ServerURL(ITestAssetRO asset)
          Creates new server URL for given asset

Method Summary
 voidaddParameter(String key, String value)
          Adds a parameter (a key-value pair) to the URL
 URLgetServer()
          Returns the URL of the server
 InputStreamopenStream()
          Returns the input stream of this server URL
 voidsetCommand(String command)
          Sets the command in this server URL.
 StringtoString()
          Converts the string representation of this URL.

Field Detail

LOG

private final static Category LOG

myCommand

private String myCommand

myRequestString

private String myRequestString

myServer

private URL myServer

myStringRepresentation

private String myStringRepresentation
Constructor Detail

ServerURL

public ServerURL(ITestAssetRO asset, String refid)
Creates a new server URL for given asset and reference id.

ServerURL

public ServerURL(ITestAssetRO asset)
Creates new server URL for given asset
Method Detail

addParameter

public void addParameter(String key, String value)
Adds a parameter (a key-value pair) to the URL

getServer

public URL getServer()
Returns the URL of the server

openStream

public InputStream openStream()
throws java.io.IOException
Returns the input stream of this server URL

setCommand

public void setCommand(String command)
Sets the command in this server URL.

toString

public String toString()
Converts the string representation of this URL.

Association Links

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String

to Class java.net.URL