Commit 900e277b by guo_minglei@163.com

添加测试方法

parent dead06df
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>
<configuration> <configuration>
&lt;!&ndash; 指定SpringBoot程序的main函数入口类 &ndash;&gt; &lt;!&ndash; 指定SpringBoot程序的main函数入口类 &ndash;&gt;
<mainClass>com.byit.executor.Test</mainClass> <mainClass>com.test.Test</mainClass>
</configuration> </configuration>
<executions> <executions>
......
package com.test;
import com.byit.executor.jobExecutor.process.MythJobProcess;
import lombok.extern.slf4j.Slf4j;
import java.io.IOException;
import java.util.*;
/**
* @description:
* @author: gml
* @create: 2020-01-15 11:10
*/
@Slf4j
public class Test {
public static void main(String[] args) throws IOException, InterruptedException {
List<MythJobProcess> list = new ArrayList<>();
Thread thread = new Thread(() -> {
List<String> cmdList = new ArrayList<>();
cmdList = Arrays.asList("python D:\\workSpace\\python\\test\\test1.py".split(" "));
Map<String, String> env = new HashMap<>();
env.put("python", "C:\\Program Files\\Python38");
MythJobProcess mythJobProcess = new MythJobProcess(cmdList, null, null, 0);
list.add(mythJobProcess);
String log = mythJobProcess.call();
System.out.println("运行日志" + log);
});
thread.start();
Thread.sleep(30000);
list.forEach(process -> {
process.hardKill();
});
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment