-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10324 from Garima829/JarTestBranch2.0
Updating FarJarTest for Gradle
- Loading branch information
Showing
2 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
integration-tests/gradle/src/test/java/io/quarkus/gradle/LaunchUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package io.quarkus.gradle; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
import java.nio.file.Path; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import io.quarkus.utilities.JavaBinFinder; | ||
|
||
public class LaunchUtils { | ||
|
||
protected static Process launch(Path jar, File output) throws IOException { | ||
List<String> commands = new ArrayList<>(); | ||
commands.add(JavaBinFinder.findBin()); | ||
commands.add("-jar"); | ||
commands.add(jar.toString()); | ||
ProcessBuilder processBuilder = new ProcessBuilder(commands.toArray(new String[0])); | ||
processBuilder.redirectOutput(output); | ||
processBuilder.redirectError(output); | ||
return processBuilder.start(); | ||
} | ||
|
||
} |