In my first Wicket project (developed in Wicket 6.20 using Eclipse mars and Glassfish 4.1) based on the Quickstart Maven archetype, I am using
getResourceSettings().getResourceFinders().add(new WebApplicationPath(getServletContext(), "html"));
to separate markup from code.
My homepage works well, but the WicketTester throws an exception org.apache.wicket.markup.MarkupNotFoundException: Can not determine Markup. Component is not yet connected to a parent. [Page class = ...MyProject.HomePage, id = 0, render count = 1]
This problem does not seem to be addressed anywhere in the literature.
After many hours of searching, a thorough debugging session lead me to the JavaDoc for MockServletContext which explains that it is necessary to supply an absolute path to the root of the application on disk if non-default resource locations are used.
Furthermore, I found that this path can be supplied as a second argument to the constructor of WicketTester.
So, my test Setup() method finishes with :
return new WicketTester(new WicketApplication(),"<path to Eclipse workspace>/MyProject/src/main/webapp");