com.ibm.team.fvt.tests.topology
Class Topology

java.lang.Object
  extended by com.ibm.team.fvt.tests.topology.Topology

public abstract class Topology
extends java.lang.Object

Manage the scenario topology. A topology is made of applications (e.g. CLM applications: JTS, CCM, QM, RM, and LPA) which can be deployed either on collocated or distributed machines.

The topology has a baseUrl computed from "baseUrl" parameter. Each application might have its own address if the "baseUrlAPPLI" parameter is specified.

The topology manages user login to each application and typically provides service to know whether a login is necessary before going to a specific location.


Constructor Summary
Topology()
          Initialize the topology from a given CLM version.
 
Method Summary
 Application getApplication(java.lang.String url)
          Return the application matching the given url address.
 java.util.List<Application> getApplications()
          Return the list of application titles
 User getLoggedUser(java.lang.String url)
           
 java.lang.String getPageUrl(java.lang.String currentUrl)
          Return the modified page URL if necessary.
abstract  boolean isDistributed()
          Returns whether this topology is distributed across multiple servers
 boolean login(java.lang.String location, User user)
          Login the given user to the application matching the given location and do the same for all other applications on the same server.
 boolean logout(java.lang.String location)
          Logout the given user from the application matching the given location and do the same for all other applications on the same server.
 void logoutApplications()
          Logs out all applications, regardless of the user currently logged in.
 boolean needLogin(java.lang.String location, User user)
          Returns whether the given user needs to login before accessing the given location.
 boolean onSameHost(Application firstApp, Application secondApp)
          Return whether two applications are hosted on the same server.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Topology

public Topology()
Initialize the topology from a given CLM version.

Method Detail

getApplication

public Application getApplication(java.lang.String url)
Return the application matching the given url address.

Parameters:
url - The address
Returns:
The Application corresponding to the given address.
Throws:
ScenarioFailedError - If not application is found for the given address.

getApplications

public java.util.List<Application> getApplications()
Return the list of application titles

Returns:
All the supported applications during the test scenario as a List of Application.

getLoggedUser

public User getLoggedUser(java.lang.String url)

getPageUrl

public java.lang.String getPageUrl(java.lang.String currentUrl)
Return the modified page URL if necessary.

Returns:
The page URL as a String.
See Also:
Application.getPageUrl(String)

isDistributed

public abstract boolean isDistributed()
Returns whether this topology is distributed across multiple servers

Returns:
true if the topology is distributed, false otherwise

login

public boolean login(java.lang.String location,
                     User user)
Login the given user to the application matching the given location and do the same for all other applications on the same server.

Parameters:
location - The location concerned by the login
user - The user concerned by the login
Returns:
true if the user was changed on the application from which the location belongs to, false otherwise.

logout

public boolean logout(java.lang.String location)
Logout the given user from the application matching the given location and do the same for all other applications on the same server.

Parameters:
location - The location concerned by the logout

logoutApplications

public void logoutApplications()
Logs out all applications, regardless of the user currently logged in.


needLogin

public boolean needLogin(java.lang.String location,
                         User user)
Returns whether the given user needs to login before accessing the given location.

Parameters:
location - The location to go to
user - The user to use when going to the location
Returns:
true if the user has never accessed to the application matching the location and neither to no any other application of the same server, false otherwise.

onSameHost

public boolean onSameHost(Application firstApp,
                          Application secondApp)
Return whether two applications are hosted on the same server.

Parameters:
firstApp - The first application to check
secondApp - The second application to check
Returns:
true if the two applications are on the same server, false otherwise