org.viewaframework.test.component
Class AbstractComponentTrapper<T extends Component>

java.lang.Object
  extended by org.viewaframework.test.component.AbstractComponentTrapper<T>
Type Parameters:
T -
All Implemented Interfaces:
ApplicationTrapperAware, ViewTrapperAware, Trapper<T>
Direct Known Subclasses:
AbstractButtonTrapper, AbstractTextTrapper, CheckBoxTrapper, ComboTrapper, ListTrapper

public abstract class AbstractComponentTrapper<T extends Component>
extends Object
implements Trapper<T>, ApplicationTrapperAware, ViewTrapperAware

Author:
Mario Garcia

Constructor Summary
AbstractComponentTrapper(ApplicationTrapper applicationTrapper, String componentName)
           
AbstractComponentTrapper(ApplicationTrapper applicationTrapper, String viewId, String componentName)
           
 
Method Summary
 ApplicationTrapper applicationTrapper()
           
 T getTarget()
           
abstract  AbstractComponentTrapper<T> requireEnabled()
          Checks that the component is enabled otherwise the test will fail
abstract  AbstractComponentTrapper<T> requireEnabled(boolean enabled)
          Checks whether the component is enabled or not
abstract  AbstractComponentTrapper<T> requireVisible()
          Checks the component is visible otherwise the test will fail
abstract  AbstractComponentTrapper<T> requireVisible(boolean visible)
          Checks whether the component is visible or not
 void setTarget(T target)
           
 ViewTrapper view()
           
 ViewTrapper view(String viewId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.viewaframework.test.Trapper
getType, log
 

Constructor Detail

AbstractComponentTrapper

public AbstractComponentTrapper(ApplicationTrapper applicationTrapper,
                                String componentName)
Parameters:
applicationTrapper -
componentName -

AbstractComponentTrapper

public AbstractComponentTrapper(ApplicationTrapper applicationTrapper,
                                String viewId,
                                String componentName)
Parameters:
applicationTrapper -
viewId -
componentName -
Method Detail

applicationTrapper

public ApplicationTrapper applicationTrapper()
Specified by:
applicationTrapper in interface ApplicationTrapperAware

getTarget

public T getTarget()
Specified by:
getTarget in interface Trapper<T extends Component>
Returns:

requireEnabled

public abstract AbstractComponentTrapper<T> requireEnabled()
Checks that the component is enabled otherwise the test will fail

Returns:

requireVisible

public abstract AbstractComponentTrapper<T> requireVisible()
Checks the component is visible otherwise the test will fail

Returns:

requireEnabled

public abstract AbstractComponentTrapper<T> requireEnabled(boolean enabled)
Checks whether the component is enabled or not

Returns:

requireVisible

public abstract AbstractComponentTrapper<T> requireVisible(boolean visible)
Checks whether the component is visible or not

Returns:

setTarget

public void setTarget(T target)
Specified by:
setTarget in interface Trapper<T extends Component>

view

public ViewTrapper view()
Specified by:
view in interface ViewTrapperAware
Returns:

view

public ViewTrapper view(String viewId)
Specified by:
view in interface ViewTrapperAware
Returns:


Copyright © 2010. All Rights Reserved.