protected void prepareUsecase() throws Exception {
super.prepareUsecase();
Area authoring = getPublication("test").getArea("authoring");
SiteStructure authoringSite = authoring.getSite();
SiteNode node = authoringSite.getNode(SOURCE_PATH);
Document doc = node.getLink("en").getDocument();
DocumentManager docMgr = null;
try {
docMgr = (DocumentManager) getManager().lookup(DocumentManager.ROLE);
String pubId = doc.getPublication().getId();
String area = doc.getArea();
DocumentLocator loc = DocumentLocator.getLocator(pubId, area, PATH, doc.getLanguage());
authoringSite.add("/foo");
authoringSite.add("/foo/bar");
docMgr.copy(doc, loc);
// add an ancestor language version to test the method
// MoveSubSite.getTargetURL()
DocumentLocator ancestorLoc = DocumentLocator.getLocator(pubId, area, "/foo", "de");
docMgr.copy(doc, ancestorLoc);
SiteNode childNode = authoringSite.getNode(PATH);
this.uuid = childNode.getUuid();
} finally {
if (docMgr != null) {
getManager().release(docMgr);
}