Skip to content

Commit

Permalink
Merge pull request #262 from axonivy/XIVY-10310-useBaseUri
Browse files Browse the repository at this point in the history
XIVY-10310 run tests on launching Designer instance http.port
  • Loading branch information
ivy-rew authored Aug 29, 2024
2 parents fd724e1 + 1e64fad commit e9f5fd6
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
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;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class IvyWebTestExtension implements BeforeEachCallback, BeforeAllCallback, Para

@Override
public void beforeAll(ExtensionContext context) throws Exception {
IvyTestRuntimeProps.loadToSystem();
Configuration.browser = browser(context);
Configuration.headless = headless(context);
}
Expand Down

0 comments on commit e9f5fd6

Please sign in to comment.