java.lang.Object
org.apache.wicket.util.tester.WicketTesterHelper
A
WicketTester-specific helper class.- Since:
- 1.2.6
- Author:
- Ingram Chen
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classComponentDataclass. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringasLined(Collection<?> objects) AtoStringmethod for the givenCollection.static voidassertEquals(Collection<?> expects, Collection<?> actuals) Asserts that bothCollections contain the same elements.static voidfailWithVerboseMessage(Collection<?> expects, Collection<?> actuals) Fails with a verbose error message.static AjaxEventBehaviorfindAjaxEventBehavior(Component component, String event) Finds the first AjaxEventBehavior attached to the specified component with the specified event.static List<AjaxEventBehavior>findAjaxEventBehaviors(Component component, String event) Finds all AjaxEventBehavior's attached to the specified component with the specified event.static BehaviorfindBehavior(Component component, Class<? extends Behavior> behaviorClass) static List<WicketTesterHelper.ComponentData>getComponentData(Page page) Gets recursively allComponents of a givenPage, extracts the information relevant to us, and adds them to aList.
-
Constructor Details
-
WicketTesterHelper
public WicketTesterHelper()
-
-
Method Details
-
getComponentData
Gets recursively allComponents of a givenPage, extracts the information relevant to us, and adds them to aList.- Parameters:
page- thePageto analyze- Returns:
- a
ListofComponentdata objects
-
assertEquals
Asserts that bothCollections contain the same elements.- Parameters:
expects- aCollectionobjectactuals- aCollectionobject
-
failWithVerboseMessage
Fails with a verbose error message.- Parameters:
expects- aCollectionobjectactuals- aCollectionobject
-
asLined
AtoStringmethod for the givenCollection.- Parameters:
objects- aCollectionobject- Returns:
- a
Stringrepresentation of theCollection
-
findAjaxEventBehavior
Finds the first AjaxEventBehavior attached to the specified component with the specified event.- Parameters:
component-event-- Returns:
- the first behavior for this event, or
null
-
findAjaxEventBehaviors
Finds all AjaxEventBehavior's attached to the specified component with the specified event.- Parameters:
component-event-- Returns:
- a list of all found AjaxEventBehavior or an empty list
-
findBehavior
- Parameters:
component-behaviorClass-- Returns:
- Behavior or null
-