From 8e8a61511ff7edeb992c20be6e9f9e31f0d589df Mon Sep 17 00:00:00 2001 From: Reguel Wermelinger Date: Wed, 11 Sep 2024 15:30:39 +0200 Subject: [PATCH] XIVY-10310 provide feedback if URI setup failed - e.g. due to missing ivyTestRuntime.proprties at designer or engine-launch jvm param in Maven. --- .../java/com/axonivy/ivy/webtest/engine/BaseEngineUrl.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/web-tester/src/main/java/com/axonivy/ivy/webtest/engine/BaseEngineUrl.java b/web-tester/src/main/java/com/axonivy/ivy/webtest/engine/BaseEngineUrl.java index 7b91d99..3c4bf02 100644 --- a/web-tester/src/main/java/com/axonivy/ivy/webtest/engine/BaseEngineUrl.java +++ b/web-tester/src/main/java/com/axonivy/ivy/webtest/engine/BaseEngineUrl.java @@ -32,6 +32,7 @@ */ class BaseEngineUrl { + private static final String DEFAULT_URL = "http://localhost:8081/"; static final String TEST_ENGINE_URL = "test.engine.url"; static String url() { @@ -39,7 +40,11 @@ static String url() { } private String evaluate() { - var engineUrl = System.getProperty(TEST_ENGINE_URL, "http://localhost:8081/"); + var engineUrl = System.getProperty(TEST_ENGINE_URL); + if (engineUrl == null || engineUrl.isBlank()) { + System.err.println("Missing system property '"+TEST_ENGINE_URL+"' falling back to '"+DEFAULT_URL+"'."); + engineUrl = DEFAULT_URL; + } try { return evaluate(engineUrl); } catch(Exception ex) {