/** * Constructs a test executor with default options. */ public Test() { this.setupOpts = new SetupOptions(); this.runOpts = new RuntimeOptions(); }
/** * Constructs a test executor with default options. */ public Test() { this.setupOpts = new SetupOptions(); this.runOpts = new RuntimeOptions(); }
/** * Extracts test run arguments from an XML properties file. The arguments * are added to the resulting <code>RuntimeOptions</code> object as * key-value pairs represented as a string: "{key}={value}". * * @param testRunArgs An XML representation of a properties file containing * an {@literal <entry>} element for each supplied argument. * @return The configuration settings for a test run, including a list of * parameters (which may be empty). * * @see * <a target="_blank" href="https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html">Properties</a> */ RuntimeOptions extractTestRunArguments(Document testRunArgs) { RuntimeOptions runOpts = new RuntimeOptions(); if (null != testRunArgs) { NodeList entries = testRunArgs.getElementsByTagName("entry"); for (int i = 0; i < entries.getLength(); i++) { Element entry = (Element) entries.item(i); String kvp = String.format("%s=%s", entry.getAttribute("key"), entry.getTextContent().trim()); runOpts.addParam(kvp); this.testInputs.put(entry.getAttribute("key"), entry.getTextContent().trim()); } } return runOpts; }
/** * Extracts test run arguments from an XML properties file. The arguments * are added to the resulting <code>RuntimeOptions</code> object as * key-value pairs represented as a string: "{key}={value}". * * @param testRunArgs An XML representation of a properties file containing * an {@literal <entry>} element for each supplied argument. * @return The configuration settings for a test run, including a list of * parameters (which may be empty). * * @see * <a target="_blank" href="https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html">Properties</a> */ RuntimeOptions extractTestRunArguments(Document testRunArgs) { RuntimeOptions runOpts = new RuntimeOptions(); if (null != testRunArgs) { NodeList entries = testRunArgs.getElementsByTagName("entry"); for (int i = 0; i < entries.getLength(); i++) { Element entry = (Element) entries.item(i); String kvp = String.format("%s=%s", entry.getAttribute("key"), entry.getTextContent().trim()); runOpts.addParam(kvp); this.testInputs.put(entry.getAttribute("key"), entry.getTextContent().trim()); } } return runOpts; }