use of org.apache.wicket.util.tester.apps_1.Book in project wicket by apache.
the class WicketTesterTest method bookmarkableLink.
/**
* @throws Exception
*/
@Test
public void bookmarkableLink() throws Exception {
// for WebPage without default constructor, I define a TestPageSource to
// let the page be instatiated lately.
Book mockBook = new Book("xxId", "xxName");
tester.startPage(new ViewBook(mockBook));
// assertion
tester.assertRenderedPage(ViewBook.class);
tester.clickLink("link");
tester.assertRenderedPage(CreateBook.class);
}
use of org.apache.wicket.util.tester.apps_1.Book in project wicket by apache.
the class WicketTesterTest method viewBook.
/**
* @throws Exception
*/
@Test
public void viewBook() throws Exception {
Book mockBook = new Book("xxId", "xxName");
Page page = new ViewBook(mockBook);
tester.startPage(page);
// assertion
tester.assertRenderedPage(ViewBook.class);
tester.assertLabel("id", "xxId");
tester.assertLabel("name", "xxName");
}
use of org.apache.wicket.util.tester.apps_1.Book in project wicket by apache.
the class WicketTesterTest method pageConstructor.
/**
* @throws Exception
*/
@Test
public void pageConstructor() throws Exception {
Book mockBook = new Book("xxId", "xxName");
Page page = new ViewBook(mockBook);
tester.startPage(page);
// assertion
tester.assertRenderedPage(ViewBook.class);
tester.clickLink("link");
tester.assertRenderedPage(CreateBook.class);
}
use of org.apache.wicket.util.tester.apps_1.Book in project wicket by apache.
the class FormTesterTest method before.
/**
*/
@Before
public void before() {
books = new Book[] { new Book("1", "book1"), new Book("2", "book2"), new Book("3", "book3"), new Book("4", "book4") };
choicePage = tester.startPage(new ChoicePage(Arrays.asList(books)));
formTester = tester.newFormTester("choiceForm");
}
Aggregations