@Test
public void reuseTranslationsFromObsoleteDocuments() throws Exception {
ProjectIterationDAO projectIterationDAO =
seam.autowire(ProjectIterationDAO.class);
DocumentDAO documentDAO = seam.autowire(DocumentDAO.class);
// Make all documents obsolete
HProjectIteration version =
projectIterationDAO.getBySlug("same-project", "same-version");
assert version != null;
for (HDocument doc : version.getDocuments().values()) {
doc.setObsolete(true);
documentDAO.makePersistent(doc);
}
ProjectDAO projectDAO = seam.autowire(ProjectDAO.class);
HProject project = projectDAO.getBySlug("different-project");
assert project != null;
for (HProjectIteration it : project.getProjectIterations()) {
for (HDocument doc : it.getDocuments().values()) {
doc.setObsolete(true);
documentDAO.makePersistent(doc);
}
}
// Run the copy trans scenario
CopyTransExecution execution =