use of de.micromata.opengis.kml.v_2_2_0.Document in project k-9 by k9mail.
the class SettingsExporterTest method exportPreferences_setsFormatTo1.
@Test
public void exportPreferences_setsFormatTo1() throws Exception {
Document document = exportPreferences(false, Collections.<String>emptySet());
assertEquals("1", document.getRootElement().getAttributeValue("format"));
}
use of de.micromata.opengis.kml.v_2_2_0.Document in project k-9 by k9mail.
the class SettingsExporterTest method exportPreferences_setsVersionToLatest.
@Test
public void exportPreferences_setsVersionToLatest() throws Exception {
Document document = exportPreferences(false, Collections.<String>emptySet());
assertEquals(Integer.toString(Settings.VERSION), document.getRootElement().getAttributeValue("version"));
}
use of de.micromata.opengis.kml.v_2_2_0.Document in project k-9 by k9mail.
the class SettingsExporterTest method exportPreferences_ignoresGlobalSettingsWhenRequested.
@Test
public void exportPreferences_ignoresGlobalSettingsWhenRequested() throws Exception {
Document document = exportPreferences(false, Collections.<String>emptySet());
assertNull(document.getRootElement().getChild("global"));
}
use of de.micromata.opengis.kml.v_2_2_0.Document in project gocd by gocd.
the class GoControlLog method writeLogFile.
protected void writeLogFile(File file, Element element) throws IOException {
// Write the log file out, let jdom care about the encoding by using
// an OutputStream instead of a Writer.
OutputStream logStream = null;
try {
Format format = Format.getPrettyFormat();
XMLOutputter outputter = new XMLOutputter(format);
IO.mkdirFor(file);
file.setWritable(true);
logStream = new BufferedOutputStream(new FileOutputStream(file));
outputter.output(new Document(element), logStream);
} finally {
IO.close(logStream);
}
}
use of de.micromata.opengis.kml.v_2_2_0.Document in project gocd by gocd.
the class GoConfigMigrationIntegrationTest method shouldRemoveAllLuauConfigurationFromConfig.
@Test
public void shouldRemoveAllLuauConfigurationFromConfig() throws Exception {
String configString = "<cruise schemaVersion='66'>" + "<server siteUrl='https://hostname'>" + "<security>" + " <luau url='https://luau.url.com' clientKey='0d010cf97ec505ee3788a9b5b8cf71d482c394ae88d32f0333' authState='authorized' />" + " <ldap uri='ldap' managerDn='managerDn' encryptedManagerPassword='+XhtUNvVAxJdHGF4qQGnWw==' searchFilter='(sAMAccountName={0})'>" + " <bases>" + " <base value='ou=Enterprise,ou=Principal,dc=corporate,dc=thoughtworks,dc=com' />" + " </bases>" + " </ldap>" + " <roles>" + " <role name='luau-role'><groups><luauGroup>luau-group</luauGroup></groups></role>" + " <role name='ldap-role'><users><user>some-user</user></users></role>" + "</roles>" + "</security>" + "</server>" + "</cruise>";
String migratedContent = migrateXmlString(configString, 66);
Document document = new SAXBuilder().build(new StringReader(migratedContent));
assertThat(document.getDescendants(new ElementFilter("luau")).hasNext(), is(false));
assertThat(document.getDescendants(new ElementFilter("groups")).hasNext(), is(false));
}
Aggregations