Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
byit-myth-job
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liyuan
byit-myth-job
Commits
900e277b
Commit
900e277b
authored
Feb 24, 2020
by
guo_minglei@163.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加测试方法
parent
dead06df
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
1 deletion
+44
-1
pom.xml
byit-myth-core/myth-executor-core/pom.xml
+1
-1
Test.java
...-core/myth-executor-core/src/test/java/com/test/Test.java
+43
-0
No files found.
byit-myth-core/myth-executor-core/pom.xml
View file @
900e277b
...
@@ -70,7 +70,7 @@
...
@@ -70,7 +70,7 @@
<artifactId>spring-boot-maven-plugin</artifactId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<configuration>
<!– 指定SpringBoot程序的main函数入口类 –>
<!– 指定SpringBoot程序的main函数入口类 –>
<mainClass>com.
byit.executor
.Test</mainClass>
<mainClass>com.
test
.Test</mainClass>
</configuration>
</configuration>
<executions>
<executions>
...
...
byit-myth-core/myth-executor-core/src/test/java/com/test/Test.java
0 → 100644
View file @
900e277b
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
();
});
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment