Mercurial > stress-tester
changeset 1214:f6ebddf4c8f2
Scanner, Converter - configuration context rootDir changed
author | Devel 2 |
---|---|
date | Wed, 24 Jun 2020 09:31:23 +0200 |
parents | f2fec8fc04e2 |
children | afd31c0205e9 |
files | stress-tester/src/main/java/com/passus/st/converter/Converter.java stress-tester/src/main/java/com/passus/st/scanner/Scanner.java |
diffstat | 2 files changed, 6 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/stress-tester/src/main/java/com/passus/st/converter/Converter.java Wed Jun 24 09:30:33 2020 +0200 +++ b/stress-tester/src/main/java/com/passus/st/converter/Converter.java Wed Jun 24 09:31:23 2020 +0200 @@ -83,12 +83,12 @@ return; } - String configFile = clArgs[0]; + File configFile = new File(clArgs[0]); String output = clArgs[1]; System.out.println("Converting to " + output); cliHelper.configureLogger(cl); - ConfigurationContext context = ConfigurationContext.create(); + ConfigurationContext context = ConfigurationContext.create(configFile.getParentFile()); Errors errors = new Errors(); ConverterConfiguratorPluginFactory pluginFactory = new ConverterConfiguratorPluginFactory(); Configuration config = cliHelper.readConfiguration(configFile);
--- a/stress-tester/src/main/java/com/passus/st/scanner/Scanner.java Wed Jun 24 09:30:33 2020 +0200 +++ b/stress-tester/src/main/java/com/passus/st/scanner/Scanner.java Wed Jun 24 09:31:23 2020 +0200 @@ -14,6 +14,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import java.io.File; import java.util.List; import static com.passus.st.metric.MetricUtils.printMetrics; @@ -56,11 +57,12 @@ cliHelper.configureLogger(cl); final String metricFormat = cl.getOptionValue("mf", "text"); - ConfigurationContext context = ConfigurationContext.create(); + File configFile = new File(clArgs[0]); + ConfigurationContext context = ConfigurationContext.create(configFile.getParentFile()); ScannerConfiguratorPluginFactory pluginFactory = new ScannerConfiguratorPluginFactory(); Errors errors = new Errors(); - Configuration config = cliHelper.readConfiguration(clArgs[0]); + Configuration config = cliHelper.readConfiguration(configFile); JobConfigurator jobConfigurator = cliHelper.processJobConfiguration(config, context, errors, pluginFactory); ScannerJob job = ScannerJob.create(context);