Configuration implements DataSerializable { public void setCacheXmlFile(File cacheXmlFile) throws IOException { if (cacheXmlFile.length() == 0) { cacheXmlContent = ""; } else { try { Document doc = XmlUtils.getDocumentBuilder().parse(cacheXmlFile); cacheXmlContent = XmlUtils.elementToString(doc); } catch (SAXException | TransformerException | ParserConfigurationException e) { throw new IOException("Unable to parse existing cluster configuration from file: " + cacheXmlFile.getAbsolutePath(), e); } } } Configuration();  Configuration(Configuration that);  Configuration(String configName); String getCacheXmlContent(); void setCacheXmlContent(String cacheXmlContent); void setCacheXmlFile(File cacheXmlFile); void setPropertiesFile(File propertiesFile); String getCacheXmlFileName(); Properties getGemfireProperties(); void setGemfireProperties(Properties gemfireProperties); void addGemfireProperties(Properties gemfireProperties); String getConfigName(); String getPropertiesFileName(); void putDeployment(Deployment deployment); Collection<Deployment> getDeployments(); void removeJarNames(String[] jarNames); Set<String> getJarNames(); @Override void toData(DataOutput out); @Override void fromData(DataInput in); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void setInvalidCacheXmlFile() throws IOException { File file = folder.newFile("test.xml"); FileUtils.writeStringToFile(file, "invalid xml content", "UTF-8"); assertThatThrownBy(() -> configuration.setCacheXmlFile(file)).isInstanceOf(IOException.class) .hasMessageContaining("Unable to parse"); }