From 3cba3e803c3f7bd82692f1b85066d0fabb1845a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E6=B8=85?= <62982788+597365581@users.noreply.github.com> Date: Sat, 30 Jan 2021 16:09:01 +0800 Subject: [PATCH] Update ShellCommandExecutorTest.java update unit test --- .../worker/shell/ShellCommandExecutorTest.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/worker/shell/ShellCommandExecutorTest.java b/dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/worker/shell/ShellCommandExecutorTest.java index 3f65ec87f5..2d339e0b69 100644 --- a/dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/worker/shell/ShellCommandExecutorTest.java +++ b/dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/worker/shell/ShellCommandExecutorTest.java @@ -175,33 +175,31 @@ public class ShellCommandExecutorTest { } @Test - public void testFindAppId(){ + public void testFindAppId() { Class shellCommandExecutorClass = ShellCommandExecutor.class; - try{ + try { Object instance = shellCommandExecutorClass.newInstance(); Method method = shellCommandExecutorClass.getDeclaredMethod("findAppId", new Class[]{String.class}); method.setAccessible(true); Object[] arg1s = {"11111"}; ShellCommandExecutor result = (ShellCommandExecutor) method.invoke(instance, arg1s); - } - catch (Exception e){ + } catch (Exception e) { logger.error(e.getMessage()); } } @Test - public void testConvertFile2List(){ + public void testConvertFile2List() { Class shellCommandExecutorClass = AbstractCommandExecutor.class; - try{ + try { Object instance = shellCommandExecutorClass.newInstance(); Method method = shellCommandExecutorClass.getDeclaredMethod("convertFile2List", new Class[]{String.class}); method.setAccessible(true); Object[] arg1s = {"/opt/1.txt"}; AbstractCommandExecutor result = (AbstractCommandExecutor) method.invoke(instance, arg1s); - } - catch (Exception e){ + } catch (Exception e) { logger.error(e.getMessage()); } }