}
protected void checkPublication(Session session, DocumentFactory factory, Publication pub)
throws ServiceException, SiteException, DocumentBuildException, PublicationException,
RepositoryException {
DocumentManager docManager = null;
ServiceSelector selector = null;
SiteManager siteManager = null;
ServiceSelector resourceTypeSelector = null;
try {
selector = (ServiceSelector) getManager().lookup(SiteManager.ROLE + "Selector");
siteManager = (SiteManager) selector.select(pub.getSiteManagerHint());
SiteStructure structure = siteManager.getSiteStructure(factory, pub,
Publication.AUTHORING_AREA);
docManager = (DocumentManager) getManager().lookup(DocumentManager.ROLE);
resourceTypeSelector = (ServiceSelector) getManager().lookup(
ResourceType.ROLE + "Selector");
ResourceType type = (ResourceType) resourceTypeSelector.select("entry");
String contentSourceUri = "context://sitemap.xmap";
Document doc = docManager.add(factory, type, contentSourceUri, pub,
Publication.AUTHORING_AREA, "en", "xml");
structure.add(PATH, doc);
assertTrue(structure.contains(PATH));
Document linkDoc = structure.getNode(PATH).getLink("en").getDocument();