Class WicketTesterHelper

java.lang.Object
org.apache.wicket.util.tester.WicketTesterHelper

public class WicketTesterHelper extends Object
A WicketTester-specific helper class.
Since:
1.2.6
Author:
Ingram Chen
  • Constructor Details

  • Method Details

    • getComponentData

      Gets recursively all Components of a given Page, extracts the information relevant to us, and adds them to a List.
      Parameters:
      page - the Page to analyze
      Returns:
      a List of Component data objects
    • assertEquals

      public static void assertEquals(Collection<?> expects, Collection<?> actuals)
      Asserts that both Collections contain the same elements.
      Parameters:
      expects - a Collection object
      actuals - a Collection object
    • failWithVerboseMessage

      public static void failWithVerboseMessage(Collection<?> expects, Collection<?> actuals)
      Fails with a verbose error message.
      Parameters:
      expects - a Collection object
      actuals - a Collection object
    • asLined

      public static String asLined(Collection<?> objects)
      A toString method for the given Collection.
      Parameters:
      objects - a Collection object
      Returns:
      a String representation of the Collection
    • 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