new NonFacesRequest("/main.xhtml") {
@Override
protected void renderResponse()
{
ListDataModel bookings = (ListDataModel) getInstance("bookings");
assert bookings.getRowCount()==1;
bookings.setRowIndex(0);
Booking booking = (Booking) bookings.getRowData();
assert booking.getHotel().getCity().equals("NY");
assert booking.getUser().getUsername().equals("gavin");
assert !Manager.instance().isLongRunningConversation();
}
}.run();
new FacesRequest("/main.xhtml") {
@Override
protected void invokeApplication()
{
ListDataModel bookings = (ListDataModel) Contexts.getSessionContext().get("bookings");
bookings.setRowIndex(0);
invokeAction("#{bookingList.cancel}");
}
@Override
protected void renderResponse()
{
ListDataModel bookings = (ListDataModel) Contexts.getSessionContext().get("bookings");
assert bookings.getRowCount()==0;
assert !Manager.instance().isLongRunningConversation();
}
}.run();