mirror of
https://github.com/PowerJob/PowerJob.git
synced 2025-07-17 00:00:04 +08:00
[fix] suit ScriptProcessor's API change
This commit is contained in:
parent
3fde1ddd66
commit
a2336354d9
@ -18,7 +18,7 @@ public class OhMyConfig {
|
||||
*/
|
||||
private String appName;
|
||||
/**
|
||||
* 调度服务器地址,ip:port
|
||||
* 调度服务器地址,ip:port 或 域名
|
||||
*/
|
||||
private List<String> serverAddress;
|
||||
/**
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user