public class DefaultRemoteProxy extends BaseRemoteProxy implements TimeoutListener, SelfHealingProxy, CommandListener, TestSessionListener
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_DOWN_POLLING_LIMIT |
static int |
DEFAULT_POLLING_INTERVAL |
static int |
DEFAULT_UNREGISTER_DELAY |
remoteHost| Constructor and Description |
|---|
DefaultRemoteProxy(RegistrationRequest request,
Registry registry) |
| Modifier and Type | Method and Description |
|---|---|
void |
addNewEvent(RemoteException event)
Allow to record when something important about the remote state is detected.
|
void |
afterCommand(TestSession session,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Executed just before the forwards returns.
|
void |
afterSession(TestSession session)
Will be run after the last command is forwarded, but before the proxy slot is released.
|
void |
beforeCommand(TestSession session,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Executed before the hub forwards the request.
|
void |
beforeRelease(TestSession session)
Gives a chance to clean the resources on the remote when the session has timed out.
|
void |
beforeSession(TestSession session)
The client shouldn't have to care where firefox is installed as long as the correct version is
launched, however with webdriver the binary location is specified in the desiredCapability,
making it the responsibility of the person running the test.
|
HtmlRenderer |
getHtmlRender()
Returns the object responsible for rendering any information about the proxy in a Web application.
|
TestSession |
getNewSession(Map<String,Object> requestedCapability)
overwrites the session allocation to discard the proxy that are down.
|
boolean |
isAlive() |
boolean |
isDown() |
void |
onEvent(List<RemoteException> events,
RemoteException lastInserted)
Allow to process the list of all the events that were detected on this Remote so far.
|
void |
startPolling()
start/restart the polling for the remote proxy.
|
void |
stopPolling()
put the polling on hold.
|
void |
teardown()
If the RemoteProxy implementation also implements TimeoutListener, then this method
will stop the thread used to monitor timeouts.
|
compareTo, equals, forceSlotCleanerRun, getCapabilityHelper, getConfig, getHttpClientFactory, getId, getMaxNumberOfConcurrentTestSessions, getNewInstance, getOriginalRegistrationRequest, getRegistry, getRemoteHost, getResourceUsageInPercent, getStatus, getTestSlots, getTimeOut, getTotalUsed, hasCapability, hashCode, isBusy, setupTimeoutListener, toStringpublic static final int DEFAULT_POLLING_INTERVAL
public static final int DEFAULT_UNREGISTER_DELAY
public static final int DEFAULT_DOWN_POLLING_LIMIT
public DefaultRemoteProxy(RegistrationRequest request, Registry registry)
public void beforeRelease(TestSession session)
TimeoutListenerbeforeRelease in interface TimeoutListenerpublic void afterCommand(TestSession session, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
CommandListenerafterCommand in interface CommandListenerpublic void beforeCommand(TestSession session, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
CommandListenerbeforeCommand in interface CommandListenerpublic HtmlRenderer getHtmlRender()
RemoteProxygetHtmlRender in interface RemoteProxygetHtmlRender in class BaseRemoteProxypublic boolean isAlive()
public void startPolling()
SelfHealingProxystartPolling in interface SelfHealingProxypublic void stopPolling()
SelfHealingProxystopPolling in interface SelfHealingProxypublic void addNewEvent(RemoteException event)
SelfHealingProxyaddNewEvent in interface SelfHealingProxypublic void onEvent(List<RemoteException> events, RemoteException lastInserted)
SelfHealingProxyonEvent in interface SelfHealingProxypublic TestSession getNewSession(Map<String,Object> requestedCapability)
getNewSession in interface RemoteProxygetNewSession in class BaseRemoteProxyrequestedCapability - the type of test the client is interested in performing.null otherwisepublic boolean isDown()
public void beforeSession(TestSession session)
For instance if a node registers: {"browserName":"firefox","version":"7.0","firefox_binary":"/home/ff7"} and later on a client requests {"browserName":"firefox","version":"7.0"} , the hub will automatically append the correct binary path to the desiredCapability before it's forwarded to the server. That way the version / install location mapping is done only once at the node level.
beforeSession in interface TestSessionListenerif the setup applies to all the tests.public void afterSession(TestSession session)
TestSessionListenerafterSession in interface TestSessionListenerpublic void teardown()
RemoteProxyteardown in interface RemoteProxyteardown in class BaseRemoteProxyCopyright © 2013. All rights reserved.