Added java11 args
This commit is contained in:
parent
9463a09dd6
commit
77fa8b6186
|
@ -54,6 +54,7 @@ class ProcessExecutorShutdownHookTest {
|
||||||
.enableRead()
|
.enableRead()
|
||||||
.defaultLogger()
|
.defaultLogger()
|
||||||
.asJvmProcess()
|
.asJvmProcess()
|
||||||
|
.addArg("-add-opens java.base/java.lang=ALL-UNNAMED")
|
||||||
.cloneClasspath()
|
.cloneClasspath()
|
||||||
.setMainClass(TestSetup.getFile(loopStarterClassFile))
|
.setMainClass(TestSetup.getFile(loopStarterClassFile))
|
||||||
.startBlocking()
|
.startBlocking()
|
||||||
|
|
|
@ -19,6 +19,9 @@
|
||||||
|
|
||||||
package dorkbox.executor.shutdown;
|
package dorkbox.executor.shutdown;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
import dorkbox.executor.Executor;
|
import dorkbox.executor.Executor;
|
||||||
import dorkbox.executor.samples.TestSetup;
|
import dorkbox.executor.samples.TestSetup;
|
||||||
|
|
||||||
|
@ -44,13 +47,39 @@ class WriterLoopStarterAfterExit implements Runnable {
|
||||||
public
|
public
|
||||||
void run() {
|
void run() {
|
||||||
try {
|
try {
|
||||||
new Executor("java", TestSetup.INSTANCE.getFile(WriterLoop.class))
|
// silly workarounds, because executing java files from CLI, require SINGLE-FILE access!
|
||||||
.destroyOnExit()
|
String path = getFile(WriterLoopStarterBeforeExit.class)
|
||||||
.startBlocking();
|
.replace(WriterLoopStarterBeforeExit.class.getSimpleName(), "WriterLoop");
|
||||||
|
|
||||||
|
System.out.println("Starting output: " + path);
|
||||||
|
|
||||||
|
new Executor()
|
||||||
|
.redirectOutputAsInfo()
|
||||||
|
.redirectErrorAsInfo()
|
||||||
|
.asJvmProcess()
|
||||||
|
.addArg("-add-opens java.base/java.lang=ALL-UNNAMED")
|
||||||
|
.cloneClasspath()
|
||||||
|
.setMainClass(path)
|
||||||
|
.startBlocking();
|
||||||
|
|
||||||
|
|
||||||
Thread.sleep(SLEEP_AFTER_START);
|
Thread.sleep(SLEEP_AFTER_START);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static String getFile(Class javaClass) throws IOException {
|
||||||
|
String properName;
|
||||||
|
|
||||||
|
if (Executor.Companion.getIS_OS_WINDOWS()) {
|
||||||
|
properName = javaClass.getName().replace('.', '\\');
|
||||||
|
} else {
|
||||||
|
properName = javaClass.getName().replace('.', '/');
|
||||||
|
}
|
||||||
|
|
||||||
|
File file = new File("test", properName + ".java").getAbsoluteFile().getCanonicalFile();
|
||||||
|
return file.getPath();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,6 +44,7 @@ class WriterLoopStarterBeforeExit {
|
||||||
.redirectOutputAsInfo()
|
.redirectOutputAsInfo()
|
||||||
.redirectErrorAsInfo()
|
.redirectErrorAsInfo()
|
||||||
.asJvmProcess()
|
.asJvmProcess()
|
||||||
|
.addArg("-add-opens java.base/java.lang=ALL-UNNAMED")
|
||||||
.cloneClasspath()
|
.cloneClasspath()
|
||||||
.setMainClass(path)
|
.setMainClass(path)
|
||||||
.startBlocking();
|
.startBlocking();
|
||||||
|
|
Loading…
Reference in New Issue