Package org.apache.wicket.util.tester
Class WicketTesterHelper
- java.lang.Object
-
- org.apache.wicket.util.tester.WicketTesterHelper
-
public class WicketTesterHelper extends Object
AWicketTester
-specific helper class.- Since:
- 1.2.6
- Author:
- Ingram Chen
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
WicketTesterHelper.ComponentData
ComponentData
class.
-
Constructor Summary
Constructors Constructor Description WicketTesterHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
asLined(Collection<?> objects)
AtoString
method for the givenCollection
.static void
assertEquals(Collection<?> expects, Collection<?> actuals)
Asserts that bothCollection
s contain the same elements.static void
failWithVerboseMessage(Collection<?> expects, Collection<?> actuals)
Fails with a verbose error message.static AjaxEventBehavior
findAjaxEventBehavior(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 Behavior
findBehavior(Component component, Class<? extends Behavior> behaviorClass)
static List<WicketTesterHelper.ComponentData>
getComponentData(Page page)
Gets recursively allComponent
s of a givenPage
, extracts the information relevant to us, and adds them to aList
.
-
-
-
Constructor Detail
-
WicketTesterHelper
public WicketTesterHelper()
-
-
Method Detail
-
getComponentData
public static List<WicketTesterHelper.ComponentData> getComponentData(Page page)
Gets recursively allComponent
s of a givenPage
, extracts the information relevant to us, and adds them to aList
.- Parameters:
page
- thePage
to analyze- Returns:
- a
List
ofComponent
data objects
-
assertEquals
public static void assertEquals(Collection<?> expects, Collection<?> actuals)
Asserts that bothCollection
s contain the same elements.- Parameters:
expects
- aCollection
objectactuals
- aCollection
object
-
failWithVerboseMessage
public static void failWithVerboseMessage(Collection<?> expects, Collection<?> actuals)
Fails with a verbose error message.- Parameters:
expects
- aCollection
objectactuals
- aCollection
object
-
asLined
public static String asLined(Collection<?> objects)
AtoString
method for the givenCollection
.- Parameters:
objects
- aCollection
object- Returns:
- a
String
representation of theCollection
-
findAjaxEventBehavior
public static AjaxEventBehavior findAjaxEventBehavior(Component component, 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 List<AjaxEventBehavior> findAjaxEventBehaviors(Component component, 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
-
findBehavior
public static Behavior findBehavior(Component component, Class<? extends Behavior> behaviorClass)
- Parameters:
component
-behaviorClass
-- Returns:
- Behavior or null
-
-