jdave.wicket
Class ComponentSpecification<T extends org.apache.wicket.Component>

java.lang.Object
  extended by jdave.ContainmentSupport
      extended by jdave.mock.MockSupport
          extended by jdave.Specification<T>
              extended by jdave.wicket.ComponentSpecification<T>

public abstract class ComponentSpecification<T extends org.apache.wicket.Component>
extends jdave.Specification<T>

A base class for Wicket's MarkupContainer specifications.

Author:
Joni Freeman

Field Summary
protected  org.apache.wicket.util.tester.BaseWicketTester wicket
           
 
Fields inherited from class jdave.Specification
be, context, does, should
 
Constructor Summary
ComponentSpecification()
           
 
Method Summary
 org.apache.wicket.markup.html.list.ListItem itemAt(org.apache.wicket.markup.html.list.ListView view, int index)
          Select an item from a ListView.
 org.apache.wicket.markup.repeater.Item itemAt(org.apache.wicket.markup.repeater.RefreshingView view, int index)
          Select an item from a RefreshingView.
 java.util.List<?> modelObjects(java.util.Iterator<?> components)
          Collect model objects from given components.
protected  org.apache.wicket.protocol.http.WebApplication newApplication()
          Create the application for the specification.
protected abstract  T newComponent(java.lang.String id, org.apache.wicket.model.IModel model)
          Create a new instance of a Wicket component to be specified.
protected  org.apache.wicket.util.tester.BaseWicketTester newWicketTester()
          Create a WicketTester for the specification.
 T startComponent()
          Start container for context.
 T startComponent(org.apache.wicket.model.IModel model)
          Start container for context.
 void startComponentWithoutMarkup(org.apache.wicket.model.IModel model)
           
 
Methods inherited from class jdave.Specification
addListener, create, destroy, equal, equal, equal, fireAfterContextCreation, fireAfterContextDestroy, fireAfterContextInstantiation, needsThreadLocalIsolation, not, raise, raise, raiseExactly, raiseExactly, satisfies, specify, specify, specify, specify, specify, specify, specify, specify, specify, specify, specify, specify, specify, specify, specify, specify, specify, specify, specify, specify, specify, specify, specify, specify, specify, where
 
Methods inherited from class jdave.mock.MockSupport
checking, mock, mock, mockery, sequence, setDefaultResultForType, states, verifyMocks
 
Methods inherited from class jdave.ContainmentSupport
contain, containAll, containAll, containAll, containAll, containAll, containAll, containAll, containAll, containAll, containAll, containAny, containAny, containAny, containAny, containAny, containAny, containAny, containAny, containAny, containAny, containExactly, containExactly, containExactly, containExactly, containExactly, containExactly, containExactly, containExactly, containExactly, containExactly, containInOrder, containInOrder, containInOrder, containInOrder, containInOrder, containInOrder, containInOrder, containInOrder, containInOrder, containInOrder, containInPartialOrder, containInPartialOrder, containInPartialOrder, containInPartialOrder, containInPartialOrder, containInPartialOrder, containInPartialOrder, containInPartialOrder, containInPartialOrder, containInPartialOrder, contains, containsAll, containsAll, containsAll, containsAll, containsAll, containsAll, containsAll, containsAll, containsAll, containsAll, containsAny, containsAny, containsAny, containsAny, containsAny, containsAny, containsAny, containsAny, containsAny, containsAny, containsExactly, containsExactly, containsExactly, containsExactly, containsExactly, containsExactly, containsExactly, containsExactly, containsExactly, containsExactly, containsInOrder, containsInOrder, containsInOrder, containsInOrder, containsInOrder, containsInOrder, containsInOrder, containsInOrder, containsInOrder, containsInOrder, containsInPartialOrder, containsInPartialOrder, containsInPartialOrder, containsInPartialOrder, containsInPartialOrder, containsInPartialOrder, containsInPartialOrder, containsInPartialOrder, containsInPartialOrder, containsInPartialOrder, newAllContainment, newAllContainment, newAllContainment, newAnyContainment, newAnyContainment, newAnyContainment, newExactContainment, newExactContainment, newExactContainment, newInOrderContainment, newInOrderContainment, newInOrderContainment, newInPartialOrderContainment, newInPartialOrderContainment, newInPartialOrderContainment, newObjectContainment
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

wicket

protected final org.apache.wicket.util.tester.BaseWicketTester wicket
Constructor Detail

ComponentSpecification

public ComponentSpecification()
Method Detail

startComponent

public T startComponent()
Start container for context.


startComponent

public T startComponent(org.apache.wicket.model.IModel model)
Start container for context.

Parameters:
model - The model passed to container that is used for context.

startComponentWithoutMarkup

public void startComponentWithoutMarkup(org.apache.wicket.model.IModel model)

itemAt

public org.apache.wicket.markup.repeater.Item itemAt(org.apache.wicket.markup.repeater.RefreshingView view,
                                                     int index)
Select an item from a RefreshingView.


itemAt

public org.apache.wicket.markup.html.list.ListItem itemAt(org.apache.wicket.markup.html.list.ListView view,
                                                          int index)
Select an item from a ListView.


modelObjects

public java.util.List<?> modelObjects(java.util.Iterator<?> components)
Collect model objects from given components.


newWicketTester

protected org.apache.wicket.util.tester.BaseWicketTester newWicketTester()
Create a WicketTester for the specification.

By default, WicketTester is created as:

return new BaseWicketTester(newApplication());
So, it is possible to overwrite newApplication if you just need a different Application for a specification.

See Also:
newApplication()

newApplication

protected org.apache.wicket.protocol.http.WebApplication newApplication()
Create the application for the specification.


newComponent

protected abstract T newComponent(java.lang.String id,
                                  org.apache.wicket.model.IModel model)
Create a new instance of a Wicket component to be specified.

The component must get given id. If the component is a Page, the id is null.

Parameters:
id - The id of a component, null if the component is a Page,
model - A model for the component which was passed in startComponent method.
See Also:
startComponent(IModel)


Copyright © 2007. All Rights Reserved.