use of org.apache.wicket.util.tester.WicketTester in project wicket by apache.
the class ImagesTest method testImages.
/**
* Test page.
*
* @throws Exception
*/
@Test
public void testImages() throws Exception {
WicketTester tester = new WicketTester(new ImagesApplication());
try {
tester.startPage(Home.class);
tester.assertContains("Wicket Examples - images");
} finally {
tester.destroy();
}
}
use of org.apache.wicket.util.tester.WicketTester in project wicket by apache.
the class LibraryTest method test_1.
/**
* Test page.
*
* @throws Exception
*/
@Test
public void test_1() throws Exception {
WicketTester tester = new WicketTester(new LibraryApplication());
try {
tester.startPage(SignIn.class);
tester.assertContains("Wicket Examples - library");
tester.assertContains("Username and password are both");
FormTester formTester = tester.newFormTester("signInPanel:signInForm");
formTester.setValue("username", "wicket");
formTester.setValue("password", "wicket");
formTester.submit();
tester.assertRenderedPage(Home.class);
tester.assertContains("Wicket Examples - library");
tester.assertLabel("books:0:author", "Effective Java (Joshua Bloch)");
} finally {
tester.destroy();
}
}
use of org.apache.wicket.util.tester.WicketTester in project wicket by apache.
the class NiceUrlTest method before.
/**
*/
@Before
public void before() {
tester = new WicketTester(new NiceUrlApplication());
tester.startPage(Home.class);
}
use of org.apache.wicket.util.tester.WicketTester in project wicket by apache.
the class VelocityJavaScriptContributorTest method testRenderHead.
/**
* Test that the header contribution is added correctly.
*/
@Test
public void testRenderHead() {
WicketTester tester = new WicketTester();
try {
tester.startPage(VelocityJavaScriptPage.class);
System.out.println(tester.getLastResponseAsString());
tester.assertContains("msg1: " + VelocityJavaScriptPage.MSG1);
} finally {
tester.destroy();
}
}
use of org.apache.wicket.util.tester.WicketTester in project wicket by apache.
the class SignInPanelTest method instantiateJustOnce.
/**
* https://issues.apache.org/jira/browse/WICKET-3980
*/
@Test
public void instantiateJustOnce() {
final AtomicInteger constructorsCalls = new AtomicInteger(0);
WicketTester tester = new WicketTester(new TestApplication());
assertEquals(0, constructorsCalls.get());
tester.startPage(new TestPage(constructorsCalls));
assertEquals(1, constructorsCalls.get());
tester.assertRenderedPage(TestPage.class);
assertEquals(1, constructorsCalls.get());
}
Aggregations