Search in sources :

Example 11 with WebComponent

use of org.apache.wicket.markup.html.WebComponent 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

WebComponent (org.apache.wicket.markup.html.WebComponent)11 Test (org.junit.Test)8 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)3 ObjectOutputStream (java.io.ObjectOutputStream)2 OutputStream (java.io.OutputStream)2 Component (org.apache.wicket.Component)2 MockPageWithLinkAndComponent (org.apache.wicket.MockPageWithLinkAndComponent)2 LayerIcon (com.evolveum.midpoint.gui.impl.component.icon.LayerIcon)1 VisibleEnableBehaviour (com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 IOException (java.io.IOException)1 Constructor (java.lang.reflect.Constructor)1 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1 Matcher (java.util.regex.Matcher)1 Pattern (java.util.regex.Pattern)1 MockPageWithLink (org.apache.wicket.MockPageWithLink)1 TestPage_1 (org.apache.wicket.TestPage_1)1 AjaxEventBehavior (org.apache.wicket.ajax.AjaxEventBehavior)1 Behavior (org.apache.wicket.behavior.Behavior)1 CheckingObjectOutputStream (org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream)1