*/
@Test
public void panel() throws Exception
{
Page page = new MyPage();
Panel panel = new MyPanel("panel");
page.add(panel);
// Get the associated markup file
IMarkupFragment markup = panel.getAssociatedMarkup();
compareMarkupWithFile(markup, "MyPanel_ExpectedResult.html");
// The Page is missing the tag to "call" the panel
assertNull(panel.getMarkup());
// Create a Page with proper markup for the panel
page = new MyPanelPage();
panel = (Panel)page.get("panel");
// getMarkup() returns the "calling" tags
markup = panel.getMarkup();
compareMarkupWithString(markup, "<span wicket:id=\"panel\">test</span>");
// getMarkup(null) returns the markup which is used to find a child component, which in case
// of Panel is the <wicket:panel> tag and is thus may not be equal to the associated markup
// file.
markup = panel.getMarkup(null);
compareMarkupWithString(markup,
"<wicket:panel> <span wicket:id=\"label\">text</span></wicket:panel>");
}