use of com.vip.saturn.job.console.vo.UpdateJobConfigVo in project Saturn by vipshop.
the class DownStreamIT method test.
@Test
public void test() throws Exception {
startOneNewExecutorList();
JobB.count = 0;
// add downStream firstly
JobConfig jobB = new JobConfig();
jobB.setJobName("downStreamITJobB");
jobB.setJobType(JobType.PASSIVE_JAVA_JOB.toString());
jobB.setJobClass(JobB.class.getCanonicalName());
jobB.setShardingTotalCount(1);
jobB.setShardingItemParameters("0=0");
addJob(jobB);
Thread.sleep(1000);
JobConfig jobA = new JobConfig();
jobA.setJobName("downStreamITJobA");
jobA.setCron("9 9 9 9 9 ? 2099");
jobA.setJobType(JobType.JAVA_JOB.toString());
jobA.setJobClass(JobA.class.getCanonicalName());
jobA.setShardingTotalCount(1);
jobA.setShardingItemParameters("0=0");
jobA.setDownStream(jobB.getJobName());
addJob(jobA);
Thread.sleep(1000);
enableJob(jobA.getJobName());
enableJob(jobB.getJobName());
Thread.sleep(1000);
runAtOnce(jobA.getJobName());
Thread.sleep(1000);
waitForFinish(new FinishCheck() {
@Override
public boolean isOk() {
return JobB.count == 1;
}
}, 10);
disableJob(jobA.getJobName());
disableJob(jobB.getJobName());
Thread.sleep(1000);
UpdateJobConfigVo updateJobConfigVo = new UpdateJobConfigVo();
updateJobConfigVo.setJobName(jobA.getJobName());
updateJobConfigVo.setDownStream("");
updateJob(updateJobConfigVo);
Thread.sleep(1000);
removeJob(jobA.getJobName());
removeJob(jobB.getJobName());
}
use of com.vip.saturn.job.console.vo.UpdateJobConfigVo in project Saturn by vipshop.
the class AbstractSaturnIT method disableReport.
public void disableReport(String jobName) throws Exception {
UpdateJobConfigVo updateJobConfigVo = new UpdateJobConfigVo();
updateJobConfigVo.setJobName(jobName);
updateJobConfigVo.setEnabledReport(false);
updateJob(updateJobConfigVo);
}
use of com.vip.saturn.job.console.vo.UpdateJobConfigVo in project Saturn by vipshop.
the class AbstractSaturnIT method enableReport.
public void enableReport(String jobName) throws Exception {
UpdateJobConfigVo updateJobConfigVo = new UpdateJobConfigVo();
updateJobConfigVo.setJobName(jobName);
updateJobConfigVo.setEnabledReport(true);
updateJob(updateJobConfigVo);
}
Aggregations