Mercurial > stress-tester
changeset 915:f4d5bc0876bd
unit tests fixed
author | Devel 1 |
---|---|
date | Tue, 24 Apr 2018 23:00:43 +0200 |
parents | afa17add2f3f |
children | b3e412d37d75 |
files | stress-tester/src/main/java/com/passus/st/lookup/LookupsDomainConfigurator.java stress-tester/src/test/java/com/passus/st/lookup/LookupsDomainConfiguratorTest.java stress-tester/src/test/resources/com/passus/st/config/test_job_config.yml |
diffstat | 3 files changed, 10 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/stress-tester/src/main/java/com/passus/st/lookup/LookupsDomainConfigurator.java Tue Apr 24 22:44:33 2018 +0200 +++ b/stress-tester/src/main/java/com/passus/st/lookup/LookupsDomainConfigurator.java Tue Apr 24 23:00:43 2018 +0200 @@ -27,16 +27,19 @@ return DOMAIN; } + @Deprecated public static List<Lookup> getLookups(File configFile, Errors errors, ConfigurationContext context) throws IOException, NodeException { Configuration config = YamlConfigurationReader.readFromFile(configFile); return getLookups(config, errors, context); } + @Deprecated public static List<Lookup> getLookups(String configStr, Errors errors, ConfigurationContext context) throws IOException, NodeException { Configuration config = YamlConfigurationReader.readFromString(configStr); return getLookups(config, errors, context); } + @Deprecated public static List<Lookup> getLookups(Configuration config, Errors errors, ConfigurationContext context) { NodeDefinition nodeDef = CREATOR.create(); return ConfigurationUtils.getDomainObjects(config, errors, context, DOMAIN, nodeDef);
--- a/stress-tester/src/test/java/com/passus/st/lookup/LookupsDomainConfiguratorTest.java Tue Apr 24 22:44:33 2018 +0200 +++ b/stress-tester/src/test/java/com/passus/st/lookup/LookupsDomainConfiguratorTest.java Tue Apr 24 23:00:43 2018 +0200 @@ -11,15 +11,19 @@ import java.util.List; import static com.passus.config.YamlConfigurationReader.readFromString; +import com.passus.st.utils.TestResourceUtils; +import java.io.File; import static junit.framework.TestCase.assertTrue; import static org.testng.AssertJUnit.assertFalse; public class LookupsDomainConfiguratorTest { + private final File csvFile = TestResourceUtils.getFile("csv/semicolon.csv"); + private final String lookupsConfig = "lookups:\n" + " - type: csvFile\n" + " name: csv\n" - + " fileName: 'c:\\test.csv'\n"; + + " fileName: '" + csvFile.getAbsolutePath() + "'\n"; @Test @SuppressWarnings("unchecked") @@ -34,6 +38,7 @@ List<Lookup> lookups = (List<Lookup>) context.get(ConfigurationContextConsts.LOOKUPS); assertTrue(lookups.get(0) instanceof CsvFileLookup); + configurator.destroy(config, context); } @Test
--- a/stress-tester/src/test/resources/com/passus/st/config/test_job_config.yml Tue Apr 24 22:44:33 2018 +0200 +++ b/stress-tester/src/test/resources/com/passus/st/config/test_job_config.yml Tue Apr 24 23:00:43 2018 +0200 @@ -43,7 +43,7 @@ lookups: - type: csvFile name: csv - fileName: c:\csv + fileName: src\test\resources\csv\semicolon.csv appVars: varName: varValue