Search in sources :

Example 1 with TestPage_1

use of org.apache.wicket.TestPage_1 in project wicket by apache.

the class OrphanComponentCheckerTest method checkOrphanComponent.

@Test
public void checkOrphanComponent() {
    WebComponent component = new WebComponent("a");
    IObjectChecker checker = new OrphanComponentChecker();
    IObjectChecker.Result result = checker.check(component);
    assertEquals(IObjectChecker.Result.Status.FAILURE, result.status);
    assertEquals("A component without a parent is detected.", result.reason);
    WebPage parent = new TestPage_1();
    parent.add(component);
    IObjectChecker.Result result2 = checker.check(component);
    assertEquals(IObjectChecker.Result.SUCCESS, result2);
}
Also used : WebComponent(org.apache.wicket.markup.html.WebComponent) WebPage(org.apache.wicket.markup.html.WebPage) TestPage_1(org.apache.wicket.TestPage_1) Test(org.junit.Test)

Aggregations

TestPage_1 (org.apache.wicket.TestPage_1)1 WebComponent (org.apache.wicket.markup.html.WebComponent)1 WebPage (org.apache.wicket.markup.html.WebPage)1 Test (org.junit.Test)1