From a410b8465f6964d88106a03b04176d2ae3a3cb10 Mon Sep 17 00:00:00 2001 From: xuxueli <931591021@qq.com> Date: Thu, 8 Nov 2018 16:11:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=89=A7=E8=A1=8C=E5=99=A8?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E4=B9=8B=E5=90=8Ejetty=E5=81=9C=E6=AD=A2?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/XXL-JOB官方文档.md | 12 ++++++------ .../java/com/xxl/job/executor/ExecutorBizTest.java | 14 ++++++++++++-- 2 files changed, 18 insertions(+), 8 deletions(-) rename xxl-job-executor-samples/xxl-job-executor-sample-spring/src/test/java/com/xxl/executor/test/DemoJobHandlerTest.java => xxl-job-admin/src/test/java/com/xxl/job/executor/ExecutorBizTest.java (86%) diff --git a/doc/XXL-JOB官方文档.md b/doc/XXL-JOB官方文档.md index 86f47197..2fe2fa57 100644 --- a/doc/XXL-JOB官方文档.md +++ b/doc/XXL-JOB官方文档.md @@ -998,14 +998,14 @@ API服务请求参考代码:可参考任务界面操作的ajax请求。任何a ### 5.12 执行器API服务 执行器提供了API服务,供调度中心选择使用,目前提供的API服务有: - 1、心跳检测 - 2、忙碌检测 - 3、触发任务执行 - 4、获取Rolling Log - 5、终止任务 + 1、心跳检测:调度中心使用 + 2、忙碌检测:调度中心使用 + 3、触发任务执行:调度中心使用;本地进行任务开发时,可使用该API服务模拟触发任务; + 4、获取Rolling Log:调度中心使用 + 5、终止任务:调度中心使用 API服务位置:com.xxl.job.core.biz.ExecutorBiz -API服务请求参考代码:com.xxl.executor.test.DemoJobHandlerTest +API服务请求参考代码:com.xxl.job.executor.ExecutorBizTest ### 5.13 故障转移 & 失败重试 一次完整任务流程包括"调度(调度中心) + 执行(执行器)"两个阶段。 diff --git a/xxl-job-executor-samples/xxl-job-executor-sample-spring/src/test/java/com/xxl/executor/test/DemoJobHandlerTest.java b/xxl-job-admin/src/test/java/com/xxl/job/executor/ExecutorBizTest.java similarity index 86% rename from xxl-job-executor-samples/xxl-job-executor-sample-spring/src/test/java/com/xxl/executor/test/DemoJobHandlerTest.java rename to xxl-job-admin/src/test/java/com/xxl/job/executor/ExecutorBizTest.java index 82027a35..bf3abab7 100644 --- a/xxl-job-executor-samples/xxl-job-executor-sample-spring/src/test/java/com/xxl/executor/test/DemoJobHandlerTest.java +++ b/xxl-job-admin/src/test/java/com/xxl/job/executor/ExecutorBizTest.java @@ -1,4 +1,4 @@ -package com.xxl.executor.test; +package com.xxl.job.executor; import com.xxl.job.core.biz.ExecutorBiz; import com.xxl.job.core.biz.model.ReturnT; @@ -15,7 +15,7 @@ import com.xxl.rpc.serialize.Serializer; * * Created by xuxueli on 17/5/12. */ -public class DemoJobHandlerTest { +public class ExecutorBizTest { public static void main(String[] args) throws Exception { @@ -23,6 +23,16 @@ public class DemoJobHandlerTest { String jobHandler = "demoJobHandler"; String params = ""; + runTest(jobHandler, params); + } + + /** + * run jobhandler + * + * @param jobHandler + * @param params + */ + private static void runTest(String jobHandler, String params){ // trigger data TriggerParam triggerParam = new TriggerParam(); triggerParam.setJobId(1);