Package org.apache.wicket.util.tester
Class WicketTesterHelper
- java.lang.Object
-
- org.apache.wicket.util.tester.WicketTesterHelper
-
public class WicketTesterHelper extends java.lang.ObjectAWicketTester-specific helper class.- Since:
- 1.2.6
- Author:
- Ingram Chen
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classWicketTesterHelper.ComponentDataComponentDataclass.
-
Constructor Summary
Constructors Constructor Description WicketTesterHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringasLined(java.util.Collection<?> objects)AtoStringmethod for the givenCollection.static voidassertEquals(java.util.Collection<?> expects, java.util.Collection<?> actuals)Asserts that bothCollections contain the same elements.static voidfailWithVerboseMessage(java.util.Collection<?> expects, java.util.Collection<?> actuals)Fails with a verbose error message.static AjaxEventBehaviorfindAjaxEventBehavior(Component component, java.lang.String event)Finds the first AjaxEventBehavior attached to the specified component with the specified event.static java.util.List<AjaxEventBehavior>findAjaxEventBehaviors(Component component, java.lang.String event)Finds all AjaxEventBehavior's attached to the specified component with the specified event.static BehaviorfindBehavior(Component component, java.lang.Class<? extends Behavior> behaviorClass)static java.util.List<WicketTesterHelper.ComponentData>getComponentData(Page page)Gets recursively allComponents of a givenPage, extracts the information relevant to us, and adds them to aList.
-
-
-
Method Detail
-
getComponentData
public static java.util.List<WicketTesterHelper.ComponentData> getComponentData(Page page)
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
public static void assertEquals(java.util.Collection<?> expects, java.util.Collection<?> actuals)Asserts that bothCollections contain the same elements.- Parameters:
expects- aCollectionobjectactuals- aCollectionobject
-
failWithVerboseMessage
public static void failWithVerboseMessage(java.util.Collection<?> expects, java.util.Collection<?> actuals)Fails with a verbose error message.- Parameters:
expects- aCollectionobjectactuals- aCollectionobject
-
asLined
public static java.lang.String asLined(java.util.Collection<?> objects)
AtoStringmethod for the givenCollection.- Parameters:
objects- aCollectionobject- Returns:
- a
Stringrepresentation of theCollection
-
findAjaxEventBehavior
public static AjaxEventBehavior findAjaxEventBehavior(Component component, java.lang.String event)
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
public static java.util.List<AjaxEventBehavior> findAjaxEventBehaviors(Component component, java.lang.String event)
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
-
-