7 changed files with 132 additions and 32 deletions
@ -0,0 +1,20 @@ |
|||
package cn.chjyj.szwh.job; |
|||
|
|||
import org.apache.commons.logging.Log; |
|||
import org.apache.commons.logging.LogFactory; |
|||
import org.quartz.Job; |
|||
import org.quartz.JobDataMap; |
|||
import org.quartz.JobExecutionContext; |
|||
import org.quartz.JobExecutionException; |
|||
|
|||
public class SzwhJob implements Job { |
|||
private static Log log = LogFactory.getLog(SzwhJob.class); |
|||
@Override |
|||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { |
|||
//
|
|||
JobDataMap data = jobExecutionContext.getTrigger().getJobDataMap(); |
|||
String invokeParam = (String) data.get("invokeParam"); |
|||
//在这里实现业务逻辑
|
|||
log.info("自定义任务 szwhjob"); |
|||
} |
|||
} |
|||
@ -0,0 +1,62 @@ |
|||
package cn.chjyj.szwh.mapper; |
|||
|
|||
import cn.chjyj.szwh.bean.JobDetail; |
|||
import org.junit.Test; |
|||
import org.junit.runner.RunWith; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.boot.test.context.SpringBootTest; |
|||
import org.springframework.test.context.junit4.SpringRunner; |
|||
|
|||
import static org.junit.Assert.*; |
|||
|
|||
@SpringBootTest |
|||
@RunWith(SpringRunner.class) |
|||
public class JobDetailMapperTest { |
|||
@Autowired |
|||
private JobDetailMapper jobDetailMapper; |
|||
|
|||
@Test |
|||
public void deleteByPrimaryKey() { |
|||
} |
|||
|
|||
@Test |
|||
public void insert() { |
|||
JobDetail jobDetail= new JobDetail(); |
|||
jobDetail.setJobClassName("szwhJob"); |
|||
jobDetail.setSchedName("szwhjob"); |
|||
jobDetail.setJobName("szwhjob"); |
|||
jobDetail.setJobGroup("szwh"); |
|||
// 是否持久化
|
|||
jobDetail.setIsDurable("1"); |
|||
jobDetail.setIsNonconcurrent("1"); |
|||
jobDetail.setIsUpdateData("0"); |
|||
jobDetail.setRequestsRecovery("1"); |
|||
jobDetail.setJobData(null); |
|||
|
|||
jobDetailMapper.insert(jobDetail); |
|||
} |
|||
|
|||
@Test |
|||
public void insertSelective() { |
|||
} |
|||
|
|||
@Test |
|||
public void selectByPrimaryKey() { |
|||
} |
|||
|
|||
@Test |
|||
public void updateByPrimaryKeySelective() { |
|||
} |
|||
|
|||
@Test |
|||
public void updateByPrimaryKeyWithBLOBs() { |
|||
} |
|||
|
|||
@Test |
|||
public void updateByPrimaryKey() { |
|||
} |
|||
|
|||
@Test |
|||
public void getJobAndTriggerDetails() { |
|||
} |
|||
} |
|||
Loading…
Reference in new issue