Commit a6cb577a by caojingji

网安接口稳定性测试完毕,删除测试线程

parent bd8d6ca1
package com.founder.interservice.regionalanalysis.service.impl;
import com.founder.interservice.util.HttpUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;
import static com.founder.interservice.util.PropertieUtil.writeProperties;
@Component
@Async
public class TestSendTask {
@Value(value = "${wabigdata.regionalAnalysisTask.url}")
private String REGION_ALANALYSIS_URL; //发送任务接口
@Value(value = "${wabigdata.trackTravelTogetherForPhoneTask.url}")
private String TOGETHER_TASK_URL;
/*@Scheduled(initialDelay = 2000,fixedDelay = 300000) //项目启动后两秒开始执行一次 每个五分钟执行一次
public void doTestTogetherSendTask(){
System.out.println("测试伴随线程开始执行");
long day1 = System.currentTimeMillis();
String taskId = null;
String name = "T"+new SimpleDateFormat("yyyy年MM月dd日 HH时mm分ss秒").format(new Date());
try{
String url = TOGETHER_TASK_URL + "&objectType=" + "4314"
+ "&objectValue=" + "460029789430171"
+ "&taskName="+"测试伴随任务"
+ "&taskCaseId=" + "A5001231231234234"
+ "&startTime=" + System.currentTimeMillis()
+ "&endTime=" + System.currentTimeMillis();
taskId = HttpUtil.getWaData(url);
String logValue = null;
if("Rate Limit".equals(taskId.trim()) || "null".equals(taskId)){
logValue="伴随任务:任务状态:FAIL;任务编号:"+taskId+";用时"+(System.currentTimeMillis()-day1+"毫秒");
}else if(taskId == null || "".equals(taskId)){
logValue="伴随任务:任务状态:TIMEOUT;任务编号:"+taskId+";用时"+(System.currentTimeMillis()-day1+"毫秒");
}else{
logValue="伴随任务:任务状态:SUCCESS;任务编号:"+taskId+";用时"+(System.currentTimeMillis()-day1+"毫秒");
}
writeProperties("TogetherTaskLogFile.properties", name, logValue);
}catch (Exception e){
try{
e.printStackTrace();
String logValue="伴随任务:任务状态:TIMEOUT;任务编号:null;用时"+(System.currentTimeMillis()-day1+"毫秒");
writeProperties("TogetherTaskLogFile.properties", name, logValue);
}catch (Exception e1){
e1.printStackTrace();
}
}
}*/
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment