Search in sources :

Example 1 with UpdateJobConfigVo

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());
}
Also used : FinishCheck(com.vip.saturn.it.base.FinishCheck) JobB(com.vip.saturn.it.job.downStream.JobB) JobA(com.vip.saturn.it.job.downStream.JobA) UpdateJobConfigVo(com.vip.saturn.job.console.vo.UpdateJobConfigVo) JobConfig(com.vip.saturn.job.console.domain.JobConfig) Test(org.junit.Test)

Example 2 with UpdateJobConfigVo

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);
}
Also used : UpdateJobConfigVo(com.vip.saturn.job.console.vo.UpdateJobConfigVo)

Example 3 with 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);
}
Also used : UpdateJobConfigVo(com.vip.saturn.job.console.vo.UpdateJobConfigVo)

Aggregations

UpdateJobConfigVo (com.vip.saturn.job.console.vo.UpdateJobConfigVo)3 FinishCheck (com.vip.saturn.it.base.FinishCheck)1 JobA (com.vip.saturn.it.job.downStream.JobA)1 JobB (com.vip.saturn.it.job.downStream.JobB)1 JobConfig (com.vip.saturn.job.console.domain.JobConfig)1 Test (org.junit.Test)1