Skip to content

Commit

Permalink
Bugfix: Testplan cloning copying assigned to field.
Browse files Browse the repository at this point in the history
  • Loading branch information
gitorko committed Feb 24, 2016
1 parent d8f4885 commit 45b2bda
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/main/java/com/deem/excord/controller/TestPlanController.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,16 @@ public String cloneTestplan(HttpSession session, HttpServletRequest request, Mod
newTpObj.setLeader(tpObj.getLeader());
tpDao.save(newTpObj);
//Find all testcases associated with the testplan and copy.
List<EcTestcase> tcLst = tcDao.findAllTestCasesByTestPlanId(testplanId);
for (EcTestcase tc : tcLst) {
EcTestplanTestcaseMapping tptcObj = new EcTestplanTestcaseMapping();
tptcObj.setTestcaseId(tc);
tptcObj.setTestplanId(newTpObj);
//TODO: Clone assign only.
//tptcObj.setAssignedTo();
tptcDao.save(tptcObj);

List<EcTestplanTestcaseMapping> oldTptcLst = tptcDao.findByTestplanId(tpObj);
for (EcTestplanTestcaseMapping oldtctpObj : oldTptcLst) {

EcTestplanTestcaseMapping newtptcObj = new EcTestplanTestcaseMapping();
newtptcObj.setTestcaseId(oldtctpObj.getTestcaseId());
newtptcObj.setTestplanId(newTpObj);
newtptcObj.setAssignedTo(oldtctpObj.getAssignedTo());
tptcDao.save(newtptcObj);
}

historyUtil.addHistory("Cloned testplan: [" + tpObj.getName() + "]", tpObj.getSlug(), request, session);
session.setAttribute("flashMsg", "Successfully Cloned TestPlan " + tpObj.getName());
if (newTpObj.getEnabled()) {
Expand Down

0 comments on commit 45b2bda

Please sign in to comment.