{
@Override
protected void updateModelValues() throws Exception
{
BlogEntry entry = (BlogEntry) getInstance("blogEntry");
entry.setId("testing");
entry.setTitle("Integration testing Seam applications is easy!");
entry.setBody("This post is about SeamTest...");
}
@Override
protected void invokeApplication() throws Exception
{
// post now returns void
// assert invokeMethod("#{postAction.post}").equals("/index.xhtml");
invokeMethod("#{postAction.post}");
setOutcome("/index.xhtml");
}
@Override
protected void afterRequest()
{
assert isInvokeApplicationComplete();
assert !isRenderResponseBegun();
}
}.run();
new NonFacesRequest("/index.xhtml")
{
@Override
protected void renderResponse() throws Exception
{
List<BlogEntry> blogEntries = ( (Blog) getInstance(BlogService.class) ).getBlogEntries();
assert blogEntries.size()==4;
BlogEntry blogEntry = blogEntries.get(0);
assert blogEntry.getId().equals("testing");
assert blogEntry.getBody().equals("This post is about SeamTest...");
assert blogEntry.getTitle().equals("Integration testing Seam applications is easy!");
}
}.run();
new FacesRequest()