|
@@ -907,6 +907,7 @@ public class AnalyzeService {
|
|
return coverMap;
|
|
return coverMap;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //将三级页面信息的jsonobject转为string
|
|
private List<String> getPageStr(String caseId){
|
|
private List<String> getPageStr(String caseId){
|
|
List<String>result=new ArrayList<>();
|
|
List<String>result=new ArrayList<>();
|
|
Exam exam=extraService.getExam(String.valueOf(caseId));
|
|
Exam exam=extraService.getExam(String.valueOf(caseId));
|
|
@@ -940,6 +941,46 @@ public class AnalyzeService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public int[][] getBugInfo(String taskId,String caseId){
|
|
|
|
+ String caseTakeId=caseId+"-"+taskId;
|
|
|
|
+ List<Bug>bugs=bdao.findByCaseid(caseTakeId);
|
|
|
|
+ int[][]bugInfo=new int[6][6]; //bug的复现程度和严重程度都为1-5
|
|
|
|
+ for(Bug bug:bugs){
|
|
|
|
+ int bugSeverity=bug.getSeverity();
|
|
|
|
+ int bugRecurrent=bug.getRecurrent();
|
|
|
|
+ bugInfo[bugSeverity][bugRecurrent]+=1;
|
|
|
|
+ }
|
|
|
|
+ return bugInfo;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public Map<Integer,Integer> getBugSubmitInfo(String taskId,String caseId,int piece){
|
|
|
|
+ Task task=taskDao.findById(taskId);
|
|
|
|
+ Map<Integer,Integer>map=new HashMap<>();
|
|
|
|
+ long startTime=0;
|
|
|
|
+ long endTime=0;
|
|
|
|
+ if(task!=null) {
|
|
|
|
+ startTime = task.getStart_time();
|
|
|
|
+ endTime = task.getEnd_time();
|
|
|
|
+ }
|
|
|
|
+ long pieceTime=(endTime-startTime)/piece;
|
|
|
|
+ String caseTakeId=caseId+"-"+taskId;
|
|
|
|
+ List<Bug>bugs=bdao.findByCaseid(caseTakeId);
|
|
|
|
+ for(Bug bug:bugs){
|
|
|
|
+ long time=Long.parseLong(bug.getCreate_time_millis());
|
|
|
|
+ int index=(int)((time-startTime)/pieceTime);
|
|
|
|
+ if(map.containsKey(index)){
|
|
|
|
+ map.replace(index,map.get(index)+1);
|
|
|
|
+ }
|
|
|
|
+ else{
|
|
|
|
+ map.put(index,1);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return map;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|