use of org.jdom2.Document in project gocd by gocd.
the class FullConfigSaveFlow method toXmlString.
protected String toXmlString(CruiseConfig configForEdit) throws Exception {
Document document = documentFrom(configForEdit);
validateDocument(document);
return toXmlString(document);
}
use of org.jdom2.Document in project gocd by gocd.
the class FullConfigSaveFlow method documentFrom.
protected org.jdom2.Document documentFrom(CruiseConfig configForEdit) {
LOGGER.debug("[Config Save] Building Document from CruiseConfig object: Starting.");
Document document = writer.documentFrom(configForEdit);
LOGGER.debug("[Config Save] Building Document from CruiseConfig object: Done.");
return document;
}
use of org.jdom2.Document in project k-9 by k9mail.
the class SettingsExporterTest method exportPreferences_exportsGlobalSettingsWhenRequested.
@Test
public void exportPreferences_exportsGlobalSettingsWhenRequested() throws Exception {
Document document = exportPreferences(true, Collections.<String>emptySet());
assertNotNull(document.getRootElement().getChild("global"));
}
use of org.jdom2.Document in project k-9 by k9mail.
the class SettingsExporterTest method exportPreferences_producesXML.
@Test
public void exportPreferences_producesXML() throws Exception {
Document document = exportPreferences(false, Collections.<String>emptySet());
assertEquals("k9settings", document.getRootElement().getName());
}
use of org.jdom2.Document in project k-9 by k9mail.
the class SettingsExporterTest method parseXML.
private Document parseXML(byte[] xml) throws Exception {
SAXBuilder builder = new SAXBuilder();
InputStream stream = new ByteArrayInputStream(xml);
return builder.build(stream);
}
Aggregations