/** panel has leading markup */ @Test public void panel2() { MarkupContainer r = new R(); TestPanel q = new TestPanel("q"); q.setPanelMarkup( "<html><body><wicket:panel><p wicket:id='r'></p></wicket:panel></body></html>"); q.queue(r); TestPage p = new TestPage(); p.setPageMarkup("<p wicket:id='q'></p>"); p.queue(q); tester.startPage(p); assertThat(p, hasPath(new Path(q, r))); }
/** {@code [a,q[r,s]] - > [a[q[r[s]]]] } */ @Test public void panel1() { MarkupContainer a = new A(), r = new R(), s = new S(); TestPanel q = new TestPanel("q"); q.setPanelMarkup("<wicket:panel><p wicket:id='r'><p wicket:id='s'></p></p></wicket:panel>"); q.queue(r, s); TestPage p = new TestPage(); p.setPageMarkup("<p wicket:id='a'><p wicket:id='q'></p></p>"); p.queue(a, q); tester.startPage(p); assertThat(p, hasPath(new Path(a, q, r, s))); }
/** panel with a static header section */ @Test public void panel3() { MarkupContainer r = new R(); TestPanel q = new TestPanel("q"); q.setPanelMarkup( "<html><head><wicket:head><meta/></wicket:head></head>" + "<body><wicket:panel><p wicket:id='r'></p></wicket:panel></body></html>"); q.queue(r); TestPage p = new TestPage(); p.setPageMarkup("<html><head></head><body><p wicket:id='q'></p></body></html>"); p.queue(q); tester.startPage(p); assertThat(p, hasPath(new Path(q, r))); tester.assertContains("<meta/>"); // contributed by <wicket:head> }