-
Notifications
You must be signed in to change notification settings - Fork 0
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 #262 from axonivy/XIVY-10310-useBaseUri
XIVY-10310 run tests on launching Designer instance http.port
- Loading branch information
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
web-tester/src/main/java/com/axonivy/ivy/webtest/IvyTestRuntimeProps.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,31 @@ | ||
package com.axonivy.ivy.webtest; | ||
|
||
import java.util.Properties; | ||
|
||
class IvyTestRuntimeProps { | ||
|
||
/** keep sync with ivy.core resource | ||
* ch.ivyteam.ivy.bpm.exec.client.restricted.IvyTestRuntime.IvyTestRuntimeIO#RESOURCE_NAME */ | ||
private static final String RT_PROPS = "ivyTestRuntime.properties"; | ||
|
||
public static void loadToSystem() { | ||
var rtProps = loadProps(); | ||
rtProps.propertyNames().asIterator().forEachRemaining(it -> { | ||
var key = (String)it; | ||
System.setProperty(key, rtProps.getProperty(key)); | ||
}); | ||
} | ||
|
||
public static Properties loadProps() { | ||
var props = new Properties(); | ||
ClassLoader loader = IvyWebTestExtension.class.getClassLoader(); | ||
try(var in = loader.getResourceAsStream(RT_PROPS)) { | ||
props.load(in); | ||
} catch (Exception ex) { | ||
System.err.println("Failed to read properties " + RT_PROPS); | ||
ex.printStackTrace(); | ||
} | ||
return props; | ||
} | ||
|
||
} |
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