From a254a030c7cb81cb5948649a7dd4421870c3f8e7 Mon Sep 17 00:00:00 2001 From: xuxueli <931591021@qq.com> Date: Wed, 9 Jan 2019 14:52:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=87=E7=BA=A7=20xxl-rpc=20=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/test/java/com/xxl/job/adminbiz/AdminBizTest.java | 7 +++++++ .../test/java/com/xxl/job/executor/ExecutorBizTest.java | 6 +++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/xxl-job-admin/src/test/java/com/xxl/job/adminbiz/AdminBizTest.java b/xxl-job-admin/src/test/java/com/xxl/job/adminbiz/AdminBizTest.java index 45b3e15b..249113b8 100644 --- a/xxl-job-admin/src/test/java/com/xxl/job/adminbiz/AdminBizTest.java +++ b/xxl-job-admin/src/test/java/com/xxl/job/adminbiz/AdminBizTest.java @@ -4,6 +4,7 @@ import com.xxl.job.core.biz.AdminBiz; import com.xxl.job.core.biz.model.RegistryParam; import com.xxl.job.core.biz.model.ReturnT; import com.xxl.job.core.enums.RegistryConfig; +import com.xxl.rpc.remoting.invoker.XxlRpcInvokerFactory; import com.xxl.rpc.remoting.invoker.call.CallType; import com.xxl.rpc.remoting.invoker.reference.XxlRpcReferenceBean; import com.xxl.rpc.remoting.invoker.route.LoadBalance; @@ -48,6 +49,9 @@ public class AdminBizTest { RegistryParam registryParam = new RegistryParam(RegistryConfig.RegistType.EXECUTOR.name(), "xxl-job-executor-example", "127.0.0.1:9999"); ReturnT returnT = adminBiz.registry(registryParam); Assert.assertTrue(returnT.getCode() == ReturnT.SUCCESS_CODE); + + // stop invoker + XxlRpcInvokerFactory.getInstance().stop(); } /** @@ -75,6 +79,9 @@ public class AdminBizTest { RegistryParam registryParam = new RegistryParam(RegistryConfig.RegistType.EXECUTOR.name(), "xxl-job-executor-example", "127.0.0.1:9999"); ReturnT returnT = adminBiz.registryRemove(registryParam); Assert.assertTrue(returnT.getCode() == ReturnT.SUCCESS_CODE); + + // stop invoker + XxlRpcInvokerFactory.getInstance().stop(); } } diff --git a/xxl-job-admin/src/test/java/com/xxl/job/executor/ExecutorBizTest.java b/xxl-job-admin/src/test/java/com/xxl/job/executor/ExecutorBizTest.java index 8ea545c5..3892c1f9 100644 --- a/xxl-job-admin/src/test/java/com/xxl/job/executor/ExecutorBizTest.java +++ b/xxl-job-admin/src/test/java/com/xxl/job/executor/ExecutorBizTest.java @@ -5,6 +5,7 @@ import com.xxl.job.core.biz.model.ReturnT; import com.xxl.job.core.biz.model.TriggerParam; import com.xxl.job.core.enums.ExecutorBlockStrategyEnum; import com.xxl.job.core.glue.GlueTypeEnum; +import com.xxl.rpc.remoting.invoker.XxlRpcInvokerFactory; import com.xxl.rpc.remoting.invoker.call.CallType; import com.xxl.rpc.remoting.invoker.reference.XxlRpcReferenceBean; import com.xxl.rpc.remoting.invoker.route.LoadBalance; @@ -33,7 +34,7 @@ public class ExecutorBizTest { * @param jobHandler * @param params */ - private static void runTest(String jobHandler, String params){ + private static void runTest(String jobHandler, String params) throws Exception { // trigger data TriggerParam triggerParam = new TriggerParam(); triggerParam.setJobId(1); @@ -62,6 +63,9 @@ public class ExecutorBizTest { null).getObject(); ReturnT runResult = executorBiz.run(triggerParam); + + System.out.println(runResult); + XxlRpcInvokerFactory.getInstance().stop(); } }