@Test public void returnsASingleVersion() { Map<String, String> versionsToFind = new HashMap<String, String>(); versionsToFind.put("googlechrome", "2.14"); XMLParser parser = new XMLParser(null, null, versionsToFind, false, false); assertThat(parser.driverVersionSelector(), is(equalTo("[(parent::*[@id='googlechrome'] and @id='2.14')]"))); }
protected String driverVersionSelector() { if (null == driverVersions || driverVersions.size() == 0) { return ""; } StringBuilder versionSelector = new StringBuilder(); versionSelector.append("["); Iterator it = driverVersions.entrySet().iterator(); while (it.hasNext()) { Map.Entry specificDriver = (Map.Entry) it.next(); versionSelector.append("(parent::*[@id='"); versionSelector.append(specificDriver.getKey()); versionSelector.append("'] and @id='"); versionSelector.append(specificDriver.getValue()); versionSelector.append("')"); if (it.hasNext()) { versionSelector.append(" or "); } } versionSelector.append("]"); return versionSelector.toString(); }
XMLParser { protected String driverVersionSelector() { if (null == driverVersions || driverVersions.size() == 0) { return ""; } StringBuilder versionSelector = new StringBuilder(); versionSelector.append("["); Iterator it = driverVersions.entrySet().iterator(); while (it.hasNext()) { Map.Entry specificDriver = (Map.Entry) it.next(); versionSelector.append("(parent::*[@id='"); versionSelector.append(specificDriver.getKey()); versionSelector.append("'] and @id='"); versionSelector.append(specificDriver.getValue()); versionSelector.append("')"); if (it.hasNext()) { versionSelector.append(" or "); } } versionSelector.append("]"); return versionSelector.toString(); } }
XMLParser { protected String driverVersionSelector() { if (null == driverVersions || driverVersions.size() == 0) { return ""; } StringBuilder versionSelector = new StringBuilder(); versionSelector.append("["); Iterator it = driverVersions.entrySet().iterator(); while (it.hasNext()) { Map.Entry specificDriver = (Map.Entry) it.next(); versionSelector.append("(parent::*[@id='"); versionSelector.append(specificDriver.getKey()); versionSelector.append("'] and @id='"); versionSelector.append(specificDriver.getValue()); versionSelector.append("')"); if (it.hasNext()) { versionSelector.append(" or "); } } versionSelector.append("]"); return versionSelector.toString(); } XMLParser(InputStream repositoryMap, Set<OperatingSystem> operatingSystems, Map<String, String> driverVersions, boolean thirtyTwoBit, boolean sixtyFourBit); }
XMLParser { protected String driverVersionSelector() { if (null == driverVersions || driverVersions.size() == 0) { return ""; } StringBuilder versionSelector = new StringBuilder(); versionSelector.append("["); Iterator it = driverVersions.entrySet().iterator(); while (it.hasNext()) { Map.Entry specificDriver = (Map.Entry) it.next(); versionSelector.append("(parent::*[@id='"); versionSelector.append(specificDriver.getKey()); versionSelector.append("'] and @id='"); versionSelector.append(specificDriver.getValue()); versionSelector.append("')"); if (it.hasNext()) { versionSelector.append(" or "); } } versionSelector.append("]"); return versionSelector.toString(); } XMLParser(InputStream repositoryMap, Set<OperatingSystem> operatingSystems, Map<String, String> driverVersions, boolean thirtyTwoBit, boolean sixtyFourBit); NodeList getAllNodesInScope(); }
XMLParser { protected String driverVersionSelector() { if (null == driverVersions || driverVersions.size() == 0) { return ""; } StringBuilder versionSelector = new StringBuilder(); versionSelector.append("["); Iterator it = driverVersions.entrySet().iterator(); while (it.hasNext()) { Map.Entry specificDriver = (Map.Entry) it.next(); versionSelector.append("(parent::*[@id='"); versionSelector.append(specificDriver.getKey()); versionSelector.append("'] and @id='"); versionSelector.append(specificDriver.getValue()); versionSelector.append("')"); if (it.hasNext()) { versionSelector.append(" or "); } } versionSelector.append("]"); return versionSelector.toString(); } XMLParser(InputStream repositoryMap, Set<OperatingSystem> operatingSystems, Map<String, String> driverVersions, boolean thirtyTwoBit, boolean sixtyFourBit); NodeList getAllNodesInScope();  }