Browse Source

Update ShellCommandExecutorTest.java

add unit test
pull/3/MERGE
小清 4 years ago committed by GitHub
parent
commit
dfc40c0645
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/worker/shell/ShellCommandExecutorTest.java

5
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/worker/shell/ShellCommandExecutorTest.java

@ -121,9 +121,10 @@ public class ShellCommandExecutorTest {
try { try {
Object instance = shellCommandExecutorClass.newInstance(); Object instance = shellCommandExecutorClass.newInstance();
Method method = shellCommandExecutorClass.getDeclaredMethod("parseProcessOutput", new Class[]{}); Method method = shellCommandExecutorClass.getDeclaredMethod("parseProcessOutput", new Class[]{Process.class});
method.setAccessible(true); method.setAccessible(true);
ShellCommandExecutor result = (ShellCommandExecutor) method.invoke(instance, new Object[]{}); Object arg1s[] = {PowerMockito.mock(Process.class)};
ShellCommandExecutor result = (ShellCommandExecutor) method.invoke(instance, arg1s);
} catch (Exception e) { } catch (Exception e) {
logger.error(e.getMessage()); logger.error(e.getMessage());
} }

Loading…
Cancel
Save