[fix] suit ScriptProcessor's API change

This commit is contained in:
tjq 2020-05-18 12:21:33 +08:00
parent 3fde1ddd66
commit a2336354d9
2 changed files with 5 additions and 6 deletions

View File

@ -18,7 +18,7 @@ public class OhMyConfig {
*/
private String appName;
/**
* 调度服务器地址ip:port
* 调度服务器地址ip:port 域名
*/
private List<String> serverAddress;
/**

View File

@ -16,26 +16,25 @@ import java.util.concurrent.Executors;
public class ScriptProcessorTest {
private static final long timeout = 10000;
private static final ExecutorService pool = Executors.newFixedThreadPool(3);
@Test
public void testLocalShellProcessor() throws Exception {
ShellProcessor sp = new ShellProcessor(1L, "ls -a", timeout, pool);
ShellProcessor sp = new ShellProcessor(1L, "ls -a", timeout);
sp.process(null);
ShellProcessor sp2 = new ShellProcessor(2777L, "pwd", timeout, pool);
ShellProcessor sp2 = new ShellProcessor(2777L, "pwd", timeout);
sp2.process(null);
}
@Test
public void testLocalPythonProcessor() throws Exception {
PythonProcessor pp = new PythonProcessor(2L, "print 'Hello World!'", timeout, pool);
PythonProcessor pp = new PythonProcessor(2L, "print 'Hello World!'", timeout);
pp.process(null);
}
@Test
public void testNetShellProcessor() throws Exception {
ShellProcessor sp = new ShellProcessor(18L, "http://localhost:8080/test/test.sh", timeout, pool);
ShellProcessor sp = new ShellProcessor(18L, "http://localhost:8080/test/test.sh", timeout);
sp.process(null);
}