Skip to content

Commit

Permalink
Bug fix: TC and TP cloning.
Browse files Browse the repository at this point in the history
  • Loading branch information
gitorko committed Feb 22, 2016
1 parent ff3b8f5 commit c8cf5b1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,8 @@ public String testcaseClone(Model model, HttpServletRequest request, HttpSession
String newTCName = tc.getName();
if (newTCName.length() > 84) {
newTCName = newTCName.substring(0, 84) + "_CLONE";
} else {
newTCName = newTCName + "_CLONE";
}
newTc.setName(newTCName);
newTc.setPriority(tc.getPriority());
Expand Down Expand Up @@ -621,7 +623,7 @@ public String testCaseUpload(HttpSession session, HttpServletRequest request, @R
String testDescription = BizUtil.INSTANCE.validateInput(df.formatCellValue(row.getCell(2)), -1);
Integer timeToRun = Integer.parseInt(BizUtil.INSTANCE.validateInput(df.formatCellValue(row.getCell(3)), -1));

if (timeToRun != 1 & timeToRun != 5 && timeToRun != 10 && timeToRun != 15 && timeToRun != 20 && timeToRun != 30) {
if (timeToRun != 1 && timeToRun != 5 && timeToRun != 10 && timeToRun != 15 && timeToRun != 20 && timeToRun != 30) {
timeToRun = 5;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,10 @@ public String cloneTestplan(HttpSession session, HttpServletRequest request, Mod
newTpObj.setSlug(BizUtil.INSTANCE.getSlug());

String newTPName = tpObj.getName();
if (newTPName.length() > 84) {
newTPName = newTPName.substring(0, 84) + "_CLONE";
if (newTPName.length() > 39) {
newTPName = newTPName.substring(0, 39) + "_CLONE";
} else {
newTPName = newTPName + "_CLONE";
}
newTpObj.setName(newTPName);
newTpObj.setCreator((String) session.getAttribute("authName"));
Expand Down

0 comments on commit c8cf5b1

Please sign in to comment.