Test fixes

This commit is contained in:
crschnick 2024-05-27 21:15:19 +00:00
parent a5309f3614
commit 9ad3e1975e
2 changed files with 12 additions and 1 deletions

View file

@ -40,6 +40,7 @@ public class AppProperties {
AppVersion canonicalVersion;
boolean locatePtb;
boolean locatorVersionCheck;
boolean isTest;
public AppProperties() {
var appDir = Path.of(System.getProperty("user.dir")).resolve("app");
@ -103,6 +104,16 @@ public class AppProperties {
locatorVersionCheck = Optional.ofNullable(System.getProperty("io.xpipe.app.locator.disableInstallationVersionCheck"))
.map(s -> !Boolean.parseBoolean(s))
.orElse(true);
isTest = isJUnitTest();
}
private static boolean isJUnitTest() {
for (StackTraceElement element : Thread.currentThread().getStackTrace()) {
if (element.getClassName().startsWith("org.junit.")) {
return true;
}
}
return false;
}
public static void logSystemProperties() {

View file

@ -24,7 +24,7 @@ testing {
systemProperty 'io.xpipe.app.fullVersion', "true"
systemProperty 'io.xpipe.beacon.printDaemonOutput', "false"
systemProperty 'io.xpipe.app.useVirtualThreads', "false"
systemProperty "io.xpipe.beacon.port", "21725"
// systemProperty "io.xpipe.beacon.port", "21725"
systemProperty "io.xpipe.beacon.launchDebugDaemon", "true"
systemProperty "io.xpipe.app.dataDir", "$projectDir/local/"
systemProperty "io.xpipe.app.logLevel", "trace"