Ajocado API 1.0.0.Alpha2

org.jboss.arquillian.ajocado.framework
Class AjaxSeleniumContext

java.lang.Object
  extended by org.jboss.arquillian.ajocado.framework.AjaxSeleniumContext
All Implemented Interfaces:
InvocationHandler

public final class AjaxSeleniumContext
extends Object
implements InvocationHandler

Context for keeping thread local context of AjaxSelenium.

Provides getProxy() method for accessing that context over model of your tests.

Proxy specifically handles the situations when no context is set - in this situation, runtime exception with IllegalStateException cause is thrown.

Especially, the ExtendedTypedSelenium.isStarted() method is handled in that situation, it returns false instead of throwing exception. Therefore it can be safely used for obtaining current status of Selenium initialization.

Version:
$Revision$
Author:
Lukas Fryc

Method Summary
static AjaxSelenium getProxy()
          Returns the instance of proxy to thread local context of AjaxSelenium
 Object invoke(Object proxy, Method method, Object[] args)
          End point for handling invocations on proxy
static boolean isInitialized()
           
static void set(AjaxSelenium selenium)
          Sets the AjaxSelenium context for current thread
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

set

public static void set(AjaxSelenium selenium)
Sets the AjaxSelenium context for current thread

Parameters:
selenium - the AjaxSelenium instance

isInitialized

public static boolean isInitialized()

getProxy

public static AjaxSelenium getProxy()
Returns the instance of proxy to thread local context of AjaxSelenium

Returns:
the instance of proxy to thread local context of AjaxSelenium

invoke

public Object invoke(Object proxy,
                     Method method,
                     Object[] args)
              throws Throwable
End point for handling invocations on proxy

Specified by:
invoke in interface InvocationHandler
Throws:
Throwable

Ajocado API 1.0.0.Alpha2

Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.